michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const { interfaces: Ci, classes: Cc } = Components; michael@0: michael@0: function startup(aParams, aReason) { michael@0: Components.utils.import("resource://gre/modules/Services.jsm"); michael@0: let res = Services.io.getProtocolHandler("resource") michael@0: .QueryInterface(Ci.nsIResProtocolHandler); michael@0: res.setSubstitution("browser_dbg_addon5", aParams.resourceURI); michael@0: michael@0: // Load a JS module michael@0: Components.utils.import("resource://browser_dbg_addon5/test.jsm"); michael@0: } michael@0: michael@0: function shutdown(aParams, aReason) { michael@0: // Unload the JS module michael@0: Components.utils.unload("resource://browser_dbg_addon5/test.jsm"); michael@0: michael@0: let res = Services.io.getProtocolHandler("resource") michael@0: .QueryInterface(Ci.nsIResProtocolHandler); michael@0: res.setSubstitution("browser_dbg_addon5", null); michael@0: }