From 1e776711569270561fd4448c34f6c4b8aada7b42 Mon Sep 17 00:00:00 2001 From: tigerbot Date: Mon, 24 Apr 2017 12:19:46 -0600 Subject: [PATCH] added hook to crash the program (to test the reporter) --- crash-reporter.js | 10 ++++++++++ index.html | 5 +++++ 2 files changed, 15 insertions(+) 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 @@ +

Drag and Drop Area

+ +
+ +