diff --git a/platform/mv3/make-scriptlets.js b/platform/mv3/make-scriptlets.js index d276a56a6..4ca52cd1b 100644 --- a/platform/mv3/make-scriptlets.js +++ b/platform/mv3/make-scriptlets.js @@ -19,12 +19,8 @@ Home: https://github.com/gorhill/uBlock */ -'use strict'; - -/******************************************************************************/ - +import { builtinScriptlets } from './resources/scriptlets.js'; import fs from 'fs/promises'; -import { builtinScriptlets } from './scriptlets.js'; import { safeReplace } from './safe-replace.js'; /******************************************************************************/ diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js index f16b73ca0..d768db546 100644 --- a/src/js/redirect-engine.js +++ b/src/js/redirect-engine.js @@ -316,7 +316,7 @@ class RedirectEngine { this.aliases = new Map(); const fetches = [ - import('/assets/resources/scriptlets.js').then(module => { + import('/js/resources/scriptlets.js').then(module => { for ( const scriptlet of module.builtinScriptlets ) { const details = {}; details.mime = mimeFromName(scriptlet.name); diff --git a/assets/resources/attribute.js b/src/js/resources/attribute.js similarity index 100% rename from assets/resources/attribute.js rename to src/js/resources/attribute.js diff --git a/assets/resources/base.js b/src/js/resources/base.js similarity index 100% rename from assets/resources/base.js rename to src/js/resources/base.js diff --git a/assets/resources/cookie.js b/src/js/resources/cookie.js similarity index 100% rename from assets/resources/cookie.js rename to src/js/resources/cookie.js diff --git a/assets/resources/localstorage.js b/src/js/resources/localstorage.js similarity index 100% rename from assets/resources/localstorage.js rename to src/js/resources/localstorage.js diff --git a/assets/resources/parse-replace.js b/src/js/resources/parse-replace.js similarity index 100% rename from assets/resources/parse-replace.js rename to src/js/resources/parse-replace.js diff --git a/assets/resources/proxy-apply.js b/src/js/resources/proxy-apply.js similarity index 100% rename from assets/resources/proxy-apply.js rename to src/js/resources/proxy-apply.js diff --git a/assets/resources/replace-argument.js b/src/js/resources/replace-argument.js similarity index 100% rename from assets/resources/replace-argument.js rename to src/js/resources/replace-argument.js diff --git a/assets/resources/run-at.js b/src/js/resources/run-at.js similarity index 100% rename from assets/resources/run-at.js rename to src/js/resources/run-at.js diff --git a/assets/resources/safe-self.js b/src/js/resources/safe-self.js similarity index 100% rename from assets/resources/safe-self.js rename to src/js/resources/safe-self.js diff --git a/assets/resources/scriptlets.js b/src/js/resources/scriptlets.js similarity index 100% rename from assets/resources/scriptlets.js rename to src/js/resources/scriptlets.js diff --git a/assets/resources/set-constant.js b/src/js/resources/set-constant.js similarity index 100% rename from assets/resources/set-constant.js rename to src/js/resources/set-constant.js diff --git a/assets/resources/shared.js b/src/js/resources/shared.js similarity index 96% rename from assets/resources/shared.js rename to src/js/resources/shared.js index 89d8503e7..9a38fca48 100644 --- a/assets/resources/shared.js +++ b/src/js/resources/shared.js @@ -21,7 +21,7 @@ */ // Code imported from main code base and exposed as injectable scriptlets -import { ArglistParser } from '../../js/arglist-parser.js'; +import { ArglistParser } from '../arglist-parser.js'; import { registerScriptlet } from './base.js'; diff --git a/assets/resources/spoof-css.js b/src/js/resources/spoof-css.js similarity index 100% rename from assets/resources/spoof-css.js rename to src/js/resources/spoof-css.js diff --git a/tools/copy-common-files.sh b/tools/copy-common-files.sh index 56fb20ab3..29f7ee45c 100644 --- a/tools/copy-common-files.sh +++ b/tools/copy-common-files.sh @@ -12,6 +12,7 @@ cp -R src/css $DES/ cp -R src/img $DES/ mkdir $DES/js cp -R src/js/*.js $DES/js/ +cp -R src/js/resources $DES/js/ cp -R src/js/codemirror $DES/js/ cp -R src/js/scriptlets $DES/js/ cp -R src/js/wasm $DES/js/ diff --git a/tools/make-mv3.sh b/tools/make-mv3.sh index 92ce9d445..8b1803987 100755 --- a/tools/make-mv3.sh +++ b/tools/make-mv3.sh @@ -109,7 +109,7 @@ if [ "$QUICK" != "yes" ]; then cp platform/mv3/*.mjs "$TMPDIR"/ cp platform/mv3/extension/js/utils.js "$TMPDIR"/js/ cp "$UBO_DIR"/assets/assets.dev.json "$TMPDIR"/ - cp "$UBO_DIR"/assets/resources/*.js "$TMPDIR"/ + cp -R "$UBO_DIR"/src/js/resources "$TMPDIR"/ cp -R platform/mv3/scriptlets "$TMPDIR"/ mkdir -p "$TMPDIR"/web_accessible_resources cp "$UBO_DIR"/src/web_accessible_resources/* "$TMPDIR"/web_accessible_resources/