electron/spec/fixtures/pages/fullscreen-ipif.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

15 lines
574 B
HTML

<body>
<iframe style="width: 0" frameborder=0 src="fullscreen.html" allowfullscreen></iframe>
<script>
const { webFrame, ipcRenderer } = require('electron')
const iframe = document.querySelector('iframe')
document.addEventListener('fullscreenchange', () => {
ipcRenderer.send('fullscreenChange')
})
iframe.addEventListener('load', () => {
webFrame.executeJavaScript("document.querySelector('iframe').contentDocument.querySelector('video').requestFullscreen()", true)
})
</script>
</body>