Bug 1392210 followup to handle clicks in subframes correctly, r?kmag draft
authorShane Caraveo <scaraveo@mozilla.com>
Tue, 05 Sep 2017 13:36:08 -0700
changeset 659290 212deacc98bb0b35ff307d79496c2ba6e8f0ac35
parent 659065 3ecda4678c49ca255c38b1697142b9118cdd27e7
child 729953 be30521c8cb05f3d4bf8c7c2ce355d2db75bd947
push id78091
push usermixedpuppy@gmail.com
push dateTue, 05 Sep 2017 20:36:38 +0000
reviewerskmag
bugs1392210
milestone57.0a1
Bug 1392210 followup to handle clicks in subframes correctly, r?kmag MozReview-Commit-ID: LwTd64x8Mz7
toolkit/components/extensions/ext-browser-content.js
--- a/toolkit/components/extensions/ext-browser-content.js
+++ b/toolkit/components/extensions/ext-browser-content.js
@@ -287,17 +287,21 @@ const BrowserListener = {
   },
 };
 
 addMessageListener("Extension:InitBrowser", BrowserListener);
 addMessageListener("Extension:UnblockParser", BrowserListener);
 
 var WebBrowserChrome = {
   onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab) {
-    return BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
+    // isAppTab is the value for the docShell that received the click.  We're
+    // handling this in the top-level frame and want traversal behavior to
+    // match the value for this frame rather than any subframe, so we pass
+    // through the docShell.isAppTab value rather than what we were handed.
+    return BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, docShell.isAppTab);
   },
 
   shouldLoadURI(docShell, URI, referrer, hasPostData, triggeringPrincipal) {
     return true;
   },
 
   shouldLoadURIInThisProcess(URI) {
     return E10SUtils.shouldLoadURIInThisProcess(URI);