-
Notifications
You must be signed in to change notification settings - Fork 4
Development environment OSX
Create a development Firefox profile, named e.g. annotator-dev.
Terminal:
mkdir -p ~/Library/Application\ Support/Firefox/Profiles/annotator-dev
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
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
Install some developer extensions, namely:
- DOM Inspector 2.0.13 (https://addons.mozilla.org/en-us/firefox/addon/dom-inspector-6622/): lets you examine the structure and state of Firefox’s chrome
- Console2 (pronounced Console Squared or Console Two) (https://addons.mozilla.org/en-US/firefox/addon/console²): separates chrome and content errors to make it easier to catch problems in your code
Create your extension directory, which is the place where you put your extension files.
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.
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