Confirmed users
657
edits
(Initial write-up) |
(Explicitly mention that checker needs to quit Firefox) |
||
| Line 35: | Line 35: | ||
=== Finishing the test and report generation === | === Finishing the test and report generation === | ||
In this stage, checker needs to [https://developer.mozilla.org/En/Supporting_private_browsing_mode#Turning_private_browsing_on_and_off turn off the private browsing mode]. Then, it needs to spawn the reporting utility.<br>In order to use the same set of skills which is required to build the checker extension, and to keep everything portable to all the platforms that we support, it is advised to write the reporting application as a [http://blogs.acceleration.net/ryan/archive/2005/05/06/1073.aspx XUL application]. In this case, checker can [https://developer.mozilla.org/en/Code_snippets/Running_applications run] the XUL reporter application, and pass it the domains and URLs collected in the second phase as arguments. In order not to be forced to ship a separate [https://developer.mozilla.org/en/XULRunner xulrunner] runtime, [https://developer.mozilla.org/en/XULRunner_tips#Using_Firefox_3_to_run_XULRunner_applications Firefox itself can be used to run the XUL application]. You should however note that you need to specify another profile when running the reporter application, because the entire point behind launching a separate program is to make sure that no file in the active profile directory is being locked. This can be done by [https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIFile/createUnique creating a temporary directory] and using a command line like this to launch Firefox: | In this stage, checker needs to [https://developer.mozilla.org/En/Supporting_private_browsing_mode#Turning_private_browsing_on_and_off turn off the private browsing mode]. Then, it needs to spawn the reporting utility, and [https://developer.mozilla.org/en/How_to_Quit_a_XUL_Application quit Firefox] to release any possible file locks inside the active profile directory. The reporter application should [https://developer.mozilla.org/en/nsIProcess#Attributes wait until Firefox has exited], and then start its job.<br>In order to use the same set of skills which is required to build the checker extension, and to keep everything portable to all the platforms that we support, it is advised to write the reporting application as a [http://blogs.acceleration.net/ryan/archive/2005/05/06/1073.aspx XUL application]. In this case, checker can [https://developer.mozilla.org/en/Code_snippets/Running_applications run] the XUL reporter application, and pass it the domains and URLs collected in the second phase as arguments. In order not to be forced to ship a separate [https://developer.mozilla.org/en/XULRunner xulrunner] runtime, [https://developer.mozilla.org/en/XULRunner_tips#Using_Firefox_3_to_run_XULRunner_applications Firefox itself can be used to run the XUL application]. You should however note that you need to specify another profile when running the reporter application, because the entire point behind launching a separate program is to make sure that no file in the active profile directory is being locked. This can be done by [https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIFile/createUnique creating a temporary directory] and using a command line like this to launch Firefox: | ||
<pre>/path/to/firefox -profile /path/to/tmp/dir -app /path/to/reporter/application.ini | <pre>/path/to/firefox -profile /path/to/tmp/dir -app /path/to/reporter/application.ini | ||
</pre> | </pre> | ||
The reporter application should [https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Enumerating_files_in_given_directory enumerate] the Firefox active profile directory which was used during testing, and [https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Asynchronously read each file in that directory] and [https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/indexOf look for] the each item in the list of domains and URLs inside that file. If the file contains an item in that list, it should report the file's name and path, as well as the domain/URL found in that file. | The reporter application should [https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Enumerating_files_in_given_directory enumerate] the Firefox active profile directory which was used during testing, and [https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Asynchronously read each file in that directory] and [https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/indexOf look for] the each item in the list of domains and URLs inside that file. If the file contains an item in that list, it should report the file's name and path, as well as the domain/URL found in that file. | ||
= See Also = | = See Also = | ||
In order to know more about what we're trying to achieve with this tool, see [http://ehsanakhgari.org/blog/2010-02-17/private-browsing-support-firefox-extensions my blog post]. | In order to know more about what we're trying to achieve with this tool, see [http://ehsanakhgari.org/blog/2010-02-17/private-browsing-support-firefox-extensions my blog post]. | ||