diff --git a/app/channel.js b/app/channel.js index 39a1ae30bf8..f7411242515 100644 --- a/app/channel.js +++ b/app/channel.js @@ -9,8 +9,8 @@ const config = require('../js/constants/buildConfig') // The current channel is retrieved first from the buildConfig constants file, // then the environments and finally defaults to dev -var channel = config.channel || process.env.CHANNEL || 'dev' -let channels = new Set(['dev', 'beta', 'stable', 'developer', 'nightly']) +var channel = config.channel || process.env.CHANNEL || '' +let channels = new Set(['dev', 'beta', 'stable', 'developer', 'nightly', '']) if (!channels.has(channel)) { throw new Error(`Invalid channel ${channel}`) diff --git a/app/crash-herald.js b/app/crash-herald.js index 134c180044c..973d7bd9c08 100644 --- a/app/crash-herald.js +++ b/app/crash-herald.js @@ -2,10 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const buildConfig = require('../js/constants/buildConfig') const Channel = require('./channel') +const {app} = require('electron') -const version = buildConfig.BROWSER_LAPTOP_REV || 'unknown' +const version = app.getVersion() const channel = Channel.channel() const crashKeys = { @@ -15,6 +15,10 @@ const crashKeys = { } const initCrashKeys = () => { + // set muon-app-version switch to pass version to renderer processes + app.commandLine.appendSwitch('muon-app-version', version) + app.commandLine.appendSwitch('muon-app-channel', channel) + for (let key in crashKeys) { muon.crashReporter.setCrashKeyValue(key, crashKeys[key]) } @@ -22,10 +26,6 @@ const initCrashKeys = () => { exports.init = (enabled) => { initCrashKeys() - const {app} = require('electron') - // set muon-app-version switch to pass version to renderer processes - app.commandLine.appendSwitch('muon-app-version', version) - app.commandLine.appendSwitch('muon-app-channel', channel) muon.crashReporter.setEnabled(enabled) if (enabled) { console.log('Crash reporting enabled')