Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue 5949 (Firebug cannot be opened in popup windows)

  • Loading branch information...
commit 682d6777177fe722a68b678a2b264ce408657cf9 1 parent 66652ca
@SebastianZ SebastianZ authored
Showing with 20 additions and 12 deletions.
  1. +20 −12 extension/bootstrap.js
View
32 extension/bootstrap.js
@@ -26,6 +26,7 @@ var FIREBUG_MODULES = [
"resource://firebug/storageService.js"
];
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
// ********************************************************************************************* //
@@ -69,7 +70,7 @@ function startup(params, reason)
FirebugLoader.loadIntoWindow(enumerator.getNext());
// Listen for new windows, Firebug must be loaded into them too.
- Services.ww.registerNotification(windowWatcher);
+ Services.obs.addObserver(windowWatcher, "chrome-document-global-created", false);
// GCLI commands
Cu.import("resource://firebug/gcli.js");
@@ -83,7 +84,7 @@ function shutdown(params, reason)
return;
// Remove "new window" listener.
- Services.ww.unregisterNotification(windowWatcher);
+ Services.obs.removeObserver(windowWatcher, "chrome-document-global-created");
// remove from all windows
try
@@ -122,17 +123,24 @@ function shutdown(params, reason)
// ********************************************************************************************* //
// Window Listener
-var windowWatcher = function windowWatcher(win, topic)
+var windowWatcher =
{
- if (topic != "domwindowopened")
- return;
-
- win.addEventListener("load", function onLoad()
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
+ observe: function windowWatcher(win, topic, data)
{
- win.removeEventListener("load", onLoad, false);
- if (win.document.documentElement.getAttribute("windowtype") == "navigator:browser")
- FirebugLoader.loadIntoWindow(win);
- }, false);
-}
+ if (win.location.href !== "about:blank")
+ {
+ // https://bugzil.la/795961 ?
+ win.addEventListener("load", function onLoad(evt)
+ {
+ // load listener not necessary once https://bugzil.la/800677 is fixed
+ var win = evt.currentTarget;
+ win.removeEventListener("load", onLoad, false);
+ if (win.document.documentElement.getAttribute("windowtype") == "navigator:browser")
+ FirebugLoader.loadIntoWindow(win);
+ }, false);
+ }
+ }
+};
// ********************************************************************************************* //

0 comments on commit 682d677

Please sign in to comment.
Something went wrong with that request. Please try again.