Bug 1449248 - Manually add handler for resource://tps uri in TPS r=kitcambridge

MozReview-Commit-ID: 97YR2gOlOKC

--HG--
extra : rebase_source : 1766078e99e8b8e08677c0339ce5e8e34be868c8
This commit is contained in:
Thom Chiovoloni 2018-03-27 10:12:44 -07:00
parent ca8f68d641
commit 9c92761c4d
3 changed files with 8 additions and 3 deletions

View File

@ -11,9 +11,13 @@ XPCOMUtils.defineLazyServiceGetter(this, "categoryManager",
"@mozilla.org/categorymanager;1",
"nsICategoryManager");
XPCOMUtils.defineLazyServiceGetter(this, "resProto",
"@mozilla.org/network/protocol;1?name=resource",
"nsISubstitutingProtocolHandler");
const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
const CATEGORY_NAME = "command-line-handler";
const CATEGORY_ENTRY = "m-tps";
@ -89,9 +93,11 @@ TPSCmdLine.prototype = {
function startup(data, reason) {
TPSCmdLine.prototype.register();
resProto.setSubstitution("tps", Services.io.newURI("resource", null, data.resourceURI));
}
function shutdown(data, reason) {
resProto.setSubstitution("tps", null);
TPSCmdLine.prototype.unregister();
}

View File

@ -1 +0,0 @@
resource tps resource/

View File

@ -15,7 +15,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>24.0.*</em:minVersion>
<em:maxVersion>31.0.*</em:maxVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>