I'm curious if it's possible to stop users from taking screenshots of content in a static web app. I've researched this and it seems like screenshotting is a feature controlled at the OS level, which means web browsers don't get events related to it. I've thought about some workarounds like using heuristics for visibility changes or page focus/blur detection, but those don't cover everything, especially on mobile. I even looked into DRM methods, but that raises issues like losing scrollability since the content becomes more like a video. I'm hoping to find some potential solutions for both desktop and mobile browsers. Any ideas or examples of how to tackle this?
2 Answers
Honestly, there's no reliable way to block screenshots in a static web app since screenshotting is controlled by the operating system. Your heuristics might catch some actions, but they'll miss things like external cameras or tools that capture screens. Even DRM options, which might turn your HTML into an unscrollable video, can be bypassed. Ultimately, if pixels appear on the screen, they can be captured. The only real measures are things like using invisible watermarks or low-res previews for non-subscribers. If you want more control, you’d need to go the native app route with hardware DRM, but even then, dedicated users will find ways around it.
If something is on the internet, someone will figure out how to screenshot it. Sure, you can try to make it a little more difficult, but completely preventing it is almost impossible. Pursuing this might just lead to a worse experience for your users without any solid gain.

True, but I’m just curious if it’s possible to do something about it. Exploring ideas isn't a crime!