diff --git a/js/entry.js b/js/entry.js index d3d0f43e2cf..eb88fb00a6f 100644 --- a/js/entry.js +++ b/js/entry.js @@ -21,11 +21,21 @@ require('../less/notificationBar.less') require('../less/addEditBookmark.less') require('../node_modules/font-awesome/css/font-awesome.css') -if (process.platform === 'darwin') { - // Setup the crash handling for mac renderer processes - // https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md#crashreporterstartoptions - const CrashHerald = require('../app/crash-herald') - CrashHerald.init() +// Enable or disable crash reporting based on platform +const setupCrashReporting = () => { + if (process.platform === 'darwin') { + // Setup the crash handling for mac renderer processes + // https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md#crashreporterstartoptions + console.log('Renderer crash reporting initialized') + require('../app/crash-herald').init() + } else { + console.log(`Unsupported crash reporting platform ${process.platform} for renderer crashes`) + } +} + +// Notify that renderer crash reporting is disabled +const disableCrashReporting = () => { + console.log('Disabling renderer crash reporting') } const React = require('react') @@ -77,6 +87,12 @@ window.addEventListener('beforeunload', function () { // get appStore from url ipc.on(messages.INITIALIZE_WINDOW, (e, disposition, appState, frames, initWindowState) => { + // Configure renderer crash reporting + if (appState.settings[require('./constants/settings').SEND_CRASH_REPORTS] !== false) { + setupCrashReporting() + } else { + disableCrashReporting() + } appStoreRenderer.state = Immutable.fromJS(appState) ReactDOM.render( ,