Bug 1240913 - Add @allowfullscreen to appease swapFrameLoaders. r=ochameau draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 19 Apr 2016 15:35:04 -0500
changeset 368079 db3dc72f59c5db7f4a11e49e92b6185140fc8525
parent 368078 f1a46caa101f1120f7cb2657e1e3c126bee68aca
child 368080 e27df42e793aca7d7eae944f116f3e98107740a3
push id18425
push userbmo:jryans@gmail.com
push dateWed, 18 May 2016 01:26:45 +0000
reviewersochameau
bugs1240913
milestone49.0a1
Bug 1240913 - Add @allowfullscreen to appease swapFrameLoaders. r=ochameau We don't really need fullscreen access here, but we do need the same access to browser features as regular browser tabs. The `swapFrameLoaders` platform API we use compares such features before allowing the swap to proceed. MozReview-Commit-ID: DVPUC1QKBgJ
devtools/client/responsive.html/components/browser.js
--- a/devtools/client/responsive.html/components/browser.js
+++ b/devtools/client/responsive.html/components/browser.js
@@ -98,19 +98,25 @@ module.exports = createClass({
 
         /**
          * React uses a whitelist for attributes, so we need some way to set
          * attributes it does not know about, such as @mozbrowser.  If this were
          * the only issue, we could use componentDidMount or ref: node => {} to
          * set the atttibutes. In the case of @remote, the attribute must be set
          * before the element is added to the DOM to have any effect, which we
          * are able to do with this approach.
+         *
+         * @noisolation and @allowfullscreen are needed so that these frames
+         * have the same access to browser features as regular browser tabs.
+         * The `swapFrameLoaders` platform API we use compares such features
+         * before allowing the swap to proceed.
          */
         dangerouslySetInnerHTML: {
           __html: `<iframe class="browser" mozbrowser="true" remote="true"
-                           noisolation="true" src="${location}"
-                           width="100%" height="100%"></iframe>`
+                           noisolation="true" allowfullscreen="true"
+                           src="${location}" width="100%" height="100%">
+                   </iframe>`
         }
       }
     );
   },
 
 });