electron/spec/fixtures/pages/visibilitychange.html

14 lines
379 B
HTML
Raw Normal View History

<html>
<body>
<script type="text/javascript" charset="utf-8">
const {ipcRenderer} = require('electron')
ipcRenderer.send('pong', document.visibilityState, document.hidden)
document.addEventListener('visibilitychange', function () {
setTimeout(() => {
ipcRenderer.send('pong', document.visibilityState, document.hidden)
}, 500);
})
</script>
</body>
</html>