JavaScript 是否可以阻止人们右键单击保存图像?
我一直在研究 JavaScript,发现它可以做很多事情,而且我对使用这种语言感到很舒服,但我开始担心右键单击保护程序。有没有办法阻止人们从我的网站保存图像并将其放到桌面上?
- 某个女孩
- 某个人
- 那个人拍摄了图像
- 将其存储在他/她的桌面上
- 取笑那个女孩
I have been studying JavaScript and I've found so many things what it can do and I feel comfortable using this language, but I'm getting worried about the right click savers out there. Is there a way to prevent people from ever saving the images from my website and put it onto their desktop?
- Some girl
- Some person
- That person took the images
- Store it on his/her desktop
- Makes fun of the girl
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不,没有任何方法可以轻易规避。
No, there isn't any way to do this that isn't easily circumvented.
您可以在图像上放置一些覆盖层,但这不会阻止人们使用浏览器的开发控制台。
另一种方法是从脚本加载图像,并且仅允许它们在特定页面上时显示(使用 php 或任何其他服务器实现)
You can put some overlay onto the image, but that wont stop people with a dev console for their browser.
Another way is to load images from a script and only allow them to be shown when they are on a certain page (using php or any other server implementation)
不会。如果有人访问您的网页并可以看到您的图像,则浏览器已经下载了该图像并将其保存到本地缓存,无论用户是否知道如何访问该图像。
此外,他们可以随时关闭浏览器中的 Javascript
No. If someone has gone to your web page and can see your image the browser has already downloaded the image and saved it to the local cache, whether or not the user knows how to get to it.
Also, they can always turn off Javascript in their browser
您可以使下载图像变得困难,但不可能防止图像被盗!
使用小图像网格并在用户放大时仅显示整个图像的一部分是大多数摄影网站使用的方式,以使其难以窃取图像。当您使用图像网格时,拖放或另存为不会保存整个图像。
但仍然可以通过收集图像的所有部分并通过图像编辑工具将它们连接在一起来窃取图像
You can make it hard to download the image but it's IMPOSSIBLE to prevent image theft!
Using a grid of small images and showing just a part of whole image when user zoom in is the way most photography site uses to make it hard to steal the image. When you use grid of images then drag and drop or Save As wouldn't save whole image.
But it's still possible to steal the image by collection all parts of image and connecting them together via an image editing tool