extension-develop 3.10.1-canary.244.f55d6fb → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/270.cjs CHANGED
@@ -2662,6 +2662,9 @@ exports.modules = {
2662
2662
  } catch {}
2663
2663
  return false;
2664
2664
  }
2665
+ function isCanonicalContentScriptCss(resource) {
2666
+ return /^content_scripts\/content-\d+\.css$/.test(resource);
2667
+ }
2665
2668
  function generateManifestPatches(compilation, manifestPath, entryImports, browser) {
2666
2669
  const canonicalManifest = getManifestContent(compilation, manifestPath);
2667
2670
  const resolved = resolveUserDeclaredWAR(compilation, manifestPath, canonicalManifest, browser);
@@ -2709,6 +2712,11 @@ exports.modules = {
2709
2712
  if (contentScript) {
2710
2713
  const matches = contentScript.matches || [];
2711
2714
  const filteredResources = resources.filter((resource)=>!resource.endsWith('.map') && !resource.endsWith('.js'));
2715
+ const importedContentCss = filteredResources.filter((resource)=>resource.endsWith('.css')).filter(isCanonicalContentScriptCss);
2716
+ if (importedContentCss.length > 0) contentScript.css = Array.from(new Set([
2717
+ ...contentScript.css || [],
2718
+ ...importedContentCss
2719
+ ])).sort();
2712
2720
  if (0 === filteredResources.length) continue;
2713
2721
  if (3 === canonicalManifest.manifest_version) {
2714
2722
  const normalizedMatches = cleanMatches(matches);