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"]; |