XUL Explorer:UseCases/Extension Testing
Jump to navigation
Jump to search
Firefox extension Test mode
Brief Description
Allows a user to test their extension on Mozilla Firefox without having to package it up.
Precondition
User selects 'test extension' from a menuitem/button
Basic Flow
- Locate firefox executable
- Attempt to read the pref.js file for firefox directory (explorer_browser_path)
- Attempt to auto-locate the firefox directory. Save the browser path to prefs.js(?)
- Launch a file picker for a file. Save the browser path to prefs.js(?)
- Locate the profile
- Attempt to read the pref.js file for the profile directory (explorer_browser_profile_path)
- Gather all the profiles from ~/.mozilla/firefox/ or ~/Application Data/Mozilla/profile
- allow the user to select a profile, or pick the first one if there is only one
- save the profile path to prefs.js (?)
- Launch the file picker for a directory. Save the profile path to prefs.js (?)
- Locate the root directory of the extension
- This should probably be two directories up
- Locate the extension's id
- In the extension's root directory. Either in install.rdf or application.ini
- If we cannot find, throw a neat error
- Create firefox extension text file
- Check if the profile/extensions folder exists. if not, create it.
- Add a new plain text file to extensions/extension_id
- Add root directory to file (using trailing slash, if needed)
- Launch firefox with options -no-remote and -profile
- Pass profile directory
- Wait for firefox to be closed
- delete extensions/extension_id