Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to modify source code without re-running cfx and Firefox when debugging an SDK add-on?

I'm developing a Firefox add-on using Add-on SDK. Up to now, I must close debug process and execute "cfx run" after I modified my source code.

So I would like to know how to edit source code without rerunning Firefox, like debugging JavaScript in Chrome. Is there any way to debug modified code after refreshing the page with inject script?

like image 716
legendlee Avatar asked May 09 '12 15:05

legendlee


1 Answers

I am a huge fan of Wladimir Palant's 'Extension Auto-Installer' add-on:

  • blog post: http://adblockplus.org/blog/faster-extension-development-cycle-install-changes-automatically
  • AMO link: https://addons.mozilla.org/en-US/firefox/addon/autoinstaller/

Once this is installed and configured in Firefox, you can create a shell script to reduce the typing overhead:

#!/bin/bash

# quick script to build the xpi and pass it on to the
# extension auto-installer extension running on port 8888

/path/to/addon-sdk/bin/cfx xpi && wget --post-file=add-on-name.xpi http://127.0.0.1:8888/

Every time you run the script, wget posts the freshly built xpi to firefox, which then installs it.

like image 96
therealjeffg Avatar answered Oct 23 '22 06:10

therealjeffg