Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you prevent screen captures on the web? [2020]

Tags:

javascript

web

BEFORE YOU TRY AND MARK THIS AS A REPEATED QUESTION I know this is possible, and all of the other questions are old. Here's why this question is different:

  • Netflix has been able to do this. Try streaming Netflix, turn subtitles on, and you can see that if you try and take a screenshot, the subtitle will appear, but the video will not.
  • Try this again with OBS. When you use a desktop/window capture, you can see the video from Netflix playing in the browser, but at the SAME time, OBS can't pick it up.
  • This Wordpress plugin (which I haven't tried out personally, so not sure if it works, but the reviews are promising)

So now that I've assured you this isn't a question with the context of 2014, are there any new ways to be able to avoid screen capture on the web? I've assumed that it's impossible for a while, but it looks like there might be an API for it somewhere, and no one hasn't asked this question in years here. It'd be useful for preventing capture in my own JS websites, so I was just wondering how I could implement this myself. Thanks.


2 Answers

Your initial assumption is correct, it's impossible. The Netflix example is different, because it isn't preventing a screenshot of the webpage (which is why the subtitles still get captured) but of the video stream, which is embedded in the webpage, but not actually a part of it. The video isn't captured in your example because it's protected by Encrypted Media Extensions. This also means, though, that the video isn't playable in just any browser, it's only accessible in browsers that support EME.

So, the answer to "how do you prevent screen captures on the web" is "convince every browser manufacturer to include features in their browser that allow you to control screen capturing, and then only make your website available to browsers that support that feature" (which is essentially what Netflix did for video).

like image 177
Jason Kohles Avatar answered Dec 07 '25 03:12

Jason Kohles


You could try playing a transparent DRM-protected video on top of your content (and forward any user event to the element below it). When the user takes a screenshot, the video should produce a solid overlay on top of your actual content.

like image 43
jcayzac Avatar answered Dec 07 '25 02:12

jcayzac