added hook to crash the program (to test the reporter)

这个提交包含在:
tigerbot 2017-04-24 12:19:46 -06:00
父节点 c6952b54c7
当前提交 1e77671156
共有 2 个文件被更改,包括 15 次插入0 次删除

查看文件

@ -18,3 +18,13 @@ electron.crashReporter.start({
prop: 'some string value',
},
});
// If we are in a render thread add a hook catch clicks on "crasher" buttons
// that will crash the program
if (typeof document !== 'undefined') {
document.body.addEventListener('click', function (ev) {
if (ev.target.classList.contains('crasher')) {
process.crash();
}
});
}

查看文件

@ -14,9 +14,14 @@
<button class="start-notify">Start</button>
<button class="stop-notify">Stop</button>
</div>
<div class="drag-n-drop">
<h3>Drag and Drop Area</h3>
<div class="file-container"></div>
</div>
<div>
<button class="crasher">Crash Program</button>
</div>
</body>
</html>