Commit 5b13748c authored by Alex Catarineu's avatar Alex Catarineu
Browse files

Remove aboutTor component

parent 4dd346e2
/*************************************************************************
* Copyright (c) 2017, The Tor Project, Inc.
* See LICENSE for licensing information.
*
* vim: set sw=2 sts=2 ts=8 et syntax=javascript:
*
* about:tor component
*************************************************************************/
// Module specific constants
const kMODULE_NAME = "about:tor";
const kMODULE_CONTRACTID = "@mozilla.org/network/protocol/about;1?what=tor";
const kMODULE_CID = Components.ID("84d47da6-79c3-4661-aa9f-8049476f7bf5");
const kAboutTorURL = "chrome://torbutton/content/aboutTor/aboutTor.xhtml";
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
function AboutTor() {}
AboutTor.prototype =
{
QueryInterface: ChromeUtils.generateQI([Ci.nsIAboutModule]),
// nsIClassInfo implementation:
classDescription: kMODULE_NAME,
classID: kMODULE_CID,
contractID: kMODULE_CONTRACTID,
// nsIAboutModule implementation:
newChannel(aURI, aLoadInfo) {
let ioSvc = Services.io;
let uri = ioSvc.newURI(kAboutTorURL);
let channel = ioSvc.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
channel.originalURI = aURI;
return channel;
},
getURIFlags: function(aURI)
{
return Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT |
Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD |
Ci.nsIAboutModule.ALLOW_SCRIPT;
}
};
let factory = XPCOMUtils._getFactory(AboutTor);
let reg = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
reg.registerFactory(kMODULE_CID, "", kMODULE_CONTRACTID, factory);
......@@ -62,13 +62,6 @@ function StartupObserver() {
} catch(e) {
this.logger.log(4, "Early proxy change failed. Will try again at profile load. Error: "+e);
}
// Arrange for our about:tor handler to be loaded in the default (chrome)
// process as well as in each content process.
let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"]
.getService(Ci.nsIProcessScriptLoader);
ppmm.loadProcessScript("resource://torbutton/components/aboutTor.js",
true);
}
StartupObserver.prototype = {
......
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