[Pkg-mozext-commits] [firebug] 07/15: Issue 5949 (Firebug cannot be opened in popup windows) http://code.google.com/p/fbug/issues/detail?id=5949

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:46:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag firebug-1.10.5
in repository firebug.

commit 682d6777177fe722a68b678a2b264ce408657cf9
Author: Sebastian Zartner <sebastianzartner at gmail.com>
Date:   Fri Oct 12 07:34:01 2012 +0200

    Issue 5949 (Firebug cannot be opened in popup windows)
    http://code.google.com/p/fbug/issues/detail?id=5949
---
 extension/bootstrap.js | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/extension/bootstrap.js b/extension/bootstrap.js
index 0432247..fe4f06b 100644
--- a/extension/bootstrap.js
+++ b/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);
+        }
+    }
+};
 
 // ********************************************************************************************* //

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list