Bug 1445337 - Send Reader:PushState message to the correct browser. r?gijs
MozReview-Commit-ID: HmNFGgCgRTc
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5150,24 +5150,24 @@ var TabsProgressListener = {
return;
aBrowser.removeEventListener("pagehide", onPageHide, true);
if (event.target.documentElement)
event.target.documentElement.removeAttribute("hasBrowserHandlers");
}, true);
}
},
- onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI,
- aFlags) {
+ onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI, aFlags) {
// Filter out location changes caused by anchor navigation
// or history.push/pop/replaceState.
if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
- // Reader mode actually cares about these:
- let mm = gBrowser.selectedBrowser.messageManager;
- mm.sendAsyncMessage("Reader:PushState", {isArticle: gBrowser.selectedBrowser.isArticle});
+ // Reader mode cares about history.pushState and friends.
+ aBrowser.messageManager.sendAsyncMessage("Reader:PushState", {
+ isArticle: aBrowser.isArticle,
+ });
return;
}
// Filter out location changes in sub documents.
if (!aWebProgress.isTopLevel)
return;
// Only need to call locationChange if the PopupNotifications object