Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #5335 from bsclifton/default-to-newtab
Browse files Browse the repository at this point in the history
Removed "blank" option (about:blank !== about:newtab)
  • Loading branch information
bsclifton authored Nov 1, 2016
2 parents d7d2718 + 96492aa commit 8d369b0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion app/common/constants/settingsEnums.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const startsWithOption = {
}

const newTabMode = {
BLANK: 'blank',
NEW_TAB_PAGE: 'newTabPage',
HOMEPAGE: 'homePage',
DEFAULT_SEARCH_ENGINE: 'defaultSearchEngine'
Expand Down
2 changes: 1 addition & 1 deletion docs/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ AppStore
// See defaults in js/constants/appConfig.js
'general.startup-mode': string, // One of: lastTime, homePage, newTabPage
'general.homepage': string, // URL of the user's homepage
'general.newtab-mode-TEMP': string, // One of: blank, newTabPage, homePage, defaultSearchEngine
'general.newtab-mode': string, // One of: newTabPage, homePage, defaultSearchEngine
'general.show-home-button': boolean, // true if the home button should be shown
'general.useragent.value': (undefined|string), // custom user agent value
'general.downloads.default-save-path': string, // default path for saving files
Expand Down
1 change: 0 additions & 1 deletion js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ class GeneralTab extends ImmutableComponent {
<SettingItem dataL10nId='newTabMode'>
<select value={getSetting(settings.NEWTAB_MODE, this.props.settings)}
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.NEWTAB_MODE)} >
<option data-l10n-id='newTabBlank' value={newTabMode.BLANK} />
<option data-l10n-id='newTabNewTabPage' value={newTabMode.NEW_TAB_PAGE} />
<option data-l10n-id='newTabHomePage' value={newTabMode.HOMEPAGE} />
<option data-l10n-id='newTabDefaultSearchEngine' value={newTabMode.DEFAULT_SEARCH_ENGINE} />
Expand Down
2 changes: 1 addition & 1 deletion js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = {
'general.language': null, // null means to use the OS lang
'general.startup-mode': 'lastTime',
'general.homepage': 'https://www.brave.com',
'general.newtab-mode-TEMP': process.env.NODE_ENV === 'test' ? 'newTabPage' : 'blank',
'general.newtab-mode': 'newTabPage',
'general.show-home-button': false,
'general.useragent.value': null, // Set at runtime
'general.autohide-menu': true,
Expand Down
2 changes: 1 addition & 1 deletion js/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const settings = {
// General tab
STARTUP_MODE: 'general.startup-mode',
HOMEPAGE: 'general.homepage',
NEWTAB_MODE: 'general.newtab-mode-TEMP',
NEWTAB_MODE: 'general.newtab-mode',
SHOW_HOME_BUTTON: 'general.show-home-button',
USERAGENT: 'general.useragent.value',
DEFAULT_DOWNLOAD_SAVE_PATH: 'general.downloads.default-save-path',
Expand Down
8 changes: 3 additions & 5 deletions js/lib/appUrlUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,8 @@ module.exports.newFrameUrl = function () {
const {newTabMode} = require('../../app/common/constants/settingsEnums')

switch (settingValue) {
case newTabMode.NEW_TAB_PAGE:
return 'about:newtab'

case newTabMode.HOMEPAGE:
return getSetting(settings.HOMEPAGE) || 'about:blank'
return getSetting(settings.HOMEPAGE) || 'about:newtab'

case newTabMode.DEFAULT_SEARCH_ENGINE:
const searchProviders = require('../data/searchProviders').providers
Expand All @@ -173,7 +170,8 @@ module.exports.newFrameUrl = function () {
})
return defaultSearchEngineSettings[0].base

case newTabMode.NEW_TAB_PAGE:
default:
return 'about:blank'
return 'about:newtab'
}
}

0 comments on commit 8d369b0

Please sign in to comment.