diff --git a/src/linkExposure.js b/src/linkExposure.js index dd5fac0e..c1e6de16 100644 --- a/src/linkExposure.js +++ b/src/linkExposure.js @@ -14,9 +14,8 @@ import * as linkResolution from "./linkResolution.js"; import * as matching from "./matching.js"; import * as messaging from "./messaging.js"; import * as pageManager from "./pageManager.js"; -import * as inline from "./inline.js"; import * as permissions from "./permissions.js"; -import linkExposureContentScript from "./content-scripts/linkExposure.content.js"; +import linkExposureContentScript from "include:./content-scripts/linkExposure.content.js"; /** * Ignore links where the link URL PS+1 is identical to the page URL PS+1. @@ -194,7 +193,7 @@ async function addUpdateListener(listener, { linkMatchPatterns, pageMatchPattern const contentScript = await browser.contentScripts.register({ matches: pageMatchPatterns, js: [{ - code: inline.dataUrlToString(linkExposureContentScript) + file: linkExposureContentScript }], runAt: "document_idle" }); diff --git a/src/linkResolution.js b/src/linkResolution.js index c105ec97..2269862a 100644 --- a/src/linkResolution.js +++ b/src/linkResolution.js @@ -7,13 +7,12 @@ import * as matching from "./matching.js"; import * as permissions from "./permissions.js"; import * as id from "./id.js"; import * as pageManager from "./pageManager.js"; -import * as inline from "./inline.js"; import * as messaging from "./messaging.js"; import { urlShortenerMatchPatterns } from "./data/urlShorteners.js"; import { ampCacheDomains, ampViewerDomainsAndPaths } from "./data/ampCachesAndViewers.js"; import { parse as tldtsParse } from "tldts"; -import linkResolutionTwitterContentScript from "./content-scripts/linkResolution.twitter.content.js"; -import linkResolutionGoogleNewsContentScript from "./content-scripts/linkResolution.googleNews.content.js"; +import linkResolutionTwitterContentScript from "include:./content-scripts/linkResolution.twitter.content.js"; +import linkResolutionGoogleNewsContentScript from "include:./content-scripts/linkResolution.googleNews.content.js"; // AMP caches and viewers @@ -528,7 +527,7 @@ export function initialize() { browser.contentScripts.register({ matches: [ "*://*.twitter.com/*" ], js: [{ - code: inline.dataUrlToString(linkResolutionTwitterContentScript) + file: linkResolutionTwitterContentScript }], runAt: "document_idle" }); @@ -542,7 +541,7 @@ export function initialize() { browser.contentScripts.register({ matches: [ "*://*.news.google.com/*" ], js: [{ - code: inline.dataUrlToString(linkResolutionGoogleNewsContentScript) + file: linkResolutionGoogleNewsContentScript }], runAt: "document_idle" }); diff --git a/src/pageManager.js b/src/pageManager.js index 0ce9bc06..587ced0f 100644 --- a/src/pageManager.js +++ b/src/pageManager.js @@ -123,10 +123,9 @@ import * as events from "./events.js"; import * as idle from "./idle.js"; import * as messaging from "./messaging.js"; -import * as inline from "./inline.js"; import * as permissions from "./permissions.js"; import * as timing from "./timing.js"; -import pageManagerContentScript from "./content-scripts/pageManager.content.js"; +import pageManagerContentScript from "include:./content-scripts/pageManager.content.js"; /** * The threshold (in seconds) for determining whether the browser has the user's attention, @@ -711,7 +710,7 @@ export async function initialize() { browser.contentScripts.register({ matches: permissions.getManifestOriginMatchPatterns(), js: [{ - code: inline.dataUrlToString(pageManagerContentScript) + file: pageManagerContentScript }], runAt: "document_start" }); diff --git a/src/pageNavigation.js b/src/pageNavigation.js index 7d6a656f..c8e3e7ce 100644 --- a/src/pageNavigation.js +++ b/src/pageNavigation.js @@ -8,9 +8,8 @@ import * as events from "./events.js"; import * as messaging from "./messaging.js"; import * as pageManager from "./pageManager.js"; -import * as inline from "./inline.js"; import * as matching from "./matching.js"; -import pageNavigationContentScript from "./content-scripts/pageNavigation.content.js"; +import pageNavigationContentScript from "include:./content-scripts/pageNavigation.content.js"; /** * A listener for the `onPageData` event. @@ -152,7 +151,7 @@ async function addListener(listener, { const contentScript = await browser.contentScripts.register({ matches: matchPatterns, js: [{ - code: inline.dataUrlToString(pageNavigationContentScript) + file: pageNavigationContentScript }], runAt: "document_start" }); diff --git a/src/pageText.js b/src/pageText.js index 1637536c..5c99e126 100644 --- a/src/pageText.js +++ b/src/pageText.js @@ -53,10 +53,9 @@ import * as messaging from "./messaging.js"; import * as matching from "./matching.js"; import * as events from "./events.js"; -import * as inline from "./inline.js"; import * as pageManager from "./pageManager.js"; import * as permissions from "./permissions.js"; -import pageTextContentScript from "./content-scripts/pageText.content.js"; +import pageTextContentScript from "include:./content-scripts/pageText.content.js"; /** * A listener for the `onTextParsed` event. @@ -215,7 +214,7 @@ async function addListener(listener, { const contentScript = await browser.contentScripts.register({ matches: matchPatterns, js: [{ - code: inline.dataUrlToString(pageTextContentScript) + file: pageTextContentScript }], runAt: "document_idle" }); diff --git a/src/pageTransition.js b/src/pageTransition.js index 05f70c7f..659499f4 100644 --- a/src/pageTransition.js +++ b/src/pageTransition.js @@ -138,11 +138,10 @@ import * as events from "./events.js"; import * as permissions from "./permissions.js"; import * as messaging from "./messaging.js"; import * as matching from "./matching.js"; -import * as inline from "./inline.js"; import * as timing from "./timing.js"; import * as pageManager from "./pageManager.js"; -import pageTransitionEventContentScript from "./content-scripts/pageTransition.event.content.js"; -import pageTransitionClickContentScript from "./content-scripts/pageTransition.click.content.js"; +import pageTransitionEventContentScript from "include:./content-scripts/pageTransition.event.content.js"; +import pageTransitionClickContentScript from "include:./content-scripts/pageTransition.click.content.js"; /** * A listener for the `onPageTransitionData` event. @@ -280,7 +279,7 @@ export const onPageTransitionData = events.createEvent({ contentScript: await browser.contentScripts.register({ matches: matchPatterns, js: [{ - code: inline.dataUrlToString(pageTransitionEventContentScript) + file: pageTransitionEventContentScript }], runAt: "document_start" }) @@ -330,7 +329,7 @@ async function initialize() { await browser.contentScripts.register({ matches: permissions.getManifestOriginMatchPatterns(), js: [{ - code: inline.dataUrlToString(pageTransitionClickContentScript) + file: pageTransitionClickContentScript }], runAt: "document_start" }); diff --git a/src/socialMediaActivity.js b/src/socialMediaActivity.js index d0ea0a95..02e01148 100644 --- a/src/socialMediaActivity.js +++ b/src/socialMediaActivity.js @@ -6,11 +6,10 @@ import * as debugging from "./debugging.js"; import * as messaging from "./messaging.js"; -import * as inline from "./inline.js"; import * as permissions from "./permissions.js"; import * as timing from "./timing.js"; -import facebookContentScript from "./content-scripts/socialMediaActivity.facebook.content.js"; -import twitterContentScript from "./content-scripts/socialMediaActivity.twitter.content.js"; +import facebookContentScript from "include:./content-scripts/socialMediaActivity.facebook.content.js"; +import twitterContentScript from "include:./content-scripts/socialMediaActivity.twitter.content.js"; permissions.check({ module: "webScience.socialMediaActivity", @@ -533,7 +532,7 @@ function tweetContentInit() { browser.contentScripts.register({ matches: ["https://twitter.com/*", "https://twitter.com/"], js: [{ - code: inline.dataUrlToString(twitterContentScript) + file: twitterContentScript }], runAt: "document_idle" }); @@ -571,7 +570,7 @@ async function fbPostContentInit() { await browser.contentScripts.register({ matches: ["https://www.facebook.com/*", "https://www.facebook.com/"], js: [{ - code: inline.dataUrlToString(facebookContentScript) + file: facebookContentScript }], runAt: "document_start" }); diff --git a/src/userSurvey.js b/src/userSurvey.js index ac86abea..9ac04d96 100644 --- a/src/userSurvey.js +++ b/src/userSurvey.js @@ -35,10 +35,9 @@ import * as id from "./id.js"; import * as timing from "./timing.js"; import * as storage from "./storage.js"; import * as messaging from "./messaging.js"; -import * as inline from "./inline.js"; import * as permissions from "./permissions.js"; -import popupPromptPage from "./html/userSurvey.popupPrompt.html"; -import popupNoPromptPage from "./html/userSurvey.popupNoPrompt.html"; +import popupPromptPage from "include:./html/userSurvey.popupPrompt.html"; +import popupNoPromptPage from "include:./html/userSurvey.popupNoPrompt.html"; /** * A persistent storage space for data about surveys. @@ -165,7 +164,7 @@ async function remindUser() { */ function setPopupToNoPromptPage() { browser.browserAction.setPopup({ - popup: inline.dataUrlToBlobUrl(popupNoPromptPage) + popup: browser.runtime.getURL(popupNoPromptPage) }); } @@ -294,7 +293,7 @@ export async function setSurvey(options) { } else { browser.browserAction.setPopup({ - popup: inline.dataUrlToBlobUrl(popupPromptPage) + popup: browser.runtime.getURL(popupPromptPage) }); }