如何使用Firebug扩展名调试Greasemonkey脚本? [英] How to debug Greasemonkey script with the Firebug extension?
问题描述
有没有人知道如何执行此操作?
谢谢。
Updatier:现在Mene + Shuman修复使用Firefox 30和Firebug 2进行破坏。Firefox 31 可能会提供解决方法(将进行调查)。在此期间,请使用下面列出的一般解决方案策略。
更新:答案现在已经过时了。
如果您打开关于:config
和
设置扩展名.firebug.filterSystemURLs
到 false
那么你可以使用Firebug来调试Greasemonkey脚本,就像其他任何一样。 p>
这项工作与 @grant
模式无关。
旧答案
因为Greasemonkey运行在一个沙箱里,Firebug看不到它。
一般解决策略:
-
首先在Firebug的JavaScript控制台中测试不使用
GM _
函数的GM脚本的所有部分。最小化使用GM _
函数,并且根本不使用GM_log()
。 -
所有 Firebug的
控制台
函数在GM脚本中工作得很好。
I didn't find a way to debug Greasemonkey scripts with the Firebug extension.
Does anyone know how to do this ?
Thanks.
Updatier: The Mene+Shuman fix now is busted with Firefox 30 and Firebug 2. Firefox 31 may provide workarounds (will investigate). In the meantime, use the "General workaround strategies" listed below.
Update: This answer is now obsolete.
If you open about:config
and
set extensions.firebug.filterSystemURLs
to false
then you can use Firebug to debug the Greasemonkey script just like any other.
This works irregardless of the @grant
mode.
See Mene's answer -- with an assist from Shuman.
Old answer:
Because Greasemonkey operates in a sandbox, Firebug cannot see it. There is no easy way around this.
General workaround strategies:
Test all parts of a GM script that don't use
GM_
functions, in Firebug's JavaScript console first. Minimize use ofGM_
functions and don't useGM_log()
at all.All of Firebug's
console
functions work great from within a GM script.
这篇关于如何使用Firebug扩展名调试Greasemonkey脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!