如何从我的网站禁用(查看源代码)和(Ctrl + C) [英] How to disable (View Source) and (Ctrl + C ) from my site

查看:108
本文介绍了如何从我的网站禁用(查看源代码)和(Ctrl + C)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有机会从我的网站上禁用这两件事?
(查看来源)和(Ctrl + C)

Is there a chance to disable these two things from my site? (View Source) and (Ctrl + C )

推荐答案

这是不可能的。您可以尝试以某种方式混淆代码,但您需要向客户端发送内容,不是吗?您可以使用AJAX调用来加载您的html。这样,浏览器显示的源几乎是空的。但是,您无法阻止有经验的用户查看您发送给客户端的所有内容。事实上,他/她可以使用这么多工具来重建页面,你会努力申请任何技术,只会延迟他/她几分钟。

This isn't possible. You could try to somehow obfuscate the code, but you need to send something to client, don't you? You could use AJAX calls to load your html. This way, the source that the browser will show could be almost empty. However, there is nothing you can do to prevent an experienced user from viewing everything you are sending to the client. In fact there are so many tools he/she can use to reconstruct the page that any technique you will fight hard to apply, will only delay him/her for a couple of minutes.

关于Ctrl-C你可以添加javascript来阻止它,但它没用,因为用户总是可以禁用javascript。事实上,许多用户会发现拦截右键非常烦人。

Regarding the Ctrl-C you could add javascript to block it, but it is useless, since the user can always disable javascript. In fact many users will find interception of right-click very annoying.

如果您正在构建Intranet应用程序,或者您可以发送集成浏览器,那么所有这些都有意义。用户查看应用程序。使用公共HTML,我相信它甚至不值得尝试。一种解决方案是使用闪存或其他插件构建应用程序。这样,您就可以加密发送给客户端的所有内容。

All these could have a meaning if you are building an intranet application or you can ship an integrated browser for users to view the application. With public html, I believe it isn't even worth trying. One solution would be to build your application with flash or another plug-in. This way you can encrypt everything you've sent to the client.

这篇关于如何从我的网站禁用(查看源代码)和(Ctrl + C)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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