如何禁用查看源代码和检查元素 [英] How to disable View source and inspect element

查看:124
本文介绍了如何禁用查看源代码和检查元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用/查看source /和/ inspect元素/,按Ctrl + ctrl + ctrl + ctrl + ctrl + ctrl + ctrl + ctrl + ctrl + ctrl +所有可能的部分,我更愿意这样做JavaScript数组keycodes或html没有PHP或其他languages.also我想阻止ifram使用像我的网站,如谷歌等一些网站。
据我所知,它是不可能完全禁用视图源和检查元素,所以我想代码的缩小和我的问题的其余部分,而不是。
-----------------------------------编辑---------- ---------------------------



我自己解决了很多问题,我使用onkeydown返回false来禁用所有键,仍然需要数组,我通过强制浏览器到window.open禁用检查元素菜单栏我仍然需要右键单击,但是想补充一点,我需要一个自定义右键菜单,我禁用了通过使用noscript函数重定向来禁用Javascript以停止密钥块的可能性。我还需要拖动和选择部分。我仍然希望更好地修复它......甚至可以将代码缩小或加密。任何人需要我使用的一些代码只是回复。我只需要修复它。

解决方案

无法阻止用户检查在其计算机上运行的代码。在一天结束的时候,他们获得的HTMl将以纯文本形式可读。例如,你可以对大多数人造成滋扰,但这不会是一个有效的安全措施 - 例如,Chrome扩展仍然会运行,所以如果有人使用NoScript扩展名,它将禁用所有javascript。



更好的选择是处理您的逻辑服务器端,并且只向客户端发送他们需要知道/请求的信息。



一些免费的JavaScript混淆器,例如 https://javascriptobfuscator.com/ 。请记住,这不是一个安全的方法,但。


How do you disable/ view source/ and /inspect element/, ctrl u ctrl shift I f12 menu bar and right click, also ctrl s ctrl p ctrl v, ctrl a, ctrl c, and drag select page, please answer all parts that's possible, I prefer to do this will JavaScript array keycodes or html no php or other languages.also I want to block ifram use on my site like somesites such as google. As I understand it is not possible to completely disable view source and inspect element, so I want minification of code and rest of my question answered instead. -----------------------------------EDIT-------------------------------------

I solved alot of it myself, I used onkeydown return false to disable all keys, still need the arrays, I disabled inspect element menu bar by forcing browser to window.open I still need right click, however would like to add that I need a custom right click menu, I disabled the possibility to disable Javascript in order to stop the key block by using noscript function redirects. I also still need the drag and select part. I would still like betterways to fix it...maybe even just minify the code or encrypt it. Of anyone needs some of the code I used just reply. I just need to fix it.

解决方案

It is not possible to prevent the user from inspecting code running on their machine. At the end of the day the HTMl they are getting delivered will be readable in plain text. You can cause a nuisance for most people, but this will not be a valid security measure - chrome extensions will still run, for instance, so if someone is using the NoScript extension it will disable all javascript.

A much better option would be to handle your logic serverside, and only send the client the information they need to know/requested.

There are some free javascript obfuscators, such as https://javascriptobfuscator.com/. Please remember that it is not a secure method, though.

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

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