iFrame is allowed to go full screen, even though "allowfullscreen" attribute hasn't been set
Reported by
walkingf...@googlemail.com,
Apr 17 2018
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Steps to reproduce the problem: 1. open the test.html attachment 2. press the "go full screen" button 3. What is the expected behavior? The browser doesn't go into full-screen mode What went wrong? The browser went into full-screen mode Did this work before? N/A Does this work in other browsers? Yes Chrome version: 65.0.3325.181 Channel: stable OS Version: OS X 10.11.6 Flash Version: The specs say that you need to set "allowfullscreen" in order for an iFrame to go full screen: https://fullscreen.spec.whatwg.org/#security-and-privacy-considerations https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allowfullscreen
,
Apr 17 2018
Thanks for the speedy reply :) We noticed that using the "sandbox" attribute will disable the iframe from going full screen. But this also disable the use of Window.postMessage() Is there a way to disable an iframe from going full screen, while still being able to use Window.postMessage()?
,
Apr 18 2018
,
Apr 20 2018
Able to reproduce this issue on Windows 10, Mac OS 10.12.6 and Ubuntu 14.04 on the latest Canary 68.0.3400.0 and latest Stable 66.0.3359.117 as per the original comment. Bisect Information: =================== Good Build: 62.0.3188.0 Bad Build : 62.0.3189.0 As per comment #1, the CL which caused this issue is Reviewed-on: https://codereview.chromium.org/2898503002 iclelland@ Please check and confirm if this issue is related to your change, else help us in assigning to the right owner. Thanks.
,
Apr 23 2018
(Marking WAI as this is the intended behaviour as of M62)
Re: #2 -- yes, you can disable fullscreen specifically with feature policy. Adding the attribute
allow="fullscreen 'none'"
to the iframe should cause fullscreen to be blocked in that frame.
<iframe src="http://some.example.com" allow="fullscreen 'none'"></iframe>
You can still postMessage, and do everything else that would otherwise be allowed in that frame. Only the one feature will be blocked.
Of course, if you don't trust the frame not to abuse fullscreen, it should really be sandboxed, or hosted on a different origin than the main page at least: A same-origin frame can do things like changing the markup in the parent page, or abusing the parent's ability to use fullscreen in order to fullscreen its own <iframe> element.
|
||||
►
Sign in to add a comment |
||||
Comment 1 by woxxom@gmail.com
, Apr 17 2018