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
package/dist/build.d.ts
DELETED
package/dist/cleanup.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cleanupCommand(): Promise<void>;
|
|
@@ -1,135 +0,0 @@
|
|
|
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: ()=>deprecated_shadow_root
|
|
37
|
-
});
|
|
38
|
-
const external_path_namespaceObject = require("path");
|
|
39
|
-
const external_fs_namespaceObject = require("fs");
|
|
40
|
-
const external_loader_utils_namespaceObject = require("loader-utils");
|
|
41
|
-
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
42
|
-
const external_pintor_namespaceObject = require("pintor");
|
|
43
|
-
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
|
|
44
|
-
external_path_namespaceObject.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
|
|
45
|
-
const CHROMIUM_BASED_BROWSERS = [
|
|
46
|
-
'chrome',
|
|
47
|
-
'edge'
|
|
48
|
-
];
|
|
49
|
-
const GECKO_BASED_BROWSERS = [
|
|
50
|
-
'firefox'
|
|
51
|
-
];
|
|
52
|
-
[
|
|
53
|
-
...CHROMIUM_BASED_BROWSERS,
|
|
54
|
-
...GECKO_BASED_BROWSERS
|
|
55
|
-
];
|
|
56
|
-
function getLoggingPrefix(feature, type) {
|
|
57
|
-
if ('error' === type) return `${external_pintor_default().red('ERROR')} ${feature}`;
|
|
58
|
-
if ('warn' === type) return `${external_pintor_default().brightYellow("\u25BA\u25BA\u25BA")} ${feature}`;
|
|
59
|
-
const arrow = 'info' === type ? external_pintor_default().blue("\u25BA\u25BA\u25BA") : external_pintor_default().green("\u25BA\u25BA\u25BA");
|
|
60
|
-
return `${arrow} ${feature}`;
|
|
61
|
-
}
|
|
62
|
-
function deprecatedShadowRoot() {
|
|
63
|
-
return `${getLoggingPrefix('DEPRECATION', 'warn')} Using ${external_pintor_default().yellow('window.__EXTENSION_SHADOW_ROOT__')} in content_scripts is deprecated\nand will be removed in a future version of Extension.js. To use content_scripts with\nthe shadow DOM, see one of the many examples at:\nhttps://github.com/extension-js/extension.js/tree/main/examples\n\nIf you really need to use the shadow DOM as-is, the latest version of Extension.js\nto support it is ${external_pintor_default().gray('extension@2.0.0-beta.9')}.\n`;
|
|
64
|
-
}
|
|
65
|
-
const schema = {
|
|
66
|
-
type: 'object',
|
|
67
|
-
properties: {
|
|
68
|
-
test: {
|
|
69
|
-
type: 'string'
|
|
70
|
-
},
|
|
71
|
-
manifestPath: {
|
|
72
|
-
type: 'string'
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
function deprecated_shadow_root(source) {
|
|
77
|
-
const options = this.getOptions();
|
|
78
|
-
const manifestPath = options.manifestPath;
|
|
79
|
-
const projectPath = external_path_namespaceObject.dirname(manifestPath);
|
|
80
|
-
const manifest = JSON.parse(external_fs_namespaceObject.readFileSync(manifestPath, 'utf8'));
|
|
81
|
-
(0, external_schema_utils_namespaceObject.validate)(schema, options, {
|
|
82
|
-
name: "scripts:deprecated-shadow-root",
|
|
83
|
-
baseDataPath: 'options'
|
|
84
|
-
});
|
|
85
|
-
const url = (0, external_loader_utils_namespaceObject.urlToRequest)(this.resourcePath);
|
|
86
|
-
const patchCssTag = `
|
|
87
|
-
;const appendStyleElementForLegacyShadowRoot = (legacyShadowRoot, stylesheets) => {
|
|
88
|
-
if (typeof chrome !== 'undefined' || typeof browser !== 'undefined') {
|
|
89
|
-
const styleElement = document.createElement('link')
|
|
90
|
-
styleElement.rel = 'stylesheet'
|
|
91
|
-
styleElement.href = (typeof chrome !== 'undefined' ? chrome : browser).runtime.getURL('content_scripts/content-0.css')
|
|
92
|
-
legacyShadowRoot.appendChild(styleElement)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function injectStyles() {
|
|
97
|
-
const legacyShadowRoot = window.__EXTENSION_SHADOW_ROOT__
|
|
98
|
-
|
|
99
|
-
if (legacyShadowRoot) {
|
|
100
|
-
appendStyleElementForLegacyShadowRoot(legacyShadowRoot)
|
|
101
|
-
} else {
|
|
102
|
-
// Use MutationObserver to wait for shadow root to be available
|
|
103
|
-
const observer = new MutationObserver(() => {
|
|
104
|
-
const shadowRoot = window.__EXTENSION_SHADOW_ROOT__
|
|
105
|
-
|
|
106
|
-
if (shadowRoot) {
|
|
107
|
-
appendStyleElementForLegacyShadowRoot(shadowRoot)
|
|
108
|
-
observer.disconnect()
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
observer.observe(document.body, { childList: true, subtree: true })
|
|
113
|
-
}
|
|
114
|
-
};injectStyles();`;
|
|
115
|
-
if (manifest.content_scripts) {
|
|
116
|
-
for (const contentScript of manifest.content_scripts)if (contentScript.js) for (const js of contentScript.js){
|
|
117
|
-
const absoluteUrl = external_path_namespaceObject.resolve(projectPath, js);
|
|
118
|
-
if (url.includes(absoluteUrl)) {
|
|
119
|
-
if (source.includes('__EXTENSION_SHADOW_ROOT__')) {
|
|
120
|
-
if ('development' === process.env.EXTENSION_ENV) console.warn(deprecatedShadowRoot());
|
|
121
|
-
return `${patchCssTag}${source}`;
|
|
122
|
-
}
|
|
123
|
-
return `${source}`;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return source;
|
|
128
|
-
}
|
|
129
|
-
exports["default"] = __webpack_exports__["default"];
|
|
130
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
131
|
-
"default"
|
|
132
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
133
|
-
Object.defineProperty(exports, '__esModule', {
|
|
134
|
-
value: true
|
|
135
|
-
});
|
package/dist/dev.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
2
|
-
export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium-based' | 'gecko-based';
|
|
3
|
-
export interface BrowserOptionsBase {
|
|
4
|
-
open?: boolean;
|
|
5
|
-
profile?: string | false;
|
|
6
|
-
startingUrl?: string;
|
|
7
|
-
browser: BrowserType;
|
|
8
|
-
}
|
|
9
|
-
export interface ChromiumOptions extends BrowserOptionsBase {
|
|
10
|
-
browser: 'chromium-based';
|
|
11
|
-
chromiumBinary?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface GeckoOptions extends BrowserOptionsBase {
|
|
14
|
-
browser: 'gecko-based';
|
|
15
|
-
geckoBinary?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface NonBinaryOptions extends BrowserOptionsBase {
|
|
18
|
-
browser: Exclude<BrowserType, 'chromium-based' | 'gecko-based'>;
|
|
19
|
-
}
|
|
20
|
-
export type ExtendedBrowserOptions = ChromiumOptions | GeckoOptions | NonBinaryOptions;
|
|
21
|
-
export interface DevOptions extends BrowserOptionsBase {
|
|
22
|
-
mode: 'development' | 'production' | 'none';
|
|
23
|
-
polyfill?: boolean;
|
|
24
|
-
port?: string | number | undefined;
|
|
25
|
-
chromiumBinary?: ChromiumOptions['chromiumBinary'];
|
|
26
|
-
geckoBinary?: GeckoOptions['geckoBinary'];
|
|
27
|
-
source?: string;
|
|
28
|
-
watchSource?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface BuildOptions {
|
|
31
|
-
browser: BrowserOptionsBase['browser'];
|
|
32
|
-
zipFilename?: string;
|
|
33
|
-
zip?: boolean;
|
|
34
|
-
zipSource?: boolean;
|
|
35
|
-
polyfill?: boolean;
|
|
36
|
-
silent?: boolean;
|
|
37
|
-
exitOnError?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface PreviewOptions extends BrowserOptionsBase {
|
|
40
|
-
mode: 'production';
|
|
41
|
-
outputPath?: string;
|
|
42
|
-
chromiumBinary?: ChromiumOptions['chromiumBinary'];
|
|
43
|
-
geckoBinary?: GeckoOptions['geckoBinary'];
|
|
44
|
-
}
|
|
45
|
-
export interface StartOptions extends BrowserOptionsBase {
|
|
46
|
-
mode: 'production';
|
|
47
|
-
polyfill?: boolean;
|
|
48
|
-
chromiumBinary?: ChromiumOptions['chromiumBinary'];
|
|
49
|
-
geckoBinary?: GeckoOptions['geckoBinary'];
|
|
50
|
-
}
|
|
51
|
-
export interface BrowserConfig extends BrowserOptionsBase {
|
|
52
|
-
browserFlags?: string[];
|
|
53
|
-
excludeBrowserFlags?: string[];
|
|
54
|
-
preferences?: Record<string, unknown>;
|
|
55
|
-
chromiumBinary?: ChromiumOptions['chromiumBinary'];
|
|
56
|
-
geckoBinary?: GeckoOptions['geckoBinary'];
|
|
57
|
-
reuseProfile?: boolean;
|
|
58
|
-
}
|
|
59
|
-
export interface FileConfig {
|
|
60
|
-
browser?: {
|
|
61
|
-
chrome?: BrowserConfig;
|
|
62
|
-
firefox?: BrowserConfig;
|
|
63
|
-
edge?: BrowserConfig;
|
|
64
|
-
'chromium-based'?: BrowserConfig;
|
|
65
|
-
'gecko-based'?: BrowserConfig;
|
|
66
|
-
};
|
|
67
|
-
commands?: {
|
|
68
|
-
dev?: Pick<DevOptions, 'browser' | 'profile' | 'chromiumBinary' | 'geckoBinary' | 'open' | 'polyfill'> & {
|
|
69
|
-
browserFlags?: string[];
|
|
70
|
-
excludeBrowserFlags?: string[];
|
|
71
|
-
preferences?: Record<string, unknown>;
|
|
72
|
-
};
|
|
73
|
-
start?: Pick<StartOptions, 'browser' | 'profile' | 'chromiumBinary' | 'geckoBinary' | 'polyfill'> & {
|
|
74
|
-
browserFlags?: string[];
|
|
75
|
-
excludeBrowserFlags?: string[];
|
|
76
|
-
preferences?: Record<string, unknown>;
|
|
77
|
-
};
|
|
78
|
-
preview?: Pick<PreviewOptions, 'browser' | 'profile' | 'chromiumBinary' | 'geckoBinary'> & {
|
|
79
|
-
browserFlags?: string[];
|
|
80
|
-
excludeBrowserFlags?: string[];
|
|
81
|
-
preferences?: Record<string, unknown>;
|
|
82
|
-
};
|
|
83
|
-
build?: Pick<BuildOptions, 'browser' | 'zipFilename' | 'zip' | 'zipSource' | 'polyfill'>;
|
|
84
|
-
};
|
|
85
|
-
config?: (config: Configuration) => Configuration;
|
|
86
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function downloadAndExtractZip(url: string, targetPath: string): Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function generateExtensionTypes(projectPath: string): Promise<void>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
2
|
-
import { BrowserConfig, DevOptions } from './config-types';
|
|
3
|
-
export declare function loadCustomWebpackConfig(projectPath: string): Promise<(config: Configuration) => Configuration>;
|
|
4
|
-
export declare function loadCommandConfig(projectPath: string, command: 'dev' | 'build' | 'start' | 'preview'): Promise<{}>;
|
|
5
|
-
export declare function loadBrowserConfig(projectPath: string, browser?: DevOptions['browser']): Promise<BrowserConfig>;
|
|
6
|
-
export declare function isUsingExperimentalConfig(projectPath: string): Promise<boolean>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface ProjectStructure {
|
|
2
|
-
manifestPath: string;
|
|
3
|
-
packageJsonPath?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function getProjectPath(pathOrRemoteUrl: string | undefined): Promise<string>;
|
|
6
|
-
export declare function getProjectStructure(pathOrRemoteUrl: string | undefined): Promise<ProjectStructure>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Manifest } from '../webpack/webpack-types';
|
|
2
|
-
import { type DevOptions } from './config-types';
|
|
3
|
-
export declare function manifestNotFoundError(manifestPath: string): string;
|
|
4
|
-
export declare function packageJsonNotFoundError(manifestPath: string): string;
|
|
5
|
-
export declare function building(browser: DevOptions['browser']): string;
|
|
6
|
-
export declare function runningInProduction(outputPath: string): string;
|
|
7
|
-
export declare function ready(mode: DevOptions['mode'], browser: DevOptions['browser']): string;
|
|
8
|
-
export declare function previewing(browser: DevOptions['browser']): string;
|
|
9
|
-
export declare function previewWebpack(): string;
|
|
10
|
-
export declare function buildWebpack(projectDir: string, stats: any, browser: DevOptions['browser']): string;
|
|
11
|
-
export declare function buildSuccess(): string;
|
|
12
|
-
export declare function fetchingProjectPath(owner: string, project: string): string;
|
|
13
|
-
export declare function downloadingProjectPath(projectName: string): string;
|
|
14
|
-
export declare function creatingProjectPath(projectPath: string): string;
|
|
15
|
-
export declare function noGitIgnoreFound(projectDir: string): string;
|
|
16
|
-
export declare function packagingSourceFiles(zipPath: string): string;
|
|
17
|
-
export declare function packagingDistributionFiles(zipPath: string): string;
|
|
18
|
-
export declare function treeWithSourceAndDistFiles(browser: DevOptions['browser'], name: string, sourceZip: string, destZip: string): string;
|
|
19
|
-
export declare function treeWithDistFilesbrowser(name: string, ext: string, browser: DevOptions['browser'], zipPath: string): string;
|
|
20
|
-
export declare function treeWithSourceFiles(name: string, ext: string, browser: DevOptions['browser'], zipPath: string): string;
|
|
21
|
-
export declare function failedToCompressError(error: any): string;
|
|
22
|
-
export declare function writingTypeDefinitions(manifest: Manifest): string;
|
|
23
|
-
export declare function writingTypeDefinitionsError(error: any): string;
|
|
24
|
-
export declare function downloadingText(url: string): string;
|
|
25
|
-
export declare function unpackagingExtension(zipFilePath: string): string;
|
|
26
|
-
export declare function unpackagedSuccessfully(): string;
|
|
27
|
-
export declare function failedToDownloadOrExtractZIPFileError(error: any): string;
|
|
28
|
-
export declare function invalidRemoteZip(url: string, contentType: string): string;
|
|
29
|
-
export declare function isUsingExperimentalConfig(integration: any): string;
|
|
30
|
-
export declare function installingDependencies(): string;
|
|
31
|
-
export declare function installingDependenciesFailed(gitCommand: string, gitArgs: string[], code: number | null): string;
|
|
32
|
-
export declare function installingDependenciesProcessError(error: any): string;
|
|
33
|
-
export declare function cantInstallDependencies(error: any): string;
|
|
34
|
-
export declare function portInUse(requestedPort: number, newPort: number): string;
|
|
35
|
-
export declare function configLoadingError(configPath: string, error: unknown): string;
|
|
36
|
-
export declare function managedDependencyConflict(duplicates: string[], userPackageJsonPath: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function assertNoManagedDependencyConflicts(userPackageJsonPath: string, projectPath: string): void;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {createExtensionsPageTab, handleFirstRun} from './define-initial-tab.js'
|
|
2
|
-
import {connect, disconnect, keepAlive} from './reload-service.js'
|
|
3
|
-
|
|
4
|
-
function bgGreen(str) {
|
|
5
|
-
return `background: transparent; color: #0971fe; ${str}`
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
async function initManagerUI() {
|
|
9
|
-
try {
|
|
10
|
-
chrome.tabs.query({active: true, currentWindow: true}, async (tabs) => {
|
|
11
|
-
const initialTab = Array.isArray(tabs) ? tabs[0] : undefined
|
|
12
|
-
|
|
13
|
-
console.log(
|
|
14
|
-
`%c
|
|
15
|
-
██████████████████████████████████████████████████████████
|
|
16
|
-
██████████████████████████████████████████████████████████
|
|
17
|
-
████████████████████████████ ██████████████████████████
|
|
18
|
-
█████████████████████████ ██████ ███████████████
|
|
19
|
-
███████████████████████ ███ ███ ████████████
|
|
20
|
-
██████████████████████ ██████ ███ ███████████
|
|
21
|
-
███████████████████████ ██████ ██████ ███████████
|
|
22
|
-
████████████████ ██████ ██████████████ ███████████
|
|
23
|
-
█████████████ ████ ████████████ ████████████
|
|
24
|
-
███████████ ██ █████████████ ███████████████
|
|
25
|
-
██████████ ██████ █████████████████ █████████████
|
|
26
|
-
███████████ ████████████████████████████ ███████████
|
|
27
|
-
█████████████ █████████████████ ██████ ██████████
|
|
28
|
-
███████████████ ██████████████ ██ ██████████
|
|
29
|
-
████████████ ████████████ ████ █████████████
|
|
30
|
-
███████████ █████████████ ██████ ███████████████
|
|
31
|
-
███████████ ██████ ██████ ███████████████████████
|
|
32
|
-
███████████ ████ ██████ ██████████████████████
|
|
33
|
-
████████████ ██ ███ ███████████████████████
|
|
34
|
-
███████████████ ██████ █████████████████████████
|
|
35
|
-
██████████████████████████ ████████████████████████████
|
|
36
|
-
██████████████████████████████████████████████████████████
|
|
37
|
-
██████████████████████████████████████████████████████████
|
|
38
|
-
MIT (c) ${new Date().getFullYear()} - Cezar Augusto and the Extension.js Authors.
|
|
39
|
-
`,
|
|
40
|
-
bgGreen('')
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
if (!initialTab) {
|
|
44
|
-
try {
|
|
45
|
-
await handleFirstRun()
|
|
46
|
-
} catch {
|
|
47
|
-
try {
|
|
48
|
-
chrome.tabs.create({url: 'chrome://extensions/'})
|
|
49
|
-
} catch {}
|
|
50
|
-
}
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
initialTab.url === 'chrome://newtab/' ||
|
|
56
|
-
initialTab.url === 'chrome://welcome/'
|
|
57
|
-
) {
|
|
58
|
-
await handleFirstRun()
|
|
59
|
-
} else {
|
|
60
|
-
createExtensionsPageTab(initialTab, 'chrome://extensions/')
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
} catch {}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Guard tab access and run after startup
|
|
67
|
-
chrome.runtime.onStartup.addListener(async () => {
|
|
68
|
-
await initManagerUI()
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
chrome.runtime.onInstalled.addListener(async () => {
|
|
72
|
-
let isConnected = false
|
|
73
|
-
|
|
74
|
-
// Ensure UI setup also runs on install (first run)
|
|
75
|
-
await initManagerUI()
|
|
76
|
-
|
|
77
|
-
if (isConnected) {
|
|
78
|
-
disconnect()
|
|
79
|
-
} else {
|
|
80
|
-
await connect()
|
|
81
|
-
isConnected = true
|
|
82
|
-
keepAlive()
|
|
83
|
-
}
|
|
84
|
-
})
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
async function getDevExtension() {
|
|
2
|
-
const allExtensions = await new Promise((resolve) => {
|
|
3
|
-
chrome.management.getAll(resolve)
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
const devExtensions = allExtensions.filter((extension) => {
|
|
7
|
-
return (
|
|
8
|
-
// Do not include itself
|
|
9
|
-
extension.id !== chrome.runtime.id &&
|
|
10
|
-
// Reload extension
|
|
11
|
-
extension.id !== 'igcijhgmihmjbbahdabahfbpffalcfnn' &&
|
|
12
|
-
// Show only unpackaged extensions
|
|
13
|
-
extension.installType === 'development'
|
|
14
|
-
)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
return devExtensions[0]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Ideas here are adapted from
|
|
21
|
-
// https://github.com/jeremyben/webpack-chrome-extension-launcher
|
|
22
|
-
// Released under MIT license.
|
|
23
|
-
|
|
24
|
-
// Create a new tab and set it to background.
|
|
25
|
-
// We want the user-selected page to be active,
|
|
26
|
-
// not chrome://extensions.
|
|
27
|
-
export function createExtensionsPageTab(initialTab, url) {
|
|
28
|
-
// Check if url tab is open
|
|
29
|
-
chrome.tabs.query({url: 'chrome://extensions/'}, (tabs) => {
|
|
30
|
-
const extensionsTabExist = tabs.length > 0
|
|
31
|
-
|
|
32
|
-
// Return if url exists
|
|
33
|
-
if (extensionsTabExist) return
|
|
34
|
-
|
|
35
|
-
// Create an inactive tab
|
|
36
|
-
chrome.tabs.create(
|
|
37
|
-
{url, active: false},
|
|
38
|
-
function setBackgroundTab(extensionsTab) {
|
|
39
|
-
// Get current url tab and move it left.
|
|
40
|
-
// This action auto-activates the tab
|
|
41
|
-
chrome.tabs.move(extensionsTab.id, {index: 0}, () => {
|
|
42
|
-
// Get user-selected initial page tab and activate the right tab
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
chrome.tabs.update(initialTab.id, {active: true})
|
|
45
|
-
}, 500)
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Function to handle first run logic
|
|
53
|
-
export async function handleFirstRun() {
|
|
54
|
-
chrome.tabs.update({url: 'chrome://extensions/'})
|
|
55
|
-
|
|
56
|
-
const devExtension = await getDevExtension()
|
|
57
|
-
|
|
58
|
-
chrome.storage.local.get(devExtension.id, (result) => {
|
|
59
|
-
if (result[devExtension.id] && result[devExtension.id].didRun) {
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Guard against opening multiple welcome pages
|
|
64
|
-
chrome.tabs.query(
|
|
65
|
-
{url: chrome.runtime.getURL('pages/welcome.html')},
|
|
66
|
-
(tabs) => {
|
|
67
|
-
if (Array.isArray(tabs) && tabs.length > 0) {
|
|
68
|
-
// Already open; do not create another
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
chrome.tabs.create({url: 'pages/welcome.html'})
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
// Ensure the welcome page shows only once per extension installation
|
|
75
|
-
chrome.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
76
|
-
})
|
|
77
|
-
}
|
|
Binary file
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Extension.js DevTools",
|
|
3
|
-
"description": "Extension.js built-in developer tools for browser instance ID __INSTANCE_ID__",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"manifest_version": 3,
|
|
6
|
-
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAolEJq/DBHxY5dBpOqBRWNCl7vRPBvJPlpEzF19fYFVzzaH44AF6+sKjN3jwIKlsgI82F3TIuwoNFiN1yBu5Unf8SVBE4BTO92P02/ACcGYQxicgCLFUGQKlq4uSrwSPaBYl7FHcYl5SERgxnIGCGnaGMdL2vC7waCj2/U/iKoBF9I1lBH9/aKCSjTd3h2UYo7gg6n5nY/ENbzylDt42T3ATmvnVJfYhSNKA9Dv/zryknfnHYYgBKHtz7pDZwWnYdxs78n2VEKwGj7TgbXuIPDpCkrMnU9PTKpHbXFYARA4H9qYORQmYazfIxUZRnKQNSR+GAOGrb8JK+ijeQdwzDAwIDAQAB",
|
|
7
|
-
"background": {
|
|
8
|
-
"service_worker": "background.js",
|
|
9
|
-
"type": "module"
|
|
10
|
-
},
|
|
11
|
-
"icons": {
|
|
12
|
-
"16": "images/logo.png",
|
|
13
|
-
"48": "images/logo.png",
|
|
14
|
-
"128": "images/logo.png"
|
|
15
|
-
},
|
|
16
|
-
"permissions": ["management", "tabs", "storage"]
|
|
17
|
-
}
|