extension-develop 4.1.39 → 4.1.40-canary.459.2c1ba7b

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.
Files changed (210) hide show
  1. package/README.md +13 -10
  2. package/dist/{771~0.mjs → 5h~0.mjs} +13 -3
  3. package/dist/{273~0.mjs → 6l~0.mjs} +1 -1
  4. package/dist/{524~0.mjs → 9~0.mjs} +18 -2
  5. package/dist/{640~0.mjs → bh~0.mjs} +6 -1
  6. package/dist/bridge.mjs +14 -8
  7. package/dist/b~0.mjs +8644 -0
  8. package/dist/command-dev.d.ts +2 -0
  9. package/dist/command-preview.d.ts +2 -0
  10. package/dist/contracts.mjs +2 -1
  11. package/dist/{469~0.mjs → cp~0.mjs} +66 -17
  12. package/dist/css-parse-guard-loader.mjs +2 -2
  13. package/dist/c~0.mjs +56 -0
  14. package/dist/dead-css-url-loader.mjs +20 -119
  15. package/dist/dev-server/control-bridge/actions-file.d.ts +7 -0
  16. package/dist/dev-server/control-bridge/broker.d.ts +42 -2
  17. package/dist/dev-server/control-bridge/consumer-client.d.ts +7 -0
  18. package/dist/dev-server/control-bridge/contracts.d.ts +29 -1
  19. package/dist/dev-server/control-bridge/logs-file.d.ts +6 -0
  20. package/dist/dev-server/control-bridge/loopback.d.ts +1 -0
  21. package/dist/dev-server/control-bridge/producer-runtime.d.ts +5 -2
  22. package/dist/dev-server/control-bridge/production-control.d.ts +1 -0
  23. package/dist/dev-server/control-bridge/session-token.d.ts +5 -2
  24. package/dist/dev-server/cors.d.ts +4 -2
  25. package/dist/dev-server/messages.d.ts +6 -0
  26. package/dist/dev-server/session-restart.d.ts +3 -1
  27. package/dist/dev-server~0.mjs +71 -129
  28. package/dist/df~0.mjs +197 -0
  29. package/dist/{846~0.mjs → d~0.mjs} +4 -3
  30. package/dist/ensure-hmr-for-scripts.js +3 -3
  31. package/dist/ensure-hmr-for-scripts.mjs +3 -3
  32. package/dist/extension-js-devtools/build-stamp.json +2 -2
  33. package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
  34. package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
  35. package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
  36. package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
  37. package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
  38. package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
  39. package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
  40. package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
  41. package/dist/extension-js-theme/build-stamp.json +2 -2
  42. package/dist/{143~0.mjs → ey~0.mjs} +2 -2
  43. package/dist/e~0.mjs +33 -0
  44. package/dist/feature-scripts-classic-traced-globals-loader.mjs +7 -2
  45. package/dist/feature-scripts-content-script-wrapper.js +56 -18
  46. package/dist/feature-scripts-content-script-wrapper.mjs +56 -18
  47. package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
  48. package/dist/{105~0.mjs → g0~0.mjs} +1 -1
  49. package/dist/{88~0.mjs → j6~0.mjs} +9 -1
  50. package/dist/{731~0.mjs → j~0.mjs} +2 -2
  51. package/dist/{712~0.mjs → ka~0.mjs} +18 -2
  52. package/dist/{852~0.mjs → k~0.mjs} +4 -2
  53. package/dist/late-css-import-loader.mjs +1 -1
  54. package/dist/lib/addon-lint.d.ts +6 -0
  55. package/dist/lib/build-summary.d.ts +6 -0
  56. package/dist/lib/dev-additions.d.ts +12 -0
  57. package/dist/lib/extension-base-from-stack.d.ts +16 -0
  58. package/dist/lib/localized-manifest-name.d.ts +9 -0
  59. package/dist/lib/manifest-types.d.ts +276 -0
  60. package/dist/lib/messages.d.ts +6 -2
  61. package/dist/lib/process-started-at.d.ts +1 -0
  62. package/dist/lib/real-path.d.ts +8 -0
  63. package/dist/lib/resource-path.d.ts +1 -0
  64. package/dist/lib/session-paths.d.ts +2 -0
  65. package/dist/lib/split-chunks.d.ts +2 -1
  66. package/dist/lib/stats-handler.d.ts +1 -0
  67. package/dist/lib/tsconfig-includes-file.d.ts +1 -0
  68. package/dist/l~0.mjs +2290 -0
  69. package/dist/main-world-bridge.js +92 -23
  70. package/dist/main-world-bridge.mjs +92 -23
  71. package/dist/manifest-entry.d.ts +2 -0
  72. package/dist/manifest.mjs +3 -1
  73. package/dist/module.mjs +3 -3
  74. package/dist/{832~0.mjs → m~0.mjs} +2244 -288
  75. package/dist/o~0.mjs +47 -0
  76. package/dist/plugin-browsers/index.d.ts +7 -0
  77. package/dist/plugin-browsers/safari-dev-plugin.d.ts +2 -0
  78. package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +5 -1
  79. package/dist/plugin-compatibility/compatibility-lib/native-browser-namespace.d.ts +5 -0
  80. package/dist/plugin-compatibility/feature-browser-global.d.ts +11 -1
  81. package/dist/plugin-compatibility/index.d.ts +2 -0
  82. package/dist/plugin-compilation/compilation-lib/messages.d.ts +4 -1
  83. package/dist/plugin-compilation/env.d.ts +1 -0
  84. package/dist/plugin-compilation/index.d.ts +2 -0
  85. package/dist/plugin-compilation/node-builtins.d.ts +5 -0
  86. package/dist/plugin-compilation/one-diagnostic-per-location.d.ts +13 -0
  87. package/dist/plugin-compilation/resolve-file-requests.d.ts +16 -0
  88. package/dist/plugin-compilation/warm-ancestor-watchers.d.ts +19 -0
  89. package/dist/plugin-compilation/watch-real-project-path.d.ts +27 -0
  90. package/dist/plugin-compilation/zip.d.ts +2 -0
  91. package/dist/plugin-css/css-in-content-script-loader.d.ts +1 -1
  92. package/dist/plugin-css/css-lib/build-css-rules.d.ts +3 -0
  93. package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +3 -1
  94. package/dist/plugin-css/css-lib/messages.d.ts +4 -0
  95. package/dist/plugin-css/css-lib/sfc-style-block.d.ts +26 -0
  96. package/dist/plugin-css/css-lib/unplaced-style-imports.d.ts +7 -0
  97. package/dist/plugin-css/css-lib/verbatim-css.d.ts +1 -0
  98. package/dist/plugin-css/dead-css-url-loader.d.ts +9 -1
  99. package/dist/plugin-css/index.d.ts +1 -0
  100. package/dist/plugin-css/sfc-style-block-loader.d.ts +18 -0
  101. package/dist/plugin-css/unplaced-style-import-loader.d.ts +16 -0
  102. package/dist/plugin-playwright/index.d.ts +22 -0
  103. package/dist/plugin-reload/classify-reload.d.ts +20 -0
  104. package/dist/plugin-reload/index.d.ts +4 -2
  105. package/dist/plugin-reload/messages.d.ts +1 -0
  106. package/dist/plugin-reload/reload-dispatch.d.ts +21 -2
  107. package/dist/plugin-reload/reload-lib/dev-content-scripts.d.ts +6 -0
  108. package/dist/plugin-reload/reload-lib/scripts-replay-shim.d.ts +1 -1
  109. package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +6 -0
  110. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +3 -0
  111. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +1 -1
  112. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +1 -1
  113. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +1 -1
  114. package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +1 -1
  115. package/dist/plugin-special-folders/get-data.d.ts +2 -0
  116. package/dist/plugin-special-folders/hint-import-only-scripts.d.ts +4 -0
  117. package/dist/plugin-special-folders/include-files.d.ts +2 -0
  118. package/dist/plugin-special-folders/messages.d.ts +1 -0
  119. package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +1 -1
  120. package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -0
  121. package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +1 -0
  122. package/dist/plugin-web-extension/feature-icons/extract-action-theme-icons.d.ts +1 -0
  123. package/dist/plugin-web-extension/feature-icons/extract-icon-variants.d.ts +2 -0
  124. package/dist/plugin-web-extension/feature-json/json-validation.d.ts +2 -1
  125. package/dist/plugin-web-extension/feature-json/messages.d.ts +2 -0
  126. package/dist/plugin-web-extension/feature-json/process-assets.d.ts +1 -1
  127. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-gecko.d.ts +21 -0
  128. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +1 -1
  129. package/dist/plugin-web-extension/feature-manifest/manifest-lib/icon-variants-fallback.d.ts +15 -0
  130. package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +2 -1
  131. package/dist/plugin-web-extension/feature-manifest/manifest-lib/webkit-unsupported-keys.d.ts +15 -0
  132. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +1 -1
  133. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/icons.d.ts +3 -2
  134. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +1 -1
  135. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +2 -1
  136. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +1 -1
  137. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +1 -1
  138. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +4 -3
  139. package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +3 -2
  140. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +15 -1
  141. package/dist/plugin-web-extension/feature-manifest/normalize-manifest-path.d.ts +2 -0
  142. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-additions.d.ts +8 -0
  143. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +2 -2
  144. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-externally-connectable.d.ts +1 -1
  145. package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +1 -0
  146. package/dist/plugin-web-extension/feature-manifest/steps/warn-content-script-host-access.d.ts +17 -0
  147. package/dist/plugin-web-extension/feature-manifest/steps/warn-description-length.d.ts +26 -0
  148. package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +37 -2
  149. package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +3 -0
  150. package/dist/plugin-web-extension/feature-scripts/index.d.ts +1 -0
  151. package/dist/plugin-web-extension/feature-scripts/messages.d.ts +10 -1
  152. package/dist/plugin-web-extension/feature-scripts/scripts-lib/completion-value.d.ts +13 -0
  153. package/dist/plugin-web-extension/feature-scripts/scripts-lib/injected-sheet-urls.d.ts +5 -0
  154. package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-bridge-pairing.d.ts +5 -0
  155. package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-copy-routing.d.ts +2 -0
  156. package/dist/plugin-web-extension/feature-scripts/scripts-lib/registration-worlds.d.ts +10 -0
  157. package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-main-world-scripts.d.ts +25 -2
  158. package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-script-sheet.d.ts +14 -0
  159. package/dist/plugin-web-extension/feature-scripts/scripts-lib/taken-extension-base.d.ts +10 -0
  160. package/dist/plugin-web-extension/feature-scripts/steps/add-base-uri-runtime-module.d.ts +7 -1
  161. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +2 -0
  162. package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +2 -0
  163. package/dist/plugin-web-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +6 -0
  164. package/dist/plugin-web-extension/feature-scripts/steps/classic-traced-globals-loader.d.ts +1 -0
  165. package/dist/plugin-web-extension/feature-scripts/steps/compile-main-world-scripts.d.ts +4 -0
  166. package/dist/plugin-web-extension/feature-scripts/steps/keep-completion-value.d.ts +6 -0
  167. package/dist/plugin-web-extension/feature-scripts/steps/pair-runtime-main-world-bridges.d.ts +12 -0
  168. package/dist/plugin-web-extension/feature-scripts/steps/place-runtime-script-sheets.d.ts +12 -0
  169. package/dist/plugin-web-extension/feature-scripts/steps/prune-main-world-bridges.d.ts +1 -0
  170. package/dist/plugin-web-extension/feature-scripts/steps/root-injected-sheet-urls.d.ts +9 -0
  171. package/dist/plugin-web-extension/feature-scripts/steps/route-main-world-copies.d.ts +10 -0
  172. package/dist/plugin-web-extension/feature-scripts/steps/source-literals.d.ts +24 -0
  173. package/dist/plugin-web-extension/feature-scripts/steps/take-extension-base.d.ts +11 -0
  174. package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +18 -3
  175. package/dist/plugin-web-extension/feature-scripts/steps/warn-main-world-registration-changed.d.ts +12 -0
  176. package/dist/plugin-web-extension/feature-scripts/steps/warn-moved-page-relative-urls.d.ts +30 -0
  177. package/dist/plugin-web-extension/feature-scripts/steps/warn-page-relative-script-path.d.ts +10 -0
  178. package/dist/plugin-web-extension/feature-scripts/steps/warn-unknown-registration-world.d.ts +10 -0
  179. package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
  180. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +2 -0
  181. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/page-requests.d.ts +5 -0
  182. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/resolve-war.d.ts +1 -0
  183. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts +1 -0
  184. package/dist/plugin-web-extension/shared/script-graph.d.ts +12 -0
  185. package/dist/preprocessor-passthrough-loader.mjs +1 -1
  186. package/dist/preview.mjs +1 -1
  187. package/dist/public-css-url-loader.mjs +1 -1
  188. package/dist/{331~0.mjs → q~0.mjs} +2 -2
  189. package/dist/rj~0.mjs +125 -0
  190. package/dist/{519~0.mjs → rl~0.mjs} +56 -5
  191. package/dist/rspack-config~0.mjs +3140 -3302
  192. package/dist/{177~0.mjs → r~0.mjs} +2 -2
  193. package/dist/sfc-style-block-loader.mjs +49 -0
  194. package/dist/stats-handler~0.mjs +15 -7
  195. package/dist/tm~0.mjs +71 -0
  196. package/dist/types.d.ts +46 -5
  197. package/dist/{285~0.mjs → t~0.mjs} +41 -26
  198. package/dist/unplaced-style-import-loader.mjs +131 -0
  199. package/dist/x~0.mjs +3 -0
  200. package/dist/y~0.mjs +234 -0
  201. package/dist/zip~0.mjs +5 -4
  202. package/dist/{363~0.mjs → z~0.mjs} +563 -281
  203. package/package.json +6 -6
  204. package/dist/527~0.mjs +0 -3
  205. package/dist/840~0.mjs +0 -5635
  206. /package/dist/{895~0.mjs → 3~0.mjs} +0 -0
  207. /package/dist/{374~0.mjs → 5~0.mjs} +0 -0
  208. /package/dist/{206~0.mjs → 6~0.mjs} +0 -0
  209. /package/dist/{471~0.mjs → g~0.mjs} +0 -0
  210. /package/dist/{117~0.mjs → w~0.mjs} +0 -0
@@ -1 +1 @@
1
- export declare const SCRIPTS_REPLAY_SHIM_SOURCE = ";(function () {\n try {\n if (typeof globalThis !== \"object\" || !globalThis) return;\n var chromeRef =\n (globalThis.chrome && globalThis.chrome.scripting && typeof globalThis.chrome.scripting.executeScript === \"function\")\n ? globalThis.chrome\n : (globalThis.browser && globalThis.browser.scripting && typeof globalThis.browser.scripting.executeScript === \"function\")\n ? globalThis.browser\n : null;\n if (!chromeRef) return;\n if (globalThis.__extjsScriptsReplayInstalled) return;\n globalThis.__extjsScriptsReplayInstalled = true;\n\n var MAX_TABS = 50;\n var MAX_ENTRIES_PER_TAB = 50;\n var registry = new Map();\n var originalExecuteScript = chromeRef.scripting.executeScript.bind(chromeRef.scripting);\n var tabsApi = chromeRef.tabs && typeof chromeRef.tabs.get === \"function\" ? chromeRef.tabs : null;\n\n var serialize = function (entry) {\n try {\n return JSON.stringify({\n files: entry && Array.isArray(entry.files) ? entry.files : [],\n world: entry && entry.world ? String(entry.world) : \"\"\n });\n } catch (error) {\n return \"\";\n }\n };\n\n var pageKey = function (url) {\n if (typeof url !== \"string\" || !url) return \"\";\n try {\n var parsed = new URL(url);\n return parsed.origin + parsed.pathname;\n } catch (error) {\n return url;\n }\n };\n\n // Resolves to the page the tab shows now, \"\" when the url is not visible\n // to the extension, and null once the tab is gone.\n var currentPage = function (tabId) {\n if (!tabsApi) return Promise.resolve(\"\");\n try {\n var lookup = tabsApi.get(tabId);\n if (!lookup || typeof lookup.then !== \"function\") return Promise.resolve(\"\");\n return lookup.then(\n function (tab) { return tab ? pageKey(tab.url) : null; },\n function () { return null; }\n );\n } catch (error) {\n return Promise.resolve(\"\");\n }\n };\n\n var remember = function (tabId, entry) {\n var entries = (registry.get(tabId) || []).filter(function (e) { return e.sig !== entry.sig; });\n entries.push(entry);\n registry.delete(tabId);\n registry.set(tabId, entries.slice(-MAX_ENTRIES_PER_TAB));\n while (registry.size > MAX_TABS) {\n registry.delete(registry.keys().next().value);\n }\n };\n\n var track = function (injection) {\n try {\n var tabId = injection && injection.target && injection.target.tabId;\n var files =\n injection && Array.isArray(injection.files) ? injection.files.slice() : null;\n if (typeof tabId !== \"number\") return;\n if (!files || !files.length) return;\n var world = injection.world ? String(injection.world) : undefined;\n var entry = { files: files, world: world, sig: serialize({ files: files, world: world }), page: \"\" };\n remember(tabId, entry);\n currentPage(tabId).then(function (page) {\n entry.page = page || \"\";\n }, function () {});\n } catch (error) {\n // Ignore\n }\n };\n\n chromeRef.scripting.executeScript = function (injection, callback) {\n track(injection);\n return originalExecuteScript(injection, callback);\n };\n\n try {\n if (chromeRef.tabs && chromeRef.tabs.onRemoved && typeof chromeRef.tabs.onRemoved.addListener === \"function\") {\n chromeRef.tabs.onRemoved.addListener(function (tabId) {\n registry.delete(tabId);\n });\n }\n } catch (error) {\n // Ignore\n }\n\n var normalizeFile = function (value) {\n return String(value || \"\").replace(/^[/\\\\]+/, \"\");\n };\n\n var fileMatches = function (entryFile, changedNormalized) {\n var fn = normalizeFile(entryFile);\n for (var i = 0; i < changedNormalized.length; i++) {\n var c = changedNormalized[i];\n if (!c) continue;\n if (fn === c) return true;\n if (fn.length > c.length && fn.slice(fn.length - c.length - 1) === \"/\" + c) return true;\n if (c.length > fn.length && c.slice(c.length - fn.length - 1) === \"/\" + fn) return true;\n }\n return false;\n };\n\n var entryMatches = function (entry, changedNormalized) {\n for (var i = 0; i < entry.files.length; i++) {\n if (fileMatches(entry.files[i], changedNormalized)) return true;\n }\n return false;\n };\n\n var replayEntry = function (tabId, entry) {\n try {\n return Promise.resolve(\n originalExecuteScript({\n target: { tabId: tabId },\n files: entry.files,\n world: entry.world\n })\n ).then(\n function () { return { ok: true, tabId: tabId, files: entry.files }; },\n function (error) {\n return {\n ok: false,\n tabId: tabId,\n files: entry.files,\n error: String((error && error.message) || error)\n };\n }\n );\n } catch (error) {\n return Promise.resolve(null);\n }\n };\n\n var replayTab = function (tabId, changedNormalized) {\n return currentPage(tabId).then(function (page) {\n if (page === null) {\n registry.delete(tabId);\n return [];\n }\n // An entry recorded on another page belongs to a document this tab\n // no longer shows, so it is dropped instead of injected into the new one.\n var live = (registry.get(tabId) || []).filter(function (entry) {\n return !(page && entry.page && entry.page !== page);\n });\n if (!live.length) {\n registry.delete(tabId);\n return [];\n }\n registry.set(tabId, live);\n return Promise.all(\n live\n .filter(function (entry) { return entryMatches(entry, changedNormalized); })\n .map(function (entry) { return replayEntry(tabId, entry); })\n );\n }, function () { return []; });\n };\n\n globalThis.__extjsScriptsReplay = function (changedFiles) {\n var changedNormalized = (Array.isArray(changedFiles) ? changedFiles : []).map(normalizeFile);\n var tabReplays = [];\n registry.forEach(function (entries, tabId) {\n if (!entries.some(function (entry) { return entryMatches(entry, changedNormalized); })) return;\n tabReplays.push(replayTab(tabId, changedNormalized));\n });\n return Promise.all(tabReplays).then(function (perTab) {\n var outcomes = [];\n perTab.forEach(function (results) {\n results.forEach(function (result) {\n if (result) outcomes.push(result);\n });\n });\n return outcomes;\n });\n };\n } catch (error) {\n // Best-effort shim; do not break the SW bootstrap on any failure.\n }\n})();\n";
1
+ export declare const SCRIPTS_REPLAY_SHIM_SOURCE = ";(function () {\n try {\n if (typeof globalThis !== \"object\" || !globalThis) return;\n var injects = function (root) {\n return !!root && !!root.scripting && typeof root.scripting.executeScript === \"function\";\n };\n var chromeRef = injects(globalThis.chrome) ? globalThis.chrome : injects(globalThis.browser) ? globalThis.browser : null;\n if (!chromeRef) return;\n // The author may inject through either namespace, and one of them can\n // answer a callback only. The replay asks the one that hands a promise back.\n var replayRef = injects(globalThis.browser) ? globalThis.browser : chromeRef;\n if (globalThis.__extjsScriptsReplayInstalled) return;\n globalThis.__extjsScriptsReplayInstalled = true;\n\n var MAX_TABS = 50;\n var MAX_ENTRIES_PER_TAB = 50;\n var registry = new Map();\n var originalExecuteScript = replayRef.scripting.executeScript.bind(replayRef.scripting);\n var tabsApi = replayRef.tabs && typeof replayRef.tabs.get === \"function\" ? replayRef.tabs : null;\n\n var serialize = function (entry) {\n try {\n return JSON.stringify({\n files: entry && Array.isArray(entry.files) ? entry.files : [],\n world: entry && entry.world ? String(entry.world) : \"\"\n });\n } catch (error) {\n return \"\";\n }\n };\n\n var pageKey = function (url) {\n if (typeof url !== \"string\" || !url) return \"\";\n try {\n var parsed = new URL(url);\n return parsed.origin + parsed.pathname;\n } catch (error) {\n return url;\n }\n };\n\n // Resolves to the page the tab shows now, \"\" when the url is not visible\n // to the extension, and null once the tab is gone.\n var currentPage = function (tabId) {\n if (!tabsApi) return Promise.resolve(\"\");\n try {\n var lookup = tabsApi.get(tabId);\n if (!lookup || typeof lookup.then !== \"function\") return Promise.resolve(\"\");\n return lookup.then(\n function (tab) { return tab ? pageKey(tab.url) : null; },\n function () { return null; }\n );\n } catch (error) {\n return Promise.resolve(\"\");\n }\n };\n\n var remember = function (tabId, entry) {\n var entries = (registry.get(tabId) || []).filter(function (e) { return e.sig !== entry.sig; });\n entries.push(entry);\n registry.delete(tabId);\n registry.set(tabId, entries.slice(-MAX_ENTRIES_PER_TAB));\n while (registry.size > MAX_TABS) {\n registry.delete(registry.keys().next().value);\n }\n };\n\n var track = function (injection) {\n try {\n var tabId = injection && injection.target && injection.target.tabId;\n var files =\n injection && Array.isArray(injection.files) ? injection.files.slice() : null;\n if (typeof tabId !== \"number\") return;\n if (!files || !files.length) return;\n var world = injection.world ? String(injection.world) : undefined;\n var entry = { files: files, world: world, sig: serialize({ files: files, world: world }), page: \"\" };\n remember(tabId, entry);\n currentPage(tabId).then(function (page) {\n entry.page = page || \"\";\n }, function () {});\n } catch (error) {\n // Ignore\n }\n };\n\n var tracked = [];\n var trackCalls = function (root) {\n if (!injects(root) || tracked.indexOf(root.scripting) !== -1) return;\n var scripting = root.scripting;\n var native = scripting.executeScript.bind(scripting);\n scripting.executeScript = function (injection) {\n track(injection);\n return native.apply(null, arguments);\n };\n tracked.push(scripting);\n };\n trackCalls(globalThis.chrome);\n trackCalls(globalThis.browser);\n\n try {\n if (chromeRef.tabs && chromeRef.tabs.onRemoved && typeof chromeRef.tabs.onRemoved.addListener === \"function\") {\n chromeRef.tabs.onRemoved.addListener(function (tabId) {\n registry.delete(tabId);\n });\n }\n } catch (error) {\n // Ignore\n }\n\n var normalizeFile = function (value) {\n return String(value || \"\").replace(/^[/\\\\]+/, \"\");\n };\n\n var fileMatches = function (entryFile, changedNormalized) {\n var fn = normalizeFile(entryFile);\n for (var i = 0; i < changedNormalized.length; i++) {\n var c = changedNormalized[i];\n if (!c) continue;\n if (fn === c) return true;\n if (fn.length > c.length && fn.slice(fn.length - c.length - 1) === \"/\" + c) return true;\n if (c.length > fn.length && c.slice(c.length - fn.length - 1) === \"/\" + fn) return true;\n }\n return false;\n };\n\n var entryMatches = function (entry, changedNormalized) {\n for (var i = 0; i < entry.files.length; i++) {\n if (fileMatches(entry.files[i], changedNormalized)) return true;\n }\n return false;\n };\n\n var replayEntry = function (tabId, entry) {\n try {\n return Promise.resolve(\n originalExecuteScript({\n target: { tabId: tabId },\n files: entry.files,\n world: entry.world\n })\n ).then(\n function () { return { ok: true, tabId: tabId, files: entry.files }; },\n function (error) {\n return {\n ok: false,\n tabId: tabId,\n files: entry.files,\n error: String((error && error.message) || error)\n };\n }\n );\n } catch (error) {\n return Promise.resolve(null);\n }\n };\n\n var replayTab = function (tabId, changedNormalized) {\n return currentPage(tabId).then(function (page) {\n if (page === null) {\n registry.delete(tabId);\n return [];\n }\n // An entry recorded on another page belongs to a document this tab\n // no longer shows, so it is dropped instead of injected into the new one.\n var live = (registry.get(tabId) || []).filter(function (entry) {\n return !(page && entry.page && entry.page !== page);\n });\n if (!live.length) {\n registry.delete(tabId);\n return [];\n }\n registry.set(tabId, live);\n return Promise.all(\n live\n .filter(function (entry) { return entryMatches(entry, changedNormalized); })\n .map(function (entry) { return replayEntry(tabId, entry); })\n );\n }, function () { return []; });\n };\n\n globalThis.__extjsScriptsReplay = function (changedFiles) {\n var changedNormalized = (Array.isArray(changedFiles) ? changedFiles : []).map(normalizeFile);\n var tabReplays = [];\n registry.forEach(function (entries, tabId) {\n if (!entries.some(function (entry) { return entryMatches(entry, changedNormalized); })) return;\n tabReplays.push(replayTab(tabId, changedNormalized));\n });\n return Promise.all(tabReplays).then(function (perTab) {\n var outcomes = [];\n perTab.forEach(function (results) {\n results.forEach(function (result) {\n if (result) outcomes.push(result);\n });\n });\n return outcomes;\n });\n };\n } catch (error) {\n // Best-effort shim; do not break the SW bootstrap on any failure.\n }\n})();\n";
@@ -1,4 +1,10 @@
1
1
  import { type Compiler } from '@rspack/core';
2
+ import { type EmittedCompilation, type EmittedModule } from '../../plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/emitted-evidence.js';
3
+ export declare function readDevBuild(compilation: object | undefined): string;
4
+ export declare function readBootRegistrations(compilation: object | undefined): boolean;
5
+ export declare function backgroundNamesRegistration(compilation: EmittedCompilation & {
6
+ modules?: Iterable<EmittedModule>;
7
+ }): boolean;
2
8
  export declare class InjectBridgeProducer {
3
9
  apply(compiler: Compiler): void;
4
10
  }
@@ -3,6 +3,9 @@ export default class WebExtensionChuckLoaderRuntimePlugin {
3
3
  private readonly options;
4
4
  private readonly contentScriptsMeta;
5
5
  private rspackAutoPublicPath;
6
+ private readonly gecko;
7
+ private readonly baseAttribute;
8
+ private readonly baseScheme;
6
9
  constructor(options: any);
7
10
  apply(compiler: any): void;
8
11
  tap(compiler: any, compilation: any): void;
@@ -1,2 +1,2 @@
1
1
  import type * as webpack from 'webpack';
2
- export default function AutoPublicPathRuntimeModule(webpack: typeof import('webpack')): webpack.RuntimeModule;
2
+ export default function AutoPublicPathRuntimeModule(webpack: typeof import('webpack'), gecko?: boolean, attribute?: string, scheme?: string): webpack.RuntimeModule;
@@ -1,2 +1,2 @@
1
1
  import type * as webpack from 'webpack';
2
- export default function BaseUriRuntimeModule(webpack: typeof import('webpack')): webpack.RuntimeModule;
2
+ export default function BaseUriRuntimeModule(webpack: typeof import('webpack'), gecko?: boolean, attribute?: string, scheme?: string): webpack.RuntimeModule;
@@ -1,4 +1,4 @@
1
1
  export default function LoadScriptRuntimeModule(webpack: typeof import('webpack'), supportDynamicImport: boolean | undefined, classicLoaderEnabled: boolean | undefined, contentScriptsMeta?: Record<string, {
2
2
  world?: 'main' | 'extension';
3
3
  bridgeBundleId?: string;
4
- }>): import('webpack').RuntimeModule;
4
+ }>, gecko?: boolean): import('webpack').RuntimeModule;
@@ -1,2 +1,2 @@
1
1
  import type * as webpack from 'webpack';
2
- export default function PublicPathRuntimeModule(webpack: typeof import('webpack')): webpack.RuntimeModule;
2
+ export default function PublicPathRuntimeModule(webpack: typeof import('webpack'), gecko?: boolean, attribute?: string, scheme?: string): webpack.RuntimeModule;
@@ -4,6 +4,8 @@ import type { FilepathList, SpecialFoldersConfig } from '../types.js';
4
4
  import type { CompanionExtensionsConfig } from './folder-extensions/types.js';
5
5
  import { rememberSpecialFoldersConfig } from './folders-config.js';
6
6
  export { rememberSpecialFoldersConfig };
7
+ export declare function collectReferenceCorpus(projectRoot: string): string;
8
+ export declare function referenceSpellings(relativePath: string): string[];
7
9
  export type CompileMode = 'development' | 'production' | 'none';
8
10
  export declare function getSpecialFoldersDataForCompiler(compiler: Compiler): SpecialFoldersData;
9
11
  export declare function getSpecialFoldersDataForProjectRoot(projectRoot: string, folders?: SpecialFoldersConfig, mode?: CompileMode): SpecialFoldersData;
@@ -0,0 +1,4 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ export declare class HintImportOnlyScripts {
3
+ apply(compiler: Compiler): void;
4
+ }
@@ -9,6 +9,7 @@ type Verdict = {
9
9
  output: string;
10
10
  source: string;
11
11
  isDir: boolean;
12
+ minify: boolean;
12
13
  } | {
13
14
  kind: 'invalid';
14
15
  output: string;
@@ -18,6 +19,7 @@ type Verdict = {
18
19
  output: string;
19
20
  source: string;
20
21
  };
22
+ export declare function minifyIncludedScript(input: Buffer, absoluteFilename: string): Promise<Buffer>;
21
23
  export declare function judgeIncludeFiles(include: IncludeFilesConfig | undefined, projectRoot: string): Verdict[];
22
24
  export declare class IncludeFiles {
23
25
  static readonly name: string;
@@ -13,3 +13,4 @@ export declare function excludeEntryMissing(entry: string, browser: string): str
13
13
  export declare function manifestNamesExcludedFile(relativePath: string, browser: string): string;
14
14
  export declare function includeSourceMissing(outputPath: string, sourcePath: string, projectRoot: string): string;
15
15
  export declare function includeOutputPathInvalid(outputPath: string, reason: string): string;
16
+ export declare function scriptsEntriesOnlyImported(relativePaths: string[], folder: string): string;
@@ -10,7 +10,7 @@ export declare function createScriptTag(src: string, firstScriptAttrs?: Array<{
10
10
  name: string;
11
11
  value: string;
12
12
  }>): ReturnType<typeof parse5utilities.createNode>;
13
- export declare function injectJsScript(bodyNode: Parameters<typeof parse5utilities.append>[0], feature: string, firstScriptAttrs?: Array<{
13
+ export declare function injectJsScript(bodyNode: Parameters<typeof parse5utilities.append>[0], entryScript: string, firstScriptAttrs?: Array<{
14
14
  name: string;
15
15
  value: string;
16
16
  }>, siblingScripts?: string[]): void;
@@ -2,5 +2,6 @@ import { type Compilation } from '@rspack/core';
2
2
  import type { FilepathList } from '../../../types.js';
3
3
  export declare function patchHtml(compilation: Compilation, feature: string, htmlEntry: string, includeList: FilepathList, manifestDir?: string, siblingScripts?: string[], html?: string, options?: {
4
4
  optionsDialogFloor?: boolean;
5
+ entryScript?: string;
5
6
  }): string;
6
7
  export declare function patchHtmlNested(compilation: Compilation, htmlEntry: string, manifestDir?: string): string;
@@ -1,6 +1,7 @@
1
1
  import { Compilation, type Compiler } from '@rspack/core';
2
2
  import type { FilepathList, PluginInterface } from '../../../types.js';
3
3
  export declare function siblingScriptsFor(compilation: Compilation, feature: string): string[];
4
+ export declare function entryScriptFor(compilation: Compilation, feature: string): string | undefined;
4
5
  export declare class UpdateHtmlFile {
5
6
  readonly manifestPath: string;
6
7
  readonly includeList?: FilepathList;
@@ -1,2 +1,3 @@
1
1
  import type { DevOptions, FilepathList } from '../../types.js';
2
+ export declare function resolveManifestIconPath(context: string, relativePath: string, projectPath?: string): string;
2
3
  export declare function extractActionThemeIcons(manifestPath: string, browser?: DevOptions['browser'], projectPath?: string): FilepathList;
@@ -0,0 +1,2 @@
1
+ import type { DevOptions, FilepathList } from '../../types.js';
2
+ export declare function extractIconVariants(manifestPath: string, browser?: DevOptions['browser'], projectPath?: string): FilepathList;
@@ -1,4 +1,5 @@
1
1
  import { type Compilation } from '@rspack/core';
2
2
  export declare function isManagedSchemaFeature(feature: string): boolean;
3
3
  export declare function isCriticalJsonFeature(feature: string): boolean;
4
- export declare function validateJsonAsset(compilation: Compilation, feature: string, filePath: string, buf: Buffer): boolean;
4
+ export declare function re2UnsupportedConstruct(filter: string): string | undefined;
5
+ export declare function validateJsonAsset(compilation: Compilation, feature: string, filePath: string, buf: Buffer, browser?: string): boolean;
@@ -10,6 +10,8 @@ export declare function invalidJsonSyntax(manifestField: string, file: string, c
10
10
  export declare function invalidRulesetStructure(manifestField: string, file: string): string;
11
11
  export declare function invalidRulesetRule(manifestField: string, file: string, ruleIndex: number, reason: string): string;
12
12
  export declare function rulesetRuleShapeIssue(manifestField: string, file: string, ruleIndex: number, reason: string): string;
13
+ export declare function rulesetDuplicateRuleIds(manifestField: string, file: string, ids: readonly number[]): string;
14
+ export declare function rulesetRegexChromeCannotCompile(manifestField: string, file: string, ids: readonly number[], construct: string): string;
13
15
  export declare function invalidManagedSchemaStructure(manifestField: string, file: string): string;
14
16
  export declare function jsonEmitSummary(feature: string, stats: {
15
17
  entries: number;
@@ -1,2 +1,2 @@
1
1
  import { type Compilation } from '@rspack/core';
2
- export declare function processJsonAssets(compilation: Compilation, manifestPath: string, includeList: Record<string, string | string[] | undefined>): void;
2
+ export declare function processJsonAssets(compilation: Compilation, manifestPath: string, includeList: Record<string, string | string[] | undefined>, browser?: string): void;
@@ -0,0 +1,21 @@
1
+ import type { DevOptions, Manifest } from '../../../types.js';
2
+ export declare const GECKO_UNSUPPORTED_PERMISSIONS: ReadonlySet<string>;
3
+ export interface GeckoDroppedKey {
4
+ path: string;
5
+ reason: string;
6
+ }
7
+ export interface GeckoReinterpretedKey {
8
+ path: string;
9
+ declared: string;
10
+ effective: string;
11
+ }
12
+ export declare function dropGeckoUnsupportedKeys(manifest: Manifest, browser: DevOptions['browser']): {
13
+ manifest: Manifest;
14
+ dropped: GeckoDroppedKey[];
15
+ reinterpreted: GeckoReinterpretedKey[];
16
+ };
17
+ export declare function reportGeckoUnsupportedKeys(found: {
18
+ dropped: GeckoDroppedKey[];
19
+ reinterpreted: GeckoReinterpretedKey[];
20
+ }, browser: DevOptions['browser']): void;
21
+ export declare function resetGeckoKeyNotices(): void;
@@ -1,9 +1,9 @@
1
1
  import type { DevOptions, Manifest } from '../../../types.js';
2
+ export { WEBKIT_UNSUPPORTED_PERMISSIONS as UNSUPPORTED_PERMISSIONS, type WebkitDroppedPage, type WebkitUnsupportedKey, webkitDroppedSurfacePages, webkitUnsupportedManifestKeys, webkitUnsupportedPermissions } from './webkit-unsupported-keys.js';
2
3
  export interface WebkitDroppedKey {
3
4
  path: string;
4
5
  reason: string;
5
6
  }
6
- export declare const UNSUPPORTED_PERMISSIONS: ReadonlySet<string>;
7
7
  export declare function isWebkitUnsupportedPermission(permission: string, browser?: string): boolean;
8
8
  export declare function dropWebkitUnsupportedKeys(manifest: Manifest, browser: DevOptions['browser']): {
9
9
  manifest: Manifest;
@@ -0,0 +1,15 @@
1
+ import type { DevOptions, Manifest } from '../../../types.js';
2
+ export type IconVariantsReader = 'gecko' | 'chromium' | 'webkit';
3
+ export type IconVariantsOutcome = 'kept' | 'added' | 'missing';
4
+ export interface IconVariantsVerdict {
5
+ key: string;
6
+ outcome: IconVariantsOutcome;
7
+ }
8
+ export declare function ignoresIconVariants(browser: DevOptions['browser']): IconVariantsReader | undefined;
9
+ export declare function iconsFromVariants(variants: unknown, reader: IconVariantsReader): Record<string, string> | undefined;
10
+ export declare function applyIconVariantsFallback(manifest: Manifest, browser: DevOptions['browser']): {
11
+ manifest: Manifest;
12
+ verdicts: IconVariantsVerdict[];
13
+ };
14
+ export declare function reportIconVariantsFallback(verdicts: IconVariantsVerdict[], browser: DevOptions['browser']): void;
15
+ export declare function resetIconVariantsNotice(): void;
@@ -2,6 +2,7 @@ import type { Manifest } from '../../../types.js';
2
2
  export interface FatalShapeFix {
3
3
  field: string;
4
4
  detail: string;
5
+ refusedBy?: string;
5
6
  }
6
7
  export interface MistypedManifestField {
7
8
  field: string;
@@ -9,7 +10,7 @@ export interface MistypedManifestField {
9
10
  received: string;
10
11
  }
11
12
  export declare function findMistypedManifestFields(manifest: Manifest): MistypedManifestField[];
12
- export declare function sanitizeFatalManifestShapes(manifest: Manifest, manifestDir?: string): {
13
+ export declare function sanitizeFatalManifestShapes(manifest: Manifest, manifestDir?: string, browser?: string): {
13
14
  manifest: Manifest;
14
15
  fixes: FatalShapeFix[];
15
16
  };
@@ -0,0 +1,15 @@
1
+ export interface WebkitUnsupportedKey {
2
+ key: string;
3
+ reason: string;
4
+ }
5
+ export declare const WEBKIT_UNSUPPORTED_TOP_LEVEL_KEYS: Readonly<Record<string, string>>;
6
+ export declare const WEBKIT_UNSUPPORTED_PERMISSIONS: ReadonlySet<string>;
7
+ export declare const WEBKIT_UNSUPPORTED_OPTIONS_UI_KEYS: Readonly<Record<string, string>>;
8
+ export declare function webkitUnsupportedManifestKeys(): WebkitUnsupportedKey[];
9
+ export declare function webkitUnsupportedPermissions(): string[];
10
+ export interface WebkitDroppedPage {
11
+ path: string;
12
+ key: string;
13
+ reason: string;
14
+ }
15
+ export declare function webkitDroppedSurfacePages(manifest: Record<string, unknown> | undefined): WebkitDroppedPage[];
@@ -21,7 +21,7 @@ export declare function contentScripts(manifest: Manifest, manifestPath?: string
21
21
  match_about_blank?: boolean | undefined;
22
22
  include_globs?: string[] | undefined;
23
23
  exclude_globs?: string[] | undefined;
24
- world?: "ISOLATED" | "MAIN" | undefined;
24
+ world?: 'ISOLATED' | 'MAIN' | undefined;
25
25
  }[];
26
26
  } | {
27
27
  content_scripts: Record<string, unknown>[];
@@ -1,6 +1,7 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export declare function icons(manifest: Manifest): {
3
- icons: {
3
+ icons?: {
4
4
  [k: string]: string;
5
- };
5
+ } | undefined;
6
+ icon_variants?: unknown;
6
7
  } | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export declare function omnibox(manifest: Manifest): {
3
3
  omnibox: {
4
- default_icon?: string | Record<string, string>;
5
4
  keyword: string;
5
+ default_icon?: string | Record<string, string>;
6
6
  };
7
7
  } | undefined;
@@ -1,8 +1,9 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export declare function pageAction(manifest: Manifest, manifestPath?: string, projectPath?: string): {
3
3
  page_action: {
4
- default_icon?: string | chrome.runtime.ManifestIcons | undefined;
4
+ default_icon?: string | import("../../../../lib/manifest-types.js").ManifestIcons | undefined;
5
5
  default_title?: string | undefined;
6
6
  default_popup?: string | undefined;
7
+ icon_variants?: unknown;
7
8
  };
8
9
  } | undefined;
@@ -1,4 +1,4 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export declare function permissions(manifest: Manifest): {
3
- permissions: string[] & chrome.runtime.ManifestPermission[];
3
+ permissions: string[] & import("../../../../lib/manifest-types.js").ManifestPermission[];
4
4
  } | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export declare function sandbox(manifest: Manifest, manifestPath?: string, projectPath?: string): {
3
3
  sandbox: {
4
- pages: string[];
5
4
  content_security_policy?: string | undefined;
5
+ pages: string[];
6
6
  };
7
7
  } | undefined;
@@ -1,12 +1,13 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export declare function browserAction(manifest: Manifest, manifestPath?: string, projectPath?: string): {
3
3
  browser_action: {
4
+ default_icon?: string | import("../../../../lib/manifest-types.js").ManifestIcons | undefined;
5
+ default_title?: string | undefined;
6
+ default_popup?: string | undefined;
7
+ icon_variants?: unknown;
4
8
  theme_icons?: {
5
9
  light: string;
6
10
  dark: string;
7
11
  }[] | undefined;
8
- default_icon?: string | chrome.runtime.ManifestIcons | undefined;
9
- default_title?: string | undefined;
10
- default_popup?: string | undefined;
11
12
  };
12
13
  } | undefined;
@@ -1,9 +1,10 @@
1
1
  import type { Manifest, ThemeIcon } from '../../../../types.js';
2
2
  export declare function action(manifest: Manifest, manifestPath?: string, projectPath?: string): {
3
3
  action: {
4
- theme_icons?: ThemeIcon[];
5
- default_icon?: string | chrome.runtime.ManifestIcons | undefined;
4
+ default_icon?: string | import("../../../../lib/manifest-types.js").ManifestIcons | undefined;
6
5
  default_title?: string | undefined;
7
6
  default_popup?: string | undefined;
7
+ icon_variants?: unknown;
8
+ theme_icons?: ThemeIcon[];
8
9
  };
9
10
  } | undefined;
@@ -1,7 +1,7 @@
1
1
  export declare function serverRestartRequiredFromManifestError(fileAdded: string, fileRemoved: string): string;
2
2
  export declare function manifestFilesInTurnedOffPublic(files: string[]): string;
3
3
  export declare function legacyManifestPathWarning(field: string, legacyPath: string, modernPath: string): string;
4
- export declare function fatalManifestShapeFixed(field: string, detail: string): string;
4
+ export declare function fatalManifestShapeFixed(field: string, detail: string, refusedBy?: string): string;
5
5
  export declare function manifestFieldMistyped(field: string, expected: string, received: string): string;
6
6
  export declare function invalidThemeValue(field: string, detail: string, value: string): string;
7
7
  export declare function themeNotSupportedByBrowser(browser: string): string;
@@ -22,6 +22,7 @@ export declare function mv3BrowserActionFoldedIntoAction(browser: string): strin
22
22
  export declare function mv2ActionFoldedIntoBrowserAction(browser: string): string;
23
23
  export declare function sidebarKeyTranslatedForBrowser(browser: string, from: string, to: string): string;
24
24
  export declare function mv3BackgroundPageUnsupported(browser: string): string;
25
+ export declare function geckoEmptyBackgroundScriptsDropped(browser: string, keepsBackground?: boolean): string;
25
26
  export declare function geckoSidePanelUnsupported(file: string): string;
26
27
  export declare function safariSidePanelUnsupported(file: string): string;
27
28
  export declare function safariOffscreenUnsupported(file: string): string;
@@ -37,10 +38,23 @@ export declare function safariDownloadsUnsupported(file: string): string;
37
38
  export declare function safariIdleUnsupported(file: string): string;
38
39
  export declare const safariMissingMemberDetails: Record<string, string>;
39
40
  export declare function safariMemberUnsupported(file: string, api: string, member: string, kind: 'call' | 'read'): string;
41
+ export declare function geckoCallbackFormUnsupported(file: string, api: string, member: string): string;
40
42
  export declare function geckoActionUnsupportedOnMv2(file: string): string;
41
43
  export declare function contentScriptEntryDroppedForBrowser(index: number, browser: string, prefixedKeys: string[]): string;
42
44
  export declare function edgeEmbeddedOptionsDialog(): string;
45
+ export declare function iconVariantsFallback(reader: 'gecko' | 'chromium' | 'webkit', verdicts: Array<{
46
+ key: string;
47
+ outcome: 'kept' | 'added' | 'missing';
48
+ }>): string;
43
49
  export declare function webkitUnsupportedKeysDropped(browser: string, dropped: Array<{
44
50
  path: string;
45
51
  reason: string;
46
52
  }>): string;
53
+ export declare function geckoUnsupportedKeysDropped(browser: string, dropped: Array<{
54
+ path: string;
55
+ reason: string;
56
+ }>): string;
57
+ export declare function geckoIncognitoSplitNotAllowed(browser: string): string;
58
+ export declare function manifestDescriptionOverStoreLimit(browser: string, length: number, limit: number, store: string): string;
59
+ export declare function contentScriptMatchesGrantNoHostOnChromium(permissions: readonly string[], matches: readonly string[]): string;
60
+ export declare function manifestDescriptionMissingForStore(browser: string, store: string, limit: number): string;
@@ -3,5 +3,7 @@ export declare function manifestPageOutputTarget(raw: string, compiledTarget: st
3
3
  export declare function manifestJsonOutputTarget(raw: string, compiledTarget: string, manifestPath?: string, projectPath?: string): string;
4
4
  export declare function externalAssetOutputPath(normalized: string, root: string): string;
5
5
  export declare function iconOutputPath(raw: string): string;
6
+ export declare function iconVariantsOf(holder: unknown): unknown;
7
+ export declare function iconVariantsOutput(variants: unknown): unknown;
6
8
  export declare function themeIconOutputPath(raw: string, folder: 'action' | 'browser_action'): string;
7
9
  export declare function themeImageOutputPath(raw: string): string;
@@ -0,0 +1,8 @@
1
+ import type { DevAddition } from '../../../../lib/dev-additions.js';
2
+ interface ManifestGrants {
3
+ permissions?: unknown;
4
+ host_permissions?: unknown;
5
+ web_accessible_resources?: unknown;
6
+ }
7
+ export declare function listDevManifestAdditions(source: ManifestGrants, dev: ManifestGrants): DevAddition[];
8
+ export {};
@@ -6,7 +6,7 @@ export default function patchBackground(manifest: Manifest, browser: DevOptions[
6
6
  persistent?: boolean | undefined;
7
7
  } & {
8
8
  service_worker: string;
9
- type?: "module";
9
+ type?: 'module';
10
10
  }) | undefined;
11
11
  } | {
12
12
  background: {
@@ -14,6 +14,6 @@ export default function patchBackground(manifest: Manifest, browser: DevOptions[
14
14
  page?: string | undefined;
15
15
  persistent?: boolean | undefined;
16
16
  service_worker?: string | undefined;
17
- type?: "module";
17
+ type?: 'module';
18
18
  };
19
19
  };
@@ -1,9 +1,9 @@
1
1
  import type { Manifest } from '../../../../types.js';
2
2
  export default function patchExternallyConnectable(manifest: Manifest): {
3
3
  externally_connectable: {
4
- ids: string[];
5
4
  matches?: string[] | undefined;
6
5
  accepts_tls_channel_id?: boolean | undefined;
6
+ ids: string[];
7
7
  };
8
8
  } | {
9
9
  externally_connectable?: undefined;
@@ -1,2 +1,3 @@
1
1
  import type { DevOptions, Manifest } from '../../../types.js';
2
+ export declare function hasEmptyGeckoBackgroundScripts(manifest: Manifest, browser: DevOptions['browser']): boolean;
2
3
  export declare function patchGeckoBackground(manifest: Manifest, browser: DevOptions['browser']): Manifest;
@@ -0,0 +1,17 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { DevOptions } from '../../../types.js';
3
+ export declare const HOST_GATED_PERMISSIONS: readonly ['scripting', 'cookies', 'webRequest'];
4
+ export interface ContentScriptOnlyHostAccess {
5
+ matches: string[];
6
+ permissions: string[];
7
+ }
8
+ export declare function findContentScriptOnlyHostAccess(manifest: unknown, browser: string): ContentScriptOnlyHostAccess | null;
9
+ export declare class WarnContentScriptHostAccess {
10
+ static readonly name: string;
11
+ private readonly browser;
12
+ private reported;
13
+ constructor(options: {
14
+ browser: DevOptions['browser'];
15
+ });
16
+ apply(compiler: Compiler): void;
17
+ }
@@ -0,0 +1,26 @@
1
+ import { type Compiler } from '@rspack/core';
2
+ import type { DevOptions } from '../../../types.js';
3
+ export declare const APP_STORE_DESCRIPTION_LIMIT = 112;
4
+ export declare const CHROME_DESCRIPTION_LIMIT = 132;
5
+ export declare const AMO_DESCRIPTION_LIMIT = 250;
6
+ export interface DescriptionRule {
7
+ limit: number;
8
+ store: string;
9
+ required: boolean;
10
+ }
11
+ export interface DescriptionLimitHit {
12
+ kind: 'missing' | 'over';
13
+ length: number;
14
+ rule: DescriptionRule;
15
+ }
16
+ export declare function descriptionRuleFor(browser: string): DescriptionRule | null;
17
+ export declare function findDescriptionLimitHit(manifest: unknown, browser: string): DescriptionLimitHit | null;
18
+ export declare class WarnDescriptionLength {
19
+ static readonly name: string;
20
+ private readonly browser;
21
+ private reported;
22
+ constructor(options: {
23
+ browser: DevOptions['browser'];
24
+ });
25
+ apply(compiler: Compiler): void;
26
+ }
@@ -112,6 +112,41 @@ export declare const webkitUnsupportedMembers: readonly [{
112
112
  export type WebkitMemberApi = (typeof webkitUnsupportedMembers)[number]['api'];
113
113
  export type UnsupportedApiName = GeckoUnsupportedApi | WebkitMemberApi;
114
114
  export declare const webkitMissingApis: WebkitMissingApis;
115
+ export interface GeckoPromiseOnlyMethod {
116
+ api: 'action' | 'tabs';
117
+ member: string;
118
+ max: number;
119
+ soleCallback?: boolean;
120
+ }
121
+ export declare const geckoPromiseOnlyMethods: readonly [{
122
+ readonly api: 'action';
123
+ readonly member: 'setBadgeTextColor';
124
+ readonly max: 1;
125
+ }, {
126
+ readonly api: 'action';
127
+ readonly member: 'getBadgeTextColor';
128
+ readonly max: 1;
129
+ }, {
130
+ readonly api: 'action';
131
+ readonly member: 'isEnabled';
132
+ readonly max: 1;
133
+ readonly soleCallback: true;
134
+ }, {
135
+ readonly api: 'action';
136
+ readonly member: 'openPopup';
137
+ readonly max: 1;
138
+ readonly soleCallback: true;
139
+ }, {
140
+ readonly api: 'tabs';
141
+ readonly member: 'discard';
142
+ readonly max: 1;
143
+ }, {
144
+ readonly api: 'tabs';
145
+ readonly member: 'ungroup';
146
+ readonly max: 1;
147
+ }];
148
+ export declare function callArgumentsAt(text: string, open: number): string[] | undefined;
149
+ export declare function usesGeckoCallbackForm(source: string, entry: GeckoPromiseOnlyMethod): boolean;
115
150
  export type UnsupportedApiEngine = 'gecko' | 'webkit';
116
151
  export interface GeckoUnsupportedApiUse {
117
152
  api: UnsupportedApiName;
@@ -120,9 +155,9 @@ export interface GeckoUnsupportedApiUse {
120
155
  emitted: boolean;
121
156
  }
122
157
  export declare function geckoUnsupportedApis(manifestVersion: unknown, engine?: UnsupportedApiEngine): GeckoUnsupportedApi[];
123
- export declare function usesGeckoUnsupportedApi(source: string, api: GeckoUnsupportedApi, engine?: UnsupportedApiEngine, guarded?: Range[]): boolean;
158
+ export declare function usesGeckoUnsupportedApi(source: string, api: GeckoUnsupportedApi, guarded?: Range[]): boolean;
124
159
  export declare function usesWebkitUnsupportedMember(source: string, entry: WebkitUnsupportedMember, guarded?: Range[]): boolean;
125
- export declare function webkitGuardedRangesOf(): (text: string) => Range[];
160
+ export declare function guardedRangesOf(missing?: WebkitMissingApis): (text: string) => Range[];
126
161
  interface ScannableModule {
127
162
  resource?: string;
128
163
  modules?: Iterable<ScannableModule>;
@@ -1,4 +1,7 @@
1
1
  export declare const EXTENSIONJS_CONTENT_SCRIPT_LAYER = "extensionjs-content-script";
2
+ export declare const EXTENSIONJS_MAIN_WORLD_IMPORT_LAYER = "extensionjs-content-script-main-world-import";
3
+ export declare const MAIN_WORLD_COPY_SUFFIX = ".extjs-main-world";
4
+ export declare function mainWorldCopyEntryName(entryName: string): string;
2
5
  export declare const CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX = "content_scripts/content-";
3
6
  export declare function getCanonicalContentScriptEntryName(index: number): string;
4
7
  export declare function getCanonicalContentScriptJsAssetName(index: number): string;
@@ -3,6 +3,7 @@ import type { DevOptions, FilepathList, PluginInterface } from '../../types.js';
3
3
  export declare class ScriptsPlugin {
4
4
  readonly manifestPath: string;
5
5
  readonly includeList?: FilepathList;
6
+ readonly pageList?: FilepathList;
6
7
  readonly browser?: DevOptions['browser'];
7
8
  readonly devSession?: boolean;
8
9
  readonly define?: Record<string, unknown>;
@@ -28,11 +28,20 @@ declare const PAGE_CONTEXT_SURFACES: {
28
28
  export declare function workerStartedFromPageContext(assetName: string, surface: keyof typeof PAGE_CONTEXT_SURFACES): string;
29
29
  export declare function fetchedFileDependencyMissing(assetName: string, literal: string, expectedPath: string): string;
30
30
  export declare function getURLDependencyMissing(assetName: string, literal: string, expectedPath: string, foundOutside?: string): string;
31
+ export declare function webkitDroppedPageOpened(assetName: string, literal: string, page: {
32
+ path: string;
33
+ key: string;
34
+ reason: string;
35
+ }, browser: string): string;
31
36
  export declare function runtimeSetSurfaceDependencyMissing(assetName: string, literal: string, expectedPath: string, foundOutside?: string): string;
32
37
  export declare function staticImportDependencyMissing(assetName: string, literal: string, expectedPath: string, foundOutside?: string): string;
33
38
  export declare function buildConstantNeverDefined(file: string, name: string, entryName: string): string;
34
39
  export declare function reservedScriptsFolder(relPath: string, indicators: string[]): string;
35
40
  export declare function compiledSourceSpelling(assetName: string, api: string, literal: string, emittedPath: string): string;
36
41
  export declare function runtimeAssetFolderNotShipped(assetName: string, literal: string, folder: string, missing: string[]): string;
37
- export declare function contentScriptWithoutDefaultExport(file: string): string;
42
+ export declare function pageRelativeScriptPath(sourcePath: string, literal: string, requestedPath: string, emittedPath: string): string;
43
+ export declare function movedPageRelativeUrl(sourcePath: string, literal: string, page: string, requestedPath: string, emittedPath: string): string;
44
+ export declare function mainWorldRegistrationChanged(scriptPath: string, registeredBy?: string): string;
45
+ export declare function unknownRegistrationWorld(sourcePath: string, line: number, emittedPaths: string[]): string;
46
+ export declare function contentScriptWithoutDefaultExport(file: string, oldCopyOutlivesReload: boolean): string;
38
47
  export {};
@@ -0,0 +1,13 @@
1
+ export declare const COMPLETION_VALUE_SETTER = "__extjsCompletion";
2
+ export declare const INJECTED_CLASSIC_QUERY = "__extensionjs_injected__";
3
+ export declare const COMPLETION_VALUE_HOLDER = "__extjsCompletionValue";
4
+ export declare function keepCompletionValue(source: string, resourcePath: string, options?: {
5
+ importsAnotherScript?: boolean;
6
+ declaresNothing?: boolean;
7
+ }): string;
8
+ export declare function carriesCompletionValue(text: string): boolean;
9
+ export declare function endsOnCompletionValue(text: string): boolean;
10
+ export declare function closeCompletionValueBlock(text: string): {
11
+ open: string;
12
+ closed: string;
13
+ };