Skip to content

Commit

Permalink
Getting rid of nsIResProtocolHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocr committed Feb 21, 2014
1 parent 474e96c commit cec1418
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Cu.import("resource://gre/modules/AddonManager.jsm");
function LOG(m) (m = addon.name + ' Message @ '
+ (new Date()).toISOString() + "\n> " + m,
dump(m + "\n"), Services.console.logStringMessage(m));
function rsc(n) 'resource://' + addon.tag + '/' + n;

let i$ = {
onOpenWindow: function(aWindow) {
Expand All @@ -44,7 +43,7 @@ function iNotify(aMsg, callback) {
let nme = addon.branch.getIntPref('nme');

if(nme == 2) {
showAlertNotification(rsc("icon.png"),addon.name,aMsg,!1,"",
showAlertNotification(addon.icon,addon.name,aMsg,!1,"",
(s,t) => t == "alertshow" || callback(t));
} else {
if(nme) Services.prompt.alert(null,addon.name,aMsg);
Expand Down Expand Up @@ -390,17 +389,12 @@ function startup(data) {
id: data.id,
name: data.name,
version: data.version,
icon: data.getResourceURI("icon.png").spec,
tag: data.name.toLowerCase().replace(/[^\w]/g,''),
wms: new WeakMap()
};
addon.branch = Services.prefs.getBranch('extensions.'+addon.tag+'.');

let io = Services.io;
io.getProtocolHandler("resource")
.QueryInterface(Ci.nsIResProtocolHandler)
.setSubstitution(addon.tag,
io.newURI(__SCRIPT_URI_SPEC__+'/../',null,null));

i$.wmf(loadIntoWindowStub);
Services.wm.addListener(i$);

Expand All @@ -417,10 +411,6 @@ function shutdown(data, reason) {

Services.wm.removeListener(i$);
i$.wmf(unloadFromWindow);

Services.io.getProtocolHandler("resource")
.QueryInterface(Ci.nsIResProtocolHandler)
.setSubstitution(addon.tag,null);
}

function install(data, reason) {}
Expand Down

0 comments on commit cec1418

Please sign in to comment.