comparison extension/modules/setup.js @ 4:1c02976d8809

Changed to Firebug's progress listener, which allows us to inject our code before any scripts are executed on target pages.
author Atul Varma <varmaa@toolness.com>
date Thu, 06 Aug 2009 17:18:45 -0700
parents 889c2fd4c9cf
children
comparison
equal deleted inserted replaced
3:413435fc6202 4:1c02976d8809
44 Cc["@mozilla.org/fuel/application;1"] 44 Cc["@mozilla.org/fuel/application;1"]
45 .getService(Ci.fuelIApplication) : 45 .getService(Ci.fuelIApplication) :
46 Cc["@mozilla.org/steel/application;1"] 46 Cc["@mozilla.org/steel/application;1"]
47 .getService(Ci.steelIApplication); 47 .getService(Ci.steelIApplication);
48 48
49 let gIsInitialized = false;
50
51 let PowerboxSetup = { 49 let PowerboxSetup = {
52 getExtensionDirectory: function getExtensionDirectory() { 50 getExtensionDirectory: function getExtensionDirectory() {
53 let extMgr = Cc["@mozilla.org/extensions/manager;1"] 51 let extMgr = Cc["@mozilla.org/extensions/manager;1"]
54 .getService(Components.interfaces.nsIExtensionManager); 52 .getService(Components.interfaces.nsIExtensionManager);
55 let loc = extMgr.getInstallLocation("powerbox@labs.mozilla.com"); 53 let loc = extMgr.getInstallLocation("powerbox@labs.mozilla.com");
80 get version() { 78 get version() {
81 return Application.extensions.get("powerbox@labs.mozilla.com").version; 79 return Application.extensions.get("powerbox@labs.mozilla.com").version;
82 }, 80 },
83 81
84 installToWindow: function installToWindow(window) { 82 installToWindow: function installToWindow(window) {
85 if (!gIsInitialized) { 83 var Injector = {};
86 gIsInitialized = true; 84 Cu.import("resource://powerbox/modules/content-injector.js", Injector);
87 var Injector = {}; 85 Injector.init(window);
88 Cu.import("resource://powerbox/modules/content-injector.js", Injector);
89 Injector.init();
90 }
91 } 86 }
92 }; 87 };