From 05d4049f16715194842cf8cdf62345478288ee71 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 18 Dec 2020 17:06:30 -0500 Subject: DOMParser replacement (#561) * Add script to build library files * Add built parse5 library * Add new SimpleDOMParser which uses parse5 * Update license info * Update MV3 build to use the new SimpleDOMParser * Update file exclusions * Hide/clarify license info for MV2 builds --- test/test-sw.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/test-sw.js b/test/test-sw.js index a2cb9df4..fb8d2f50 100644 --- a/test/test-sw.js +++ b/test/test-sw.js @@ -36,6 +36,13 @@ function getAllHtmlScriptPaths(fileName) { } } +function convertBackgroundScriptsToServiceWorkerScripts(scripts) { + // Use parse5-based SimpleDOMParser + scripts.splice(0, 0, '/mixed/lib/parse5.js'); + const index = scripts.indexOf('/bg/js/native-simple-dom-parser.js'); + assert.ok(index >= 0); + scripts[index] = '/bg/js/simple-dom-parser.js'; +} function main() { try { @@ -45,6 +52,7 @@ function main() { const extDir = path.join(rootDir, extDirName); const scripts = getAllHtmlScriptPaths(path.join(extDir, 'bg', 'background.html')); + convertBackgroundScriptsToServiceWorkerScripts(scripts); const importedScripts = []; const importScripts = (...scripts2) => { -- cgit v1.2.3