Commit 5237865c authored by Mike Perry's avatar Mike Perry
Browse files

Bug 5965: Comment stuff we want to preserve for Android

Grep the source for "1506" and a priority level. P5 is the highest, most
important stuff. Here's a key:

P0: Toggle mode code. It needs to die.
P1: Feature we could live without/do another way
P2: Mildly useful feature/enhancement
P3: Fingerprinting and linkability defenses; more useful features
P4: Important privacy features, including New Identity
P5: Proxy bypass/state leak issues

These priority levels will also be used to guide us towards a simplified,
toggle-free Torbutton (probably based on Proxy Mobile. See #1506).
parent b1f0e6ef
// Bug 1506 P0: These hooks are only relevant to FF 3.5 and below.
window.__HookObjects = function() {
if (typeof(window.__tb_hooks_ran) === "boolean") {
return false;
......
// Bug 1506 P1: We're almost certainly going to replace this stuff with direct
// patches of the JS VM.
window.__HookObjects = function() {
if (typeof(window.__tb_hooks_ran) === "boolean") {
return false;
......
// Bug 1506 P1: Most of this code needs to go away. See also Bug 3100.
// PREFERences dialog functions
// torbutton_prefs_set_field_attributes() -- initialize dialog fields
// torbutton_prefs_init() -- on dialog load
......
// Bug 1506 P3: This file provides important cache isolation properties,
// but it is not very useful without a patched Firefox to go with it.
// It could probably also use some refactoring into an XPCOM component.
// It is currently registered from torbutton.js's "main window" observers,
// which is not the right place.
/*
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
......
This diff is collapsed.
// Bug 1506 P0: This component is unused. Ignore it.
/*************************************************************************
* Hack to disable CA cert trust dialog popup during CA cert import
* during Tor toggle (since we save the trust bits to disk).
......
// Bug 1506 P1: This component is currently only used to protect
// user-selected cookies from deletion. Moreover, all the E4X code is
// deprecated and needs to be replaced with JSON.
/*************************************************************************
* Cookie Jar Selector (JavaScript XPCOM component)
* Enables selection of separate cookie jars for (more) anonymous browsing.
......@@ -154,6 +158,7 @@ function CookieJarSelector() {
foStream.close();
};
// Start1506
this._protectedCookiesToFile = function(name) {
var file = getProfileFile("protected-" + name + ".xml");
var foStream = Cc["@mozilla.org/network/file-output-stream;1"]
......@@ -292,6 +297,7 @@ function CookieJarSelector() {
}
this["protected-" + name] = cookiesAsXml;
};
// End1506
this._cookiesFromFile = function(name) {
var file = getProfileFile("cookies-" + name + ".xml");
......@@ -360,6 +366,7 @@ function CookieJarSelector() {
this.logger.log(2, "Cookies saved");
};
// Start1506
this.clearUnprotectedCookies = function(name) {
try {
var cookiesAsXml = this.getProtectedCookies(name);
......@@ -407,6 +414,7 @@ function CookieJarSelector() {
this.logger.log(3, "Error deleting unprotected cookies: " + e);
}
};
// End1506
this._oldLoadCookies = function(name, deleteSavedCookieJar) {
var cookieManager =
......@@ -541,6 +549,7 @@ const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsIObserverService = Components.interfaces.nsIObserverService;
const nsICategoryManager = Components.interfaces.nsICategoryManager;
// Start1506: You may or may not care about this:
CookieJarSelector.prototype =
{
QueryInterface: function(iid)
......@@ -610,3 +619,5 @@ if (XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([CookieJarSelector]);
else
var NSGetModule = XPCOMUtils.generateNSGetModule([CookieJarSelector]);
// End1506
// Bug 1506 P1-2: 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.
/*************************************************************************
* Crash observer (JavaScript XPCOM component)
*
......@@ -92,11 +96,10 @@ CrashObserver.prototype = {
}
},
// This is done in the constructor. JS doesn't allow this...
//onEnabling: this.onOperationCancelled,
observe: function(subject, topic, data) {
if(topic == "profile-after-change") {
// Bug 1506 P1: We listen to these prefs as signals for startup,
// but only for hackish reasons.
if(this._prefs.getBoolPref("extensions.torbutton.fresh_install")) {
this._prefs.setBoolPref("extensions.torbutton.normal_exit", true);
}
......@@ -108,6 +111,8 @@ 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);
......@@ -122,6 +127,8 @@ CrashObserver.prototype = {
}
}
} else if (topic == "quit-application-granted") {
// 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, "Got firefox quit event.");
var chrome = null;
try {
......
// Bug 1506 P0: All of this code is toggle specific and can be killed
/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
/*************************************************************************
* Content policy to block stuff not handled by other components
......
// Bug 1506 Android P1/TBB P5: This code providers users with notification
// in the event of external app launch. We want it to exist in the desktop
// port, but it is probably useless for Android.
/*************************************************************************
* External App Handler.
* Handles displaying confirmation dialogs for external apps and protocols
......
// Bug 1506 P0: This code is a relic from FF < 3.5 days and can be totally
// ignored.
/*************************************************************************
* Ignore History (JavaScript XPCOM component)
* Disables reading and writing history. This component is implemented as a
......
// Bug 1506 P0: This code is a relic from FF < 3.5 days and can be totally
// ignored.
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
......
// Bug 1506 P0: This code is a relic from FF < 3.5 days and can be totally
// ignored.
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
......
// Bug 1506 P4: This code blocks the session store from being written to
// disk. It is fairly important, but only one small piece is needed. Search
// this file for 1506 for more details.
/*************************************************************************
* Torbutton Session Store Control
*
......@@ -96,6 +100,10 @@ TBSessionBlocker.prototype =
this.logger.log(3, "Got Session Store observe: "+topic);
subject = subject.QueryInterface(Ci.nsISupportsString);
// Bug 1506: This is the only important bit, other than
// the registration goop. You don't even need the JSON
// garbage...
//
// Simply block sessionstore writes entirely in Tor Browser
try {
if (this.prefs.getCharPref("torbrowser.version")) {
......@@ -106,6 +114,8 @@ TBSessionBlocker.prototype =
} catch(e) {
}
// End 1506. Rest of this function can be ignored.
this.logger.log(2, "Parsing JSON: "+subject);
var state = this._safeJSONparse(subject);
......
// Bug 1506 P0: This code is toggle-mode code and is unused. Kill it.
// Test protocol related
const kSCHEME = "tor";
const kPROTOCOL_NAME = "tor";
......
// Bug 1506 P0: I don't really believe referers matter in the grand scheme.
// Kill this code.
const kMODULE_CID = Components.ID("65be2be0-ceb4-44c2-91a5-9c75c53430bf");
const kMODULE_CONTRACTID = "@torproject.org/torRefSpoofer;1";
......
// Bug 1506 P1: This is just a handy logger. If you have a better one, toss
// this in the trash.
/*************************************************************************
* TBLogger (JavaScript XPCOM component)
*
......
// Bug 1506 P0: This code is toggle-mode code and is unused. Kill it.
// Test protocol related
const kSCHEME = "tors";
const kPROTOCOL_NAME = "tors";
......
// Bug 1506 P0: This code is toggle-mode code and is unused. Kill it.
/*************************************************************************
* ContentWindowMapper (JavaScript XPCOM component)
*
......
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