diff --git a/crash-reporter.js b/crash-reporter.js new file mode 100644 index 0000000..ea7b363 --- /dev/null +++ b/crash-reporter.js @@ -0,0 +1,20 @@ +var electron = require('electron'); + +// This file should be included from the main thread and every renderer thread. +// Note that the reporter is only half of the equation. A server listening for +// the reports is also required. +// +// The config is currently set up to report to a locally running instance of +// https://github.com/electron/mini-breakpad-server. +// Setup instructions on that page are fairly simple, though I don't know what the +// breakpad symbols parts means and I didn't use it to initially test this feature. +// If you want to force a crash for testing call `process.crash` + +electron.crashReporter.start({ + companyName: 'Daplie Labs', + productName: 'Electron Demo', + submitURL: 'http://localhost:1127/post', + extra: { + prop: 'some string value', + }, +}); diff --git a/index.html b/index.html index 3b96b30..714f1b2 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ + diff --git a/index.js b/index.js index 58e3319..c84da03 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,8 @@ var BrowserWindow = electron.BrowserWindow; var path = require('path'); var url = require('url'); +require('./crash-reporter'); + // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. var win;