electron/spec/fixtures/pages/fullscreen-oopif.html
loc 15dffb3dde fix: allow iframe-initiated HTML fullscreen to exit while in macOS fullscreen (#20962)
* fix: explicitly resize the contents when exiting html fullscreen while in OS fullscreen

* test: ensure HTML fullscreen toggles while in OS fullscreen
2019-11-05 13:34:45 -08:00

19 lines
549 B
HTML

<script>
const { webFrame, ipcRenderer } = require('electron')
document.addEventListener('fullscreenchange', () => {
ipcRenderer.send('fullscreenChange', webFrame.routingId)
});
window.addEventListener('message', ({ data }) => {
if (data === 'exitFullscreen') {
document.exitFullscreen()
}
})
window.addEventListener('load', () => {
window.focus()
webFrame.executeJavaScript('document.querySelector("video").requestFullscreen()', true)
});
</script>
<video></video>