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 #12491 from brave/fix/12490
Browse files Browse the repository at this point in the history
add setting for enabling site isolation
  • Loading branch information
diracdeltas authored Jan 4, 2018
2 parents d550194 + bb8cf94 commit aba789a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ urlBarOptions=URL Bar Options
usd=$
useHardwareAcceleration=Use hardware acceleration when available *
useSmoothScroll=Enable smooth scrolling *
siteIsolation=Strict Site Isolation
useSiteIsolation=Enhance security by loading each site in its own process (experimental) *
verifiedExplainerText= = publisher has verified their wallet
viewLog=View Log
viewPaymentHistory= {{date}}
Expand Down
13 changes: 9 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,22 @@ let loadAppStatePromise = SessionStore.loadAppState()

// Some settings must be set right away on startup, those settings should be handled here.
loadAppStatePromise.then((initialImmutableState) => {
const {HARDWARE_ACCELERATION_ENABLED, SMOOTH_SCROLL_ENABLED, SEND_CRASH_REPORTS} = require('../js/constants/settings')
CrashHerald.init(getSetting(SEND_CRASH_REPORTS, initialImmutableState.get('settings')))
const {HARDWARE_ACCELERATION_ENABLED, SMOOTH_SCROLL_ENABLED, SEND_CRASH_REPORTS, SITE_ISOLATION_ENABLED} = require('../js/constants/settings')
const initialSettings = initialImmutableState.get('settings')
CrashHerald.init(getSetting(SEND_CRASH_REPORTS, initialSettings))

telemetry.setCheckpointAndReport('state-loaded')
if (getSetting(HARDWARE_ACCELERATION_ENABLED, initialImmutableState.get('settings')) === false) {
if (getSetting(HARDWARE_ACCELERATION_ENABLED, initialSettings) === false) {
app.disableHardwareAcceleration()
}

if (getSetting(SMOOTH_SCROLL_ENABLED, initialImmutableState.get('settings')) === false) {
if (getSetting(SMOOTH_SCROLL_ENABLED, initialSettings) === false) {
app.commandLine.appendSwitch('disable-smooth-scrolling')
}

if (getSetting(SITE_ISOLATION_ENABLED, initialSettings) === true) {
app.commandLine.appendSwitch('site-per-process')
}
})

const notifyCertError = (webContents, url, error, cert) => {
Expand Down
1 change: 1 addition & 0 deletions docs/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ AppStore
'search.default-search-engine': string, // name of search engine, from js/data/searchProviders.js
'search.offer-search-suggestions': boolean, // true if suggestions should be offered from the default search engine when available.
'security.flash.installed': boolean,
'security.site-isolation-enabled': boolean,
'shields.blocked-count-badge': boolean, // true if blocked counts on the shield button should be enabled
'shields.compact-bravery-panel': boolean, // true if the compact Bravery panel should be enabled
'security.passwords.active-password-manager': string, // name of active password manager
Expand Down
5 changes: 5 additions & 0 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,10 @@ class SecurityTab extends ImmutableComponent {
<SettingsList>
<SettingCheckbox dataL10nId='doNotTrack' prefKey={settings.DO_NOT_TRACK} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
</SettingsList>
<DefaultSectionTitle data-l10n-id='siteIsolation' />
<SettingsList>
<SettingCheckbox dataL10nId='useSiteIsolation' prefKey={settings.SITE_ISOLATION_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
</SettingsList>
<SitePermissionsPage siteSettings={this.props.siteSettings} names={permissionNames} />
<div data-l10n-id='requiresRestart' className={css(commonStyles.requiresRestart)} />
</div>
Expand Down Expand Up @@ -839,6 +843,7 @@ class AboutPreferences extends React.Component {
settings.PDFJS_ENABLED,
settings.TORRENT_VIEWER_ENABLED,
settings.SMOOTH_SCROLL_ENABLED,
settings.SITE_ISOLATION_ENABLED,
settings.SEND_CRASH_REPORTS,
settings.SPELLCHECK_ENABLED,
settings.SPELLCHECK_LANGUAGES
Expand Down
1 change: 1 addition & 0 deletions js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ module.exports = {
'security.fullscreen.content': fullscreenOption.ALWAYS_ASK,
'security.autoplay.media': autoplayOption.ALWAYS_ALLOW,
'security.flash.installed': false,
'security.site-isolation-enabled': false,
'shields.blocked-count-badge': true,
'shields.compact-bravery-panel': false,
// sync
Expand Down
1 change: 1 addition & 0 deletions js/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const settings = {
FLASH_INSTALLED: 'security.flash.installed',
FULLSCREEN_CONTENT: 'security.fullscreen.content',
AUTOPLAY_MEDIA: 'security.autoplay.media',
SITE_ISOLATION_ENABLED: 'security.site-isolation-enabled',
// Autofill
AUTOFILL_ENABLED: 'privacy.autofill-enabled',
// Payments Tab
Expand Down

0 comments on commit aba789a

Please sign in to comment.