This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
562 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
const appConfig = require('../../../js/constants/appConfig') | ||
const siteSettings = require('../../../js/state/siteSettings') | ||
|
||
module.exports.isNoScriptEnabled = (state, settings) => { | ||
return siteSettings.activeSettings(settings, state, appConfig).noScript === true | ||
const siteSettingsState = { | ||
getAllSiteSettings: (state, frame) => { | ||
if (frame && frame.get('isPrivate')) { | ||
return state.get('siteSettings').mergeDeep(state.get('temporarySiteSettings')) | ||
} | ||
return state.get('siteSettings') | ||
}, | ||
|
||
isNoScriptEnabled (state, settings) { | ||
return siteSettings.activeSettings(settings, state, appConfig).noScript === true | ||
} | ||
} | ||
|
||
module.exports = siteSettingsState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const assert = require('assert') | ||
const { makeImmutable, isMap, isList } = require('./immutableUtil') | ||
|
||
const validateState = function (state) { | ||
state = makeImmutable(state) | ||
assert.ok(isMap(state), 'state must be an Immutable.Map') | ||
assert.ok(isList(state.get('sites')), 'state must contain an Immutable.List of sites') | ||
return state | ||
} | ||
|
||
const siteState = { | ||
getSites: (state) => { | ||
state = validateState(state) | ||
return state.get('sites') | ||
} | ||
} | ||
|
||
module.exports = siteState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports.createWebView = () => { | ||
return document.createElement('webview') | ||
} | ||
|
||
module.exports.appendChild = (element, child) => { | ||
element.appendChild(child) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.