问题描述
我需要阻止类似Firebug和Chrome开发者工具工具的特定页面。我该怎么做?
I need to block tools like Firebug and Chrome Developer Tools in a specific page. How can I do that?
我发现这个code和它适用于Firebug的:
I found this code and it works for Firebug:
<script>
if( window.console && window.console.firebug ){
alert("Sorry! This system does not support Firebug.\nClick OK to log out.");
window.location='/login_out';
}
</script>
但不适合Chrome开发者工具等。有谁知道它阻止大多数的开发者工具的一种方式?
But not for Chrome Developer Tools and others. Does anyone know a way of blocking it to most of developer tools?
仅供参考,我想这能避免用户更改HTML code。我使用的形式隐藏输入,可悲的是,我真的需要做到这一点,而不是使用卷曲或类似的东西。很抱歉,如果开发工具不太清楚。
Just FYI, I need this to avoid users to change the html code. I'm using hidden inputs in a form, and sadly, I really need to do this instead using cURL or something similar. Sorry if "developer tools" was not clear enough.
推荐答案
不要打扰。你无法禁用它,坦白地说 - 从未有一个很好的理由这样做。不要送你不想让他们看到你的用户任何东西。
Don't bother. You can't disable it, and frankly - there's never a good reason to do it. Don't send your users anything you don't want them to see.
这篇关于如何阻止在页面开发人员工具(如萤火虫)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!