Skip to content

Commit

Permalink
default browser check should run only on release build
Browse files Browse the repository at this point in the history
fix brave#4958

Auditors: @bridiver, @bbondy

Test Plan:
1. Make sure there is no session data
2. npm run start/test should not popup the check default browser modal.
3. BRAVE_FORCE_CHECK_DEFAULT_ON_STARTUP=true npm run start/test
should popup the check default browser modal normally.
  • Loading branch information
darkdh committed Oct 19, 2016
1 parent 4964f0f commit 7027064
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,14 @@ app.on('ready', () => {
}
process.emit(messages.APP_INITIALIZED)

// Default browser checking
let isDefaultBrowser = defaultProtocols.every(p => app.isDefaultProtocolClient(p))
appActions.changeSetting(settings.IS_DEFAULT_BROWSER, isDefaultBrowser)
if (!process.env.BRAVE_FORCE_CHECK_DEFAULT_ON_STARTUP &&
['development', 'test'].includes(process.env.NODE_ENV)) {
appActions.changeSetting(settings.IS_DEFAULT_BROWSER, true)
} else {
// Default browser checking
let isDefaultBrowser = defaultProtocols.every(p => app.isDefaultProtocolClient(p))
appActions.changeSetting(settings.IS_DEFAULT_BROWSER, isDefaultBrowser)
}

if (CmdLine.newWindowURL) {
appActions.newWindow(Immutable.fromJS({
Expand Down

0 comments on commit 7027064

Please sign in to comment.