visibilitychange.html 341 B

123456789101112
  1. <html>
  2. <body>
  3. <script type="text/javascript" charset="utf-8">
  4. const {ipcRenderer} = require('electron')
  5. ipcRenderer.send('pong', document.visibilityState, document.hidden)
  6. document.addEventListener('visibilitychange', function () {
  7. ipcRenderer.send('pong', document.visibilityState, document.hidden)
  8. })
  9. </script>
  10. </body>
  11. </html>