webview-move-to-window.html 426 B

123456789101112131415161718
  1. <html>
  2. <body>
  3. <script type="text/javascript" charset="utf-8">
  4. var ipcRenderer = require('electron').ipcRenderer
  5. ipcRenderer.on('guestinstance', function(event, instance) {
  6. var webview = new WebView()
  7. webview.setAttribute('guestinstance', instance)
  8. document.body.appendChild(webview)
  9. webview.addEventListener('did-attach', function (){
  10. ipcRenderer.send('pong')
  11. })
  12. })
  13. </script>
  14. </body>
  15. </html>