extension-develop 3.18.4 → 3.18.5-canary.local-b4fd0431

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 (268) hide show
  1. package/dist/0~dev-server.mjs +49 -8
  2. package/dist/0~rslib-runtime.mjs +9 -5
  3. package/dist/0~rspack-config.mjs +546 -129
  4. package/dist/0~zip.mjs +1 -1
  5. package/dist/{946.mjs → 101.mjs} +566 -536
  6. package/dist/{962.mjs → 839.mjs} +207 -107
  7. package/dist/bridge.mjs +2 -2
  8. package/dist/ensure-hmr-for-scripts.js +1 -1
  9. package/dist/ensure-hmr-for-scripts.mjs +1 -1
  10. package/dist/extension-js-devtools/chrome/content_scripts/content-0.js +2 -2
  11. package/dist/extension-js-devtools/chrome/pages/centralized-logger.js +4 -4
  12. package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
  13. package/dist/extension-js-devtools/chrome/scripts/logger-client.js +1 -1
  14. package/dist/extension-js-devtools/chromium/content_scripts/content-0.js +2 -2
  15. package/dist/extension-js-devtools/chromium/pages/centralized-logger.js +4 -4
  16. package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
  17. package/dist/extension-js-devtools/chromium/scripts/logger-client.js +1 -1
  18. package/dist/extension-js-devtools/edge/content_scripts/content-0.js +2 -2
  19. package/dist/extension-js-devtools/edge/pages/centralized-logger.js +4 -4
  20. package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
  21. package/dist/extension-js-devtools/edge/scripts/logger-client.js +1 -1
  22. package/dist/extension-js-devtools/firefox/content_scripts/content-0.js +2 -2
  23. package/dist/extension-js-devtools/firefox/pages/centralized-logger.js +4 -4
  24. package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
  25. package/dist/extension-js-devtools/firefox/scripts/logger-client.js +1 -1
  26. package/dist/extension-js-theme/brave/background/service_worker.js +2003 -0
  27. package/dist/extension-js-theme/brave/background/service_worker.js.map +1 -0
  28. package/dist/extension-js-theme/brave/manifest.json +45 -0
  29. package/dist/extension-js-theme/chrome/Cached Theme.pak +0 -0
  30. package/dist/extension-js-theme/chromium/Cached Theme.pak +0 -0
  31. package/dist/extension-js-theme/extension-js/brave/events.ndjson +4 -0
  32. package/dist/extension-js-theme/extension-js/brave/logs.ndjson +3 -0
  33. package/dist/extension-js-theme/extension-js/brave/ready.json +20 -0
  34. package/dist/extension-js-theme/extension-js/firefox/events.ndjson +130 -4
  35. package/dist/extension-js-theme/extension-js/firefox/ready.json +7 -7
  36. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/.extension-js-managed-profile +1 -0
  37. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/ChromeFeatureState +1 -0
  38. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/AccessibilityAnnotatorDatabase +0 -0
  39. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Account Web Data +0 -0
  40. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Account Web Data-journal +0 -0
  41. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Affiliation Database +0 -0
  42. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Affiliation Database-journal +0 -0
  43. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/AutofillAiModelCache/LOCK +0 -0
  44. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/AutofillAiModelCache/LOG +0 -0
  45. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/AutofillStrikeDatabase/LOCK +0 -0
  46. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/AutofillStrikeDatabase/LOG +0 -0
  47. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/BookmarkMergedSurfaceOrdering +2 -0
  48. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/BrowsingTopicsSiteData +0 -0
  49. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/BrowsingTopicsSiteData-journal +0 -0
  50. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/BrowsingTopicsState +12 -0
  51. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/BudgetDatabase/LOCK +0 -0
  52. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/BudgetDatabase/LOG +0 -0
  53. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cache/Cache_Data/index +1 -0
  54. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cache/Cache_Data/sqldb0 +0 -0
  55. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cache/Cache_Data/sqldb1 +0 -0
  56. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cache/Cache_Data/sqldb2 +0 -0
  57. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cache/No_Vary_Search/journal.baj +1 -0
  58. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cache/No_Vary_Search/snapshot.baf +0 -0
  59. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/ClientCertificates/LOCK +0 -0
  60. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/ClientCertificates/LOG +0 -0
  61. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Code Cache/pc/05_@;2t2fb2=a6@=`6`2`218;50[[=243915.92@2126345=;-629[`2.db +0 -0
  62. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Code Cache/pc/05_@;2t2fb2=a6@=`6`2`218;50[[=243915.92@2126345=;-629[`2.journal +0 -0
  63. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Collaboration/MessageDB +0 -0
  64. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Collaboration/MessageDB-journal +0 -0
  65. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cookies +0 -0
  66. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Cookies-journal +0 -0
  67. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DIPS +0 -0
  68. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DIPS-wal +0 -0
  69. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DataSharing/DataSharingDB +0 -0
  70. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DataSharing/DataSharingDB-journal +0 -0
  71. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnGraphiteCache/data_0 +0 -0
  72. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnGraphiteCache/data_1 +0 -0
  73. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnGraphiteCache/data_2 +0 -0
  74. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnGraphiteCache/data_3 +0 -0
  75. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnGraphiteCache/index +0 -0
  76. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnWebGPUCache/data_0 +0 -0
  77. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnWebGPUCache/data_1 +0 -0
  78. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnWebGPUCache/data_2 +0 -0
  79. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnWebGPUCache/data_3 +0 -0
  80. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/DawnWebGPUCache/index +0 -0
  81. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Rules/000003.log +0 -0
  82. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Rules/CURRENT +1 -0
  83. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Rules/LOCK +0 -0
  84. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Rules/LOG +2 -0
  85. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Rules/MANIFEST-000001 +0 -0
  86. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Scripts/000003.log +0 -0
  87. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Scripts/CURRENT +1 -0
  88. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Scripts/LOCK +0 -0
  89. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Scripts/LOG +2 -0
  90. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension Scripts/MANIFEST-000001 +0 -0
  91. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension State/000003.log +0 -0
  92. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension State/CURRENT +1 -0
  93. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension State/LOCK +0 -0
  94. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension State/LOG +2 -0
  95. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Extension State/MANIFEST-000001 +0 -0
  96. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Favicons +0 -0
  97. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Favicons-journal +0 -0
  98. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Feature Engagement Tracker/AvailabilityDB/LOCK +0 -0
  99. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Feature Engagement Tracker/AvailabilityDB/LOG +0 -0
  100. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Feature Engagement Tracker/EventDB/LOCK +0 -0
  101. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Feature Engagement Tracker/EventDB/LOG +0 -0
  102. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GCM Store/000003.log +0 -0
  103. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GCM Store/CURRENT +1 -0
  104. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GCM Store/LOCK +0 -0
  105. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GCM Store/LOG +2 -0
  106. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GCM Store/MANIFEST-000001 +0 -0
  107. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GPUCache/data_0 +0 -0
  108. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GPUCache/data_1 +0 -0
  109. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GPUCache/data_2 +0 -0
  110. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GPUCache/data_3 +0 -0
  111. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/GPUCache/index +0 -0
  112. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/History +0 -0
  113. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/History-journal +0 -0
  114. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/LOCK +0 -0
  115. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/LOG +0 -0
  116. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Extension Settings/dkmhcppnegfldhbleoedeifghnmaielp/000003.log +0 -0
  117. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Extension Settings/dkmhcppnegfldhbleoedeifghnmaielp/CURRENT +1 -0
  118. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Extension Settings/dkmhcppnegfldhbleoedeifghnmaielp/LOCK +0 -0
  119. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Extension Settings/dkmhcppnegfldhbleoedeifghnmaielp/LOG +2 -0
  120. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Extension Settings/dkmhcppnegfldhbleoedeifghnmaielp/MANIFEST-000001 +0 -0
  121. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Storage/leveldb/000003.log +0 -0
  122. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Storage/leveldb/CURRENT +1 -0
  123. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Storage/leveldb/LOCK +0 -0
  124. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Storage/leveldb/LOG +2 -0
  125. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Local Storage/leveldb/MANIFEST-000001 +0 -0
  126. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Login Data +0 -0
  127. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Login Data For Account +0 -0
  128. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Login Data For Account-journal +0 -0
  129. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Login Data-journal +0 -0
  130. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Network Action Predictor +0 -0
  131. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Network Action Predictor-journal +0 -0
  132. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Network Persistent State +1 -0
  133. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/PersistentOriginTrials/LOCK +0 -0
  134. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/PersistentOriginTrials/LOG +0 -0
  135. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Preferences +1 -0
  136. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/PreferredApps +1 -0
  137. NEL +0 -0
  138. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Reporting and NEL-journal +0 -0
  139. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/SCT Auditing Pending Reports +1 -0
  140. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Safe Browsing Cookies +0 -0
  141. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Safe Browsing Cookies-journal +0 -0
  142. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Secure Preferences +1 -0
  143. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Segmentation Platform/SegmentInfoDB/LOCK +0 -0
  144. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Segmentation Platform/SegmentInfoDB/LOG +0 -0
  145. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Segmentation Platform/SignalDB/LOCK +0 -0
  146. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Segmentation Platform/SignalDB/LOG +0 -0
  147. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Segmentation Platform/SignalStorageConfigDB/LOCK +0 -0
  148. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Segmentation Platform/SignalStorageConfigDB/LOG +0 -0
  149. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/ServerCertificate +0 -0
  150. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/ServerCertificate-journal +0 -0
  151. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/Database/000003.log +0 -0
  152. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/Database/CURRENT +1 -0
  153. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/Database/LOCK +0 -0
  154. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/Database/LOG +2 -0
  155. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/Database/MANIFEST-000001 +0 -0
  156. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/ScriptCache/2cc80dabc69f58b6_0 +0 -0
  157. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/ScriptCache/2cc80dabc69f58b6_1 +0 -0
  158. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/ScriptCache/4cb013792b196a35_0 +0 -0
  159. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/ScriptCache/4cb013792b196a35_1 +0 -0
  160. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/ScriptCache/index +0 -0
  161. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Service Worker/ScriptCache/index-dir/the-real-index +0 -0
  162. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Session Storage/000003.log +0 -0
  163. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Session Storage/CURRENT +1 -0
  164. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Session Storage/LOCK +0 -0
  165. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Session Storage/LOG +2 -0
  166. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Session Storage/MANIFEST-000001 +0 -0
  167. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sessions/Session_13426296971679614 +0 -0
  168. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sessions/Tabs_13426296976710116 +0 -0
  169. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Shared Dictionary/cache/index +0 -0
  170. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Shared Dictionary/cache/index-dir/the-real-index +0 -0
  171. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Shared Dictionary/db +0 -0
  172. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Shared Dictionary/db-journal +0 -0
  173. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/SharedStorage +0 -0
  174. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Shortcuts +0 -0
  175. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Shortcuts-journal +0 -0
  176. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Site Characteristics Database/000003.log +0 -0
  177. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Site Characteristics Database/CURRENT +1 -0
  178. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Site Characteristics Database/LOCK +0 -0
  179. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Site Characteristics Database/LOG +2 -0
  180. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Site Characteristics Database/MANIFEST-000001 +0 -0
  181. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sync Data/LevelDB/000003.log +0 -0
  182. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sync Data/LevelDB/CURRENT +1 -0
  183. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sync Data/LevelDB/LOCK +0 -0
  184. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sync Data/LevelDB/LOG +2 -0
  185. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Sync Data/LevelDB/MANIFEST-000001 +0 -0
  186. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Top Sites +0 -0
  187. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Top Sites-journal +0 -0
  188. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/TransportSecurity +1 -0
  189. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Trust Tokens +0 -0
  190. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Trust Tokens-journal +0 -0
  191. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Web Data +0 -0
  192. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/Web Data-journal +0 -0
  193. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/WebStorage/QuotaManager +0 -0
  194. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/WebStorage/QuotaManager-journal +0 -0
  195. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/chrome_cart_db/LOCK +0 -0
  196. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/chrome_cart_db/LOG +0 -0
  197. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/commerce_subscription_db/LOCK +0 -0
  198. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/commerce_subscription_db/LOG +0 -0
  199. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/discount_infos_db/LOCK +0 -0
  200. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/discount_infos_db/LOG +0 -0
  201. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/discounts_db/LOCK +0 -0
  202. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/discounts_db/LOG +0 -0
  203. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/engine_allowlist.bf +0 -0
  204. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/heavy_ad_intervention_opt_out.db +0 -0
  205. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/heavy_ad_intervention_opt_out.db-journal +0 -0
  206. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/optimization_guide_hint_cache_store/LOCK +0 -0
  207. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/optimization_guide_hint_cache_store/LOG +0 -0
  208. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/parcel_tracking_db/LOCK +0 -0
  209. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/parcel_tracking_db/LOG +0 -0
  210. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/000003.log +0 -0
  211. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/CURRENT +1 -0
  212. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/LOCK +0 -0
  213. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/LOG +2 -0
  214. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/MANIFEST-000001 +0 -0
  215. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/metadata/000003.log +0 -0
  216. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/metadata/CURRENT +1 -0
  217. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/metadata/LOCK +0 -0
  218. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/metadata/LOG +2 -0
  219. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/shared_proto_db/metadata/MANIFEST-000001 +0 -0
  220. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Default/trusted_vault.pb +2 -0
  221. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GPUPersistentCache/GPUCache/6SE4MO4T2PYNTMRZGJ6B4HK2AV4LBDP4/cache.db +0 -0
  222. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GPUPersistentCache/GPUCache/6SE4MO4T2PYNTMRZGJ6B4HK2AV4LBDP4/cache.db-wal +0 -0
  223. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GPUPersistentCache/GPUCache/6SE4MO4T2PYNTMRZGJ6B4HK2AV4LBDP4/cache.journal +0 -0
  224. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GraphiteDawnCache/data_0 +0 -0
  225. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GraphiteDawnCache/data_1 +0 -0
  226. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GraphiteDawnCache/data_2 +0 -0
  227. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GraphiteDawnCache/data_3 +0 -0
  228. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GraphiteDawnCache/f_000001 +0 -0
  229. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/GraphiteDawnCache/index +0 -0
  230. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Last Version +1 -0
  231. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Local State +1 -0
  232. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/Variations +1 -0
  233. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/extensions_crx_cache/metadata.json +1 -0
  234. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/first_party_sets.db +0 -0
  235. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/first_party_sets.db-journal +0 -0
  236. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/segmentation_platform/ukm_db +0 -0
  237. package/dist/extension-js-theme/extension-js/profiles/brave-profile/circular-scarlet-slug/segmentation_platform/ukm_db-wal +0 -0
  238. package/dist/extension-js-theme/theme-dist-bak/chrome/Cached Theme.pak +0 -0
  239. package/dist/extension-js-theme/theme-dist-bak/chrome/manifest.json +22 -0
  240. package/dist/extension-js-theme/theme-dist-bak/chromium/Cached Theme.pak +0 -0
  241. package/dist/extension-js-theme/theme-dist-bak/chromium/manifest.json +22 -0
  242. package/dist/extension-js-theme/theme-dist-bak/edge/Cached Theme.pak +0 -0
  243. package/dist/extension-js-theme/theme-dist-bak/edge/manifest.json +22 -0
  244. package/dist/extension-js-theme/theme-dist-bak/firefox/manifest.json +66 -0
  245. package/dist/feature-scripts-classic-concat-loader.js +81 -0
  246. package/dist/feature-scripts-classic-concat-loader.mjs +81 -0
  247. package/dist/feature-scripts-content-script-wrapper.js +47 -8
  248. package/dist/feature-scripts-content-script-wrapper.mjs +47 -8
  249. package/dist/module.mjs +2 -2
  250. package/dist/preview.mjs +1 -1
  251. package/package.json +13 -12
  252. package/dist/extension-js-devtools/extension-js/chrome/events.ndjson +0 -2
  253. package/dist/extension-js-devtools/extension-js/chrome/ready.json +0 -16
  254. package/dist/extension-js-devtools/extension-js/chromium/events.ndjson +0 -2
  255. package/dist/extension-js-devtools/extension-js/chromium/ready.json +0 -16
  256. package/dist/extension-js-devtools/extension-js/edge/events.ndjson +0 -2
  257. package/dist/extension-js-devtools/extension-js/edge/ready.json +0 -16
  258. package/dist/extension-js-devtools/extension-js/firefox/events.ndjson +0 -2
  259. package/dist/extension-js-devtools/extension-js/firefox/ready.json +0 -16
  260. package/dist/extension-js-theme/extension-js/chrome/events.ndjson +0 -2
  261. package/dist/extension-js-theme/extension-js/chrome/ready.json +0 -16
  262. package/dist/extension-js-theme/extension-js/chromium/events.ndjson +0 -2
  263. package/dist/extension-js-theme/extension-js/chromium/ready.json +0 -16
  264. package/dist/extension-js-theme/extension-js/edge/events.ndjson +0 -2
  265. package/dist/extension-js-theme/extension-js/edge/ready.json +0 -16
  266. /package/dist/{314.mjs → 224.mjs} +0 -0
  267. /package/dist/{526.mjs → 291.mjs} +0 -0
  268. /package/dist/{45.mjs → 875.mjs} +0 -0
@@ -12,13 +12,14 @@ import { getManifestFieldsData } from "browser-extension-manifest-fields";
12
12
  import content_security_policy_parser from "content-security-policy-parser";
13
13
  import path_0 from "path";
14
14
  import fs from "fs";
15
- import { getCanonicalContentScriptEntryName, parseCanonicalContentScriptAsset, getCanonicalContentScriptJsAssetName, getCanonicalContentScriptCssAssetName, EXTENSIONJS_CONTENT_SCRIPT_LAYER } from "./526.mjs";
16
- import { isUsingTypeScript, jsFrameworksIntegrationsEnabled, ensureTypeScriptConfig, ensureOptionalContractModuleLoaded, resolveDevelopInstallRoot, isUsingCustomLoader, resolveOptionalDependencySync, loadOptionalContractModuleWithoutInstall, isUsingIntegration as messages_isUsingIntegration, resolveOptionalContractPackageWithoutInstall, jsFrameworksHmrSummary, parseJsonSafe, getUserTypeScriptConfigFile, jsFrameworksConfigsDetected, hasDependency, resolveDevelopDistFile, optional_deps_resolver_ensureOptionalContractPackageResolved } from "./962.mjs";
17
- import { debugExtensionsToLoad, treeWithSourceFiles, getDirs, bundlerFatalError, bundlerRecompiling, asAbsolute, browserRunnerDisabled, packagingDistributionFiles, PlaywrightPlugin, resolveCompanionExtensionDirs, debugContextPath, noEntrypointsDetected, packagingSourceFiles, debugBrowser, spacerLine, debugOutputPath, messages_ready, manifestInvalidJson, treeWithSourceAndDistFiles, treeWithDistFilesbrowser, getSpecialFoldersDataForCompiler, computeExtensionsToLoad, noCompanionExtensionsResolved } from "./946.mjs";
15
+ import { getCanonicalContentScriptEntryName, parseCanonicalContentScriptAsset, getCanonicalContentScriptJsAssetName, getCanonicalContentScriptCssAssetName, EXTENSIONJS_CONTENT_SCRIPT_LAYER } from "./291.mjs";
16
+ import { isUsingTypeScript, jsFrameworksIntegrationsEnabled, ensureTypeScriptConfig, ensureOptionalContractModuleLoaded, resolveDevelopInstallRoot, isUsingCustomLoader, resolveOptionalDependencySync, loadOptionalContractModuleWithoutInstall, isUsingIntegration as messages_isUsingIntegration, resolveOptionalContractPackageWithoutInstall, jsFrameworksHmrSummary, parseJsonSafe, getUserTypeScriptConfigFile, jsFrameworksConfigsDetected, hasDependency, resolveDevelopDistFile, optional_deps_resolver_ensureOptionalContractPackageResolved } from "./839.mjs";
17
+ import { debugExtensionsToLoad, treeWithSourceFiles, getDirs, bundlerFatalError, bundlerRecompiling, asAbsolute, browserRunnerDisabled, packagingDistributionFiles, PlaywrightPlugin, resolveCompanionExtensionDirs, debugContextPath, noEntrypointsDetected, packagingSourceFiles, debugBrowser, spacerLine, debugOutputPath, messages_ready, manifestInvalidJson, treeWithSourceAndDistFiles, treeWithDistFilesbrowser, getSpecialFoldersDataForCompiler, computeExtensionsToLoad, noCompanionExtensionsResolved } from "./101.mjs";
18
18
  import { scrubBrand, makeSanitizedConsole } from "./0~branding.mjs";
19
- import { findNearestPackageJsonSync, backgroundIsRequiredMessageOnly } from "./314.mjs";
19
+ import { findNearestPackageJsonSync, backgroundIsRequiredMessageOnly } from "./224.mjs";
20
20
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
21
21
  import { dirname as __rspack_dirname } from "node:path";
22
+ var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
22
23
  import * as __rspack_external_path from "path";
23
24
  import * as __rspack_external_fs from "fs";
24
25
  import * as __rspack_external_dotenv from "dotenv";
@@ -29,16 +30,33 @@ __webpack_require__.r(rspack_config_namespaceObject);
29
30
  __webpack_require__.d(rspack_config_namespaceObject, {
30
31
  default: ()=>webpackConfig
31
32
  });
33
+ __rspack_external_path.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
34
+ const CHROMIUM_BASED_BROWSERS = [
35
+ 'chrome',
36
+ 'edge',
37
+ 'brave',
38
+ 'opera',
39
+ 'vivaldi',
40
+ 'yandex'
41
+ ];
42
+ const GECKO_BASED_BROWSERS = [
43
+ 'firefox',
44
+ 'waterfox',
45
+ 'librewolf'
46
+ ];
47
+ [
48
+ ...CHROMIUM_BASED_BROWSERS,
49
+ ...GECKO_BASED_BROWSERS
50
+ ];
51
+ function isChromiumBasedBrowser(browser) {
52
+ return CHROMIUM_BASED_BROWSERS.includes(browser) || String(browser).includes('chromium');
53
+ }
54
+ function isGeckoBasedBrowser(browser) {
55
+ return GECKO_BASED_BROWSERS.includes(browser) || String(browser).includes('gecko') || String(browser).includes('firefox');
56
+ }
32
57
  function filterKeysForThisBrowser(manifest, browser) {
33
- const CHROMIUM_BASED_BROWSERS = [
34
- 'chrome',
35
- 'edge'
36
- ];
37
- const GECKO_BASED_BROWSERS = [
38
- 'firefox'
39
- ];
40
- const isChromiumTarget = CHROMIUM_BASED_BROWSERS.includes(browser) || String(browser).includes('chromium') || 'safari' === browser || 'webkit-based' === browser || String(browser).includes('webkit');
41
- const isGeckoTarget = GECKO_BASED_BROWSERS.includes(browser) || String(browser).includes('gecko');
58
+ const isChromiumTarget = isChromiumBasedBrowser(String(browser)) || 'safari' === browser || 'webkit-based' === browser || String(browser).includes('webkit');
59
+ const isGeckoTarget = isGeckoBasedBrowser(String(browser));
42
60
  const chromiumPrefixes = new Set([
43
61
  'chromium',
44
62
  'chrome',
@@ -375,7 +393,9 @@ function getFilename(feature, filePath) {
375
393
  '.js',
376
394
  '.jsx',
377
395
  '.tsx',
378
- '.ts'
396
+ '.ts',
397
+ '.vue',
398
+ '.svelte'
379
399
  ].includes(entryExt)) fileOutputpath = fileOutputpath.replace(entryExt, '.js');
380
400
  if ([
381
401
  '.html',
@@ -399,10 +419,7 @@ function background_background(manifest) {
399
419
  ...manifest.background,
400
420
  ...manifest.background.scripts && {
401
421
  scripts: [
402
- ...manifest.background.scripts.map((script)=>(()=>{
403
- const raw = String(script);
404
- return getFilename("background/scripts.js", raw);
405
- })())
422
+ ...new Set(manifest.background.scripts.map((script)=>getFilename("background/scripts.js", String(script))))
406
423
  ]
407
424
  }
408
425
  }
@@ -426,12 +443,12 @@ function browserAction(manifest) {
426
443
  ...manifest.browser_action.default_icon && {
427
444
  default_icon: 'string' == typeof manifest.browser_action.default_icon ? (()=>{
428
445
  const raw = String(manifest.browser_action.default_icon);
429
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
446
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
430
447
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
431
448
  return getFilename(target, raw);
432
449
  })() : Object.fromEntries(Object.entries(manifest.browser_action.default_icon).map(([size, icon])=>{
433
450
  const raw = String(icon);
434
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
451
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
435
452
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
436
453
  return [
437
454
  size,
@@ -445,7 +462,7 @@ function browserAction(manifest) {
445
462
  ...themeIcon.light && {
446
463
  light: (()=>{
447
464
  const raw = String(themeIcon.light);
448
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
465
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
449
466
  const target = isPublic ? normalizeManifestOutputPath(raw) : `browser_action/${__rspack_external_path.basename(raw)}`;
450
467
  return getFilename(target, raw);
451
468
  })()
@@ -453,7 +470,7 @@ function browserAction(manifest) {
453
470
  ...themeIcon.dark && {
454
471
  dark: (()=>{
455
472
  const raw = String(themeIcon.dark);
456
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
473
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
457
474
  const target = isPublic ? normalizeManifestOutputPath(raw) : `browser_action/${__rspack_external_path.basename(raw)}`;
458
475
  return getFilename(target, raw);
459
476
  })()
@@ -497,12 +514,12 @@ function pageAction(manifest) {
497
514
  ...manifest.page_action.default_icon && {
498
515
  default_icon: 'string' == typeof manifest.page_action.default_icon ? (()=>{
499
516
  const raw = String(manifest.page_action.default_icon);
500
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
517
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
501
518
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
502
519
  return getFilename(target, raw);
503
520
  })() : Object.fromEntries(Object.entries(manifest.page_action.default_icon).map(([size, icon])=>{
504
521
  const raw = String(icon);
505
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
522
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
506
523
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
507
524
  return [
508
525
  size,
@@ -523,12 +540,12 @@ function sidebarAction(manifest) {
523
540
  ...manifest.sidebar_action.default_icon && {
524
541
  default_icon: 'string' == typeof manifest.sidebar_action.default_icon ? (()=>{
525
542
  const raw = String(manifest.sidebar_action.default_icon);
526
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
543
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
527
544
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
528
545
  return getFilename(target, raw);
529
546
  })() : Object.fromEntries(Object.entries(manifest.sidebar_action.default_icon).map(([size, icon])=>{
530
547
  const raw = String(icon);
531
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
548
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
532
549
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
533
550
  return [
534
551
  size,
@@ -545,7 +562,7 @@ function themeExperiment(manifest) {
545
562
  return te && {
546
563
  theme_experiment: {
547
564
  ...te,
548
- ...te.stylesheet && {
565
+ ...'string' == typeof te.stylesheet && {
549
566
  stylesheet: getFilename(`theme_experiment/${getBasename(te.stylesheet)}`, te.stylesheet)
550
567
  },
551
568
  ...Array.isArray(te.stylesheets) && {
@@ -574,12 +591,12 @@ function action_action(manifest) {
574
591
  ...manifest.action.default_icon && {
575
592
  default_icon: 'string' == typeof manifest.action.default_icon ? (()=>{
576
593
  const raw = String(manifest.action.default_icon);
577
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
594
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
578
595
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
579
596
  return getFilename(target, raw);
580
597
  })() : Object.fromEntries(Object.entries(manifest.action.default_icon).map(([size, icon])=>{
581
598
  const raw = String(icon);
582
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
599
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
583
600
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
584
601
  return [
585
602
  size,
@@ -753,7 +770,7 @@ function icons_icons(manifest) {
753
770
  return manifest.icons && {
754
771
  icons: Object.fromEntries(Object.entries(manifest.icons).map(([size, icon])=>{
755
772
  const raw = String(icon);
756
- const isPublic = /^(?:\/.+|(?:\.\/)?public\/)/i.test(raw);
773
+ const isPublic = /^(?:\/public\/|(?:\.\/)?public\/)/i.test(raw);
757
774
  const target = isPublic ? normalizeManifestOutputPath(raw) : `icons/${__rspack_external_path.basename(raw)}`;
758
775
  return [
759
776
  size,
@@ -817,6 +834,7 @@ function storage(manifest) {
817
834
  };
818
835
  }
819
836
  const theme_getBasename = (filepath)=>__rspack_external_path.basename(filepath);
837
+ const rewriteThemeImage = (value)=>getFilename(`theme/images/${theme_getBasename(value)}`, value);
820
838
  function theme(manifest) {
821
839
  return manifest.theme && {
822
840
  theme: {
@@ -824,7 +842,7 @@ function theme(manifest) {
824
842
  ...manifest.theme.images && {
825
843
  images: Object.fromEntries(Object.entries(manifest.theme.images).map(([key, value])=>[
826
844
  key,
827
- getFilename(`theme/images/${theme_getBasename(value)}`, value)
845
+ Array.isArray(value) ? value.map(rewriteThemeImage) : rewriteThemeImage(value)
828
846
  ]))
829
847
  }
830
848
  }
@@ -851,16 +869,18 @@ function normalizeOutputPath(originalPath) {
851
869
  }
852
870
  function webAccessibleResources(manifest) {
853
871
  if (!manifest.web_accessible_resources || !manifest.web_accessible_resources.length) return;
854
- if (Array.isArray(manifest.web_accessible_resources) && 'string' == typeof manifest.web_accessible_resources[0]) return {
855
- web_accessible_resources: manifest.web_accessible_resources.map((resource)=>getFilename(normalizeOutputPath(resource), resource))
856
- };
857
- const v3 = manifest.web_accessible_resources.filter((entry)=>Array.isArray(entry.resources)).map((entry)=>({
872
+ const mapResource = (resource)=>getFilename(normalizeOutputPath(resource), resource);
873
+ const entries = manifest.web_accessible_resources.map((entry)=>{
874
+ if ('string' == typeof entry) return mapResource(entry);
875
+ if (!entry || !Array.isArray(entry.resources)) return;
876
+ return {
858
877
  ...entry,
859
- resources: (entry.resources || []).map((res)=>getFilename(normalizeOutputPath(res), res))
860
- }));
861
- if (0 === v3.length) return;
878
+ resources: entry.resources.map(mapResource)
879
+ };
880
+ }).filter((entry)=>void 0 !== entry);
881
+ if (0 === entries.length) return;
862
882
  return {
863
- web_accessible_resources: v3
883
+ web_accessible_resources: entries
864
884
  };
865
885
  }
866
886
  function contentSecurityPolicy(manifest) {
@@ -869,12 +889,13 @@ function contentSecurityPolicy(manifest) {
869
889
  };
870
890
  }
871
891
  const omnibox_getBasename = (filepath)=>__rspack_external_path.basename(filepath);
872
- function omnibox(manifest) {
873
- return manifest.omnibox && {
892
+ function omnibox_omnibox(manifest) {
893
+ const omnibox = manifest.omnibox;
894
+ return omnibox && {
874
895
  omnibox: {
875
- ...manifest.omnibox,
876
- ...manifest.omnibox.default_icon && {
877
- default_icon: 'string' == typeof manifest.omnibox.default_icon ? getFilename(`icons/${omnibox_getBasename(manifest.omnibox.default_icon)}`, manifest.omnibox.default_icon) : Object.fromEntries(Object.entries(manifest.omnibox.default_icon).map(([size, icon])=>[
896
+ ...omnibox,
897
+ ...omnibox.default_icon && {
898
+ default_icon: 'string' == typeof omnibox.default_icon ? getFilename(`icons/${omnibox_getBasename(omnibox.default_icon)}`, omnibox.default_icon) : Object.fromEntries(Object.entries(omnibox.default_icon).map(([size, icon])=>[
878
899
  size,
879
900
  getFilename(`icons/${omnibox_getBasename(icon)}`, icon)
880
901
  ]))
@@ -899,7 +920,7 @@ function manifestCommon(manifest, manifestPath) {
899
920
  ...userScripts(manifest),
900
921
  ...webAccessibleResources(manifest),
901
922
  ...contentSecurityPolicy(manifest),
902
- ...omnibox(manifest)
923
+ ...omnibox_omnibox(manifest)
903
924
  };
904
925
  }
905
926
  function getManifestOverrides(manifestPath, manifest) {
@@ -909,14 +930,18 @@ function getManifestOverrides(manifestPath, manifest) {
909
930
  const { [key]: _ignored, ...rest } = obj;
910
931
  return rest;
911
932
  };
933
+ const pickBackground = (obj)=>{
934
+ const value = obj.background;
935
+ return value && 'object' == typeof value ? value : {};
936
+ };
912
937
  const common = manifestCommon(manifestContent, manifestPath);
913
938
  const mv2 = manifestV2(manifestContent);
914
939
  const mv3 = manifestV3(manifestContent);
915
940
  const backgroundMerged = {
916
941
  ...manifestContent.background || {},
917
- ...common.background || {},
918
- ...mv2.background || {},
919
- ...mv3.background || {}
942
+ ...pickBackground(common),
943
+ ...pickBackground(mv2),
944
+ ...pickBackground(mv3)
920
945
  };
921
946
  const merged = {
922
947
  ...manifestContent,
@@ -984,15 +1009,8 @@ function getManifestContent(compilation, manifestPath) {
984
1009
  }
985
1010
  }
986
1011
  function manifest_filterKeysForThisBrowser(manifest, browser) {
987
- const CHROMIUM_BASED_BROWSERS = [
988
- 'chrome',
989
- 'edge'
990
- ];
991
- const GECKO_BASED_BROWSERS = [
992
- 'firefox'
993
- ];
994
- const isChromiumTarget = CHROMIUM_BASED_BROWSERS.includes(browser) || String(browser).includes('chromium');
995
- const isGeckoTarget = GECKO_BASED_BROWSERS.includes(browser) || String(browser).includes('gecko');
1012
+ const isChromiumTarget = isChromiumBasedBrowser(String(browser));
1013
+ const isGeckoTarget = isGeckoBasedBrowser(String(browser));
996
1014
  const chromiumPrefixes = new Set([
997
1015
  'chromium',
998
1016
  'chrome',
@@ -1031,9 +1049,8 @@ function buildCanonicalManifest(manifestPath, manifest, browser) {
1031
1049
  ...JSON.parse(getManifestOverrides(manifestPath, filteredManifest))
1032
1050
  };
1033
1051
  }
1034
- var env_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
1035
1052
  function resolveProcessShim() {
1036
- const candidate = __rspack_external_path.join(env_dirname, '..', 'runtime', 'process-shim.cjs');
1053
+ const candidate = __rspack_external_path.join(__rspack_import_meta_dirname__, '..', 'runtime', 'process-shim.cjs');
1037
1054
  try {
1038
1055
  return __rspack_external_fs.existsSync(candidate) ? candidate : void 0;
1039
1056
  } catch {
@@ -2434,7 +2451,7 @@ async function maybeUseReact(projectPath, options = {}) {
2434
2451
  contractId: 'react-refresh',
2435
2452
  projectPath,
2436
2453
  dependencyId: '@rspack/plugin-react-refresh',
2437
- moduleAdapter: (mod)=>mod && mod.default || mod
2454
+ moduleAdapter: (mod)=>mod && (mod.default || mod.ReactRefreshRspackPlugin) || mod
2438
2455
  });
2439
2456
  const reactPlugins = [
2440
2457
  new ReactRefreshPlugin({
@@ -2910,6 +2927,7 @@ class JsFrameworksPlugin {
2910
2927
  issuerLayer: {
2911
2928
  not: EXTENSIONJS_CONTENT_SCRIPT_LAYER
2912
2929
  },
2930
+ type: "javascript/esm",
2913
2931
  exclude: [
2914
2932
  ...swcRuleBase.exclude,
2915
2933
  (resourcePath)=>isfeatureScriptsContentLike(resourcePath)
@@ -3134,10 +3152,12 @@ class UpdateManifest {
3134
3152
  this.manifestPath = options.manifestPath;
3135
3153
  this.browser = options.browser || 'chrome';
3136
3154
  }
3137
- applyDevOverrides(overrides) {
3138
- if (!overrides.content_scripts) return {};
3139
- return overrides.content_scripts.map((contentObj, index)=>{
3140
- if (contentObj.css.length && !contentObj.js.length) contentObj.js = [
3155
+ applyDevOverrides(manifest) {
3156
+ if (!manifest.content_scripts) return [];
3157
+ return manifest.content_scripts.map((contentObj, index)=>{
3158
+ const css = contentObj.css ?? [];
3159
+ const js = contentObj.js ?? [];
3160
+ if (css.length && !js.length) contentObj.js = [
3141
3161
  getFilename(`content_scripts-${index}`, 'dev.js')
3142
3162
  ];
3143
3163
  return contentObj;
@@ -3165,7 +3185,7 @@ class UpdateManifest {
3165
3185
  if ('development' === compiler.options.mode && Array.isArray(patchedManifest.content_scripts)) for (const cs of patchedManifest.content_scripts)try {
3166
3186
  const hasCss = Array.isArray(cs.css) && cs.css.length > 0;
3167
3187
  const hasJs = Array.isArray(cs.js) && cs.js.length > 0;
3168
- if (hasCss && hasJs && 1 === cs.js.length) devCssStubsAdded++;
3188
+ if (hasCss && hasJs && cs.js?.length === 1) devCssStubsAdded++;
3169
3189
  } catch {}
3170
3190
  console.log(manifestOverridesSummary(overrideKeys, devCssStubsAdded));
3171
3191
  } catch {}
@@ -3189,6 +3209,18 @@ function getSharedFor(compilation) {
3189
3209
  }
3190
3210
  return shared;
3191
3211
  }
3212
+ function cleanMatches(matches) {
3213
+ return matches.map((match)=>{
3214
+ try {
3215
+ const url = new URL(match.replace(/^\*:\/\//, 'https://'));
3216
+ if (match.endsWith(url.pathname)) return `${match.substring(0, match.length - url.pathname.length)}/*`;
3217
+ if ('/' === url.pathname) return `${match}/*`;
3218
+ return match;
3219
+ } catch {
3220
+ return match;
3221
+ }
3222
+ });
3223
+ }
3192
3224
  function warFieldError(filePath, opts) {
3193
3225
  const displayPath = opts?.overrideNotFoundPath || filePath;
3194
3226
  const lines = [];
@@ -3199,6 +3231,10 @@ function warFieldError(filePath, opts) {
3199
3231
  lines.push(`To reference files in ${pintor.yellow('public/')}, use a leading '/' (e.g. ${pintor.yellow('/open-panel.gif')}). These resolve from the built extension root.`);
3200
3232
  lines.push('');
3201
3233
  lines.push(`Fix: Add the file to ${pintor.yellow('public/')} or update the path to the correct '/...' location.`);
3234
+ } else if (opts?.sourceSibling) {
3235
+ lines.push(`Found ${pintor.yellow(opts.sourceSibling)}, but web_accessible_resources entries are copied as-is, not compiled.`);
3236
+ lines.push('');
3237
+ lines.push(`Fix: Import the file from a script so it gets bundled, or move a prebuilt copy to ${pintor.yellow('public/')} and reference it with a leading '/'.`);
3202
3238
  } else {
3203
3239
  lines.push("Relative paths must point to a real source file so the build can emit it.");
3204
3240
  lines.push('');
@@ -3209,6 +3245,16 @@ function warFieldError(filePath, opts) {
3209
3245
  lines.push(`${pintor.red('NOT FOUND')} ${pintor.underline(displayPath)}`);
3210
3246
  return lines.join('\n');
3211
3247
  }
3248
+ function warStringEntryInMv3(entry) {
3249
+ const lines = [];
3250
+ lines.push(`Check the ${pintor.yellow('web_accessible_resources')} field in your ${pintor.yellow('manifest.json')} file.`);
3251
+ lines.push(`Manifest V3 requires object entries with ${pintor.yellow('resources')} and ${pintor.yellow('matches')} (or ${pintor.yellow('extension_ids')}). Plain string entries are the Manifest V2 format and Chrome rejects them at load time.`);
3252
+ lines.push('');
3253
+ lines.push(`Fix: Wrap it like ${pintor.yellow(`{"resources": ["${entry}"], "matches": ["<all_urls>"]}`)} with the matches your pages need.`);
3254
+ lines.push('');
3255
+ lines.push(`${pintor.red('INVALID MV3 ENTRY')} ${pintor.underline(entry)}`);
3256
+ return lines.join('\n');
3257
+ }
3212
3258
  function warInvalidMatchPattern(pattern) {
3213
3259
  const lines = [];
3214
3260
  lines.push(`Check the ${pintor.yellow('web_accessible_resources')} field in your ${pintor.yellow('manifest.json')} file.`);
@@ -3249,6 +3295,33 @@ function emitFileAsAsset(compilation, absPath) {
3249
3295
  compilation.fileDependencies.add(absPath);
3250
3296
  return unixify(outName);
3251
3297
  }
3298
+ function findSourceSibling(absOutputPath) {
3299
+ const candidatesByExt = {
3300
+ '.js': [
3301
+ '.ts',
3302
+ '.tsx',
3303
+ '.jsx',
3304
+ '.vue',
3305
+ '.svelte'
3306
+ ],
3307
+ '.css': [
3308
+ '.scss',
3309
+ '.sass',
3310
+ '.less'
3311
+ ],
3312
+ '.html': [
3313
+ '.njk',
3314
+ '.nunjucks'
3315
+ ]
3316
+ };
3317
+ const ext = __rspack_external_path.extname(absOutputPath);
3318
+ const sourceExts = candidatesByExt[ext];
3319
+ if (!sourceExts) return;
3320
+ for (const sourceExt of sourceExts){
3321
+ const candidate = absOutputPath.slice(0, -ext.length) + sourceExt;
3322
+ if (__rspack_external_fs.existsSync(candidate)) return candidate;
3323
+ }
3324
+ }
3252
3325
  function isFirefox(browser) {
3253
3326
  return !!browser && browser.toLowerCase().includes('firefox');
3254
3327
  }
@@ -3284,30 +3357,33 @@ function resolveUserDeclaredWAR(compilation, manifestPath, manifest, browser) {
3284
3357
  v2,
3285
3358
  v3
3286
3359
  };
3287
- const isV2 = Array.isArray(war) && 'string' == typeof war[0];
3360
+ const isMv2 = 3 !== manifestObj.manifest_version;
3288
3361
  const manifestDir = __rspack_external_path.dirname(manifestPath);
3289
3362
  const projectPath = compilation.options?.context || manifestDir;
3290
- const pushResource = (matches, resource)=>{
3291
- if (2 === manifestObj.manifest_version || isV2) return void v2.add(resource);
3363
+ const pushResource = (matches, resource, extra)=>{
3364
+ if (isMv2) return void v2.add(resource);
3292
3365
  const key = (matches || []).join(',');
3293
3366
  let group = v3.find((g)=>g.matches.join(',') === key);
3294
- if (!group) {
3367
+ if (group) {
3368
+ if (extra && !group.extra) group.extra = extra;
3369
+ } else {
3295
3370
  group = {
3296
3371
  matches: matches || [],
3297
- resources: new Set()
3372
+ resources: new Set(),
3373
+ extra
3298
3374
  };
3299
3375
  v3.push(group);
3300
3376
  }
3301
3377
  group.resources.add(resource);
3302
3378
  };
3303
- const handleOne = (matches, res)=>{
3379
+ const handleOne = (matches, res, extra)=>{
3304
3380
  compilation.errors = compilation.errors || [];
3305
3381
  compilation.warnings = compilation.warnings || [];
3306
3382
  const normalizedOutput = normalizeManifestOutputPath(res);
3307
3383
  const publicCandidate = __rspack_external_path.join(projectPath, 'public', normalizedOutput);
3308
- if (__rspack_external_fs.existsSync(publicCandidate)) return void pushResource(matches, normalizedOutput);
3384
+ if (__rspack_external_fs.existsSync(publicCandidate)) return void pushResource(matches, normalizedOutput, extra);
3309
3385
  __rspack_external_path.isAbsolute(res) || __rspack_external_path.join(manifestDir, isPublicRootLike(res) ? toPublicOutput(res) : res);
3310
- if (/[*?\[\]{}]/.test(res)) return void pushResource(matches, res);
3386
+ if (/[*?\[\]{}]/.test(res)) return void pushResource(matches, res, extra);
3311
3387
  if (isPublicRootLike(res)) {
3312
3388
  const output = normalizeManifestOutputPath(res);
3313
3389
  const publicAbs = __rspack_external_path.join(projectPath, 'public', output);
@@ -3338,7 +3414,7 @@ function resolveUserDeclaredWAR(compilation, manifestPath, manifest, browser) {
3338
3414
  err.file = 'manifest.json';
3339
3415
  compilation.warnings.push(err);
3340
3416
  }
3341
- pushResource(matches, output);
3417
+ pushResource(matches, output, extra);
3342
3418
  return;
3343
3419
  }
3344
3420
  const abs = __rspack_external_path.isAbsolute(res) ? res : __rspack_external_path.join(manifestDir, res);
@@ -3350,46 +3426,47 @@ function resolveUserDeclaredWAR(compilation, manifestPath, manifest, browser) {
3350
3426
  const assetEmitted = Boolean(asset2 && asset2.name === res) || __rspack_external_fs.existsSync(builtAbs);
3351
3427
  if (__rspack_external_fs.existsSync(publicAbsMaybe) || assetEmitted) {
3352
3428
  const output = toPublicOutput('/' + res);
3353
- pushResource(matches, output);
3429
+ pushResource(matches, output, extra);
3354
3430
  return;
3355
3431
  }
3432
+ const sourceSibling = findSourceSibling(abs);
3356
3433
  const msg = warFieldError(abs, {
3357
- relativeRef: res
3434
+ relativeRef: res,
3435
+ sourceSibling: sourceSibling ? __rspack_external_path.relative(manifestDir, sourceSibling) : void 0
3358
3436
  });
3359
3437
  const warn = new core_WebpackError(msg);
3360
3438
  warn.file = 'manifest.json';
3361
3439
  warn.name = 'WARRelativeAssetMissing';
3362
3440
  compilation.warnings.push(warn);
3363
- pushResource(matches, res);
3364
3441
  return;
3365
3442
  }
3366
3443
  const emitted = emitFileAsAsset(compilation, abs);
3367
- pushResource(matches, emitted);
3444
+ pushResource(matches, emitted, extra);
3368
3445
  };
3369
- if (isV2) war.forEach((res)=>handleOne(void 0, res));
3370
- else war.forEach((group)=>{
3371
- const matches = group.matches || [];
3446
+ war.forEach((entry)=>{
3447
+ if ('string' == typeof entry) {
3448
+ if (isMv2) return void handleOne(void 0, entry);
3449
+ const msg = warStringEntryInMv3(entry);
3450
+ const err = new core_WebpackError(msg);
3451
+ err.file = 'manifest.json';
3452
+ err.name = 'WARStringEntryInMv3';
3453
+ compilation.errors = compilation.errors || [];
3454
+ compilation.errors.push(err);
3455
+ return;
3456
+ }
3457
+ if (!entry || 'object' != typeof entry) return;
3458
+ const matches = entry.matches || [];
3372
3459
  validateMatchesOrReport(compilation, matches, browser);
3373
- if (!Array.isArray(group.resources)) return;
3374
- group.resources.forEach((res)=>handleOne(matches, res));
3460
+ if (!Array.isArray(entry.resources)) return;
3461
+ const { resources: _resources, matches: _matches, ...extra } = entry;
3462
+ const extraFields = Object.keys(extra).length > 0 ? extra : void 0;
3463
+ entry.resources.forEach((res)=>handleOne(matches, res, extraFields));
3375
3464
  });
3376
3465
  return {
3377
3466
  v2,
3378
3467
  v3
3379
3468
  };
3380
3469
  }
3381
- function cleanMatches(matches) {
3382
- return matches.map((match)=>{
3383
- try {
3384
- const url = new URL(match.replace(/^\*:\/\//, 'https://'));
3385
- if (match.endsWith(url.pathname)) return `${match.substring(0, match.length - url.pathname.length)}/*`;
3386
- if ('/' === url.pathname) return `${match}/*`;
3387
- return match;
3388
- } catch {
3389
- return match;
3390
- }
3391
- });
3392
- }
3393
3470
  function getAssetSource(compilation, filename) {
3394
3471
  const byGet = 'function' == typeof compilation.getAsset ? compilation.getAsset(filename) : void 0;
3395
3472
  const byAssets = !byGet && compilation.assets ? compilation.assets[filename] : void 0;
@@ -3454,6 +3531,7 @@ function mergeIntoV3Group(groups, normalizedMatches, resources, options) {
3454
3531
  ].sort()
3455
3532
  });
3456
3533
  }
3534
+ const assetScanCache = new WeakMap();
3457
3535
  function isCanonicalContentScriptCss(resource) {
3458
3536
  return /^content_scripts\/content-\d+\.css$/.test(resource);
3459
3537
  }
@@ -3466,6 +3544,7 @@ function generateManifestPatches(compilation, manifestPath, entryImports, browse
3466
3544
  const canonicalManifest = getManifestContent(compilation, manifestPath);
3467
3545
  const resolved = resolveUserDeclaredWAR(compilation, manifestPath, canonicalManifest, browser);
3468
3546
  const webAccessibleResourcesV3 = 3 === canonicalManifest.manifest_version ? resolved.v3.map((g)=>({
3547
+ ...g.extra || {},
3469
3548
  matches: g.matches,
3470
3549
  resources: Array.from(g.resources)
3471
3550
  })) : [];
@@ -3475,11 +3554,17 @@ function generateManifestPatches(compilation, manifestPath, entryImports, browse
3475
3554
  const normalizedMatches = cleanMatches(matches);
3476
3555
  const jsFiles = Array.isArray(contentScript.js) ? contentScript.js : [];
3477
3556
  for (const jsFile of jsFiles){
3478
- const source = getAssetSource(compilation, jsFile);
3479
- if (!source) continue;
3480
- const re = /assets\/[A-Za-z0-9._-]+/g;
3481
- const found = source.match(re) || [];
3482
- const filtered = Array.from(new Set(found.filter((r)=>!r.endsWith('.js') && !r.endsWith('.map')))).sort();
3557
+ const assetForCache = 'function' == typeof compilation.getAsset ? compilation.getAsset(jsFile) : void 0;
3558
+ const cacheKey = assetForCache && 'object' == typeof assetForCache.source ? assetForCache.source : void 0;
3559
+ let filtered = cacheKey ? assetScanCache.get(cacheKey) : void 0;
3560
+ if (!filtered) {
3561
+ const source = getAssetSource(compilation, jsFile);
3562
+ if (!source) continue;
3563
+ const re = /assets\/[A-Za-z0-9._-]+/g;
3564
+ const found = source.match(re) || [];
3565
+ filtered = Array.from(new Set(found.filter((r)=>!r.endsWith('.js') && !r.endsWith('.map')))).sort();
3566
+ if (cacheKey) assetScanCache.set(cacheKey, filtered);
3567
+ }
3483
3568
  if (0 !== filtered.length) mergeIntoV3Group(webAccessibleResourcesV3, normalizedMatches, filtered);
3484
3569
  }
3485
3570
  }
@@ -3533,7 +3618,8 @@ function generateManifestPatches(compilation, manifestPath, entryImports, browse
3533
3618
  const emittedCssUnderContentScripts = assetKeys.filter((k)=>k.startsWith("content_scripts/")).filter((k)=>k.endsWith('.css'));
3534
3619
  const onDiskCssUnderContentScripts = [];
3535
3620
  const outputPath = compilation.options.output?.path;
3536
- if (outputPath) try {
3621
+ const isDevModeBuild = 'production' !== (compilation.options?.mode || 'development');
3622
+ if (outputPath && isDevModeBuild) try {
3537
3623
  const csDir = __rspack_external_path.join(outputPath, "content_scripts");
3538
3624
  if (__rspack_external_fs.existsSync(csDir)) {
3539
3625
  for (const name of __rspack_external_fs.readdirSync(csDir))if (name.endsWith('.css')) onDiskCssUnderContentScripts.push(`content_scripts/${name}`);
@@ -3562,6 +3648,7 @@ function generateManifestPatches(compilation, manifestPath, entryImports, browse
3562
3648
  }
3563
3649
  if (3 === canonicalManifest.manifest_version) {
3564
3650
  if (webAccessibleResourcesV3.length > 0) canonicalManifest.web_accessible_resources = webAccessibleResourcesV3.map((entry)=>({
3651
+ ...entry,
3565
3652
  resources: Array.from(new Set(entry.resources)).sort(),
3566
3653
  matches: Array.from(new Set(entry.matches)).sort()
3567
3654
  })).sort((a, b)=>a.matches.join(',').localeCompare(b.matches.join(',')));
@@ -3812,10 +3899,19 @@ class ApplyDevDefaults {
3812
3899
  return;
3813
3900
  }
3814
3901
  const canonicalManifest = getManifestContent(compilation, this.manifestPath);
3902
+ const contentScriptMatches = Array.isArray(canonicalManifest.content_scripts) ? canonicalManifest.content_scripts.flatMap((cs)=>Array.isArray(cs?.matches) ? cs.matches : []) : [];
3903
+ const hostPermissionsPatch = 3 === canonicalManifest.manifest_version && contentScriptMatches.length > 0 ? {
3904
+ host_permissions: [
3905
+ ...new Set([
3906
+ ...canonicalManifest.host_permissions || [],
3907
+ ...contentScriptMatches
3908
+ ])
3909
+ ]
3910
+ } : {};
3815
3911
  const patchedManifest = {
3816
3912
  ...canonicalManifest,
3817
3913
  content_security_policy: 3 === canonicalManifest.manifest_version ? patchV3CSP(canonicalManifest) : patchV2CSP(canonicalManifest),
3818
- ...3 === canonicalManifest.manifest_version ? canonicalManifest.permissions ? {
3914
+ ...3 === canonicalManifest.manifest_version ? {
3819
3915
  permissions: [
3820
3916
  ...new Set([
3821
3917
  "scripting",
@@ -3826,11 +3922,14 @@ class ApplyDevDefaults {
3826
3922
  ]
3827
3923
  } : {
3828
3924
  permissions: [
3829
- "scripting",
3830
- 'tabs',
3831
- 'management'
3925
+ ...new Set([
3926
+ 'tabs',
3927
+ ...contentScriptMatches,
3928
+ ...canonicalManifest.permissions || []
3929
+ ])
3832
3930
  ]
3833
- } : {},
3931
+ },
3932
+ ...hostPermissionsPatch,
3834
3933
  ...patchBackground(canonicalManifest, this.browser),
3835
3934
  ...patchExternallyConnectable(canonicalManifest),
3836
3935
  web_accessible_resources: 3 === canonicalManifest.manifest_version ? patchWebResourcesV3(canonicalManifest) : patchWebResourcesV2(canonicalManifest)
@@ -4792,7 +4891,25 @@ class AddAssetsToCompilation {
4792
4891
  });
4793
4892
  }
4794
4893
  }
4795
- var dev_server_client_import_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
4894
+ const WILDCARD_HOSTS = new Set([
4895
+ '0.0.0.0',
4896
+ '::',
4897
+ '[::]',
4898
+ '::0',
4899
+ '0.0.0.0.0',
4900
+ '*',
4901
+ ''
4902
+ ]);
4903
+ function isWildcardHost(host) {
4904
+ return WILDCARD_HOSTS.has(String(host ?? '').trim());
4905
+ }
4906
+ function resolveConnectableHost(bindHost, publicHost) {
4907
+ const override = String(publicHost ?? '').trim();
4908
+ if (override) return override;
4909
+ const bind = String(bindHost ?? '').trim();
4910
+ if (isWildcardHost(bind)) return '127.0.0.1';
4911
+ return bind || '127.0.0.1';
4912
+ }
4796
4913
  const dev_server_client_import_cjsRequire = createRequire(import.meta.url);
4797
4914
  function normalizeBoolean(value, fallback) {
4798
4915
  return String('boolean' == typeof value ? value : fallback);
@@ -4808,7 +4925,7 @@ function resolveHmrClientPath() {
4808
4925
  if (!_resolvedClientPath) try {
4809
4926
  _resolvedClientPath = dev_server_client_import_cjsRequire.resolve('@rspack/dev-server/client/index.js', {
4810
4927
  paths: [
4811
- dev_server_client_import_dirname
4928
+ __rspack_import_meta_dirname__
4812
4929
  ]
4813
4930
  });
4814
4931
  } catch {
@@ -4820,7 +4937,7 @@ function resolveHmrHotPath() {
4820
4937
  if (!_resolvedHotPath) try {
4821
4938
  _resolvedHotPath = dev_server_client_import_cjsRequire.resolve('webpack/hot/dev-server', {
4822
4939
  paths: [
4823
- dev_server_client_import_dirname
4940
+ __rspack_import_meta_dirname__
4824
4941
  ]
4825
4942
  });
4826
4943
  } catch {
@@ -4838,7 +4955,8 @@ function getDevServerHmrImports(compiler) {
4838
4955
  const clientConfig = devServer?.client && 'object' == typeof devServer.client ? devServer.client : {};
4839
4956
  const webSocketURL = clientConfig.webSocketURL && 'object' == typeof clientConfig.webSocketURL ? clientConfig.webSocketURL : {};
4840
4957
  const protocol = String(webSocketURL.protocol || envProtocol || 'ws');
4841
- const hostname = String(webSocketURL.hostname || devServer?.host || envHost || '127.0.0.1');
4958
+ const envConnectableHost = process.env.EXTENSION_DEV_SERVER_CONNECTABLE_HOST;
4959
+ const hostname = String(webSocketURL.hostname || envConnectableHost || resolveConnectableHost(devServer?.host || envHost));
4842
4960
  const port = webSocketURL.port ?? devServer?.port ?? envPort ?? process.env.EXTENSION_PUBLIC_PORT ?? 8080;
4843
4961
  const pathname = String(webSocketURL.pathname || envPath || '/ws');
4844
4962
  const logging = String(clientConfig.logging || 'none');
@@ -5242,6 +5360,7 @@ function getScriptEntries(scriptPath) {
5242
5360
  ] : [];
5243
5361
  const fileAssets = scriptEntries.filter((scriptAsset)=>{
5244
5362
  const validFile = __rspack_external_fs.existsSync(scriptAsset);
5363
+ if (/\.d\.[cm]?ts$/i.test(scriptAsset)) return false;
5245
5364
  const assetExtension = __rspack_external_path.extname(scriptAsset);
5246
5365
  return validFile && ('.js' === assetExtension || '.cjs' === assetExtension || '.mjs' === assetExtension || '.jsx' === assetExtension || '.mjsx' === assetExtension || '.ts' === assetExtension || '.mts' === assetExtension || '.mtsx' === assetExtension || '.tsx' === assetExtension);
5247
5366
  });
@@ -5257,7 +5376,6 @@ function getCssEntries(scriptPath) {
5257
5376
  });
5258
5377
  return fileAssets;
5259
5378
  }
5260
- var get_bridge_scripts_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
5261
5379
  function findPackageRoot(startDir) {
5262
5380
  let current = startDir;
5263
5381
  for(let i = 0; i < 15; i++){
@@ -5280,7 +5398,7 @@ function resolveExistingFile(candidates) {
5280
5398
  }
5281
5399
  }
5282
5400
  function resolveMainWorldBridgeSourcePath(options) {
5283
- const lookupDir = options?.lookupDir || get_bridge_scripts_dirname;
5401
+ const lookupDir = options?.lookupDir || __rspack_import_meta_dirname__;
5284
5402
  const packageRoot = options?.packageRoot || findPackageRoot(lookupDir);
5285
5403
  return resolveExistingFile([
5286
5404
  path_0.resolve(lookupDir, 'main-world-bridge'),
@@ -5306,6 +5424,17 @@ function getMainWorldBridgeScripts(manifestPath) {
5306
5424
  } catch {}
5307
5425
  return bridgeScripts;
5308
5426
  }
5427
+ function canonicalizeDir(dir) {
5428
+ try {
5429
+ return __rspack_external_fs.realpathSync.native(dir);
5430
+ } catch {
5431
+ try {
5432
+ return __rspack_external_fs.realpathSync(dir);
5433
+ } catch {
5434
+ return dir;
5435
+ }
5436
+ }
5437
+ }
5309
5438
  class AddContentScriptWrapper {
5310
5439
  static getBridgeScripts(manifestPath) {
5311
5440
  return getMainWorldBridgeScripts(manifestPath);
@@ -5319,16 +5448,39 @@ class AddContentScriptWrapper {
5319
5448
  resolveLoader() {
5320
5449
  return resolveDevelopDistFile("feature-scripts-content-script-wrapper");
5321
5450
  }
5451
+ resolveConcatLoader() {
5452
+ return resolveDevelopDistFile("feature-scripts-classic-concat-loader");
5453
+ }
5322
5454
  apply(compiler) {
5323
- const manifestDir = __rspack_external_path.dirname(this.manifestPath);
5455
+ const manifestDir = canonicalizeDir(__rspack_external_path.dirname(this.manifestPath));
5324
5456
  const packageJsonPath = findNearestPackageJsonSync(this.manifestPath);
5325
- const packageJsonDir = packageJsonPath ? __rspack_external_path.dirname(packageJsonPath) : manifestDir;
5457
+ const packageJsonDir = canonicalizeDir(packageJsonPath ? __rspack_external_path.dirname(packageJsonPath) : manifestDir);
5326
5458
  const includeDirs = packageJsonDir === manifestDir ? [
5327
5459
  manifestDir
5328
5460
  ] : [
5329
5461
  manifestDir,
5330
5462
  packageJsonDir
5331
5463
  ];
5464
+ compiler.options.module.rules.push({
5465
+ test: /\.(js|cjs|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,
5466
+ resourceQuery: /__extensionjs_classic_concat__/,
5467
+ include: includeDirs,
5468
+ exclude: [
5469
+ /([\\/])node_modules\1/
5470
+ ],
5471
+ use: [
5472
+ {
5473
+ loader: this.resolveLoader(),
5474
+ options: {
5475
+ manifestPath: this.manifestPath,
5476
+ mode: compiler.options.mode
5477
+ }
5478
+ },
5479
+ {
5480
+ loader: this.resolveConcatLoader()
5481
+ }
5482
+ ]
5483
+ });
5332
5484
  compiler.options.module.rules.push({
5333
5485
  test: /\.(js|cjs|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,
5334
5486
  include: includeDirs,
@@ -5350,7 +5502,28 @@ class AddContentScriptWrapper {
5350
5502
  const add_scripts_isRemoteUrl = (entry)=>/^([a-z][a-z0-9+.-]*:)?\/\//i.test(entry);
5351
5503
  const isContentScriptFeature = (feature)=>feature.startsWith("content_scripts/");
5352
5504
  const isScriptsFolderFeature = (feature)=>feature.startsWith("scripts/");
5505
+ const isBackgroundScriptsFeature = (feature)=>"background/scripts" === feature;
5353
5506
  function createSequentialEntryModule(feature, entryImports) {
5507
+ const isCss = (p)=>/\.css$/i.test(p);
5508
+ const jsFiles = entryImports.filter((p)=>!isCss(p));
5509
+ const cssFiles = entryImports.filter(isCss);
5510
+ const isClassic = (p)=>{
5511
+ try {
5512
+ const src = __rspack_external_fs.readFileSync(p, 'utf8');
5513
+ return !/^\s*import[\s{('"*]/m.test(src) && !/^\s*export[\s{*( ]/m.test(src);
5514
+ } catch {
5515
+ return false;
5516
+ }
5517
+ };
5518
+ const concatenateClassic = jsFiles.length > 1 && jsFiles.every(isClassic);
5519
+ if (concatenateClassic) {
5520
+ const queryData = encodeURIComponent(JSON.stringify({
5521
+ feature,
5522
+ js: jsFiles,
5523
+ css: cssFiles
5524
+ }));
5525
+ return `${jsFiles[0]}?__extensionjs_classic_concat__=${queryData}`;
5526
+ }
5354
5527
  const source = [
5355
5528
  `/* extension.js sequential entry: ${feature} */`,
5356
5529
  ...entryImports.map((entryImport)=>`import ${JSON.stringify(String(entryImport))};`)
@@ -5428,7 +5601,7 @@ class AddScripts {
5428
5601
  ...cssImports
5429
5602
  ])
5430
5603
  ];
5431
- const shouldUseSequentialEntryModule = isContentScriptFeature(feature) && scriptImports.length > 1;
5604
+ const shouldUseSequentialEntryModule = (isContentScriptFeature(feature) || isBackgroundScriptsFeature(feature)) && scriptImports.length > 1;
5432
5605
  const finalEntryImports = shouldUseSequentialEntryModule ? [
5433
5606
  createSequentialEntryModule(feature, entryImports)
5434
5607
  ] : entryImports;
@@ -6311,7 +6484,8 @@ class DevServerConfigPlugin {
6311
6484
  protocol: 'ws'
6312
6485
  });
6313
6486
  setDefault(devServer.client.webSocketURL, 'protocol', 'ws');
6314
- if (devServer.host) setDefault(devServer.client.webSocketURL, 'hostname', devServer.host);
6487
+ const connectableHost = resolveClientHost(process.env.EXTENSION_DEV_SERVER_CONNECTABLE_HOST, devServer.host);
6488
+ if (connectableHost) setDefault(devServer.client.webSocketURL, 'hostname', connectableHost);
6315
6489
  if (devServer.port) setDefault(devServer.client.webSocketURL, 'port', devServer.port);
6316
6490
  setDefault(devServer, 'allowedHosts', 'all');
6317
6491
  setDefault(devServer, 'headers', {
@@ -6331,6 +6505,21 @@ class DevServerConfigPlugin {
6331
6505
  function setDefault(obj, key, val) {
6332
6506
  if (isObject(obj) && void 0 === obj[key]) obj[key] = val;
6333
6507
  }
6508
+ const HMRDevServer_WILDCARD_HOSTS = new Set([
6509
+ '0.0.0.0',
6510
+ '::',
6511
+ '[::]',
6512
+ '::0',
6513
+ '*',
6514
+ ''
6515
+ ]);
6516
+ function resolveClientHost(connectable, bindHost) {
6517
+ const resolved = String(connectable ?? '').trim();
6518
+ if (resolved) return resolved;
6519
+ const bind = 'string' == typeof bindHost ? bindHost.trim() : '';
6520
+ if (!bind) return;
6521
+ return HMRDevServer_WILDCARD_HOSTS.has(bind) ? '127.0.0.1' : bind;
6522
+ }
6334
6523
  function isObject(x) {
6335
6524
  return 'object' == typeof x && null !== x;
6336
6525
  }
@@ -6659,6 +6848,10 @@ const BRIDGE_PRODUCER_SOURCE = `;(function () {
6659
6848
  var PORT = parseInt("__EXTJS_CONTROL_PORT__", 10);
6660
6849
  var INSTANCE_ID = "__EXTJS_INSTANCE_ID__";
6661
6850
  var CONTEXT = "__EXTJS_CONTEXT__";
6851
+ // Connectable host of the dev-server control WS. Baked from the resolved
6852
+ // connectable host (loopback locally; the public host for remote/devcontainer).
6853
+ var HOST = "__EXTJS_CONTROL_HOST__";
6854
+ if (!HOST || HOST.indexOf("__EXTJS") === 0) HOST = "127.0.0.1";
6662
6855
  if (!PORT || PORT < 1) return;
6663
6856
 
6664
6857
  var WS = g.WebSocket;
@@ -6976,6 +7169,158 @@ const BRIDGE_PRODUCER_SOURCE = `;(function () {
6976
7169
  }
6977
7170
  }
6978
7171
 
7172
+ function noopLastError() { try { void g.chrome.runtime.lastError; } catch (e) {} }
7173
+
7174
+ // Only http(s)/file/ftp tabs can run a content script; skip chrome://, the
7175
+ // extension's own pages, about:blank, etc.
7176
+ function isInjectableUrl(url) {
7177
+ return typeof url === "string" && /^(https?|file|ftp):/i.test(url);
7178
+ }
7179
+
7180
+ // Re-inject a single declared content-script entry's fresh files into every
7181
+ // open tab it matches, in place. The wrapper's reinject runtime tears down
7182
+ // the previous mount (matched by data-extjs-reinject-owner + build hash) and
7183
+ // mounts the new one — so this is the controller-less equivalent of the CDP
7184
+ // controller's reinjection, just driven from inside the extension.
7185
+ function reinjectContentScriptEntry(entry) {
7186
+ var chrome = g.chrome;
7187
+ var matches = (entry && entry.matches) || [];
7188
+ if (!Array.isArray(matches) || !matches.length) return;
7189
+ var jsFiles = ((entry && entry.js) || []).filter(function (f) { return typeof f === "string"; });
7190
+ var cssFiles = ((entry && entry.css) || []).filter(function (f) { return typeof f === "string"; });
7191
+ if (!jsFiles.length && !cssFiles.length) return;
7192
+ var world = entry.world === "MAIN" ? "MAIN" : "ISOLATED";
7193
+ var allFrames = !!entry.all_frames;
7194
+ try {
7195
+ chrome.tabs.query({url: matches}, function (tabs) {
7196
+ var err = null;
7197
+ try { err = chrome.runtime.lastError; } catch (e) {}
7198
+ if (err || !tabs) return;
7199
+ for (var i = 0; i < tabs.length; i++) {
7200
+ (function (tab) {
7201
+ if (!tab || tab.id == null || !isInjectableUrl(tab.url)) return;
7202
+ var target = {tabId: tab.id, allFrames: allFrames};
7203
+ if (cssFiles.length && chrome.scripting.insertCSS) {
7204
+ try { chrome.scripting.insertCSS({target: target, files: cssFiles}, noopLastError); } catch (e) {}
7205
+ }
7206
+ if (jsFiles.length && chrome.scripting.executeScript) {
7207
+ try {
7208
+ chrome.scripting.executeScript(
7209
+ {target: target, files: jsFiles, world: world, injectImmediately: true},
7210
+ noopLastError
7211
+ );
7212
+ } catch (e) {}
7213
+ }
7214
+ })(tabs[i]);
7215
+ }
7216
+ });
7217
+ } catch (e) {}
7218
+ }
7219
+
7220
+ // Re-inject all content scripts into their open tabs. Reads the manifest
7221
+ // FROM DISK (not chrome.runtime.getManifest(), which is frozen at extension-
7222
+ // registration time) because dev content-script filenames are content-hashed
7223
+ // and change on every edit — disk has the new js/css paths.
7224
+ function reinjectContentScripts() {
7225
+ var chrome = g.chrome;
7226
+ try {
7227
+ if (typeof g.fetch !== "function" || !chrome.scripting) return false;
7228
+ g.fetch(chrome.runtime.getURL("manifest.json"), {cache: "no-store"})
7229
+ .then(function (r) { return r.json(); })
7230
+ .then(function (manifest) {
7231
+ var entries = (manifest && manifest.content_scripts) || [];
7232
+ for (var i = 0; i < entries.length; i++) reinjectContentScriptEntry(entries[i]);
7233
+ reregisterForFutureNavigations(entries);
7234
+ })
7235
+ .catch(function () {});
7236
+ return true;
7237
+ } catch (e) { return false; }
7238
+ }
7239
+
7240
+ function mapRunAt(runAt) {
7241
+ if (runAt === "document_start") return "document_start";
7242
+ if (runAt === "document_end") return "document_end";
7243
+ return "document_idle";
7244
+ }
7245
+
7246
+ // Re-register the content scripts dynamically (chrome.scripting) pointing at
7247
+ // the fresh files, so tabs opened AFTER an edit also get the new build. The
7248
+ // static manifest registration still points at the old content-hashed file
7249
+ // (it only updates on an extension reload) and keeps firing on new
7250
+ // navigations; the dynamic registration injects the new file alongside it,
7251
+ // and the wrapper's reinject runtime converges the mount to the newest build.
7252
+ // Idempotent: update an existing id, else register it.
7253
+ function reregisterForFutureNavigations(entries) {
7254
+ var chrome = g.chrome;
7255
+ if (
7256
+ !chrome.scripting ||
7257
+ !chrome.scripting.registerContentScripts ||
7258
+ !chrome.scripting.getRegisteredContentScripts
7259
+ ) return;
7260
+
7261
+ var scripts = [];
7262
+ for (var i = 0; i < entries.length; i++) {
7263
+ var e = entries[i] || {};
7264
+ if (!Array.isArray(e.matches) || !e.matches.length) continue;
7265
+ var js = (e.js || []).filter(function (f) { return typeof f === "string"; });
7266
+ var css = (e.css || []).filter(function (f) { return typeof f === "string"; });
7267
+ if (!js.length && !css.length) continue;
7268
+ var s = {
7269
+ id: "extjs-dev-cs-" + i,
7270
+ matches: e.matches,
7271
+ runAt: mapRunAt(e.run_at),
7272
+ allFrames: !!e.all_frames,
7273
+ world: e.world === "MAIN" ? "MAIN" : "ISOLATED"
7274
+ };
7275
+ if (js.length) s.js = js;
7276
+ if (css.length) s.css = css;
7277
+ scripts.push(s);
7278
+ }
7279
+ if (!scripts.length) return;
7280
+
7281
+ try {
7282
+ chrome.scripting.getRegisteredContentScripts(function (existing) {
7283
+ try { void chrome.runtime.lastError; } catch (e) {}
7284
+ var have = {};
7285
+ if (existing) for (var k = 0; k < existing.length; k++) have[existing[k].id] = true;
7286
+ var toRegister = [], toUpdate = [];
7287
+ for (var j = 0; j < scripts.length; j++) {
7288
+ (have[scripts[j].id] ? toUpdate : toRegister).push(scripts[j]);
7289
+ }
7290
+ if (toRegister.length) {
7291
+ try { chrome.scripting.registerContentScripts(toRegister, noopLastError); } catch (e) {}
7292
+ }
7293
+ if (toUpdate.length) {
7294
+ try { chrome.scripting.updateContentScripts(toUpdate, noopLastError); } catch (e) {}
7295
+ }
7296
+ });
7297
+ } catch (e) {}
7298
+ }
7299
+
7300
+ // Perform a dev-loop reload without the CDP controller:
7301
+ // - content-scripts: re-inject the fresh script into open matching tabs in
7302
+ // place (no extension restart), the controller-less equivalent of CDP
7303
+ // reinjection. Needs the scripting permission + host access to the tab —
7304
+ // both injected in dev by ApplyDevDefaults. Falls back to a full reload
7305
+ // if scripting is unavailable.
7306
+ // - service-worker / full / manifest: restart the whole extension so it
7307
+ // re-registers from the fresh manifest.
7308
+ function performDevReload(type) {
7309
+ var chrome = g.chrome;
7310
+ if (!chrome) return;
7311
+
7312
+ var fullReload = function () {
7313
+ // Deferred so any in-flight result/log frame flushes before the SW dies.
7314
+ try { setTimeout(function () { try { chrome.runtime.reload(); } catch (e) {} }, 50); } catch (e) {}
7315
+ };
7316
+
7317
+ if (type === "content-scripts" && chrome.scripting && chrome.tabs && chrome.tabs.query) {
7318
+ if (reinjectContentScripts()) return;
7319
+ }
7320
+
7321
+ fullReload();
7322
+ }
7323
+
6979
7324
  function sanitize(args) {
6980
7325
  var out = [];
6981
7326
  for (var i = 0; i < args.length; i++) {
@@ -7014,7 +7359,7 @@ const BRIDGE_PRODUCER_SOURCE = `;(function () {
7014
7359
 
7015
7360
  function connect() {
7016
7361
  try {
7017
- socket = new WS("ws://127.0.0.1:" + PORT + "/extjs-control");
7362
+ socket = new WS("ws://" + HOST + ":" + PORT + "/extjs-control");
7018
7363
  } catch (e) {
7019
7364
  schedule();
7020
7365
  return;
@@ -7033,6 +7378,10 @@ const BRIDGE_PRODUCER_SOURCE = `;(function () {
7033
7378
  try { frame = JSON.parse(typeof ev.data === "string" ? ev.data : ""); } catch (e) { return; }
7034
7379
  if (frame && frame.type === "command") {
7035
7380
  try { executeCommand(frame); } catch (e) { replyErr(frame.cmdId, "ExecutorError", e); }
7381
+ } else if (frame && frame.type === "reload") {
7382
+ // Dev-loop reload broadcast (no CDP controller — see broker.broadcastReload).
7383
+ // Fire-and-forget: no result frame is expected.
7384
+ try { performDevReload(frame.reloadType || "full"); } catch (e) {}
7036
7385
  }
7037
7386
  };
7038
7387
  socket.onclose = function () {
@@ -7201,17 +7550,19 @@ function buildBridgeRelaySource(opts) {
7201
7550
  }
7202
7551
  function buildBridgeProducerSource(opts) {
7203
7552
  if (!opts.controlPort || opts.controlPort < 1) return '';
7204
- return BRIDGE_PRODUCER_SOURCE.replace(/__EXTJS_CONTROL_PORT__/g, String(opts.controlPort)).replace(/__EXTJS_INSTANCE_ID__/g, String(opts.instanceId)).replace(/__EXTJS_CONTEXT__/g, String(opts.context || 'background'));
7553
+ return BRIDGE_PRODUCER_SOURCE.replace(/__EXTJS_CONTROL_PORT__/g, String(opts.controlPort)).replace(/__EXTJS_INSTANCE_ID__/g, String(opts.instanceId)).replace(/__EXTJS_CONTEXT__/g, String(opts.context || 'background')).replace(/__EXTJS_CONTROL_HOST__/g, String(opts.host || '127.0.0.1'));
7205
7554
  }
7206
7555
  const inject_bridge_producer_BACKGROUND_ASSET = /(^|\/)background\/(?:service_worker|scripts?)\.js$/i;
7207
7556
  class InjectBridgeProducer {
7208
7557
  apply(compiler) {
7209
7558
  const controlPort = parseInt(String(process.env.EXTENSION_CONTROL_PORT || ''), 10);
7210
7559
  const instanceId = String(process.env.EXTENSION_INSTANCE_ID || '');
7560
+ const host = String(process.env.EXTENSION_DEV_SERVER_CONNECTABLE_HOST || '').trim() || '127.0.0.1';
7211
7561
  const source = buildBridgeProducerSource({
7212
7562
  controlPort: Number.isFinite(controlPort) ? controlPort : null,
7213
7563
  instanceId,
7214
- context: 'background'
7564
+ context: 'background',
7565
+ host
7215
7566
  });
7216
7567
  if (!source) return;
7217
7568
  compiler.hooks.thisCompilation.tap(InjectBridgeProducer.name, (compilation)=>{
@@ -7608,13 +7959,17 @@ function validateLocales(compiler, compilation, manifestPath) {
7608
7959
  return false;
7609
7960
  }
7610
7961
  }
7611
- } catch {}
7962
+ } catch (error) {
7963
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(localesValidationDetected(`could not scan __MSG__ placeholders in _locales/${defaultLocale}/messages.json: ${String(error?.message || error)}`));
7964
+ }
7612
7965
  } else if (hasLocalesRoot) {
7613
7966
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(localesValidationDetected('_locales present but no default_locale'));
7614
7967
  pushCompilationError(compiler, compilation, 'LocalesValidationError', localesPresentButNoDefaultLocale(), 'manifest.json');
7615
7968
  return false;
7616
7969
  }
7617
- } catch {}
7970
+ } catch (error) {
7971
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(localesValidationDetected(`manifest.json could not be read for locale validation, deferring to manifest validation: ${String(error?.message || error)}`));
7972
+ }
7618
7973
  try {
7619
7974
  const localesRoot = resolveLocalesFolder(manifestPath, projectRoot);
7620
7975
  if (localesRoot && __rspack_external_fs.existsSync(localesRoot)) {
@@ -7631,7 +7986,9 @@ function validateLocales(compiler, compilation, manifestPath) {
7631
7986
  }
7632
7987
  }
7633
7988
  }
7634
- } catch {}
7989
+ } catch (error) {
7990
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(localesValidationDetected(`could not scan _locales for JSON validity: ${String(error?.message || error)}`));
7991
+ }
7635
7992
  return true;
7636
7993
  }
7637
7994
  function processLocaleAssets(compiler, compilation, manifestPath) {
@@ -8073,6 +8430,7 @@ class EmitFile {
8073
8430
  let outputDir = group;
8074
8431
  if (('action' === group || 'browser_action' === group || 'page_action' === group || 'sidebar_action' === group) && 'default_icon' === sub) outputDir = 'icons';
8075
8432
  else if ('browser_action' === group && 'theme_icons' === sub) outputDir = 'browser_action';
8433
+ else if ('theme' === group && 'images' === sub) outputDir = 'theme/images';
8076
8434
  const filename = `${outputDir}/${basename}`;
8077
8435
  compilation.emitAsset(filename, rawSource);
8078
8436
  emittedCount++;
@@ -8476,7 +8834,10 @@ class plugin_web_extension_WebExtensionPlugin {
8476
8834
  }).apply(compiler);
8477
8835
  new IconsPlugin({
8478
8836
  manifestPath,
8479
- includeList: manifestFieldsData.icons,
8837
+ includeList: {
8838
+ ...manifestFieldsData.icons,
8839
+ ...manifestFieldsData.theme
8840
+ },
8480
8841
  browser: this.browser
8481
8842
  }).apply(compiler);
8482
8843
  new WebResourcesPlugin({
@@ -8521,7 +8882,6 @@ function compatibilityPolyfillSkipped(reason, browser) {
8521
8882
  function compatibilityPolyfillDisabled(browser) {
8522
8883
  return `${pintor.gray('⏵⏵⏵')} Compatibility: Polyfill ${pintor.gray('disabled')} for ${capitalizedBrowserName(browser)}`;
8523
8884
  }
8524
- var feature_polyfill_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
8525
8885
  const feature_polyfill_cjsRequire = createRequire(import.meta.url);
8526
8886
  class PolyfillPlugin {
8527
8887
  browser;
@@ -8533,7 +8893,7 @@ class PolyfillPlugin {
8533
8893
  const polyfillPath = feature_polyfill_cjsRequire.resolve('webextension-polyfill/dist/browser-polyfill.js', {
8534
8894
  paths: [
8535
8895
  compiler.options.context,
8536
- feature_polyfill_dirname
8896
+ __rspack_import_meta_dirname__
8537
8897
  ].filter(Boolean)
8538
8898
  });
8539
8899
  const currentResolve = compiler.options.resolve || {};
@@ -8743,7 +9103,6 @@ class PerfBudgetsPlugin {
8743
9103
  });
8744
9104
  }
8745
9105
  }
8746
- var rspack_config_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
8747
9106
  function webpackConfig(projectStructure, devOptions) {
8748
9107
  const { manifestPath } = projectStructure;
8749
9108
  const { packageJsonDir } = getDirs(projectStructure);
@@ -8759,7 +9118,7 @@ function webpackConfig(projectStructure, devOptions) {
8759
9118
  projectRoot: packageJsonDir,
8760
9119
  config: devOptions.extensions
8761
9120
  });
8762
- const unpackedExtensionDirsToLoad = computeExtensionsToLoad(__rspack_external_path.resolve(rspack_config_dirname, '..'), devOptions.mode, devOptions.browser, primaryExtensionOutputDir, companionUnpackedExtensionDirs, manifestPath);
9121
+ const unpackedExtensionDirsToLoad = computeExtensionsToLoad(__rspack_external_path.resolve(__rspack_import_meta_dirname__, '..'), devOptions.mode, devOptions.browser, primaryExtensionOutputDir, companionUnpackedExtensionDirs, manifestPath);
8763
9122
  const debug = 'true' === process.env.EXTENSION_AUTHOR_MODE;
8764
9123
  const transpilePackageDirs = resolveTranspilePackageDirs(packageJsonDir, devOptions.transpilePackages);
8765
9124
  if (debug) {
@@ -8769,6 +9128,7 @@ function webpackConfig(projectStructure, devOptions) {
8769
9128
  console.log(debugExtensionsToLoad(unpackedExtensionDirsToLoad));
8770
9129
  if (void 0 !== devOptions.extensions && 0 === companionUnpackedExtensionDirs.length) console.warn(noCompanionExtensionsResolved());
8771
9130
  }
9131
+ const missingCssAssets = new Set();
8772
9132
  const plugins = [
8773
9133
  new CompilationPlugin({
8774
9134
  manifestPath,
@@ -8809,7 +9169,47 @@ function webpackConfig(projectStructure, devOptions) {
8809
9169
  }),
8810
9170
  new PerfBudgetsPlugin({
8811
9171
  budgets: devOptions.perfBudgets
8812
- })
9172
+ }),
9173
+ {
9174
+ apply (compiler) {
9175
+ compiler.hooks.afterCompile.tap('warn-missing-css-assets', (compilation)=>{
9176
+ if (0 === missingCssAssets.size) return;
9177
+ const ErrorCtor = compiler.rspack?.WebpackError || Error;
9178
+ for (const request of missingCssAssets){
9179
+ const warning = new ErrorCtor(`CSS asset "${request}" was not found on disk; the url() is left unresolved. The browser requests it at runtime and loads the extension regardless. Fix the path if it's a typo, or add the asset if it should ship.`);
9180
+ warning.name = 'MissingCssAssetWarning';
9181
+ compilation.warnings.push(warning);
9182
+ }
9183
+ missingCssAssets.clear();
9184
+ });
9185
+ }
9186
+ },
9187
+ {
9188
+ apply (compiler) {
9189
+ const target = String(devOptions.browser);
9190
+ const isChromiumTarget = [
9191
+ 'chrome',
9192
+ 'edge'
9193
+ ].includes(target) || target.includes('chromium');
9194
+ if (manifest?.manifest_version !== 2 || !isChromiumTarget) return;
9195
+ compiler.hooks.thisCompilation.tap('warn-mv2-on-chromium', (compilation)=>{
9196
+ const ErrorCtor = compiler.rspack?.WebpackError || Error;
9197
+ const usesBlockingWebRequest = Array.isArray(manifest.permissions) && manifest.permissions.includes('webRequestBlocking');
9198
+ const warning = new ErrorCtor([
9199
+ "This extension declares Manifest V2, which Chrome and Edge no longer load — ",
9200
+ `the ${target} build will not install. Options:`,
9201
+ "",
9202
+ " • Build for Firefox (still supports MV2): extension build --browser firefox",
9203
+ " • Migrate the manifest to MV3 (action, background.service_worker, host_permissions)",
9204
+ " • Or ship both from one source with browser-prefixed keys",
9205
+ " (chromium:manifest_version: 3, firefox:manifest_version: 2, …)",
9206
+ usesBlockingWebRequest ? `\n Note: this extension uses webRequestBlocking, which MV3 replaces with\n declarativeNetRequest — a code change, not just a manifest edit.` : ''
9207
+ ].filter((line)=>'' !== line).join('\n'));
9208
+ warning.name = 'ManifestV2OnChromiumWarning';
9209
+ compilation.warnings.push(warning);
9210
+ });
9211
+ }
9212
+ }
8813
9213
  ];
8814
9214
  plugins.push(new PlaywrightPlugin({
8815
9215
  packageJsonDir,
@@ -8818,6 +9218,7 @@ function webpackConfig(projectStructure, devOptions) {
8818
9218
  outputPath: primaryExtensionOutputDir,
8819
9219
  manifestPath,
8820
9220
  port: devOptions.port,
9221
+ host: process.env.EXTENSION_DEV_SERVER_CONNECTABLE_HOST || devOptions.host,
8821
9222
  instanceId: devOptions.instanceId,
8822
9223
  controlPort: devOptions.controlPort,
8823
9224
  controlPath: devOptions.controlPath,
@@ -8832,6 +9233,22 @@ function webpackConfig(projectStructure, devOptions) {
8832
9233
  mode: devOptions.mode || 'development',
8833
9234
  entry: {},
8834
9235
  target: 'web',
9236
+ externals: [
9237
+ ({ request, dependencyType, context }, callback)=>{
9238
+ if ('string' != typeof request) return callback();
9239
+ if (/^(chrome|moz)-extension:/i.test(request)) return callback(null, request, 'asset');
9240
+ if ('url' === dependencyType && context && !/^[a-z][\w+.-]*:/i.test(request) && !/^[/#]/.test(request) && !request.startsWith('//')) {
9241
+ const assetPath = request.split(/[?#]/)[0];
9242
+ try {
9243
+ if (assetPath && !__rspack_external_fs.existsSync(__rspack_external_path.resolve(context, assetPath))) {
9244
+ missingCssAssets.add(request);
9245
+ return callback(null, request, 'asset');
9246
+ }
9247
+ } catch {}
9248
+ }
9249
+ callback();
9250
+ }
9251
+ ],
8835
9252
  context: packageJsonDir,
8836
9253
  cache: false,
8837
9254
  devtool: 'production' === (devOptions.mode || 'development') ? false : 3 === manifest.manifest_version ? 'cheap-source-map' : 'eval-cheap-source-map',
@@ -8971,4 +9388,4 @@ function webpackConfig(projectStructure, devOptions) {
8971
9388
  }
8972
9389
  };
8973
9390
  }
8974
- export { rspack_config_namespaceObject, setupCompilerLifecycleHooks, setupNoBrowserBannerOnFirstDone, webpackConfig };
9391
+ export { resolveConnectableHost, rspack_config_namespaceObject, setupCompilerLifecycleHooks, setupNoBrowserBannerOnFirstDone, webpackConfig };