禁用网页上的开发人员工具 [英] Disable developer tools on a web page

查看:908
本文介绍了禁用网页上的开发人员工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我想禁用浏览器的开发工具,以便没有人可以使用开发人员工具调试网站。我怎么能以编程方式实现这个目标。



谢谢



我尝试了什么:



我试图禁用用于打开开发人员工具的密钥,但这不是强大的解决方案。

Hello,

I would like to disable the developer tool of browser so that no one can debug the web site using the developer tools. How can I achieve this programmatically.

Thanks

What I have tried:

I have tried to disable the keys used to open the developer tools but this is not the robust solution.

推荐答案

您无法在浏览器上禁用开发人员工具。
You can't disable the developer tools on a browser.


Quote:

我想禁用浏览器的开发人员工具,以便没有人可以使用开发人员工具调试网站。

I would like to disable the developer tool of browser so that no one can debug the web site using the developer tools.

这是不可能的。您可以随时锁定密钥,但用户也可以定义另一个密钥来调用开发工具。

您应该向用户解释要隐藏的内容,可能有解决方案。



根据设计,开发工具始终可用。

This is not possible. You can always lock a key but the user can also define another key to call the dev tools.
You should rather explain what you want to hide from the user, there may be a solution.

By design, the dev tools are made to be always available.


Chris是对的,您的网站无法禁用浏览器功能。根据您的环境,可能还有其他选择:



1.如果您有一个我可以在平板电脑/笔记本/手机上打开的公共网站,请不要阻止任何浏览器功能。即使你可以(有些黑客可能),也就是不要这样做。或者我不会再次访问您的页面了。



2.当您在自己控制的设备上运行某种基于Web的应用程序时(像ATM这样的东西?),你可以在浏览器中阻止开发工具等。



如果你有案例2,请告诉我。
Chris is right, your website can't disable browser functions. Depending on your environment, there could be an other option:

1. When you have a public web site that I could open on my tablet/notebook/phone, don't block any browser functions. Even if you could (some hacks are possible), just don't do it. Or I will not visit your page again.

2. When you have some kind of web based application running on devices under your control (Something like an ATM?), you can block dev tools, etc. in the browser.

Let me know, if you have case 2.


这篇关于禁用网页上的开发人员工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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