extension-develop 0.0.0-next-20250825144602

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 (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -0
  3. package/dist/add-content-script-wrapper.js +1777 -0
  4. package/dist/add-hmr-accept-code.js +96 -0
  5. package/dist/build.d.ts +2 -0
  6. package/dist/cleanup.d.ts +1 -0
  7. package/dist/deprecated-shadow-root.js +135 -0
  8. package/dist/dev.d.ts +2 -0
  9. package/dist/develop-lib/config-types.d.ts +85 -0
  10. package/dist/develop-lib/extract-from-zip.d.ts +1 -0
  11. package/dist/develop-lib/find-nearest-package.d.ts +2 -0
  12. package/dist/develop-lib/generate-extension-types.d.ts +1 -0
  13. package/dist/develop-lib/generate-zip.d.ts +2 -0
  14. package/dist/develop-lib/get-extension-config.d.ts +6 -0
  15. package/dist/develop-lib/get-project-path.d.ts +6 -0
  16. package/dist/develop-lib/install-dependencies.d.ts +2 -0
  17. package/dist/develop-lib/messages.d.ts +35 -0
  18. package/dist/develop-lib/validate-user-dependencies.d.ts +1 -0
  19. package/dist/ensure-hmr-for-scripts.js +74 -0
  20. package/dist/extensions/chrome-manager-extension/background.js +58 -0
  21. package/dist/extensions/chrome-manager-extension/define-initial-tab.js +77 -0
  22. package/dist/extensions/chrome-manager-extension/images/logo.png +0 -0
  23. package/dist/extensions/chrome-manager-extension/manifest.json +17 -0
  24. package/dist/extensions/chrome-manager-extension/pages/sakura-dark.css +268 -0
  25. package/dist/extensions/chrome-manager-extension/pages/sakura.css +267 -0
  26. package/dist/extensions/chrome-manager-extension/pages/welcome.html +46 -0
  27. package/dist/extensions/chrome-manager-extension/pages/welcome.js +34 -0
  28. package/dist/extensions/chrome-manager-extension/reload-service.js +297 -0
  29. package/dist/extensions/chromium-based-manager-extension/background.js +58 -0
  30. package/dist/extensions/chromium-based-manager-extension/define-initial-tab.js +77 -0
  31. package/dist/extensions/chromium-based-manager-extension/images/logo.png +0 -0
  32. package/dist/extensions/chromium-based-manager-extension/manifest.json +17 -0
  33. package/dist/extensions/chromium-based-manager-extension/pages/sakura-dark.css +268 -0
  34. package/dist/extensions/chromium-based-manager-extension/pages/sakura.css +267 -0
  35. package/dist/extensions/chromium-based-manager-extension/pages/welcome.html +46 -0
  36. package/dist/extensions/chromium-based-manager-extension/pages/welcome.js +34 -0
  37. package/dist/extensions/chromium-based-manager-extension/reload-service.js +302 -0
  38. package/dist/extensions/edge-manager-extension/background.js +58 -0
  39. package/dist/extensions/edge-manager-extension/define-initial-tab.js +77 -0
  40. package/dist/extensions/edge-manager-extension/images/logo.png +0 -0
  41. package/dist/extensions/edge-manager-extension/manifest.json +17 -0
  42. package/dist/extensions/edge-manager-extension/pages/sakura-dark.css +268 -0
  43. package/dist/extensions/edge-manager-extension/pages/sakura.css +267 -0
  44. package/dist/extensions/edge-manager-extension/pages/welcome.html +46 -0
  45. package/dist/extensions/edge-manager-extension/pages/welcome.js +34 -0
  46. package/dist/extensions/edge-manager-extension/reload-service.js +299 -0
  47. package/dist/extensions/firefox-manager-extension/background.js +85 -0
  48. package/dist/extensions/firefox-manager-extension/define-initial-tab.js +64 -0
  49. package/dist/extensions/firefox-manager-extension/images/logo.png +0 -0
  50. package/dist/extensions/firefox-manager-extension/manifest.json +15 -0
  51. package/dist/extensions/firefox-manager-extension/pages/sakura-dark.css +268 -0
  52. package/dist/extensions/firefox-manager-extension/pages/sakura.css +267 -0
  53. package/dist/extensions/firefox-manager-extension/pages/welcome.html +46 -0
  54. package/dist/extensions/firefox-manager-extension/pages/welcome.js +34 -0
  55. package/dist/extensions/firefox-manager-extension/reload-service.js +168 -0
  56. package/dist/extensions/gecko-based-manager-extension/background.js +57 -0
  57. package/dist/extensions/gecko-based-manager-extension/define-initial-tab.js +69 -0
  58. package/dist/extensions/gecko-based-manager-extension/images/logo.png +0 -0
  59. package/dist/extensions/gecko-based-manager-extension/manifest.json +16 -0
  60. package/dist/extensions/gecko-based-manager-extension/pages/sakura-dark.css +268 -0
  61. package/dist/extensions/gecko-based-manager-extension/pages/sakura.css +267 -0
  62. package/dist/extensions/gecko-based-manager-extension/pages/welcome.html +46 -0
  63. package/dist/extensions/gecko-based-manager-extension/pages/welcome.js +34 -0
  64. package/dist/extensions/gecko-based-manager-extension/reload-service.js +158 -0
  65. package/dist/inject-chromium-client-loader.js +176 -0
  66. package/dist/inject-firefox-client-loader.js +169 -0
  67. package/dist/minimum-chromium-file.js +25 -0
  68. package/dist/minimum-content-file.js +5 -0
  69. package/dist/minimum-firefox-file.js +17 -0
  70. package/dist/minimum-script-file.js +5 -0
  71. package/dist/module.d.ts +8 -0
  72. package/dist/module.js +10846 -0
  73. package/dist/preview.d.ts +2 -0
  74. package/dist/rslib.config.d.ts +3 -0
  75. package/dist/start.d.ts +2 -0
  76. package/dist/types.d.ts +11 -0
  77. package/dist/vitest.config.d.mts +2 -0
  78. package/dist/webpack/dev-server.d.ts +3 -0
  79. package/dist/webpack/plugin-browsers/browsers-lib/add-progress-bar.d.ts +1 -0
  80. package/dist/webpack/plugin-browsers/browsers-lib/constants.d.ts +5 -0
  81. package/dist/webpack/plugin-browsers/browsers-lib/dynamic-extension-manager.d.ts +35 -0
  82. package/dist/webpack/plugin-browsers/browsers-lib/html-merge.d.ts +1 -0
  83. package/dist/webpack/plugin-browsers/browsers-lib/instance-manager.d.ts +73 -0
  84. package/dist/webpack/plugin-browsers/browsers-lib/messages.d.ts +164 -0
  85. package/dist/webpack/plugin-browsers/browsers-lib/rdp-wire.d.ts +7 -0
  86. package/dist/webpack/plugin-browsers/browsers-lib/shared-utils.d.ts +16 -0
  87. package/dist/webpack/plugin-browsers/browsers-types.d.ts +131 -0
  88. package/dist/webpack/plugin-browsers/index.d.ts +41 -0
  89. package/dist/webpack/plugin-browsers/run-chromium/browser-config.d.ts +3 -0
  90. package/dist/webpack/plugin-browsers/run-chromium/create-profile.d.ts +10 -0
  91. package/dist/webpack/plugin-browsers/run-chromium/index.d.ts +28 -0
  92. package/dist/webpack/plugin-browsers/run-chromium/master-preferences.d.ts +161 -0
  93. package/dist/webpack/plugin-browsers/run-chromium/setup-chrome-inspection/cdp-client.d.ts +29 -0
  94. package/dist/webpack/plugin-browsers/run-chromium/setup-chrome-inspection/index.d.ts +25 -0
  95. package/dist/webpack/plugin-browsers/run-firefox/firefox/binary-detector.d.ts +15 -0
  96. package/dist/webpack/plugin-browsers/run-firefox/firefox/browser-config.d.ts +7 -0
  97. package/dist/webpack/plugin-browsers/run-firefox/firefox/create-profile.d.ts +13 -0
  98. package/dist/webpack/plugin-browsers/run-firefox/firefox/master-preferences.d.ts +95 -0
  99. package/dist/webpack/plugin-browsers/run-firefox/index.d.ts +26 -0
  100. package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/index.d.ts +13 -0
  101. package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/message-utils.d.ts +2 -0
  102. package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/messaging-client.d.ts +42 -0
  103. package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/setup-firefox-inspection.d.ts +31 -0
  104. package/dist/webpack/plugin-compatibility/feature-browser-specific-fields.d.ts +9 -0
  105. package/dist/webpack/plugin-compatibility/feature-polyfill.d.ts +12 -0
  106. package/dist/webpack/plugin-compatibility/index.d.ts +13 -0
  107. package/dist/webpack/plugin-compilation/clean-dist.d.ts +8 -0
  108. package/dist/webpack/plugin-compilation/env.d.ts +9 -0
  109. package/dist/webpack/plugin-compilation/index.d.ts +12 -0
  110. package/dist/webpack/plugin-css/common-style-loaders.d.ts +8 -0
  111. package/dist/webpack/plugin-css/css-in-content-script-loader.d.ts +11 -0
  112. package/dist/webpack/plugin-css/css-in-html-loader.d.ts +8 -0
  113. package/dist/webpack/plugin-css/css-tools/less.d.ts +4 -0
  114. package/dist/webpack/plugin-css/css-tools/postcss.d.ts +3 -0
  115. package/dist/webpack/plugin-css/css-tools/sass.d.ts +4 -0
  116. package/dist/webpack/plugin-css/css-tools/stylelint.d.ts +4 -0
  117. package/dist/webpack/plugin-css/css-tools/tailwind.d.ts +2 -0
  118. package/dist/webpack/plugin-css/index.d.ts +9 -0
  119. package/dist/webpack/plugin-css/is-content-script.d.ts +1 -0
  120. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/action.d.ts +2 -0
  121. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/background.d.ts +2 -0
  122. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/browser_action.d.ts +2 -0
  123. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/chrome_url_overrides.d.ts +2 -0
  124. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/devtools_page.d.ts +2 -0
  125. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/index.d.ts +2 -0
  126. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/options_ui.d.ts +2 -0
  127. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/page_action.d.ts +2 -0
  128. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/sandbox.d.ts +2 -0
  129. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/side_panel.d.ts +2 -0
  130. package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/sidebar_action.d.ts +2 -0
  131. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/action.d.ts +2 -0
  132. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/browser_action.d.ts +2 -0
  133. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/browser_action.theme_icons.d.ts +2 -0
  134. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/icons.d.ts +2 -0
  135. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/index.d.ts +2 -0
  136. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/normalize.d.ts +6 -0
  137. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/page_action.d.ts +2 -0
  138. package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/sidebar_action.d.ts +2 -0
  139. package/dist/webpack/plugin-extension/data/manifest-fields/index.d.ts +19 -0
  140. package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/declarative_net_request.d.ts +2 -0
  141. package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/index.d.ts +2 -0
  142. package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/storage.d.ts +2 -0
  143. package/dist/webpack/plugin-extension/data/manifest-fields/locales-fields/index.d.ts +1 -0
  144. package/dist/webpack/plugin-extension/data/manifest-fields/normalize.d.ts +10 -0
  145. package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/background.d.ts +2 -0
  146. package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/content_scripts.d.ts +2 -0
  147. package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/index.d.ts +2 -0
  148. package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/service_worker.d.ts +2 -0
  149. package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/user_scripts.d.ts +2 -0
  150. package/dist/webpack/plugin-extension/data/manifest-fields/web-resources-fields/index.d.ts +2 -0
  151. package/dist/webpack/plugin-extension/data/special-folders/generate-entries.d.ts +4 -0
  152. package/dist/webpack/plugin-extension/data/special-folders/index.d.ts +12 -0
  153. package/dist/webpack/plugin-extension/feature-html/__spec__/html-lib/test-utils.d.ts +18 -0
  154. package/dist/webpack/plugin-extension/feature-html/html-lib/parse-html.d.ts +8 -0
  155. package/dist/webpack/plugin-extension/feature-html/html-lib/patch-html.d.ts +8 -0
  156. package/dist/webpack/plugin-extension/feature-html/html-lib/utils.d.ts +18 -0
  157. package/dist/webpack/plugin-extension/feature-html/index.d.ts +37 -0
  158. package/dist/webpack/plugin-extension/feature-html/steps/add-assets-to-compilation.d.ts +11 -0
  159. package/dist/webpack/plugin-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +10 -0
  160. package/dist/webpack/plugin-extension/feature-html/steps/add-to-file-dependencies.d.ts +10 -0
  161. package/dist/webpack/plugin-extension/feature-html/steps/emit-html-file.d.ts +9 -0
  162. package/dist/webpack/plugin-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +2 -0
  163. package/dist/webpack/plugin-extension/feature-html/steps/handle-common-errors.d.ts +10 -0
  164. package/dist/webpack/plugin-extension/feature-html/steps/minimum-script-file.d.ts +1 -0
  165. package/dist/webpack/plugin-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +13 -0
  166. package/dist/webpack/plugin-extension/feature-html/steps/update-html-file.d.ts +10 -0
  167. package/dist/webpack/plugin-extension/feature-icons/index.d.ts +25 -0
  168. package/dist/webpack/plugin-extension/feature-icons/steps/add-to-file-dependencies.d.ts +9 -0
  169. package/dist/webpack/plugin-extension/feature-icons/steps/emit-file.d.ts +9 -0
  170. package/dist/webpack/plugin-extension/feature-json/index.d.ts +18 -0
  171. package/dist/webpack/plugin-extension/feature-locales/get-locales.d.ts +1 -0
  172. package/dist/webpack/plugin-extension/feature-locales/index.d.ts +13 -0
  173. package/dist/webpack/plugin-extension/feature-manifest/index.d.ts +23 -0
  174. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/background.d.ts +10 -0
  175. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/chrome_url_overrides.d.ts +8 -0
  176. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/commands.d.ts +16 -0
  177. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +7 -0
  178. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/content_security_policy.d.ts +4 -0
  179. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/devtools_page.d.ts +4 -0
  180. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/icons.d.ts +6 -0
  181. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/index.d.ts +2 -0
  182. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +2 -0
  183. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/options_page.d.ts +4 -0
  184. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/options_ui.d.ts +8 -0
  185. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +8 -0
  186. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +4 -0
  187. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +7 -0
  188. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/sidebar_action.d.ts +2 -0
  189. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/storage.d.ts +6 -0
  190. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/theme.d.ts +2 -0
  191. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/user_scripts.d.ts +2 -0
  192. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/web_accessible_resources.d.ts +9 -0
  193. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/index.d.ts +2 -0
  194. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/background.d.ts +10 -0
  195. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +12 -0
  196. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +24 -0
  197. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +2 -0
  198. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/page_action.d.ts +1 -0
  199. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/sidebar_action.d.ts +1 -0
  200. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +2 -0
  201. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +8 -0
  202. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/background.d.ts +10 -0
  203. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +2 -0
  204. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +2 -0
  205. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +2 -0
  206. package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/side_panel.d.ts +2 -0
  207. package/dist/webpack/plugin-extension/feature-manifest/steps/add-dependencies.d.ts +6 -0
  208. package/dist/webpack/plugin-extension/feature-manifest/steps/check-manifest-files.d.ts +17 -0
  209. package/dist/webpack/plugin-extension/feature-manifest/steps/emit-manifest.d.ts +7 -0
  210. package/dist/webpack/plugin-extension/feature-manifest/steps/throw-if-recompile.d.ts +11 -0
  211. package/dist/webpack/plugin-extension/feature-manifest/steps/update-manifest.d.ts +9 -0
  212. package/dist/webpack/plugin-extension/feature-scripts/index.d.ts +27 -0
  213. package/dist/webpack/plugin-extension/feature-scripts/scripts-lib/utils.d.ts +3 -0
  214. package/dist/webpack/plugin-extension/feature-scripts/steps/add-content-script-wrapper.d.ts +2 -0
  215. package/dist/webpack/plugin-extension/feature-scripts/steps/add-hmr-accept-code.d.ts +2 -0
  216. package/dist/webpack/plugin-extension/feature-scripts/steps/add-public-path-for-main-world.d.ts +11 -0
  217. package/dist/webpack/plugin-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +4 -0
  218. package/dist/webpack/plugin-extension/feature-scripts/steps/add-scripts.d.ts +9 -0
  219. package/dist/webpack/plugin-extension/feature-scripts/steps/deprecated-shadow-root.d.ts +2 -0
  220. package/dist/webpack/plugin-extension/feature-scripts/steps/javascript-content-script-wrapper.d.ts +1 -0
  221. package/dist/webpack/plugin-extension/feature-scripts/steps/minimum-content-file.d.ts +0 -0
  222. package/dist/webpack/plugin-extension/feature-scripts/steps/preact-content-script-wrapper.d.ts +1 -0
  223. package/dist/webpack/plugin-extension/feature-scripts/steps/react-content-script-wrapper.d.ts +1 -0
  224. package/dist/webpack/plugin-extension/feature-scripts/steps/svelte-content-script-wrapper.d.ts +1 -0
  225. package/dist/webpack/plugin-extension/feature-scripts/steps/typescript-content-script-wrapper.d.ts +1 -0
  226. package/dist/webpack/plugin-extension/feature-scripts/steps/vue-content-script-wrapper.d.ts +1 -0
  227. package/dist/webpack/plugin-extension/feature-special-folders/copy-public-folder.d.ts +14 -0
  228. package/dist/webpack/plugin-extension/feature-special-folders/index.d.ts +19 -0
  229. package/dist/webpack/plugin-extension/feature-special-folders/warn-upon-folder-changes.d.ts +7 -0
  230. package/dist/webpack/plugin-extension/feature-web-resources/clean-matches.d.ts +7 -0
  231. package/dist/webpack/plugin-extension/feature-web-resources/index.d.ts +18 -0
  232. package/dist/webpack/plugin-extension/index.d.ts +10 -0
  233. package/dist/webpack/plugin-js-frameworks/index.d.ts +13 -0
  234. package/dist/webpack/plugin-js-frameworks/js-tools/babel.d.ts +16 -0
  235. package/dist/webpack/plugin-js-frameworks/js-tools/preact.d.ts +3 -0
  236. package/dist/webpack/plugin-js-frameworks/js-tools/react.d.ts +3 -0
  237. package/dist/webpack/plugin-js-frameworks/js-tools/svelte.d.ts +3 -0
  238. package/dist/webpack/plugin-js-frameworks/js-tools/typescript.d.ts +36 -0
  239. package/dist/webpack/plugin-js-frameworks/js-tools/vue.d.ts +3 -0
  240. package/dist/webpack/plugin-js-frameworks/load-loader-options.d.ts +1 -0
  241. package/dist/webpack/plugin-reload/index.d.ts +13 -0
  242. package/dist/webpack/plugin-reload/reload-lib/messages.d.ts +106 -0
  243. package/dist/webpack/plugin-reload/reload-types.d.ts +14 -0
  244. package/dist/webpack/plugin-reload/start-server.d.ts +4 -0
  245. package/dist/webpack/plugin-reload/steps/create-web-socket-server/index.d.ts +14 -0
  246. package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/broadcast-message.d.ts +2 -0
  247. package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/message-dispatcher.d.ts +2 -0
  248. package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/servers.d.ts +2 -0
  249. package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/index.d.ts +3 -0
  250. package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/inject-chromium-client-loader.d.ts +9 -0
  251. package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/minimum-chromium-file.d.ts +0 -0
  252. package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/index.d.ts +3 -0
  253. package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/inject-firefox-client-loader.d.ts +9 -0
  254. package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/minimum-firefox-file.d.ts +0 -0
  255. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/index.d.ts +9 -0
  256. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-background.d.ts +15 -0
  257. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-csp.d.ts +5 -0
  258. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-externally-connectable.d.ts +10 -0
  259. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-web-resources.d.ts +10 -0
  260. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/generate-manager-extension.d.ts +15 -0
  261. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/index.d.ts +10 -0
  262. package/dist/webpack/plugin-reload/steps/setup-reload-strategy/target-web-extension-plugin/index.d.ts +13 -0
  263. package/dist/webpack/plugin-static-assets/index.d.ts +12 -0
  264. package/dist/webpack/webpack-config.d.ts +14 -0
  265. package/dist/webpack/webpack-lib/auto-exit.d.ts +1 -0
  266. package/dist/webpack/webpack-lib/constants.d.ts +4 -0
  267. package/dist/webpack/webpack-lib/messages.d.ts +121 -0
  268. package/dist/webpack/webpack-lib/port-manager.d.ts +27 -0
  269. package/dist/webpack/webpack-lib/utils.d.ts +23 -0
  270. package/dist/webpack/webpack-types.d.ts +49 -0
  271. package/package.json +143 -0
@@ -0,0 +1,96 @@
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: ()=>add_hmr_accept_code
37
+ });
38
+ const external_fs_namespaceObject = require("fs");
39
+ var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
40
+ const external_path_namespaceObject = require("path");
41
+ var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
42
+ const external_loader_utils_namespaceObject = require("loader-utils");
43
+ const external_schema_utils_namespaceObject = require("schema-utils");
44
+ const schema = {
45
+ type: 'object',
46
+ properties: {
47
+ test: {
48
+ type: 'string'
49
+ },
50
+ manifestPath: {
51
+ type: 'string'
52
+ },
53
+ mode: {
54
+ type: 'string'
55
+ }
56
+ }
57
+ };
58
+ function add_hmr_accept_code(source) {
59
+ const options = this.getOptions();
60
+ const manifestPath = options.manifestPath;
61
+ const projectPath = external_path_default().dirname(manifestPath);
62
+ const manifest = JSON.parse(external_fs_default().readFileSync(manifestPath, 'utf-8'));
63
+ (0, external_schema_utils_namespaceObject.validate)(schema, options, {
64
+ name: "scripts:add-hmr-accept-code",
65
+ baseDataPath: 'options'
66
+ });
67
+ const url = (0, external_loader_utils_namespaceObject.urlToRequest)(this.resourcePath);
68
+ const reloadCode = `
69
+ // TODO: cezaraugusto re-visit this
70
+ if (import.meta.webpackHot) { import.meta.webpackHot.accept() };
71
+ `;
72
+ if (manifest.background) {
73
+ if (manifest.background.scripts) for (const bgScript of manifest.background.scripts){
74
+ const absoluteUrl = external_path_default().resolve(projectPath, bgScript);
75
+ if (url.includes(absoluteUrl)) return `${reloadCode}${source}`;
76
+ }
77
+ }
78
+ if (manifest.content_scripts) {
79
+ for (const contentScript of manifest.content_scripts)if (contentScript.js) for (const js of contentScript.js){
80
+ const absoluteUrl = external_path_default().resolve(projectPath, js);
81
+ if (url.includes(absoluteUrl)) return `${reloadCode}${source}`;
82
+ }
83
+ }
84
+ if (manifest.user_scripts) for (const userScript of manifest.user_scripts){
85
+ const absoluteUrl = external_path_default().resolve(projectPath, userScript);
86
+ if (url.includes(absoluteUrl)) return `${reloadCode}${source}`;
87
+ }
88
+ return source;
89
+ }
90
+ exports["default"] = __webpack_exports__["default"];
91
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
92
+ "default"
93
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ Object.defineProperty(exports, '__esModule', {
95
+ value: true
96
+ });
@@ -0,0 +1,2 @@
1
+ import { BuildOptions } from './develop-lib/config-types';
2
+ export declare function extensionBuild(pathOrRemoteUrl: string | undefined, buildOptions?: BuildOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function cleanupCommand(): Promise<void>;
@@ -0,0 +1,135 @@
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 ADDED
@@ -0,0 +1,2 @@
1
+ import { DevOptions } from './develop-lib/config-types';
2
+ export declare function extensionDev(pathOrRemoteUrl: string | undefined, devOptions: DevOptions): Promise<void>;
@@ -0,0 +1,85 @@
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
+ }
38
+ export interface PreviewOptions extends BrowserOptionsBase {
39
+ mode: 'production';
40
+ outputPath?: string;
41
+ chromiumBinary?: ChromiumOptions['chromiumBinary'];
42
+ geckoBinary?: GeckoOptions['geckoBinary'];
43
+ }
44
+ export interface StartOptions extends BrowserOptionsBase {
45
+ mode: 'production';
46
+ polyfill?: boolean;
47
+ chromiumBinary?: ChromiumOptions['chromiumBinary'];
48
+ geckoBinary?: GeckoOptions['geckoBinary'];
49
+ }
50
+ export interface BrowserConfig extends BrowserOptionsBase {
51
+ browserFlags?: string[];
52
+ excludeBrowserFlags?: string[];
53
+ preferences?: Record<string, unknown>;
54
+ chromiumBinary?: ChromiumOptions['chromiumBinary'];
55
+ geckoBinary?: GeckoOptions['geckoBinary'];
56
+ reuseProfile?: boolean;
57
+ }
58
+ export interface FileConfig {
59
+ browser?: {
60
+ chrome?: BrowserConfig;
61
+ firefox?: BrowserConfig;
62
+ edge?: BrowserConfig;
63
+ 'chromium-based'?: BrowserConfig;
64
+ 'gecko-based'?: BrowserConfig;
65
+ };
66
+ commands?: {
67
+ dev?: Pick<DevOptions, 'browser' | 'profile' | 'chromiumBinary' | 'geckoBinary' | 'open' | 'polyfill'> & {
68
+ browserFlags?: string[];
69
+ excludeBrowserFlags?: string[];
70
+ preferences?: Record<string, unknown>;
71
+ };
72
+ start?: Pick<StartOptions, 'browser' | 'profile' | 'chromiumBinary' | 'geckoBinary' | 'polyfill'> & {
73
+ browserFlags?: string[];
74
+ excludeBrowserFlags?: string[];
75
+ preferences?: Record<string, unknown>;
76
+ };
77
+ preview?: Pick<PreviewOptions, 'browser' | 'profile' | 'chromiumBinary' | 'geckoBinary'> & {
78
+ browserFlags?: string[];
79
+ excludeBrowserFlags?: string[];
80
+ preferences?: Record<string, unknown>;
81
+ };
82
+ build?: Pick<BuildOptions, 'browser' | 'zipFilename' | 'zip' | 'zipSource' | 'polyfill'>;
83
+ };
84
+ config?: (config: Configuration) => Configuration;
85
+ }
@@ -0,0 +1 @@
1
+ export declare function downloadAndExtractZip(url: string, targetPath: string): Promise<string>;
@@ -0,0 +1,2 @@
1
+ export declare function findNearestPackageJson(manifestPath: string): Promise<string | null>;
2
+ export declare function validatePackageJson(packageJsonPath: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function generateExtensionTypes(projectPath: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { type BuildOptions } from './config-types';
2
+ export declare function generateZip(projectDir: string, { browser, ...options }: BuildOptions): Promise<void>;
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,2 @@
1
+ export declare function getInstallCommand(): Promise<string>;
2
+ export declare function installDependencies(projectPath: string): Promise<void>;
@@ -0,0 +1,35 @@
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 isUsingExperimentalConfig(integration: any): string;
29
+ export declare function installingDependencies(): string;
30
+ export declare function installingDependenciesFailed(gitCommand: string, gitArgs: string[], code: number | null): string;
31
+ export declare function installingDependenciesProcessError(error: any): string;
32
+ export declare function cantInstallDependencies(error: any): string;
33
+ export declare function portInUse(requestedPort: number, newPort: number): string;
34
+ export declare function configLoadingError(configPath: string, error: unknown): string;
35
+ export declare function managedDependencyConflict(duplicates: string[], userPackageJsonPath: string): string;
@@ -0,0 +1 @@
1
+ export declare function assertNoManagedDependencyConflicts(userPackageJsonPath: string, projectPath: string): void;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ default: ()=>ensureHMRForScripts
28
+ });
29
+ const external_path_namespaceObject = require("path");
30
+ const external_loader_utils_namespaceObject = require("loader-utils");
31
+ const external_schema_utils_namespaceObject = require("schema-utils");
32
+ const schema = {
33
+ type: 'object',
34
+ properties: {
35
+ test: {
36
+ type: 'string'
37
+ },
38
+ manifestPath: {
39
+ type: 'string'
40
+ },
41
+ includeList: {
42
+ type: 'object'
43
+ },
44
+ excludeList: {
45
+ type: 'object'
46
+ }
47
+ }
48
+ };
49
+ function ensureHMRForScripts(source) {
50
+ const options = this.getOptions();
51
+ const manifestPath = options.manifestPath;
52
+ external_path_namespaceObject.dirname(manifestPath);
53
+ try {
54
+ (0, external_schema_utils_namespaceObject.validate)(schema, options, {
55
+ name: "html:ensure-hmr-for-scripts",
56
+ baseDataPath: 'options'
57
+ });
58
+ } catch (error) {
59
+ throw error;
60
+ }
61
+ const resourcePath = this.resourcePath || '';
62
+ (0, external_loader_utils_namespaceObject.urlToRequest)(resourcePath);
63
+ const reloadCode = `
64
+ if (import.meta.webpackHot) { import.meta.webpackHot.accept() }
65
+ `;
66
+ return `${reloadCode}${source}`;
67
+ }
68
+ exports["default"] = __webpack_exports__["default"];
69
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
70
+ "default"
71
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
72
+ Object.defineProperty(exports, '__esModule', {
73
+ value: true
74
+ });
@@ -0,0 +1,58 @@
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
+ chrome.tabs.query({active: true}, async ([initialTab]) => {
8
+ console.log(
9
+ `%c
10
+ ██████████████████████████████████████████████████████████
11
+ ██████████████████████████████████████████████████████████
12
+ ████████████████████████████ ██████████████████████████
13
+ █████████████████████████ ██████ ███████████████
14
+ ███████████████████████ ███ ███ ████████████
15
+ ██████████████████████ ██████ ███ ███████████
16
+ ███████████████████████ ██████ ██████ ███████████
17
+ ████████████████ ██████ ██████████████ ███████████
18
+ █████████████ ████ ████████████ ████████████
19
+ ███████████ ██ █████████████ ███████████████
20
+ ██████████ ██████ █████████████████ █████████████
21
+ ███████████ ████████████████████████████ ███████████
22
+ █████████████ █████████████████ ██████ ██████████
23
+ ███████████████ ██████████████ ██ ██████████
24
+ ████████████ ████████████ ████ █████████████
25
+ ███████████ █████████████ ██████ ███████████████
26
+ ███████████ ██████ ██████ ███████████████████████
27
+ ███████████ ████ ██████ ██████████████████████
28
+ ████████████ ██ ███ ███████████████████████
29
+ ███████████████ ██████ █████████████████████████
30
+ ██████████████████████████ ████████████████████████████
31
+ ██████████████████████████████████████████████████████████
32
+ ██████████████████████████████████████████████████████████
33
+ MIT (c) ${new Date().getFullYear()} - Cezar Augusto and the Extension.js Authors.
34
+ `,
35
+ bgGreen('')
36
+ )
37
+
38
+ if (
39
+ initialTab.url === 'chrome://newtab/' ||
40
+ initialTab.url === 'chrome://welcome/'
41
+ ) {
42
+ await handleFirstRun()
43
+ } else {
44
+ createExtensionsPageTab(initialTab, 'chrome://extensions/')
45
+ }
46
+ })
47
+
48
+ chrome.runtime.onInstalled.addListener(async () => {
49
+ let isConnected = false
50
+
51
+ if (isConnected) {
52
+ disconnect()
53
+ } else {
54
+ await connect()
55
+ isConnected = true
56
+ keepAlive()
57
+ }
58
+ })
@@ -0,0 +1,77 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }