Fastest way to debug Firefox addons during develop

2019-01-21 01:27发布

Debugging a Firefox addon is a slow process: (1) edit source code in a JS editor (2) package into XPI using a build script (3) drag into Firefox to install (4) restart Firefox (5) open the JavaScript Debugger

Can we speeden up the process? Like install it into Firefox without a restart, or configure the build script to install it into Firefox as well?

7条回答
不美不萌又怎样
2楼-- · 2019-01-21 01:43

i use Netbeans with the Foxbeans Plugin for addon development, there you just press the "run button", and firefox starts up with the addon installed (into a test profile). maybe you should give this a try!

查看更多
叼着烟拽天下
3楼-- · 2019-01-21 01:44

Came here via google - FF nightly 31 has new tools for debugging add ons. Its a god send. Details here: https://blog.mozilla.org/addons/2014/04/08/add-on-debugger-now-in-firefox-nightly/

查看更多
The star\"
4楼-- · 2019-01-21 01:45

You need the "edit source" and "restart firefox" steps; they can't be removed from the process...

When you install the addon, the javascript ends up on disk, in your firefox profile. If you edit it in there, and restart firefox, the new stuff will be picked up. When you're done, create the xpi from the files in your profile.

查看更多
男人必须洒脱
5楼-- · 2019-01-21 01:51

To make development of the add-on faster, an important goal is to eliminate restart of FF to test every code change. Three options that I can think of:

I have used the last two options and it works greatly for me.

查看更多
欢心
6楼-- · 2019-01-21 01:54

You can also set dynamic breakpoints via the debugger keyword. Open the "Browser Toolbox" to make the debugger stop at the line.

I think it's nice because you don't have to lookup the source file and line after every restart.

Also take a look at this Debugging extension code in firefox answer which mention the improved debugger capabilities for restartless extensions since Firefox 23.

查看更多
迷人小祖宗
7楼-- · 2019-01-21 01:59

http://simplygenius.com/2005/08/debugging-firefox-mozilla-extensions_25.html contains a good description of debugging FF extensions in venkman

查看更多
登录 后发表回答