XUL Explorer:UseCases/Extension Testing: Difference between revisions
Jump to navigation
Jump to search
MarkFinkle (talk | contribs) No edit summary |
|||
| Line 47: | Line 47: | ||
<tr> | <tr> | ||
<td>Auto-locate Firefox profiles and Firefox executable</td> | <td>Auto-locate Firefox profiles and Firefox executable</td> | ||
<td>Low</td> | <td style="background-color:yellow;text-align:center;">Low</td> | ||
<td> | <td> | ||
* This is probably a more difficult and time consuming feature to do, since it depends on the platform and where to check. | * This is probably a more difficult and time consuming feature to do, since it depends on the platform and where to check. | ||
| Line 54: | Line 54: | ||
<tr> | <tr> | ||
<td>Read values from prefs.js</td> | <td>Read values from prefs.js</td> | ||
<td>Medium</td> | <td style="background-color:green;text-align:center;">Done / Medium</td> | ||
<td> | <td> | ||
* Save information so app doesn't have to auto-locate executable/ask user each time</td> | * Save information so app doesn't have to auto-locate executable/ask user each time</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Pick files (firefox executable)/directories (profile directory)</td> | <td>Pick files (firefox executable)/directories (profile directory)</td> | ||
<td>High</td> | <td style="background-color:green;text-align:center;">Done / High</td> | ||
<td>Done</td> | <td>Done</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Locate root directory of extension</td> | <td>Locate root directory of extension</td> | ||
<td>High</td> | <td style="background-color:green;text-align:center;">Done / High</td> | ||
<td> | <td>Needed to write in text file. This is tricky because it should point to the same directory as application.ini, but where that file is isn't always relative to the current file. So we have a few options | ||
Needed to write in text file. This is tricky because it should point to the same directory as application.ini, but where that file is isn't always relative to the current file. So we have a few options | |||
* Go through each tab for a file named application.ini, and take it's document.title | * Go through each tab for a file named application.ini, and take it's document.title | ||
* Have the user locate by hand (but this shouldn't be saved to prefs.js | * Have the user locate by hand (but this shouldn't be saved to prefs.js | ||
| Line 77: | Line 74: | ||
<tr> | <tr> | ||
<td>locate extension id</td> | <td>locate extension id</td> | ||
<td>High</td> | <td style="background-color:red;text-align:center;">High</td> | ||
<td>Read application.ini/install.rdf, but how?</td> | <td>Read application.ini/install.rdf, but how? I have managed to finish application.ini, since it only relies on [http://mxr.mozilla.org/seamonkey/source/xulrunner/setup/nsXULAppInstall.js#61 undocumented] [http://mxr.mozilla.org/seamonkey/source/xpcom/ds/nsIINIParser.idl#43 interfaces]. I have no clue right now on RDF, but Mark Finkle pointed to possible [http://www.xulplanet.com/downloads/rdfds/ help].</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>create text file/directory</td> | <td>create text file/directory</td> | ||
<td>Medium</td> | <td style="background-color:orange;text-align:center;">Medium</td> | ||
<td>Create a directory/text file. I don't think this will be difficult at all | <td>Create a directory/text file. I don't think this will be difficult at all | ||
* resource : [http://developer.mozilla.org/en/docs/Code_snippets:File_I/O File I/O]</td> | * resource : [http://developer.mozilla.org/en/docs/Code_snippets:File_I/O File I/O]</td> | ||
| Line 88: | Line 85: | ||
<tr> | <tr> | ||
<td>Launch Firefox</td> | <td>Launch Firefox</td> | ||
<td>Medium</td> | <td style="background-color:orange;text-align:center;">Medium</td> | ||
<td>Not sure how to do this yet | <td>Not sure how to do this yet | ||
* resource : [http://developer.mozilla.org/en/docs/Code_snippets:Running_applications Running applications]</td> | * resource : [http://developer.mozilla.org/en/docs/Code_snippets:Running_applications Running applications]</td> | ||
| Line 94: | Line 91: | ||
<tr> | <tr> | ||
<td>Wait for Firefox to close and delete file/directory</td> | <td>Wait for Firefox to close and delete file/directory</td> | ||
<td>High</td> | <td style="background-color:red;text-align:center;">High</td> | ||
<td>Important, but not sure how to do this either. If I figure out how to launch Firefox, there will probably be an easy way to catch when it is closed.</td> | <td>Important, but not sure how to do this either. If I figure out how to launch Firefox, there will probably be an easy way to catch when it is closed.</td> | ||
</tr> | </tr> | ||
Revision as of 21:34, 18 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
- 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
Timeline
This is a timeline of what is left to do and when I should have that done
What is left to do?
| Task | Priority | Status |
|---|---|---|
| Auto-locate Firefox profiles and Firefox executable | Low |
|
| Read values from prefs.js | Done / Medium |
|
| Pick files (firefox executable)/directories (profile directory) | Done / High | Done |
| Locate root directory of extension | Done / High | Needed to write in text file. This is tricky because it should point to the same directory as application.ini, but where that file is isn't always relative to the current file. So we have a few options
I am leaning towards option #1 Mark Finkle and shaver suggest option #2, but have also suggested defaulting to the last picked directory. Which seems fair |
| locate extension id | High | Read application.ini/install.rdf, but how? I have managed to finish application.ini, since it only relies on undocumented interfaces. I have no clue right now on RDF, but Mark Finkle pointed to possible help. |
| create text file/directory | Medium | Create a directory/text file. I don't think this will be difficult at all
|
| Launch Firefox | Medium | Not sure how to do this yet
|
| Wait for Firefox to close and delete file/directory | High | Important, but not sure how to do this either. If I figure out how to launch Firefox, there will probably be an easy way to catch when it is closed. |
Estimated Time of Delivery
- I have had a hell of a time finding the title of another tab (when I did a “Save All” functionality), and I gave up. So finding the root directory will probably take half a day. Locating the extension id will probably take the other half.
- Creating a text file and directory, I don't suspect will take very long. Maybe 2 hours at most.
- Launching firefox and waiting for it will probably take a full day.
So two days? Meh, I'll make it Wednesday.