Clean up shim initialization

This commit is contained in:
hensm
2019-06-19 01:39:19 +01:00
parent 290a1facdb
commit 0a9af09419
13 changed files with 66 additions and 88 deletions

View File

@@ -258,14 +258,7 @@ browser.menus.onShown.addListener(info => {
browser.webRequest.onBeforeRequest.addListener(
async details => {
await browser.tabs.executeScript(details.tabId, {
code: `window._isFramework = ${
details.url === CAST_FRAMEWORK_LOADER_SCRIPT_URL}`
, frameId: details.frameId
, runAt: "document_start"
});
await browser.tabs.executeScript(details.tabId, {
file: "shim/content.js"
file: "shim/contentBridge.js"
, frameId: details.frameId
, runAt: "document_start"
});
@@ -402,7 +395,7 @@ browser.runtime.onMessage.addListener(async message => {
// Defines window.chrome for site compatibility
browser.contentScripts.register({
allFrames: true
, js: [{ file: "shim/contentSetup.js" }]
, js: [{ file: "shim/content.js" }]
, matches: [ "<all_urls>" ]
, runAt: "document_start"
});