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

Unified Diff: lib/appSupport.js

Issue 6325312296058880: issue #290 - [seamonkey] blockable items list persists on tab changes (Closed)
Patch Set: Created July 6, 2014, 12:42 p.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/appSupport.js
===================================================================
--- a/lib/appSupport.js
+++ b/lib/appSupport.js
@@ -359,6 +359,38 @@
return (browser ? browser.currentURI : null);
}
};
+
+ /**
+ * Makes sure that a function is called whenever the displayed browser location changes.
+ * For Seamonkey ignoreSameDoc attribute is useless while aFlags attribute is missing in onLocationChange Listener.
+ */
+ exports.addBrowserLocationListener = function addBrowserLocationListener(/**Window*/ window, /**Function*/ callback, /**Boolean*/ ignoreSameDoc)
+ {
+ let browser = (exports.getBrowser ? exports.getBrowser(window) : null);
+ if (browser)
+ {
+ let dummy = function() {};
+ let progressListener =
+ {
+ callback: callback,
+ onLocationChange: function(progress, request, uri)
saroyanm 2014/07/06 13:01:02 The issue looks caused by ​onLocationChange method
Wladimir Palant 2014/07/07 12:21:21 The code you are linking to is very outdated, the
saroyanm 2014/07/07 13:12:23 Thanks Wladimir for pointing on correct repository
+ {
+ this.callback();
+ },
+ onProgressChange: dummy,
+ onSecurityChange: dummy,
+ onStateChange: dummy,
+ onStatusChange: dummy,
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference])
+ };
+ browser.addProgressListener(progressListener);
+
+ if (progressListeners.has(window))
+ progressListeners.get(window).push(progressListener);
+ else
+ progressListeners.set(window, [progressListener]);
+ }
+ };
exports.contentContextMenu = ["contentAreaContextMenu", "mailContext"];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld