diff --git a/crash-reporter.js b/crash-reporter.js index ea7b363..8bf9709 100644 --- a/crash-reporter.js +++ b/crash-reporter.js @@ -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(); + } + }); +} diff --git a/index.html b/index.html index 40a11e2..04acaee 100644 --- a/index.html +++ b/index.html @@ -14,9 +14,14 @@ +