Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 6231262318559232: Issue 238 - Opening new windows slows down progressively (Closed)
Patch Set: Created April 4, 2014, 8:54 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -459,6 +459,24 @@
notificationTimer.initWithCallback(this.showNextNotification.bind(this),
3 * 60 * 1000, Ci.nsITimer.TYPE_ONE_SHOT);
onShutdown.add(function() notificationTimer.cancel());
+
+ // Add "anti-adblock messages" notification
+ initAntiAdblockNotification();
+
+ let documentCreationObserver = {
+ observe: function(subject, topic, data)
+ {
+ if (!(subject instanceof Ci.nsIDOMWindow))
+ return;
+
+ this.showNextNotification(subject.location.href);
+ }.bind(UI)
+ };
+ Services.obs.addObserver(documentCreationObserver, "content-document-global-created", false);
+ onShutdown.add(function()
+ {
+ Services.obs.removeObserver(documentCreationObserver, "content-document-global-created", false);
+ });
},
/**
@@ -531,24 +549,6 @@
window.document.getElementById("abp-notification").hidePopup();
}, false);
- // Add "anti-adblock messages" notification
- initAntiAdblockNotification();
-
- let documentCreationObserver = {
- observe: function(subject, topic, data)
- {
- if (!(subject instanceof Ci.nsIDOMWindow))
- return;
-
- this.showNextNotification(subject.location.href);
- }.bind(UI)
- };
- Services.obs.addObserver(documentCreationObserver, "content-document-global-created", false);
- onShutdown.add(function()
- {
- Services.obs.removeObserver(documentCreationObserver, "content-document-global-created", false);
- });
-
// First-run actions?
if (!this.firstRunDone)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld