如何在所有浏览器中禁用网页的打印屏幕功能? [英] How can I disable print-screen functionality for a webpage in all browsers?

查看:799
本文介绍了如何在所有浏览器中禁用网页的打印屏幕功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下内容,我们可以在Internet Explorer中禁用打印屏幕或屏幕截图:

Using the following we can disable print-screens or screenshots in Internet Explorer:

<body onload=setInterval("window.clipboardData.setData('text','')",2) 

oncontextmenu="return false" onselectstart="return false">

但是这些在Mozilla,Chrome和其他浏览器中不起作用.

But these don't work in Mozilla, Chrome and other browsers.

是否有更好的方法来禁用打印屏幕/屏幕截图?

Is there a better way to disable print-screens/screenshots?

推荐答案

是什么让您认为人们是否应该可以截取屏幕截图是您的决定?

What makes you think it's your decision if people should be able to take screenshots or not?

幸运的是,没有浏览器,但是IE允许您通过JavaScript访问剪贴板,所以您不走运:)

Luckily no browser but IE allows you to access the clipboard via JavaScript so you are out of luck :)

顺便说一句,如果我访问了您的网站,并且弄乱了我的剪贴板(即使它与您的网站无关,它也会覆盖其中的任何内容)-我可能已经在其中存储了一些文件中的内容而且我要粘贴到另一个文件中,由于您的网站,现在它已经丢失了.

By the way, if I visited your site and it messed up my clipboard (it overwrites anything in there, even if it's unrelated to your site) - I might have stored something in it that I've just cut from some file and I was going to paste in a different file and thanks to your site it would now be lost.

因此,结论是:不要这样胡扯.

这篇关于如何在所有浏览器中禁用网页的打印屏幕功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆