Commit 7d14292f authored by Mike Perry's avatar Mike Perry
Browse files

Add 1506 comments pointed out by Georg.

parent 5237865c
<!-- Bug 1506 P0: This is old FF2 cruft. It does not need to exist. -->
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
......
// Bug 1506 P0-P3: These utility functions might be useful, but
// you probably just want to rewrite them or use the underlying
// code directly. I don't see any of them as essential for 1506,
// really.
var m_tb_torlog = Components.classes["@torproject.org/torbutton-logger;1"]
.getService(Components.interfaces.nsISupports).wrappedJSObject;
......@@ -21,6 +26,7 @@ if(versionChecker.compare(appInfo.version, "5.0a1") >= 0) {
}
// Bug 1506 P0: Use the log service directly
function torbutton_eclog(nLevel, sMsg) {
m_tb_torlog.eclog(nLevel, sMsg);
return true;
......@@ -64,6 +70,9 @@ function torbutton_get_prefbranch(branch_name) {
return o_branch;
}
// Bug 1506 P3: This would be a semi-polite thing to do on uninstall
// for pure Firefox users. The most polite thing would be to save
// all their original prefs.. But meh?
function torbutton_reset_browser_prefs() {
var o_all_prefs = torbutton_get_prefbranch('');
var prefs = ["network.http.sendSecureXSiteReferrer",
......
// Bug 1506 P2: I think cookie protections is a neat feature.
var cookiesTree = null;
var prefs = null;
var cookies = [];
......
<!-- Bug 1506 P0: This is old FF2 cruft. It does not need to exist. -->
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
......
// Bug 1506 P1-2: This code is mostly hackish remnants of session store
// Bug 1506 P1-3: This code is mostly hackish remnants of session store
// support. There are a couple of observer events that *might* be worth
// listening to. Search for 1506 in the code.
......@@ -55,6 +55,8 @@ function CrashObserver() {
}
if (this.is_ff4) {
// Bug 1506 P2/P3: You probably want to register this observer to clean up
// prefs if you're going to support using normal firefox.
Components.utils.import("resource://gre/modules/AddonManager.jsm");
this.onEnabling = this.onOperationCancelled;
this.onDisabling = this.onUninstalling;
......@@ -74,6 +76,8 @@ CrashObserver.prototype = {
// us somehow, we will leave the browser in a sorry state... Let's hope they
// have the sense not to uninstall addons after an improper shutdown/crash
// (or at least give us this event again in that case).
// Bug 1506 P2/P3: You probably want to register this observer to clean up
// prefs if you're going to support using normal firefox.
onUninstalling: function(addon, needsRestart) {
if (addon.id.toUpperCase() == TORBUTTON_EXTENSION_UUID) {
this._uninstall = true;
......@@ -89,6 +93,8 @@ CrashObserver.prototype = {
// This is done in the constructor. JS doesn't allow this...
//onDisabling: this.onUninstalling,
// Bug 1506 P2/P3: You probably want to register this observer to clean up
// prefs if you're going to support using normal firefox.
onOperationCancelled: function(addon) {
if (addon.id.toUpperCase() == TORBUTTON_EXTENSION_UUID) {
this.logger.log(4, "Uninstall of Torbutton canceled. Hurray!");
......@@ -111,8 +117,6 @@ CrashObserver.prototype = {
}
this._prefs.setBoolPref("extensions.torbutton.normal_exit", false);
} else if (topic == "em-action-requested") {
// Bug 1506 P2/P4: You probably want to register this observer to clean up
// prefs if you're going to support using normal firefox.
this.logger.log(3, "Uninstall action requested..");
// http://xulsolutions.blogspot.com/2006/07/creating-uninstall-script-for.html
subject.QueryInterface(Components.interfaces.nsIUpdateItem);
......@@ -127,7 +131,7 @@ CrashObserver.prototype = {
}
}
} else if (topic == "quit-application-granted") {
// Bug 1506 P2/P4: You probably want to register this observer to clean up
// Bug 1506 P2/P3: You probably want to register this observer to clean up
// prefs if you're going to support using normal firefox.
this.logger.log(3, "Got firefox quit event.");
var chrome = null;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment