You mean it doesn t work when installed via Greasemonkey, right?
Not long ago, Greasemonkey broke console.log (New! Bug report). Now, to see the results of a plain console.log()
call from a Greasemonkey, you need to look in Firefox s Error console, not Firebug s.
您可通过以下紧迫方式看到FF s Error console:Ctrl。
<>However,可在 Chrome和Greasemonkey的书写中使用unsafeWindow.console.log(
。 Chrome现在对<代码>unsafeWindow的支持有限。
如果你使用<条码>unsafeWindow,你可以查阅。 Grasemonkey的“火力”伐木功能。 (Firebug必须安装,他们可能仍然不能在 Chrome印中工作;我已经用这种方式进行了测试。)
In Firefox, if Firebug is not installed, or it is not active for the page, then unsafeWindow.console.log()
calls will display to the New "Web Console" (CtrlShiftK).
You need to use the unsafeWindow
when inside a Greasemonkey script.
请注意:console.log(
,console.info(
,console.warn(
)和console.error(
本土——无需进行消防。