extension-develop 2.1.3 → 3.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -25
- package/dist/930.js +44 -0
- package/dist/add-centralized-logger-script-background.js +220 -0
- package/dist/add-centralized-logger-script-content.js +172 -0
- package/dist/add-centralized-logger-script.js +332 -0
- package/dist/add-hmr-accept-code.js +5 -11
- package/dist/content-script-wrapper.js +166 -0
- package/dist/ensure-hmr-for-scripts.js +30 -11
- package/dist/minimum-chromium-file.js +6 -20
- package/dist/minimum-firefox-file.js +6 -12
- package/dist/module.js +11751 -9472
- package/dist/resolve-paths-loader.js +1387 -0
- package/dist/warn-no-default-export.js +121 -0
- package/package.json +21 -35
- package/dist/add-content-script-wrapper.js +0 -1789
- package/dist/build.d.ts +0 -2
- package/dist/cleanup.d.ts +0 -1
- package/dist/deprecated-shadow-root.js +0 -135
- package/dist/dev.d.ts +0 -2
- package/dist/develop-lib/config-types.d.ts +0 -86
- package/dist/develop-lib/extract-from-zip.d.ts +0 -1
- package/dist/develop-lib/find-nearest-package.d.ts +0 -2
- package/dist/develop-lib/generate-extension-types.d.ts +0 -1
- package/dist/develop-lib/generate-zip.d.ts +0 -2
- package/dist/develop-lib/get-extension-config.d.ts +0 -6
- package/dist/develop-lib/get-project-path.d.ts +0 -6
- package/dist/develop-lib/install-dependencies.d.ts +0 -2
- package/dist/develop-lib/messages.d.ts +0 -36
- package/dist/develop-lib/validate-user-dependencies.d.ts +0 -1
- package/dist/extensions/chrome-manager-extension/background.js +0 -84
- package/dist/extensions/chrome-manager-extension/define-initial-tab.js +0 -77
- package/dist/extensions/chrome-manager-extension/images/logo.png +0 -0
- package/dist/extensions/chrome-manager-extension/manifest.json +0 -17
- package/dist/extensions/chrome-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/chrome-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/chrome-manager-extension/pages/welcome.html +0 -46
- package/dist/extensions/chrome-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/chrome-manager-extension/reload-service.js +0 -319
- package/dist/extensions/chromium-based-manager-extension/background.js +0 -84
- package/dist/extensions/chromium-based-manager-extension/define-initial-tab.js +0 -77
- package/dist/extensions/chromium-based-manager-extension/images/logo.png +0 -0
- package/dist/extensions/chromium-based-manager-extension/manifest.json +0 -17
- package/dist/extensions/chromium-based-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/chromium-based-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/chromium-based-manager-extension/pages/welcome.html +0 -46
- package/dist/extensions/chromium-based-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/chromium-based-manager-extension/reload-service.js +0 -324
- package/dist/extensions/edge-manager-extension/background.js +0 -82
- package/dist/extensions/edge-manager-extension/define-initial-tab.js +0 -77
- package/dist/extensions/edge-manager-extension/images/logo.png +0 -0
- package/dist/extensions/edge-manager-extension/manifest.json +0 -17
- package/dist/extensions/edge-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/edge-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/edge-manager-extension/pages/welcome.html +0 -46
- package/dist/extensions/edge-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/edge-manager-extension/reload-service.js +0 -321
- package/dist/extensions/firefox-manager-extension/background.js +0 -85
- package/dist/extensions/firefox-manager-extension/define-initial-tab.js +0 -64
- package/dist/extensions/firefox-manager-extension/images/logo.png +0 -0
- package/dist/extensions/firefox-manager-extension/manifest.json +0 -15
- package/dist/extensions/firefox-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/firefox-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/firefox-manager-extension/pages/welcome.html +0 -46
- package/dist/extensions/firefox-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/firefox-manager-extension/reload-service.js +0 -178
- package/dist/extensions/gecko-based-manager-extension/background.js +0 -67
- package/dist/extensions/gecko-based-manager-extension/define-initial-tab.js +0 -69
- package/dist/extensions/gecko-based-manager-extension/images/logo.png +0 -0
- package/dist/extensions/gecko-based-manager-extension/manifest.json +0 -16
- package/dist/extensions/gecko-based-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/gecko-based-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/gecko-based-manager-extension/pages/welcome.html +0 -46
- package/dist/extensions/gecko-based-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/gecko-based-manager-extension/reload-service.js +0 -171
- package/dist/inject-chromium-client-loader.js +0 -176
- package/dist/inject-firefox-client-loader.js +0 -169
- package/dist/minimum-content-file.js +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/preview.d.ts +0 -2
- package/dist/rslib.config.d.ts +0 -3
- package/dist/start.d.ts +0 -2
- package/dist/types.d.ts +0 -11
- package/dist/vitest.config.d.mts +0 -2
- package/dist/webpack/dev-server.d.ts +0 -3
- package/dist/webpack/plugin-browsers/browsers-lib/add-progress-bar.d.ts +0 -1
- package/dist/webpack/plugin-browsers/browsers-lib/constants.d.ts +0 -5
- package/dist/webpack/plugin-browsers/browsers-lib/dynamic-extension-manager.d.ts +0 -35
- package/dist/webpack/plugin-browsers/browsers-lib/html-merge.d.ts +0 -1
- package/dist/webpack/plugin-browsers/browsers-lib/instance-manager.d.ts +0 -74
- package/dist/webpack/plugin-browsers/browsers-lib/messages.d.ts +0 -164
- package/dist/webpack/plugin-browsers/browsers-lib/rdp-wire.d.ts +0 -7
- package/dist/webpack/plugin-browsers/browsers-lib/shared-utils.d.ts +0 -16
- package/dist/webpack/plugin-browsers/browsers-types.d.ts +0 -131
- package/dist/webpack/plugin-browsers/index.d.ts +0 -41
- package/dist/webpack/plugin-browsers/run-chromium/browser-config.d.ts +0 -3
- package/dist/webpack/plugin-browsers/run-chromium/create-profile.d.ts +0 -10
- package/dist/webpack/plugin-browsers/run-chromium/index.d.ts +0 -28
- package/dist/webpack/plugin-browsers/run-chromium/master-preferences.d.ts +0 -161
- package/dist/webpack/plugin-browsers/run-chromium/setup-chrome-inspection/cdp-client.d.ts +0 -29
- package/dist/webpack/plugin-browsers/run-chromium/setup-chrome-inspection/index.d.ts +0 -25
- package/dist/webpack/plugin-browsers/run-firefox/firefox/binary-detector.d.ts +0 -15
- package/dist/webpack/plugin-browsers/run-firefox/firefox/browser-config.d.ts +0 -7
- package/dist/webpack/plugin-browsers/run-firefox/firefox/create-profile.d.ts +0 -13
- package/dist/webpack/plugin-browsers/run-firefox/firefox/master-preferences.d.ts +0 -95
- package/dist/webpack/plugin-browsers/run-firefox/index.d.ts +0 -26
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/index.d.ts +0 -13
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/message-utils.d.ts +0 -2
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/messaging-client.d.ts +0 -42
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/setup-firefox-inspection.d.ts +0 -31
- package/dist/webpack/plugin-compatibility/feature-browser-specific-fields.d.ts +0 -9
- package/dist/webpack/plugin-compatibility/feature-polyfill.d.ts +0 -12
- package/dist/webpack/plugin-compatibility/index.d.ts +0 -13
- package/dist/webpack/plugin-compilation/clean-dist.d.ts +0 -8
- package/dist/webpack/plugin-compilation/env.d.ts +0 -9
- package/dist/webpack/plugin-compilation/index.d.ts +0 -12
- package/dist/webpack/plugin-css/common-style-loaders.d.ts +0 -8
- package/dist/webpack/plugin-css/css-in-content-script-loader.d.ts +0 -11
- package/dist/webpack/plugin-css/css-in-html-loader.d.ts +0 -8
- package/dist/webpack/plugin-css/css-tools/less.d.ts +0 -4
- package/dist/webpack/plugin-css/css-tools/postcss.d.ts +0 -3
- package/dist/webpack/plugin-css/css-tools/sass.d.ts +0 -4
- package/dist/webpack/plugin-css/css-tools/stylelint.d.ts +0 -4
- package/dist/webpack/plugin-css/css-tools/tailwind.d.ts +0 -2
- package/dist/webpack/plugin-css/index.d.ts +0 -9
- package/dist/webpack/plugin-css/is-content-script.d.ts +0 -1
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/background.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/browser_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/chrome_url_overrides.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/devtools_page.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/options_ui.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/page_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/sandbox.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/side_panel.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/sidebar_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/browser_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/browser_action.theme_icons.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/icons.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/normalize.d.ts +0 -6
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/page_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/sidebar_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/index.d.ts +0 -19
- package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/declarative_net_request.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/storage.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/locales-fields/index.d.ts +0 -1
- package/dist/webpack/plugin-extension/data/manifest-fields/normalize.d.ts +0 -10
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/background.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/content_scripts.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/service_worker.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/user_scripts.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/manifest-fields/web-resources-fields/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/data/special-folders/generate-entries.d.ts +0 -4
- package/dist/webpack/plugin-extension/data/special-folders/index.d.ts +0 -12
- package/dist/webpack/plugin-extension/feature-html/__spec__/html-lib/test-utils.d.ts +0 -18
- package/dist/webpack/plugin-extension/feature-html/html-lib/parse-html.d.ts +0 -8
- package/dist/webpack/plugin-extension/feature-html/html-lib/patch-html.d.ts +0 -8
- package/dist/webpack/plugin-extension/feature-html/html-lib/utils.d.ts +0 -18
- package/dist/webpack/plugin-extension/feature-html/index.d.ts +0 -37
- package/dist/webpack/plugin-extension/feature-html/steps/add-assets-to-compilation.d.ts +0 -11
- package/dist/webpack/plugin-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-html/steps/add-to-file-dependencies.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-html/steps/emit-html-file.d.ts +0 -9
- package/dist/webpack/plugin-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-html/steps/handle-common-errors.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-html/steps/minimum-script-file.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +0 -13
- package/dist/webpack/plugin-extension/feature-html/steps/update-html-file.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-icons/index.d.ts +0 -25
- package/dist/webpack/plugin-extension/feature-icons/steps/add-to-file-dependencies.d.ts +0 -9
- package/dist/webpack/plugin-extension/feature-icons/steps/emit-file.d.ts +0 -9
- package/dist/webpack/plugin-extension/feature-json/index.d.ts +0 -18
- package/dist/webpack/plugin-extension/feature-locales/get-locales.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-locales/index.d.ts +0 -13
- package/dist/webpack/plugin-extension/feature-manifest/index.d.ts +0 -23
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/background.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/chrome_url_overrides.d.ts +0 -8
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/commands.d.ts +0 -16
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +0 -7
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/content_security_policy.d.ts +0 -4
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/devtools_page.d.ts +0 -4
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/icons.d.ts +0 -6
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/options_page.d.ts +0 -4
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/options_ui.d.ts +0 -8
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +0 -8
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +0 -4
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +0 -7
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/sidebar_action.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/storage.d.ts +0 -6
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/theme.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/user_scripts.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/web_accessible_resources.d.ts +0 -9
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/background.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +0 -12
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +0 -24
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/page_action.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/sidebar_action.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +0 -8
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/background.d.ts +0 -10
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/side_panel.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-manifest/steps/add-dependencies.d.ts +0 -6
- package/dist/webpack/plugin-extension/feature-manifest/steps/check-manifest-files.d.ts +0 -17
- package/dist/webpack/plugin-extension/feature-manifest/steps/emit-manifest.d.ts +0 -7
- package/dist/webpack/plugin-extension/feature-manifest/steps/throw-if-recompile.d.ts +0 -11
- package/dist/webpack/plugin-extension/feature-manifest/steps/update-manifest.d.ts +0 -9
- package/dist/webpack/plugin-extension/feature-scripts/index.d.ts +0 -27
- package/dist/webpack/plugin-extension/feature-scripts/scripts-lib/utils.d.ts +0 -3
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-content-script-wrapper.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-hmr-accept-code.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-public-path-for-main-world.d.ts +0 -11
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +0 -4
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-scripts.d.ts +0 -9
- package/dist/webpack/plugin-extension/feature-scripts/steps/deprecated-shadow-root.d.ts +0 -2
- package/dist/webpack/plugin-extension/feature-scripts/steps/javascript-content-script-wrapper.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-scripts/steps/minimum-content-file.d.ts +0 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/preact-content-script-wrapper.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-scripts/steps/react-content-script-wrapper.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-scripts/steps/svelte-content-script-wrapper.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-scripts/steps/typescript-content-script-wrapper.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-scripts/steps/vue-content-script-wrapper.d.ts +0 -1
- package/dist/webpack/plugin-extension/feature-special-folders/copy-public-folder.d.ts +0 -14
- package/dist/webpack/plugin-extension/feature-special-folders/index.d.ts +0 -19
- package/dist/webpack/plugin-extension/feature-special-folders/warn-upon-folder-changes.d.ts +0 -7
- package/dist/webpack/plugin-extension/feature-web-resources/clean-matches.d.ts +0 -7
- package/dist/webpack/plugin-extension/feature-web-resources/index.d.ts +0 -18
- package/dist/webpack/plugin-extension/index.d.ts +0 -10
- package/dist/webpack/plugin-js-frameworks/index.d.ts +0 -13
- package/dist/webpack/plugin-js-frameworks/js-tools/babel.d.ts +0 -16
- package/dist/webpack/plugin-js-frameworks/js-tools/preact.d.ts +0 -3
- package/dist/webpack/plugin-js-frameworks/js-tools/react.d.ts +0 -3
- package/dist/webpack/plugin-js-frameworks/js-tools/svelte.d.ts +0 -3
- package/dist/webpack/plugin-js-frameworks/js-tools/typescript.d.ts +0 -36
- package/dist/webpack/plugin-js-frameworks/js-tools/vue.d.ts +0 -3
- package/dist/webpack/plugin-js-frameworks/load-loader-options.d.ts +0 -1
- package/dist/webpack/plugin-reload/index.d.ts +0 -13
- package/dist/webpack/plugin-reload/reload-lib/messages.d.ts +0 -106
- package/dist/webpack/plugin-reload/reload-types.d.ts +0 -14
- package/dist/webpack/plugin-reload/start-server.d.ts +0 -4
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/index.d.ts +0 -14
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/broadcast-message.d.ts +0 -2
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/message-dispatcher.d.ts +0 -2
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/servers.d.ts +0 -2
- package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/index.d.ts +0 -3
- package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/inject-chromium-client-loader.d.ts +0 -9
- package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/minimum-chromium-file.d.ts +0 -0
- package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/index.d.ts +0 -3
- package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/inject-firefox-client-loader.d.ts +0 -9
- package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/minimum-firefox-file.d.ts +0 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/index.d.ts +0 -9
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-background.d.ts +0 -15
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-csp.d.ts +0 -5
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-externally-connectable.d.ts +0 -10
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-web-resources.d.ts +0 -10
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/generate-manager-extension.d.ts +0 -15
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/index.d.ts +0 -10
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/target-web-extension-plugin/index.d.ts +0 -13
- package/dist/webpack/plugin-static-assets/index.d.ts +0 -12
- package/dist/webpack/webpack-config.d.ts +0 -14
- package/dist/webpack/webpack-lib/auto-exit.d.ts +0 -1
- package/dist/webpack/webpack-lib/constants.d.ts +0 -4
- package/dist/webpack/webpack-lib/messages.d.ts +0 -121
- package/dist/webpack/webpack-lib/port-manager.d.ts +0 -27
- package/dist/webpack/webpack-lib/utils.d.ts +0 -23
- package/dist/webpack/webpack-types.d.ts +0 -49
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
default: ()=>addCentralizedLoggerScript
|
|
28
|
+
});
|
|
29
|
+
const external_path_namespaceObject = require("path");
|
|
30
|
+
const external_fs_namespaceObject = require("fs");
|
|
31
|
+
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
32
|
+
const external_parse5_utilities_namespaceObject = require("parse5-utilities");
|
|
33
|
+
function isUrl(src) {
|
|
34
|
+
try {
|
|
35
|
+
new URL(src);
|
|
36
|
+
return true;
|
|
37
|
+
} catch (err) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function parseHtml(node, onResourceFound) {
|
|
42
|
+
if ('#comment' === node.nodeName || '#text' === node.nodeName) return;
|
|
43
|
+
if ("script" === node.nodeName) {
|
|
44
|
+
var _node_attrs_find, _node_attrs;
|
|
45
|
+
const src = null == (_node_attrs = node.attrs) ? void 0 : null == (_node_attrs_find = _node_attrs.find((attr)=>'src' === attr.name)) ? void 0 : _node_attrs_find.value;
|
|
46
|
+
if (!src) return;
|
|
47
|
+
if (isUrl(src)) return;
|
|
48
|
+
onResourceFound({
|
|
49
|
+
filePath: src,
|
|
50
|
+
childNode: node,
|
|
51
|
+
assetType: "script"
|
|
52
|
+
});
|
|
53
|
+
} else if ('link' === node.nodeName) {
|
|
54
|
+
var _node_attrs_find1, _node_attrs1, _node_attrs_find2, _node_attrs2;
|
|
55
|
+
const href = null == (_node_attrs1 = node.attrs) ? void 0 : null == (_node_attrs_find1 = _node_attrs1.find((attr)=>'href' === attr.name)) ? void 0 : _node_attrs_find1.value;
|
|
56
|
+
const rel = null == (_node_attrs2 = node.attrs) ? void 0 : null == (_node_attrs_find2 = _node_attrs2.find((attr)=>'rel' === attr.name)) ? void 0 : _node_attrs_find2.value;
|
|
57
|
+
if (!href) return;
|
|
58
|
+
if (isUrl(href)) return;
|
|
59
|
+
onResourceFound('dns-prefetch' === rel || 'icon' === rel || 'manifest' === rel || 'modulepreload' === rel || 'preconnect' === rel || 'prefetch' === rel || 'preload' === rel || 'prerender' === rel ? {
|
|
60
|
+
filePath: href,
|
|
61
|
+
childNode: node,
|
|
62
|
+
assetType: 'staticHref'
|
|
63
|
+
} : {
|
|
64
|
+
filePath: href,
|
|
65
|
+
childNode: node,
|
|
66
|
+
assetType: 'css'
|
|
67
|
+
});
|
|
68
|
+
} else if ('audio' === node.nodeName || 'embed' === node.nodeName || 'iframe' === node.nodeName || 'img' === node.nodeName || 'input' === node.nodeName || 'source' === node.nodeName || 'track' === node.nodeName || 'video' === node.nodeName) {
|
|
69
|
+
var _node_attrs_find3, _node_attrs3, _node_attrs_find4, _node_attrs4;
|
|
70
|
+
const src = null == (_node_attrs3 = node.attrs) ? void 0 : null == (_node_attrs_find3 = _node_attrs3.find((attr)=>'src' === attr.name)) ? void 0 : _node_attrs_find3.value;
|
|
71
|
+
if (!src) return;
|
|
72
|
+
if (isUrl(src)) return;
|
|
73
|
+
onResourceFound({
|
|
74
|
+
filePath: src,
|
|
75
|
+
childNode: node,
|
|
76
|
+
assetType: 'staticSrc'
|
|
77
|
+
});
|
|
78
|
+
const srcset = null == (_node_attrs4 = node.attrs) ? void 0 : null == (_node_attrs_find4 = _node_attrs4.find((attr)=>'srcset' === attr.name)) ? void 0 : _node_attrs_find4.value;
|
|
79
|
+
if (srcset) {
|
|
80
|
+
const candidates = srcset.split(',');
|
|
81
|
+
for (const candidate of candidates){
|
|
82
|
+
const parts = candidate.trim().split(/\s+/);
|
|
83
|
+
const url = parts[0];
|
|
84
|
+
if (!url) continue;
|
|
85
|
+
const { cleanPath } = cleanAssetUrl(url);
|
|
86
|
+
if (cleanPath && !isUrl(cleanPath)) onResourceFound({
|
|
87
|
+
filePath: cleanPath,
|
|
88
|
+
childNode: node,
|
|
89
|
+
assetType: 'staticSrc'
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if ('video' === node.nodeName) {
|
|
94
|
+
var _node_attrs_find5, _node_attrs5;
|
|
95
|
+
const poster = null == (_node_attrs5 = node.attrs) ? void 0 : null == (_node_attrs_find5 = _node_attrs5.find((attr)=>'poster' === attr.name)) ? void 0 : _node_attrs_find5.value;
|
|
96
|
+
if (poster && !isUrl(poster)) {
|
|
97
|
+
const { cleanPath } = cleanAssetUrl(poster);
|
|
98
|
+
if (cleanPath) onResourceFound({
|
|
99
|
+
filePath: cleanPath,
|
|
100
|
+
childNode: node,
|
|
101
|
+
assetType: 'staticSrc'
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else if ('link' === node.nodeName) {
|
|
106
|
+
var _node_attrs_find6, _node_attrs6;
|
|
107
|
+
const imagesrcset = null == (_node_attrs6 = node.attrs) ? void 0 : null == (_node_attrs_find6 = _node_attrs6.find((attr)=>'imagesrcset' === attr.name)) ? void 0 : _node_attrs_find6.value;
|
|
108
|
+
if (imagesrcset) {
|
|
109
|
+
const candidates = imagesrcset.split(',');
|
|
110
|
+
for (const candidate of candidates){
|
|
111
|
+
const parts = candidate.trim().split(/\s+/);
|
|
112
|
+
const url = parts[0];
|
|
113
|
+
if (!url) continue;
|
|
114
|
+
const { cleanPath } = cleanAssetUrl(url);
|
|
115
|
+
if (cleanPath && !isUrl(cleanPath)) onResourceFound({
|
|
116
|
+
filePath: cleanPath,
|
|
117
|
+
childNode: node,
|
|
118
|
+
assetType: 'staticHref'
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const { childNodes = [] } = node;
|
|
124
|
+
for (const childNode of childNodes)if ('#comment' !== childNode.nodeName && '#text' !== childNode.nodeName) parseHtml(childNode, onResourceFound);
|
|
125
|
+
}
|
|
126
|
+
function getAssetsFromHtml(htmlFilePath, htmlContent, publicPath = 'public') {
|
|
127
|
+
const assets = {
|
|
128
|
+
css: [],
|
|
129
|
+
js: [],
|
|
130
|
+
static: []
|
|
131
|
+
};
|
|
132
|
+
if (!htmlFilePath) return assets;
|
|
133
|
+
try {
|
|
134
|
+
const htmlString = htmlContent || external_fs_namespaceObject.readFileSync(htmlFilePath, {
|
|
135
|
+
encoding: 'utf8'
|
|
136
|
+
});
|
|
137
|
+
if (!htmlString) return assets;
|
|
138
|
+
const htmlDocument = external_parse5_utilities_namespaceObject.parse(htmlString);
|
|
139
|
+
const baseHref = getBaseHref(htmlDocument);
|
|
140
|
+
const getAbsolutePath = (htmlFilePath, filePathWithParts)=>{
|
|
141
|
+
const { cleanPath } = cleanAssetUrl(filePathWithParts);
|
|
142
|
+
if (utils_isUrl(cleanPath)) return cleanPath;
|
|
143
|
+
if (cleanPath.startsWith('/')) return cleanPath;
|
|
144
|
+
const isBaseUrl = utils_isUrl(baseHref || '');
|
|
145
|
+
const baseJoin = baseHref && !isBaseUrl ? external_path_namespaceObject.join(external_path_namespaceObject.dirname(htmlFilePath), baseHref) : external_path_namespaceObject.dirname(htmlFilePath);
|
|
146
|
+
return external_path_namespaceObject.join(baseJoin, cleanPath);
|
|
147
|
+
};
|
|
148
|
+
parseHtml(htmlDocument, ({ filePath, assetType })=>{
|
|
149
|
+
const fileAbsolutePath = getAbsolutePath(htmlFilePath, filePath);
|
|
150
|
+
switch(assetType){
|
|
151
|
+
case "script":
|
|
152
|
+
var _assets_js;
|
|
153
|
+
null == (_assets_js = assets.js) || _assets_js.push(fileAbsolutePath);
|
|
154
|
+
break;
|
|
155
|
+
case 'css':
|
|
156
|
+
var _assets_css;
|
|
157
|
+
null == (_assets_css = assets.css) || _assets_css.push(fileAbsolutePath);
|
|
158
|
+
break;
|
|
159
|
+
case 'staticSrc':
|
|
160
|
+
case 'staticHref':
|
|
161
|
+
var _assets_static;
|
|
162
|
+
if (filePath.startsWith('#')) break;
|
|
163
|
+
null == (_assets_static = assets.static) || _assets_static.push(fileAbsolutePath);
|
|
164
|
+
break;
|
|
165
|
+
default:
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
} catch (error) {}
|
|
170
|
+
return assets;
|
|
171
|
+
}
|
|
172
|
+
function utils_isUrl(src) {
|
|
173
|
+
try {
|
|
174
|
+
new URL(src);
|
|
175
|
+
return true;
|
|
176
|
+
} catch (err) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function cleanAssetUrl(url) {
|
|
181
|
+
const hashIndex = url.indexOf('#');
|
|
182
|
+
const queryIndex = url.indexOf('?');
|
|
183
|
+
let endIndex = url.length;
|
|
184
|
+
if (-1 !== hashIndex && -1 !== queryIndex) endIndex = Math.min(hashIndex, queryIndex);
|
|
185
|
+
else if (-1 !== hashIndex) endIndex = hashIndex;
|
|
186
|
+
else if (-1 !== queryIndex) endIndex = queryIndex;
|
|
187
|
+
const cleanPath = url.slice(0, endIndex);
|
|
188
|
+
const hash = -1 !== hashIndex ? url.slice(hashIndex) : '';
|
|
189
|
+
const search = -1 !== queryIndex ? url.slice(queryIndex, -1 !== hashIndex ? hashIndex : void 0) : '';
|
|
190
|
+
return {
|
|
191
|
+
cleanPath,
|
|
192
|
+
hash,
|
|
193
|
+
search
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function getBaseHref(htmlDocument) {
|
|
197
|
+
const htmlChildren = htmlDocument.childNodes || [];
|
|
198
|
+
for (const node of htmlChildren)if ((null == node ? void 0 : node.nodeName) === 'html') {
|
|
199
|
+
for (const child of node.childNodes || [])if ((null == child ? void 0 : child.nodeName) === 'head') {
|
|
200
|
+
for (const headChild of child.childNodes || [])if ((null == headChild ? void 0 : headChild.nodeName) === 'base') {
|
|
201
|
+
var _headChild_attrs_find, _headChild_attrs;
|
|
202
|
+
const href = null == (_headChild_attrs = headChild.attrs) ? void 0 : null == (_headChild_attrs_find = _headChild_attrs.find((a)=>'href' === a.name)) ? void 0 : _headChild_attrs_find.value;
|
|
203
|
+
if (href) return href;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const schema = {
|
|
209
|
+
type: 'object',
|
|
210
|
+
properties: {
|
|
211
|
+
test: {
|
|
212
|
+
type: 'string'
|
|
213
|
+
},
|
|
214
|
+
manifestPath: {
|
|
215
|
+
type: 'string'
|
|
216
|
+
},
|
|
217
|
+
includeList: {
|
|
218
|
+
type: 'object'
|
|
219
|
+
},
|
|
220
|
+
browser: {
|
|
221
|
+
type: 'string'
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
function addCentralizedLoggerScript(source) {
|
|
226
|
+
const options = this.getOptions();
|
|
227
|
+
const manifestPath = options.manifestPath;
|
|
228
|
+
const projectPath = external_path_namespaceObject.dirname(manifestPath);
|
|
229
|
+
try {
|
|
230
|
+
(0, external_schema_utils_namespaceObject.validate)(schema, options, {
|
|
231
|
+
name: "html:add-centralized-logger-script",
|
|
232
|
+
baseDataPath: 'options'
|
|
233
|
+
});
|
|
234
|
+
} catch (error) {
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
const resourcePath = this.resourcePath || '';
|
|
238
|
+
const normalizedResource = external_path_namespaceObject.normalize(resourcePath);
|
|
239
|
+
const loggerPrelude = `
|
|
240
|
+
if (import.meta.webpackHot) { import.meta.webpackHot.accept() }
|
|
241
|
+
`;
|
|
242
|
+
if (source.includes('/* centralized ui logger bootstrap */')) return `${loggerPrelude}${source}`;
|
|
243
|
+
const includeList = options.includeList || {};
|
|
244
|
+
const featureToContext = (featureKey)=>{
|
|
245
|
+
const root = (featureKey || '').split('/')[0];
|
|
246
|
+
if ('action' === root || 'page_action' === root) return 'popup';
|
|
247
|
+
if ('options' === root || 'options_ui' === root || 'options_page' === root) return 'options';
|
|
248
|
+
if ('sidebar' === root || 'sidebar_action' === root || 'side_panel' === root) return 'sidebar';
|
|
249
|
+
if ('devtools' === root) return 'devtools';
|
|
250
|
+
return 'ui';
|
|
251
|
+
};
|
|
252
|
+
let matchedContext;
|
|
253
|
+
for (const [feature, htmlPath] of Object.entries(includeList)){
|
|
254
|
+
if (!htmlPath) continue;
|
|
255
|
+
if (!external_fs_namespaceObject.existsSync(htmlPath)) continue;
|
|
256
|
+
const assets = getAssetsFromHtml(htmlPath);
|
|
257
|
+
const jsAssets = (null == assets ? void 0 : assets.js) || [];
|
|
258
|
+
const absAssets = jsAssets.map((p)=>{
|
|
259
|
+
if (p.startsWith('/')) return external_path_namespaceObject.normalize(external_path_namespaceObject.join(projectPath, 'public', p.slice(1)));
|
|
260
|
+
return external_path_namespaceObject.normalize(p);
|
|
261
|
+
});
|
|
262
|
+
if (absAssets.some((p)=>p === normalizedResource)) {
|
|
263
|
+
matchedContext = featureToContext(feature);
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (matchedContext) {
|
|
268
|
+
const loggerBridge = `
|
|
269
|
+
/* centralized ui logger bootstrap */
|
|
270
|
+
(function() {
|
|
271
|
+
var ctx = ${JSON.stringify(matchedContext)};
|
|
272
|
+
var port;
|
|
273
|
+
if (typeof chrome !== "undefined" && chrome.runtime && chrome.runtime.connect) {
|
|
274
|
+
var targetId = (function(){
|
|
275
|
+
if (typeof window !== 'undefined' && (window).__EXT_LOGGER_ID__) return String((window).__EXT_LOGGER_ID__);
|
|
276
|
+
try {
|
|
277
|
+
var u = new URL(typeof location !== 'undefined' ? String(location.href) : '');
|
|
278
|
+
var v = u.searchParams.get('loggerId');
|
|
279
|
+
if (v) return v;
|
|
280
|
+
} catch {}
|
|
281
|
+
return '';
|
|
282
|
+
})();
|
|
283
|
+
|
|
284
|
+
if (targetId) {
|
|
285
|
+
try { port = chrome.runtime.connect(targetId, { name: 'logger' }); } catch (e) {}
|
|
286
|
+
}
|
|
287
|
+
if (!port) {
|
|
288
|
+
try { port = chrome.runtime.connect({ name: 'logger' }); } catch (e) {}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Best-effort late resolution via management API (requires permission in sender)
|
|
292
|
+
if (!port && chrome.management && typeof chrome.management.getAll === 'function') {
|
|
293
|
+
chrome.management.getAll(function(list){
|
|
294
|
+
var found = (list||[]).find(function(it){ return it && typeof it.name === 'string' && it.name.toLowerCase().includes('centralized-logger'); });
|
|
295
|
+
if (found && found.id) {
|
|
296
|
+
try { port = chrome.runtime.connect(found.id, { name: 'logger' }); } catch (e) {}
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function safePost(msg) {
|
|
303
|
+
if (port && port.postMessage) { port.postMessage(msg); }
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
['log','info','warn','error','debug','trace'].forEach(function(lvl) {
|
|
307
|
+
if (typeof console !== "undefined" && typeof console[lvl] === "function") {
|
|
308
|
+
var orig = console[lvl].bind(console);
|
|
309
|
+
console[lvl] = function() {
|
|
310
|
+
var args = Array.prototype.slice.call(arguments);
|
|
311
|
+
safePost({ type:'log', level:String(lvl), context: ctx, messageParts: args });
|
|
312
|
+
orig.apply(console, args);
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
if (typeof console !== 'undefined' && typeof console.clear === 'function') {
|
|
317
|
+
var _clear = console.clear.bind(console);
|
|
318
|
+
console.clear = function(){ try { safePost({ type:'log', level:'info', context: ctx, messageParts:['console.clear'], meta: { kind: 'clear' } }) } catch (e) {} try { return _clear.apply(console, arguments) } catch (e) {} }
|
|
319
|
+
}
|
|
320
|
+
})();
|
|
321
|
+
`;
|
|
322
|
+
return `${loggerPrelude}${loggerBridge}${source}`;
|
|
323
|
+
}
|
|
324
|
+
return `${loggerPrelude}${source}`;
|
|
325
|
+
}
|
|
326
|
+
exports["default"] = __webpack_exports__["default"];
|
|
327
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
328
|
+
"default"
|
|
329
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
330
|
+
Object.defineProperty(exports, '__esModule', {
|
|
331
|
+
value: true
|
|
332
|
+
});
|
|
@@ -66,25 +66,19 @@ function add_hmr_accept_code(source) {
|
|
|
66
66
|
});
|
|
67
67
|
if (source.includes('import.meta.webpackHot')) return source;
|
|
68
68
|
const url = (0, external_loader_utils_namespaceObject.urlToRequest)(this.resourcePath);
|
|
69
|
-
const
|
|
70
|
-
//
|
|
71
|
-
if (import.meta.webpackHot) { import.meta.webpackHot.accept() }
|
|
69
|
+
const reloadCodeBackground = `
|
|
70
|
+
// Extension.js HMR registration (injected)
|
|
71
|
+
if (import.meta.webpackHot) { try { import.meta.webpackHot.accept(); } catch (_) {} }
|
|
72
72
|
`;
|
|
73
73
|
if (manifest.background) {
|
|
74
74
|
if (manifest.background.scripts) for (const bgScript of manifest.background.scripts){
|
|
75
75
|
const absoluteUrl = external_path_default().resolve(projectPath, bgScript);
|
|
76
|
-
if (url.includes(absoluteUrl)) return `${
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (manifest.content_scripts) {
|
|
80
|
-
for (const contentScript of manifest.content_scripts)if (contentScript.js) for (const js of contentScript.js){
|
|
81
|
-
const absoluteUrl = external_path_default().resolve(projectPath, js);
|
|
82
|
-
if (url.includes(absoluteUrl)) return `${reloadCode}${source}`;
|
|
76
|
+
if (url.includes(absoluteUrl)) return `${reloadCodeBackground}${source}`;
|
|
83
77
|
}
|
|
84
78
|
}
|
|
85
79
|
if (manifest.user_scripts) for (const userScript of manifest.user_scripts){
|
|
86
80
|
const absoluteUrl = external_path_default().resolve(projectPath, userScript);
|
|
87
|
-
if (url.includes(absoluteUrl)) return `${
|
|
81
|
+
if (url.includes(absoluteUrl)) return `${reloadCodeBackground}${source}`;
|
|
88
82
|
}
|
|
89
83
|
return source;
|
|
90
84
|
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
default: ()=>content_script_wrapper
|
|
37
|
+
});
|
|
38
|
+
const external_fs_namespaceObject = require("fs");
|
|
39
|
+
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
40
|
+
const external_path_namespaceObject = require("path");
|
|
41
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
42
|
+
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
43
|
+
const schema = {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
test: {
|
|
47
|
+
type: 'string'
|
|
48
|
+
},
|
|
49
|
+
manifestPath: {
|
|
50
|
+
type: 'string'
|
|
51
|
+
},
|
|
52
|
+
mode: {
|
|
53
|
+
type: 'string'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function content_script_wrapper(source) {
|
|
58
|
+
const options = this.getOptions();
|
|
59
|
+
const manifestPath = options.manifestPath;
|
|
60
|
+
const projectPath = external_path_default().dirname(manifestPath);
|
|
61
|
+
const manifest = JSON.parse(external_fs_default().readFileSync(manifestPath, 'utf-8'));
|
|
62
|
+
const isProd = 'production' === String(options && options.mode || '').toLowerCase();
|
|
63
|
+
(0, external_schema_utils_namespaceObject.validate)(schema, options, {
|
|
64
|
+
name: "scripts:content-script-wrapper",
|
|
65
|
+
baseDataPath: 'options'
|
|
66
|
+
});
|
|
67
|
+
const declaredContentJsAbsPaths = [];
|
|
68
|
+
const contentScripts = Array.isArray(manifest.content_scripts) ? manifest.content_scripts : [];
|
|
69
|
+
for (const cs of contentScripts){
|
|
70
|
+
const jsList = Array.isArray(null == cs ? void 0 : cs.js) ? cs.js : [];
|
|
71
|
+
for (const js of jsList)declaredContentJsAbsPaths.push(external_path_default().resolve(projectPath, js));
|
|
72
|
+
}
|
|
73
|
+
const resourceAbsPath = external_path_default().normalize(this.resourcePath);
|
|
74
|
+
const isDeclaredContentScript = declaredContentJsAbsPaths.some((abs)=>resourceAbsPath === external_path_default().normalize(abs));
|
|
75
|
+
if (!isDeclaredContentScript) return source;
|
|
76
|
+
const resourceQuery = String(this.resourceQuery || '');
|
|
77
|
+
const isInnerWrapperRequest = /\b__extjs_inner=1\b/.test(resourceQuery);
|
|
78
|
+
if (!isInnerWrapperRequest) {
|
|
79
|
+
if (isProd) {
|
|
80
|
+
if (!isDeclaredContentScript) return source;
|
|
81
|
+
if (!/\bexport\s+default\b/.test(source)) return source;
|
|
82
|
+
if (source.includes('__EXTENSIONJS_MOUNT_WRAPPED__')) return source;
|
|
83
|
+
const replaced = source.replace(/\bexport\s+default\b/, 'const __EXTENSIONJS_default__ =');
|
|
84
|
+
let defaultName;
|
|
85
|
+
{
|
|
86
|
+
const m1 = source.match(/\bexport\s+default\s+function\s+([A-Za-z_$][\w$]*)\s*\(/);
|
|
87
|
+
if (m1) defaultName = m1[1];
|
|
88
|
+
else {
|
|
89
|
+
const m2 = source.match(/\bexport\s+default\s+([A-Za-z_$][\w$]*)\b/);
|
|
90
|
+
if (m2) defaultName = m2[1];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
let cleaned = replaced;
|
|
94
|
+
if (defaultName) {
|
|
95
|
+
const callPattern = new RegExp(`(^|\\n|;)\\s*${defaultName}\\s*\\(\\s*\\)\\s*;?\\s*(?=\\n|$)`, 'g');
|
|
96
|
+
const next = cleaned.replace(callPattern, (_m, p1)=>p1 || '\n');
|
|
97
|
+
if (next !== cleaned) {
|
|
98
|
+
var _this_emitWarning, _this;
|
|
99
|
+
cleaned = next;
|
|
100
|
+
null == (_this_emitWarning = (_this = this).emitWarning) || _this_emitWarning.call(_this, new Error(`Removed direct call to ${defaultName}() to prevent double mount; wrapper handles mounting.`));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const runtimeProdInline = "function __EXTENSIONJS_mount(mount){\n var cleanup;\n function apply(){ cleanup = mount() }\n function unmount(){ if (typeof cleanup === 'function') cleanup() }\n if (typeof document !== 'undefined') {\n if (document.readyState === 'complete') { apply(); }\n else {\n var onReady = function(){ if (document.readyState === 'complete') { document.removeEventListener('readystatechange', onReady); apply(); } };\n document.addEventListener('readystatechange', onReady);\n }\n } else { apply() }\n return unmount;\n}\n";
|
|
104
|
+
const injected = `${runtimeProdInline}${cleaned}\n;/* __EXTENSIONJS_MOUNT_WRAPPED__ */\ntry { __EXTENSIONJS_mount(__EXTENSIONJS_default__) } catch {}\nexport default __EXTENSIONJS_default__\n`;
|
|
105
|
+
return injected;
|
|
106
|
+
}
|
|
107
|
+
const innerSpecifier = JSON.stringify(this.resourcePath.replace(/\\/g, '/') + '?__extjs_inner=1');
|
|
108
|
+
const proxyCode = [
|
|
109
|
+
"/* extension.js content script proxy */",
|
|
110
|
+
'function loadInnerWrappedModule(){',
|
|
111
|
+
` try { import(/* webpackMode: "eager" */ ${innerSpecifier}).catch(function(e){ console.warn('[extension.js] content script failed to load. waiting for next successful compile', e) }) } catch (e) { console.warn('[extension.js] content script failed to load. waiting for next successful compile', e) }`,
|
|
112
|
+
'}',
|
|
113
|
+
'loadInnerWrappedModule()',
|
|
114
|
+
'if (import.meta.webpackHot) {',
|
|
115
|
+
' const hot = (import.meta).webpackHot',
|
|
116
|
+
' if (typeof hot.accept === "function") hot.accept(() => { loadInnerWrappedModule() })',
|
|
117
|
+
' if (typeof hot.addStatusHandler === "function") hot.addStatusHandler((s) => { if (s === "apply" || s === "idle") loadInnerWrappedModule() })',
|
|
118
|
+
'}',
|
|
119
|
+
'export {}\n'
|
|
120
|
+
].join('\n');
|
|
121
|
+
return proxyCode;
|
|
122
|
+
}
|
|
123
|
+
if (!/\bexport\s+default\b/.test(source)) return source;
|
|
124
|
+
if (source.includes('__EXTENSIONJS_MOUNT_WRAPPED__')) return source;
|
|
125
|
+
const cssImportMatches = Array.from(source.matchAll(/import\s+(?:['\"](?<bare>[^'\"]+\.(css|sass|scss|less))['\"]|(?:(?:.+?)\s+from\s+['\"](?<from>[^'\"]+\.(css|sass|scss|less))['\"]))/g));
|
|
126
|
+
const cssSpecifiers = cssImportMatches.map((m)=>{
|
|
127
|
+
var _m_groups, _m_groups1;
|
|
128
|
+
return (null == (_m_groups = m.groups) ? void 0 : _m_groups.bare) || (null == (_m_groups1 = m.groups) ? void 0 : _m_groups1.from);
|
|
129
|
+
});
|
|
130
|
+
const runtimeInline = "function __EXTENSIONJS_mountWithHMR(mount){\n var cleanup;\n function apply(){ cleanup = mount() }\n function unmount(){ if (typeof cleanup === 'function') cleanup() }\n function remount(){ unmount(); apply(); }\n if (typeof document !== 'undefined') {\n if (document.readyState === 'complete') { apply(); }\n else {\n var onReady = function(){ if (document.readyState === 'complete') { document.removeEventListener('readystatechange', onReady); apply(); } };\n document.addEventListener('readystatechange', onReady);\n }\n } else { apply() }\n if (import.meta.webpackHot) {\n if (typeof import.meta.webpackHot.accept === \"function\") import.meta.webpackHot.accept();\n if (typeof import.meta.webpackHot.dispose === \"function\") import.meta.webpackHot.dispose(unmount);\n if (typeof import.meta.webpackHot.addStatusHandler === \"function\") {\n import.meta.webpackHot.addStatusHandler(function(s){ if (s==='abort'||s==='fail') { console.warn('[extension.js] HMR status:', s) } });\n }\n }\n var cssEvt='__EXTENSIONJS_CSS_UPDATE__';\n var onCss=function(){ remount() };\n window.addEventListener(cssEvt, onCss);\n return function(){ window.removeEventListener(cssEvt, onCss); unmount(); };\n}\n";
|
|
131
|
+
if (/\bexport\s+default\s+[A-Za-z_$][\w$]*\s*\(/.test(source) && !/\bexport\s+default\s+function\b/.test(source)) {
|
|
132
|
+
var _this_emitWarning1, _this1;
|
|
133
|
+
null == (_this_emitWarning1 = (_this1 = this).emitWarning) || _this_emitWarning1.call(_this1, new Error('Default export appears to be an invocation. Export a function reference instead: `export default function init(){}` or `export default init`.'));
|
|
134
|
+
return source;
|
|
135
|
+
}
|
|
136
|
+
const replaced = source.replace(/\bexport\s+default\b/, 'const __EXTENSIONJS_default__ =');
|
|
137
|
+
let defaultName;
|
|
138
|
+
{
|
|
139
|
+
const m1 = source.match(/\bexport\s+default\s+function\s+([A-Za-z_$][\w$]*)\s*\(/);
|
|
140
|
+
if (m1) defaultName = m1[1];
|
|
141
|
+
else {
|
|
142
|
+
const m2 = source.match(/\bexport\s+default\s+([A-Za-z_$][\w$]*)\b/);
|
|
143
|
+
if (m2) defaultName = m2[1];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
let cleaned = replaced;
|
|
147
|
+
if (defaultName) {
|
|
148
|
+
const callPattern = new RegExp(`(^|\\n|;)\\s*${defaultName}\\s*\\(\\s*\\)\\s*;?\\s*(?=\\n|$)`, 'g');
|
|
149
|
+
const next = cleaned.replace(callPattern, (_m, p1)=>p1 || '\n');
|
|
150
|
+
if (next !== cleaned) {
|
|
151
|
+
var _this_emitWarning2, _this2;
|
|
152
|
+
cleaned = next;
|
|
153
|
+
null == (_this_emitWarning2 = (_this2 = this).emitWarning) || _this_emitWarning2.call(_this2, new Error(`Removed direct call to ${defaultName}() to prevent double mount; wrapper handles mounting.`));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const cssAccepts = cssSpecifiers.length ? `\ntry {\n if (import.meta.webpackHot) {\n ${cssSpecifiers.map((s)=>`import.meta.webpackHot.accept(${JSON.stringify(s)}, () => { try { window.dispatchEvent(new CustomEvent('__EXTENSIONJS_CSS_UPDATE__')) } catch {} })`).join('\n ')}\n }\n} catch {}\n` : '';
|
|
157
|
+
const injected = `${runtimeInline}${cleaned}\n;/* __EXTENSIONJS_MOUNT_WRAPPED__ */\ntry { __EXTENSIONJS_mountWithHMR(__EXTENSIONJS_default__) } catch {}\n${cssAccepts}export default __EXTENSIONJS_default__\n`;
|
|
158
|
+
return injected;
|
|
159
|
+
}
|
|
160
|
+
exports["default"] = __webpack_exports__["default"];
|
|
161
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
162
|
+
"default"
|
|
163
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
164
|
+
Object.defineProperty(exports, '__esModule', {
|
|
165
|
+
value: true
|
|
166
|
+
});
|
|
@@ -26,8 +26,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
default: ()=>ensureHMRForScripts
|
|
28
28
|
});
|
|
29
|
-
const external_path_namespaceObject = require("path");
|
|
30
|
-
const external_loader_utils_namespaceObject = require("loader-utils");
|
|
31
29
|
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
32
30
|
const schema = {
|
|
33
31
|
type: 'object',
|
|
@@ -40,16 +38,12 @@ const schema = {
|
|
|
40
38
|
},
|
|
41
39
|
includeList: {
|
|
42
40
|
type: 'object'
|
|
43
|
-
},
|
|
44
|
-
excludeList: {
|
|
45
|
-
type: 'object'
|
|
46
41
|
}
|
|
47
|
-
}
|
|
42
|
+
},
|
|
43
|
+
additionalProperties: false
|
|
48
44
|
};
|
|
49
45
|
function ensureHMRForScripts(source) {
|
|
50
46
|
const options = this.getOptions();
|
|
51
|
-
const manifestPath = options.manifestPath;
|
|
52
|
-
external_path_namespaceObject.dirname(manifestPath);
|
|
53
47
|
try {
|
|
54
48
|
(0, external_schema_utils_namespaceObject.validate)(schema, options, {
|
|
55
49
|
name: "html:ensure-hmr-for-scripts",
|
|
@@ -58,10 +52,35 @@ function ensureHMRForScripts(source) {
|
|
|
58
52
|
} catch (error) {
|
|
59
53
|
throw error;
|
|
60
54
|
}
|
|
61
|
-
const resourcePath = this.resourcePath || '';
|
|
62
|
-
(0, external_loader_utils_namespaceObject.urlToRequest)(resourcePath);
|
|
63
55
|
const reloadCode = `
|
|
64
|
-
if (import.meta.webpackHot) {
|
|
56
|
+
if (import.meta.webpackHot) {
|
|
57
|
+
try {
|
|
58
|
+
// Accept updates for HTML-attached scripts and clear common containers
|
|
59
|
+
import.meta.webpackHot.accept();
|
|
60
|
+
import.meta.webpackHot.dispose(function() {
|
|
61
|
+
try {
|
|
62
|
+
var clear = function(el) {
|
|
63
|
+
if (!el) return;
|
|
64
|
+
while (el.firstChild) el.removeChild(el.firstChild);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Clear default template container
|
|
68
|
+
clear(document.getElementById('app'));
|
|
69
|
+
|
|
70
|
+
// Also clear any extension-root wrappers if present
|
|
71
|
+
var roots = document.querySelectorAll('[data-extension-root]');
|
|
72
|
+
roots.forEach(function(node) {
|
|
73
|
+
clear(node);
|
|
74
|
+
});
|
|
75
|
+
} catch (err) {
|
|
76
|
+
// 'err' is local in this catch, keep for error clarity
|
|
77
|
+
console.error('Error clearing HTML containers', err);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.error('Error accepting HMR', error);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
65
84
|
`;
|
|
66
85
|
return `${reloadCode}${source}`;
|
|
67
86
|
}
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
var __webpack_exports__ = {};
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
id: chrome.runtime.id,
|
|
9
|
-
manifest: chrome.runtime.getManifest(),
|
|
10
|
-
management: managementInfo
|
|
11
|
-
});
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if ('declarative_net_request' === request.changedFile || 'manifest.json' === request.changedFile || 'service_worker' === request.changedFile || '_locales' === request.changedFile) {
|
|
15
|
-
sendResponse({
|
|
16
|
-
reloaded: true
|
|
17
|
-
});
|
|
18
|
-
chrome.runtime.reload();
|
|
19
|
-
}
|
|
20
|
-
return true;
|
|
21
|
-
});
|
|
2
|
+
try {
|
|
3
|
+
var _globalThis;
|
|
4
|
+
const loc = null == (_globalThis = globalThis) ? void 0 : _globalThis.location;
|
|
5
|
+
if (loc && 'function' != typeof loc.reload) loc.reload = ()=>{};
|
|
6
|
+
} catch {}
|
|
7
|
+
console.log('Minimum Chromium file loaded for reload purposes');
|
|
22
8
|
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
23
9
|
Object.defineProperty(exports, '__esModule', {
|
|
24
10
|
value: true
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
var __webpack_exports__ = {};
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
if ('declarative_net_request' === request.changedFile || 'manifest.json' === request.changedFile || 'service_worker' === request.changedFile || '_locales' === request.changedFile) browser.runtime.reload();
|
|
10
|
-
return {
|
|
11
|
-
reloaded: true
|
|
12
|
-
};
|
|
13
|
-
});
|
|
2
|
+
try {
|
|
3
|
+
var _globalThis;
|
|
4
|
+
const loc = null == (_globalThis = globalThis) ? void 0 : _globalThis.location;
|
|
5
|
+
if (loc && 'function' != typeof loc.reload) loc.reload = ()=>{};
|
|
6
|
+
} catch {}
|
|
7
|
+
console.log('Minimum Firefox file loaded for reload purposes');
|
|
14
8
|
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
15
9
|
Object.defineProperty(exports, '__esModule', {
|
|
16
10
|
value: true
|