XUL Explorer:UseCases/Extension Testing: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Firefox extension Test mode=
=Extension Test mode=


==Brief Description==
==Brief Description==

Revision as of 05:22, 11 May 2007

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

  1. Locate firefox executable
    1. Attempt to read the pref.js file for firefox directory (explorer_browser_path)
    2. Attempt to auto-locate the firefox directory. Save the browser path to prefs.js(?)
    3. Launch a file picker for a file. Save the browser path to prefs.js(?)
  2. Locate the profile
    1. Attempt to read the pref.js file for the profile directory (explorer_browser_profile_path)
    2. Gather all the profiles from ~/.mozilla/firefox/ or ~/Application Data/Mozilla/profile
      1. allow the user to select a profile, or pick the first one if there is only one
      2. save the profile path to prefs.js (?)
    3. Launch the file picker for a directory. Save the profile path to prefs.js (?)
  3. Locate the root directory of the extension
    1. This should probably be two directories up
  4. Locate the extension's id
    1. In the extension's root directory. Either in install.rdf or application.ini
    2. If we cannot find, throw a neat error
  5. Create firefox extension text file
    1. Check if the profile/extensions folder exists. if not, create it.
    2. Add a new plain text file to extensions/extension_id
    3. Add root directory to file (using trailing slash, if needed)
  6. Launch firefox with options -no-remote and -profile
    1. Pass profile directory
  7. Wait for firefox to be closed
  8. delete extensions/extension_id