diff extension/content/js/xul/browser.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
line wrap: on
line diff
--- a/extension/content/js/xul/browser.js	Thu Aug 06 15:50:24 2009 -0700
+++ b/extension/content/js/xul/browser.js	Thu Aug 06 17:18:45 2009 -0700
@@ -1,5 +1,13 @@
 (function() {
    var jsm = {};
    Components.utils.import("resource://powerbox/modules/setup.js", jsm);
-   jsm.PowerboxSetup.installToWindow(window);
+
+   window.addEventListener(
+     "load",
+     function onLoad(event) {
+       window.removeEventListener("load", onLoad, false);
+       jsm.PowerboxSetup.installToWindow(window);
+     },
+     false
+   );
  })();