123456789101112131415161718192021222324252627282930313233 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title></title>
- <script>
- const {ipcRenderer, remote} = require('electron')
- const contents = remote.getCurrentWebContents()
- // This should not trigger a dereference and a remote getURL call should not fail
- contents.emit('render-view-deleted', {}, 'not-a-process-id')
- try {
- contents.getURL()
- } catch (error) {
- ipcRenderer.send('error-message', 'Unexpected error on getURL call')
- }
- // This should trigger a dereference and a remote getURL call should fail
- contents.emit('render-view-deleted', {}, contents.getProcessId())
- try {
- contents.getURL()
- ipcRenderer.send('error-message', 'No error thrown')
- } catch (error) {
- ipcRenderer.send('error-message', error.message)
- }
- </script>
- </head>
- <body>
- </body>
- </html>
|