electron/spec/fixtures/api/crash.html

31 lines
780 B
HTML
Raw Normal View History

2013-11-14 16:10:43 +00:00
<html>
<body>
<script type="text/javascript" charset="utf-8">
2017-03-30 14:11:49 +00:00
var url = require('url').parse(window.location.href, true);
var uploadToServer = !url.query.skipUpload;
var port = url.query.port;
var {crashReporter, ipcRenderer} = require('electron');
2013-11-14 16:10:43 +00:00
crashReporter.start({
productName: 'Zombies',
companyName: 'Umbrella Corporation',
2015-11-13 08:03:40 +00:00
submitURL: 'http://127.0.0.1:' + port,
2017-03-30 14:11:49 +00:00
uploadToServer: uploadToServer,
ignoreSystemCrashHandler: true,
extra: {
'extra1': 'extra1',
'extra2': 'extra2',
}
2013-11-14 16:10:43 +00:00
});
2017-04-19 23:32:43 +00:00
if (process.platform === 'win32') {
ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid)
}
2017-03-30 14:11:49 +00:00
if (!uploadToServer) {
ipcRenderer.sendSync('list-existing-dumps')
2017-03-30 14:11:49 +00:00
}
2013-11-14 16:10:43 +00:00
setImmediate(function() { process.crash(); });
</script>
</body>
</html>