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 committed Jan 4, 2018
1 parent 152f035 commit e2d0ed6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ enablePinterest=Enable Pinterest
enableMetamask=Enable MetaMask
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) *
defaultZoomLevel=Default zoom level
toolbarUserInterfaceScale=Toolbar and UI elements scale
en-US=English (U.S.)
Expand Down Expand Up @@ -360,7 +362,6 @@ scaleSizeNormal=Normal
scaleSizeLarger=Larger
scaleSizeSuper=Supersize
urlBarOptions=URL Bar Options
disableTitleMode=Always show the URL bar
wideURLbar=Use wide URL bar
autoplay=Autoplay Media
tabPreviewTiming=Time to wait before previewing a tab
Expand Down
13 changes: 9 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,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 @@ -428,6 +428,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 @@ -701,6 +701,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 @@ -876,6 +880,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 @@ -158,6 +158,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 e2d0ed6

Please sign in to comment.