Skip to content

Development environment OSX

ssvw edited this page Nov 25, 2014 · 3 revisions

Step 1

Create a development Firefox profile, named e.g. annotator-dev.

Terminal: mkdir -p ~/Library/Application\ Support/Firefox/Profiles/annotator-dev

Step 2

Start Firefox and pass the -no-remote command line argument in case you are using two profiles at the same time, i.e. if Firefox is already running using the default profile.

Terminal: /Applications/Firefox.app/Contents/MacOS/firefox -profile ~/Library/Application\ Support/Firefox/Profiles/annotator-dev -no-remote

Step 3

Set some developer preferences that make it easier to develop extensions. Enter about:config in the location bar. Accept the warning that comes up. Set the following preferences to true:

  • extensions.logging.enabled: shows extension install/update errors in Error Console
  • javascript.options.showInConsole: shows extension code errors in Error Console
  • javascript.options.strict: enforces strict error output from JavaScript
  • browser.dom.window.dump.enabled: lets extensions use the dump function in JavaScript to print messages to standard console

Step 4

Install some developer extensions, namely:

Step 5

Create your extension directory, which is the place where you put your extension files.

Step 6

For installing the extension use the link file method. Create a text file inside the extensions subdirectory of your Firefox development profile. The name of the file must be the ID of the extension, for instance if the following is stated in install.rdf: <em:id>webannotator@dasish.eu</em:id> the file needs to be named webannotator@dasish.eu. The contents of the file must be a single line specifying the path to the extension directory.

Step 7

To test the extension (re)start Firefox. It will ask you to accept installation of a new extension. Further reading:

Mozilla Developer Network (MDN): Setting up an extension development environment https://developer.mozilla.org/en-US/docs/Setting_up_extension_development_environment

Further hints:

Alternatively, you can start Firefox with a different profile via the profile manager with /Applications/Firefox.app/Contents/MacOS/firefox-bin -p