简体   繁体   English

使用 javascript 或 jquery 禁止在手机上截屏

[英]Disable taking screenshots on mobile using javascript or jquery

I saw on Facebook and other apps that Don't allow users to taking screenshots.我在 Facebook 和其他不允许用户截屏的应用程序上看到。 When we swipe down 3 fingers, or click power button and volume Down btn together, it says "Taking Screenshots is not allowed by the app or your organisation".当我们向下滑动 3 个手指,或同时单击电源按钮和降低音量按钮时,它会显示“应用程序或您的组织不允许截屏”。 How do they do it.他们是怎么做到的呢。

I saw one code / pen on Codepen where I saw the developer did it using javascript / jquery. It's been 6 months and i Forget the url of the pen.我在 Codepen 上看到一个代码/笔,我看到开发人员使用 javascript / jquery 完成了它。已经 6 个月了,我忘记了笔的 url。 Now I'm to Stack Overflow.现在我要去 Stack Overflow。

If anybody know, please reply me.如果有人知道,请回复我。 Don't Down vote my question.不要对我的问题投反对票。 Oh, I know how to disable prntscr key on desktop.哦,我知道如何在桌面上禁用 prntscr 键。

It is not possible to block taking screenshot on websites through JavaScript. The only way you might be able to do it is only if you are displaying the website in your own app on Android, it is possible to set FLAG_SECURE in your code.无法通过 JavaScript 阻止在网站上截取屏幕截图。只有当您在 Android 上在自己的应用程序中显示该网站时,您才能做到这一点,可以在您的代码中设置FLAG_SECURE You can read more about it here .您可以在此处阅读更多相关信息。 Just mind the fact that any rooted device would be able to go around it anyway.请记住一个事实,即任何有根设备无论如何都可以 go 绕过它。

Also here's related topic about trying to block screenshots on web. 这里还有关于尝试阻止 web 上的屏幕截图的相关主题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM