javascript确定firebug
我想请人们禁用萤火虫。如何判断自己安装了firebug?所以它是一个跨浏览器并确定在 Chrome、Mozilla 和 IE8+ 上
I want to ask people to disable firebug. How to determine that they have installed firebug? And so it was a cross-browser and determined in Chrome, Mozilla and IE8 +
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
两个步骤:
如果
window.console
存在,则可能会安装 Firebug。这可能不是真的,因为window.console
也可能表明 Chrome 的控制台已启用。如果步骤 1. 返回一个对象,请检查
console.firebug
是否返回任何内容。如果是,则它将是 Firebug 的版本号。现在您知道如何查看 Firebug 是否已安装,但您不能强制用户禁用它。尝试在启用 Firebug 的情况下登录 Gmail,它们会向您显示一条警告,指出启用它可能会导致性能问题。
Two steps:
if
window.console
exists, then Firebug might be installed. This might not be true, sincewindow.console
might also indicate that Chrome's console is enabled.if step 1. returns an object, check if
console.firebug
returns anything. If it does, it will be Firebug's version number.Now you know how to see if Firebug is installed, but you can't force your user do disable it. Try logging in to Gmail with Firebug enabled and they show you a warning that having it enabled might lead to performance issues.
简单:
编辑:我看不出有任何理由要求人们禁用它,除非你有像 gmail 这样的严重性能问题。
edit2:我再次阅读了你的问题。如果您还想检查 firefly 和 chrome 控制台,只需检查 window.console
重要 edit3:firebug 1.9 不再添加 window.console.firebug 。不知道从哪个版本开始出现这种情况。
easy:
edit: I don't see any reason to ask people disable it, unless you have a strong performance issue like gmail.
edit2: I've read your question again. If you also want to check for firefly and chrome console, just check for window.console
important edit3: firebug 1.9 doesn't add window.console.firebug anymore. don't know since which version this is the case.