Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <meta charset="utf-8"> | |
| 3 <title>IFrame fullscreenEnabled attribute and success reporter</title> | |
| 4 <body> | |
| 5 <script> | |
| 6 reportFullscreenEnabled = (frame, success) => { | |
| 7 return () => { | |
| 8 parent.postMessage({"report": { | |
| 9 "api": "fullscreen", | |
| 10 "result": [document.fullscreenEnabled, success], | |
| 11 "frame": frame | |
| 12 }}, "*"); | |
| 13 }; | |
| 14 }; | |
| 15 | |
| 16 window.addEventListener('message', (e) => { | |
| 17 if (e.data.action == "report") { | |
| 18 var frame = e.data.frame; | |
| 19 document.onfullscreenchange = reportFullscreenEnabled(frame, true); | |
| 20 document.onfullscreenerror = reportFullscreenEnabled(frame, false); | |
| 21 document.body.requestFullscreen(); | |
|
foolip
2017/08/15 09:44:22
This request ought to always fail since it's not i
iclelland
2017/08/16 13:31:55
Interesting... this is triggered by postmessage fr
iclelland
2017/08/16 14:20:57
And this is done; I've split the test into two, to
foolip
2017/08/16 21:43:14
Ah, so I guess it works because there was a user g
| |
| 22 } | |
| 23 }); | |
| 24 </script> | |
| OLD | NEW |