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 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start migrating to electron userPrefs and contentSettings
fixes #2157
- Loading branch information
Showing
18 changed files
with
395 additions
and
461 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
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,35 +1,34 @@ | ||
var appState = null | ||
var appConfig = null | ||
var _empty_ = Immutable.Map() | ||
window.appState = null | ||
window.appConfig = null | ||
window._empty_ = Immutable.Map() | ||
|
||
chrome.ipc.on('update-state', (evt, newState, newConfig) => { | ||
appState = Immutable.fromJS(newState) | ||
appConfig = newConfig | ||
window.appState = Immutable.fromJS(newState) | ||
window.appConfig = newConfig | ||
}) | ||
|
||
chrome.runtime.onConnect.addListener((port) => { | ||
sendMessage = () => { | ||
let tabSettings = getSiteSettings(appState, port.sender.tab.incognito) | ||
let tabSettings = getSiteSettings(window.appState, port.sender.tab.incognito) | ||
let locationSettings = getSiteSettingsForURL(tabSettings, port.sender.tab.url) || _empty_ | ||
|
||
port.postMessage(activeSettings(locationSettings, appState, appConfig)) | ||
port.postMessage(activeSettings(locationSettings, window.appState, window.appConfig)) | ||
} | ||
|
||
port.onMessage.addListener((msg) => { | ||
if (!port.sender || !port.sender.tab) | ||
if (!port.sender || !port.sender.tab || port.sender.id !== chrome.runtime.id) | ||
return | ||
|
||
if (msg.type === 'action') { | ||
chrome.ipc.send('dispatch-action', JSON.stringify(msg.action)) | ||
} | ||
|
||
// have not received state yet | ||
if (!appState || !appConfig) { | ||
if (!window.appState || !window.appConfig) { | ||
port.postMessage({msg: 'wait'}) | ||
return | ||
} | ||
|
||
sendMessage() | ||
}) | ||
}) | ||
|
81 changes: 0 additions & 81 deletions
81
app/extensions/brave/content/scripts/block3rdPartyStorage.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.