如何使用Firebug扩展名调试Greasemonkey脚本? [英] How to debug Greasemonkey script with the Firebug extension?

查看:228
本文介绍了如何使用Firebug扩展名调试Greasemonkey脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有人知道如何执行此操作?



谢谢。

解决方案

Updatier:现在Mene + Shuman修复使用Firefox 30和Firebug 2进行破坏。Firefox 31 可能会提供解决方法(将进行调查)。在此期间,请使用下面列出的一般解决方案策略。






更新:答案现在已经过时了。



如果您打开关于:config

设置扩展名.firebug.filterSystemURLs false

那么你可以使用Firebug来调试Greasemonkey脚本,就像其他任何一样。 p>

这项工作与 @grant 模式无关。



请参阅 Mene的答案 - 借助Shuman的帮助









旧答案



因为Greasemonkey运行在一个沙箱里,Firebug看不到它。



一般解决策略:


  1. 首先在Firebug的JavaScript控制台中测试不使用 GM _ 函数的GM脚本的所有部分。最小化使用 GM _ 函数,并且根本不使用 GM_log()


  2. 所有 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:

  1. Test all parts of a GM script that don't use GM_ functions, in Firebug's JavaScript console first. Minimize use of GM_ functions and don't use GM_log() at all.

  2. All of Firebug's console functions work great from within a GM script.

这篇关于如何使用Firebug扩展名调试Greasemonkey脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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