| Index: lib/windowObserver.js |
| =================================================================== |
| --- a/lib/windowObserver.js |
| +++ b/lib/windowObserver.js |
| @@ -34,7 +34,7 @@ |
| this.observe(window, "domwindowopened", null); |
| } |
| - Services.ww.registerNotification(this); |
| + Services.obs.addObserver(this, "chrome-document-global-created", true); |
| this._shutdownHandler = function() |
| { |
| @@ -42,7 +42,7 @@ |
| while (e.hasMoreElements()) |
| this._listener.removeFromWindow(e.getNext().QueryInterface(Ci.nsIDOMWindow)); |
| - Services.ww.unregisterNotification(this); |
| + Services.obs.removeObserver(this, "chrome-document-global-created"); |
| }.bind(this); |
| onShutdown.add(this._shutdownHandler); |
| } |
| @@ -64,7 +64,8 @@ |
| observe: function(subject, topic, data) |
| { |
| - if (topic == "domwindowopened") |
| + // Make sure page is not about:blank (work-around for bug 795961) |
| + if (subject instanceof Ci.nsIDOMWindow && subject.location.href !== "about:blank") |
| { |
| if (this._when == "start") |
| { |