browser/devtools/debugger/test/addon-source/browser_dbg_addon5/bootstrap.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/debugger/test/addon-source/browser_dbg_addon5/bootstrap.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +const { interfaces: Ci, classes: Cc } = Components;
     1.8 +
     1.9 +function startup(aParams, aReason) {
    1.10 +  Components.utils.import("resource://gre/modules/Services.jsm");
    1.11 +  let res = Services.io.getProtocolHandler("resource")
    1.12 +                       .QueryInterface(Ci.nsIResProtocolHandler);
    1.13 +  res.setSubstitution("browser_dbg_addon5", aParams.resourceURI);
    1.14 +
    1.15 +  // Load a JS module
    1.16 +  Components.utils.import("resource://browser_dbg_addon5/test.jsm");
    1.17 +}
    1.18 +
    1.19 +function shutdown(aParams, aReason) {
    1.20 +  // Unload the JS module
    1.21 +  Components.utils.unload("resource://browser_dbg_addon5/test.jsm");
    1.22 +
    1.23 +  let res = Services.io.getProtocolHandler("resource")
    1.24 +                       .QueryInterface(Ci.nsIResProtocolHandler);
    1.25 +  res.setSubstitution("browser_dbg_addon5", null);
    1.26 +}

mercurial