bootstrap.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. Components.utils.import("resource://gre/modules/Services.jsm");
  5. var spObserver;
  6. function startup(data, reason) {
  7. let observer = {};
  8. Components.utils.import("chrome://specialpowers/content/SpecialPowersObserver.jsm", observer);
  9. let registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  10. registrar.registerFactory(
  11. observer.SpecialPowersObserver.prototype.classID,
  12. "SpecialPowersObserver",
  13. observer.SpecialPowersObserver.prototype.contractID,
  14. observer.SpecialPowersObserverFactory
  15. );
  16. spObserver = new observer.SpecialPowersObserver();
  17. spObserver.init();
  18. }
  19. function shutdown(data, reason) {
  20. let observer = {};
  21. Components.utils.import("chrome://specialpowers/content/SpecialPowersObserver.jsm", observer);
  22. let registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  23. registrar.unregisterFactory(
  24. observer.SpecialPowersObserver.prototype.classID,
  25. observer.SpecialPowersObserverFactory
  26. );
  27. spObserver.uninit();
  28. }
  29. function install(data, reason) {}
  30. function uninstall(data, reason) {}