electron/spec/fixtures/api/crash-restart.html

51 lines
1.1 KiB
HTML
Raw Normal View History

2017-02-13 18:46:19 +00:00
<html>
<body>
<script type="text/javascript" charset="utf-8">
const {port} = require('url').parse(window.location.href, true).query
2017-04-19 23:32:43 +00:00
const {crashReporter, ipcRenderer} = require('electron')
2017-02-13 18:46:19 +00:00
crashReporter.start({
productName: 'Zombies',
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1:' + port,
uploadToServer: true,
ignoreSystemCrashHandler: true,
extra: {
2017-02-13 18:52:40 +00:00
extra1: 'extra1',
extra2: 'initial',
extra3: 'extra3'
2017-02-13 18:46:19 +00:00
}
})
2017-04-19 23:32:43 +00:00
if (process.platform === 'win32') {
ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid)
}
2017-02-13 18:46:19 +00:00
setImmediate(() => {
2017-02-13 19:15:40 +00:00
if (process.platform === 'darwin') {
2017-02-13 18:46:19 +00:00
crashReporter.setExtraParameter('extra2', 'extra2')
crashReporter.setExtraParameter('extra3', null)
} else {
crashReporter.start({
productName: 'Zombies',
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1:' + port,
uploadToServer: true,
ignoreSystemCrashHandler: true,
extra: {
2017-02-13 18:52:40 +00:00
extra1: 'extra1',
extra2: 'extra2'
2017-02-13 18:46:19 +00:00
}
})
}
setImmediate(() => {
process.crash()
})
})
</script>
</body>
</html>