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

This commit is contained in:
tigerbot 2017-04-24 12:19:46 -06:00
parent c6952b54c7
commit 1e77671156
2 changed files with 15 additions and 0 deletions

View File

@ -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();
}
});
}

View File

@ -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>