bard / mozrepl

Remotely control Firefox and other Mozilla apps with JavaScript
https://github.com/bard/mozrepl/wiki/
510 stars 64 forks source link

Feature request: REPL for add-on debugging #62

Open erjoalgo opened 9 years ago

erjoalgo commented 9 years ago

I'm developing a firefox add-on and I'd like to be able to run this repl within the context of the add-on. So far, the only way I know to run js code within the add-on is by starting firefox with the add-on enabled, go to the addons page, clicking Debug, accepting the prompt to start a remote-debugging request, setting a breakpoint, then using the browser in a way that triggers the breakpoint. Then I can go to the console tab of the remote-debugging window and I'm in the add-on context. Naturally, all this clicking and hoops are very slow and frustrating and I'd like to start a repl programmatically, something like: /usr/bin/firefox -profile /path/to/profile/folder -repl -repl 7070

as pointed out in the docs https://github.com/bard/mozrepl/wiki/Starting-the-REPL

However, mozrepl only seems to run in the context of the browser. Is there a way to specify a specific add-on to attach a repl as a debugger? Any pointers for implementing this feature?