extension-develop 4.1.9 → 4.1.11
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/0~rspack-config.mjs +212 -102
- package/dist/101.mjs +1 -1
- package/dist/291.mjs +8 -1
- package/dist/839.mjs +65 -13
- package/dist/extension-js-devtools/chrome/background/service_worker.js +1 -1
- package/dist/extension-js-devtools/chrome/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chrome/manifest.json +4 -0
- package/dist/extension-js-devtools/chrome/options/index.css +2 -0
- package/dist/extension-js-devtools/chrome/options/index.html +11 -0
- package/dist/extension-js-devtools/chrome/options/index.js +1 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.css +1 -1
- package/dist/extension-js-devtools/chrome/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/chrome/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/chromium/background/service_worker.js +1 -1
- package/dist/extension-js-devtools/chromium/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chromium/manifest.json +4 -0
- package/dist/extension-js-devtools/chromium/options/index.css +2 -0
- package/dist/extension-js-devtools/chromium/options/index.html +11 -0
- package/dist/extension-js-devtools/chromium/options/index.js +1 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.css +1 -1
- package/dist/extension-js-devtools/chromium/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/chromium/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/edge/background/service_worker.js +1 -1
- package/dist/extension-js-devtools/edge/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/edge/manifest.json +4 -0
- package/dist/extension-js-devtools/edge/options/index.css +2 -0
- package/dist/extension-js-devtools/edge/options/index.html +11 -0
- package/dist/extension-js-devtools/edge/options/index.js +1 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.css +1 -1
- package/dist/extension-js-devtools/edge/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/edge/scripts/logger-client.js +1 -1
- package/dist/extension-js-devtools/firefox/background/scripts.js +1 -1
- package/dist/extension-js-devtools/firefox/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/firefox/manifest.json +4 -0
- package/dist/extension-js-devtools/firefox/options/index.css +2 -0
- package/dist/extension-js-devtools/firefox/options/index.html +11 -0
- package/dist/extension-js-devtools/firefox/options/index.js +1 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.css +1 -1
- package/dist/extension-js-devtools/firefox/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/firefox/scripts/logger-client.js +1 -1
- package/dist/feature-scripts-content-script-wrapper.js +3 -2
- package/dist/feature-scripts-content-script-wrapper.mjs +3 -2
- package/dist/feature-scripts-native-geturl-import-loader.mjs +73 -9
- package/dist/minimum-script-file.js +4 -4
- package/dist/minimum-script-file.mjs +4 -4
- package/dist/plugin-reload/reload-dispatch.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/index.d.ts +6 -8
- package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +3 -2
- package/dist/plugin-web-extension/feature-html/html-lib/parse-html.d.ts +2 -0
- package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +6 -0
- package/dist/plugin-web-extension/feature-json/resolve-json-resource.d.ts +6 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/storage.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +3 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/utils.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +2 -1
- package/package.json +2 -2
package/dist/0~rspack-config.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import { isResourceUnderDirs, canonicalizeDir, toResourceKey } from "./93.mjs";
|
|
|
18
18
|
import { prefix as messaging_prefix, isDebug } from "./349.mjs";
|
|
19
19
|
import { jsFrameworksHmrSummary, isUsingTypeScript, resolvePackageManager, humanLine, jsFrameworksIntegrationsEnabled, jsFrameworksConfigsDetected, recordZipArtifact, hasDependency, resolveDevelopInstallRoot, resolveDevelopDistFile, isUsingCustomLoader, ensureTypeScriptConfig, isUsingIntegration as messages_isUsingIntegration, getUserTypeScriptConfigFile } from "./839.mjs";
|
|
20
20
|
import { renderStatsBlocks, makeSanitizedConsole } from "./0~stats-handler.mjs";
|
|
21
|
-
import { getCanonicalContentScriptEntryName, parseCanonicalContentScriptAsset,
|
|
21
|
+
import { EXTENSIONJS_CONTENT_SCRIPT_LAYER, getCanonicalContentScriptEntryName, parseCanonicalContentScriptAsset, CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX, createContentScriptCssProbeMarkerPattern, getCanonicalContentScriptJsAssetName, getCanonicalContentScriptCssAssetName, isCanonicalContentScriptAsset } from "./291.mjs";
|
|
22
22
|
import { hasProjectDependency, findNearestProjectManifestSync, PROJECT_MANIFEST_FILENAMES, readProjectDependencies } from "./80.mjs";
|
|
23
23
|
import { cssIntegrationsEnabled, cssConfigsDetected, deadCssUrlRef, missingSassDependency, isUsingIntegration, postCssPluginNotResolved } from "./845.mjs";
|
|
24
24
|
import { toPosixPath } from "./86.mjs";
|
|
@@ -747,11 +747,14 @@ function sandbox(manifest) {
|
|
|
747
747
|
}
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
|
-
function storage(manifest) {
|
|
750
|
+
function storage(manifest, manifestPath) {
|
|
751
751
|
return manifest.storage && {
|
|
752
752
|
storage: {
|
|
753
753
|
...manifest.storage.managed_schema && {
|
|
754
|
-
managed_schema:
|
|
754
|
+
managed_schema: (()=>{
|
|
755
|
+
const raw = String(manifest.storage.managed_schema);
|
|
756
|
+
return getFilename(manifestPageOutputTarget(raw, 'storage/managed_schema.json', manifestPath), raw);
|
|
757
|
+
})()
|
|
755
758
|
}
|
|
756
759
|
}
|
|
757
760
|
};
|
|
@@ -818,7 +821,7 @@ function manifestCommon(manifest, manifestPath) {
|
|
|
818
821
|
...optionsPage(manifest, manifestPath),
|
|
819
822
|
...optionsUi(manifest, manifestPath),
|
|
820
823
|
...sandbox(manifest),
|
|
821
|
-
...storage(manifest),
|
|
824
|
+
...storage(manifest, manifestPath),
|
|
822
825
|
...theme_theme(manifest),
|
|
823
826
|
...userScripts(manifest),
|
|
824
827
|
...webAccessibleResources(manifest),
|
|
@@ -1003,14 +1006,14 @@ function backgroundServiceWorker(manifest) {
|
|
|
1003
1006
|
}
|
|
1004
1007
|
};
|
|
1005
1008
|
}
|
|
1006
|
-
function declarativeNetRequest(manifest) {
|
|
1009
|
+
function declarativeNetRequest(manifest, manifestPath) {
|
|
1007
1010
|
return manifest.declarative_net_request && {
|
|
1008
1011
|
declarative_net_request: {
|
|
1009
1012
|
...manifest.declarative_net_request,
|
|
1010
1013
|
...Array.isArray(manifest.declarative_net_request.rule_resources) && {
|
|
1011
1014
|
rule_resources: manifest.declarative_net_request.rule_resources.map((resourceObj)=>({
|
|
1012
1015
|
...resourceObj,
|
|
1013
|
-
path: resourceObj.path && getFilename(`declarative_net_request/${resourceObj.id}.json`, resourceObj.path)
|
|
1016
|
+
path: resourceObj.path && getFilename(manifestPageOutputTarget(resourceObj.path, `declarative_net_request/${resourceObj.id}.json`, manifestPath), resourceObj.path)
|
|
1014
1017
|
}))
|
|
1015
1018
|
}
|
|
1016
1019
|
}
|
|
@@ -1034,11 +1037,11 @@ function sidePanel(manifest) {
|
|
|
1034
1037
|
}
|
|
1035
1038
|
};
|
|
1036
1039
|
}
|
|
1037
|
-
function manifestV3(manifest) {
|
|
1040
|
+
function manifestV3(manifest, manifestPath) {
|
|
1038
1041
|
return {
|
|
1039
1042
|
...action_action(manifest),
|
|
1040
1043
|
...backgroundServiceWorker(manifest),
|
|
1041
|
-
...declarativeNetRequest(manifest),
|
|
1044
|
+
...declarativeNetRequest(manifest, manifestPath),
|
|
1042
1045
|
...hostPermissions(manifest),
|
|
1043
1046
|
...sidePanel(manifest)
|
|
1044
1047
|
};
|
|
@@ -1056,7 +1059,7 @@ function getManifestOverrides(manifestPath, manifest) {
|
|
|
1056
1059
|
};
|
|
1057
1060
|
const common = manifestCommon(manifestContent, manifestPath);
|
|
1058
1061
|
const mv2 = manifestV2(manifestContent);
|
|
1059
|
-
const mv3 = manifestV3(manifestContent);
|
|
1062
|
+
const mv3 = manifestV3(manifestContent, manifestPath);
|
|
1060
1063
|
const backgroundMerged = {
|
|
1061
1064
|
...manifestContent.background || {},
|
|
1062
1065
|
...pickBackground(common),
|
|
@@ -2920,6 +2923,19 @@ function parse_html_isUrl(src) {
|
|
|
2920
2923
|
return false;
|
|
2921
2924
|
}
|
|
2922
2925
|
}
|
|
2926
|
+
function emitSrcsetCandidates(srcset, node, assetType, attributeName, onResourceFound) {
|
|
2927
|
+
for (const candidate of srcset.split(',')){
|
|
2928
|
+
const url = candidate.trim().split(/\s+/)[0];
|
|
2929
|
+
if (!url) continue;
|
|
2930
|
+
const { cleanPath } = cleanAssetUrl(url);
|
|
2931
|
+
if (cleanPath && !parse_html_isUrl(cleanPath)) onResourceFound({
|
|
2932
|
+
filePath: url,
|
|
2933
|
+
childNode: node,
|
|
2934
|
+
assetType,
|
|
2935
|
+
attributeName
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2923
2939
|
function parseHtml(node, onResourceFound) {
|
|
2924
2940
|
if ('#comment' === node.nodeName || '#text' === node.nodeName) return;
|
|
2925
2941
|
if ("script" === node.nodeName) {
|
|
@@ -2935,16 +2951,7 @@ function parseHtml(node, onResourceFound) {
|
|
|
2935
2951
|
const href = node.attrs?.find((attr)=>'href' === attr.name)?.value;
|
|
2936
2952
|
const rel = node.attrs?.find((attr)=>'rel' === attr.name)?.value;
|
|
2937
2953
|
const imagesrcset = node.attrs?.find((attr)=>'imagesrcset' === attr.name)?.value;
|
|
2938
|
-
if (imagesrcset)
|
|
2939
|
-
const url = candidate.trim().split(/\s+/)[0];
|
|
2940
|
-
if (!url) continue;
|
|
2941
|
-
const { cleanPath } = cleanAssetUrl(url);
|
|
2942
|
-
if (cleanPath && !parse_html_isUrl(cleanPath)) onResourceFound({
|
|
2943
|
-
filePath: cleanPath,
|
|
2944
|
-
childNode: node,
|
|
2945
|
-
assetType: 'staticHref'
|
|
2946
|
-
});
|
|
2947
|
-
}
|
|
2954
|
+
if (imagesrcset) emitSrcsetCandidates(imagesrcset, node, 'staticHref', 'imagesrcset', onResourceFound);
|
|
2948
2955
|
if (!href) return;
|
|
2949
2956
|
if (parse_html_isUrl(href)) return;
|
|
2950
2957
|
const nonStylesheetRelTokens = [
|
|
@@ -2964,7 +2971,8 @@ function parseHtml(node, onResourceFound) {
|
|
|
2964
2971
|
onResourceFound(relTokens.some((token)=>nonStylesheetRelTokens.includes(token)) ? {
|
|
2965
2972
|
filePath: href,
|
|
2966
2973
|
childNode: node,
|
|
2967
|
-
assetType: 'staticHref'
|
|
2974
|
+
assetType: 'staticHref',
|
|
2975
|
+
attributeName: 'href'
|
|
2968
2976
|
} : {
|
|
2969
2977
|
filePath: href,
|
|
2970
2978
|
childNode: node,
|
|
@@ -2972,38 +2980,22 @@ function parseHtml(node, onResourceFound) {
|
|
|
2972
2980
|
});
|
|
2973
2981
|
} else if ('audio' === node.nodeName || 'embed' === node.nodeName || 'iframe' === node.nodeName || 'img' === node.nodeName || 'input' === node.nodeName || 'source' === node.nodeName || 'track' === node.nodeName || 'video' === node.nodeName) {
|
|
2974
2982
|
const src = node.attrs?.find((attr)=>'src' === attr.name)?.value;
|
|
2975
|
-
if (!src)
|
|
2976
|
-
if (parse_html_isUrl(src)) return;
|
|
2977
|
-
onResourceFound({
|
|
2983
|
+
if (src && !parse_html_isUrl(src)) onResourceFound({
|
|
2978
2984
|
filePath: src,
|
|
2979
2985
|
childNode: node,
|
|
2980
|
-
assetType: 'staticSrc'
|
|
2986
|
+
assetType: 'staticSrc',
|
|
2987
|
+
attributeName: 'src'
|
|
2981
2988
|
});
|
|
2982
2989
|
const srcset = node.attrs?.find((attr)=>'srcset' === attr.name)?.value;
|
|
2983
|
-
if (srcset)
|
|
2984
|
-
const candidates = srcset.split(',');
|
|
2985
|
-
for (const candidate of candidates){
|
|
2986
|
-
const parts = candidate.trim().split(/\s+/);
|
|
2987
|
-
const url = parts[0];
|
|
2988
|
-
if (!url) continue;
|
|
2989
|
-
const { cleanPath } = cleanAssetUrl(url);
|
|
2990
|
-
if (cleanPath && !parse_html_isUrl(cleanPath)) onResourceFound({
|
|
2991
|
-
filePath: cleanPath,
|
|
2992
|
-
childNode: node,
|
|
2993
|
-
assetType: 'staticSrc'
|
|
2994
|
-
});
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2990
|
+
if (srcset) emitSrcsetCandidates(srcset, node, 'staticSrc', 'srcset', onResourceFound);
|
|
2997
2991
|
if ('video' === node.nodeName) {
|
|
2998
2992
|
const poster = node.attrs?.find((attr)=>'poster' === attr.name)?.value;
|
|
2999
|
-
if (poster && !parse_html_isUrl(poster)) {
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
});
|
|
3006
|
-
}
|
|
2993
|
+
if (poster && !parse_html_isUrl(poster)) onResourceFound({
|
|
2994
|
+
filePath: poster,
|
|
2995
|
+
childNode: node,
|
|
2996
|
+
assetType: 'staticSrc',
|
|
2997
|
+
attributeName: 'poster'
|
|
2998
|
+
});
|
|
3007
2999
|
}
|
|
3008
3000
|
}
|
|
3009
3001
|
const { childNodes = [] } = node;
|
|
@@ -3122,6 +3114,27 @@ function utils_isUrl(src) {
|
|
|
3122
3114
|
return false;
|
|
3123
3115
|
}
|
|
3124
3116
|
}
|
|
3117
|
+
function resolveStaticAttributeName(assetType, attributeName) {
|
|
3118
|
+
if (attributeName) return attributeName;
|
|
3119
|
+
return 'staticSrc' === assetType ? 'src' : 'href';
|
|
3120
|
+
}
|
|
3121
|
+
function rewriteSrcsetCandidate(srcset, fromCleanPath, toUrl) {
|
|
3122
|
+
return srcset.split(',').map((candidate)=>{
|
|
3123
|
+
const match = candidate.match(/^(\s*)(\S+)(.*)$/);
|
|
3124
|
+
if (!match) return candidate;
|
|
3125
|
+
const [, lead, url, rest] = match;
|
|
3126
|
+
const { cleanPath } = cleanAssetUrl(url);
|
|
3127
|
+
if (cleanPath !== fromCleanPath && url !== fromCleanPath) return candidate;
|
|
3128
|
+
return `${lead}${toUrl}${rest}`;
|
|
3129
|
+
}).join(',');
|
|
3130
|
+
}
|
|
3131
|
+
function applyRewrittenStaticUrl(node, attributeName, cleanPath, value) {
|
|
3132
|
+
if ('srcset' === attributeName || 'imagesrcset' === attributeName) {
|
|
3133
|
+
const current = __rspack_external_parse5_utilities_78b19c6a.getAttribute(node, attributeName) || '';
|
|
3134
|
+
return __rspack_external_parse5_utilities_78b19c6a.setAttribute(node, attributeName, rewriteSrcsetCandidate(current, cleanPath, value));
|
|
3135
|
+
}
|
|
3136
|
+
return __rspack_external_parse5_utilities_78b19c6a.setAttribute(node, attributeName, value);
|
|
3137
|
+
}
|
|
3125
3138
|
function cleanAssetUrl(url) {
|
|
3126
3139
|
const hashIndex = url.indexOf('#');
|
|
3127
3140
|
const queryIndex = url.indexOf('?');
|
|
@@ -5591,6 +5604,53 @@ class PruneStaleHotUpdates {
|
|
|
5591
5604
|
});
|
|
5592
5605
|
}
|
|
5593
5606
|
}
|
|
5607
|
+
const utils_isRemoteUrl = (entry)=>/^([a-z][a-z0-9+.-]*:)?\/\//i.test(entry);
|
|
5608
|
+
function resolveScriptEntryPath(entry, manifestDir, projectPath) {
|
|
5609
|
+
if (!entry || utils_isRemoteUrl(entry)) return entry;
|
|
5610
|
+
if (entry.startsWith('/') && !__rspack_external_node_path_c5b9b54f.isAbsolute(entry)) return __rspack_external_node_path_c5b9b54f.join(projectPath, entry.slice(1));
|
|
5611
|
+
if (__rspack_external_node_path_c5b9b54f.isAbsolute(entry)) return entry;
|
|
5612
|
+
return __rspack_external_node_path_c5b9b54f.join(manifestDir, entry);
|
|
5613
|
+
}
|
|
5614
|
+
function getBackgroundWorkerEntryName(options) {
|
|
5615
|
+
const { manifest, browser, manifestDir } = options;
|
|
5616
|
+
if (3 !== Number(manifest.manifest_version)) return;
|
|
5617
|
+
if (isGeckoBasedBrowser(String(browser))) return;
|
|
5618
|
+
const background = manifest.background;
|
|
5619
|
+
if (!background) return;
|
|
5620
|
+
const projectPath = options.projectPath || manifestDir;
|
|
5621
|
+
const resolve = (entry)=>resolveScriptEntryPath(entry, manifestDir, projectPath);
|
|
5622
|
+
if (background.service_worker) {
|
|
5623
|
+
const workerEntries = getScriptEntries([
|
|
5624
|
+
resolve(String(background.service_worker))
|
|
5625
|
+
]);
|
|
5626
|
+
if (workerEntries.length > 0) return 'background/service_worker';
|
|
5627
|
+
}
|
|
5628
|
+
const scripts = Array.isArray(background.scripts) ? background.scripts : [];
|
|
5629
|
+
const scriptEntries = getScriptEntries(scripts.filter((script)=>'string' == typeof script).map(resolve));
|
|
5630
|
+
if (scriptEntries.length > 0) return "background/scripts";
|
|
5631
|
+
}
|
|
5632
|
+
function getScriptEntries(scriptPath) {
|
|
5633
|
+
const scriptEntries = Array.isArray(scriptPath) ? scriptPath || [] : scriptPath ? [
|
|
5634
|
+
scriptPath
|
|
5635
|
+
] : [];
|
|
5636
|
+
const fileAssets = scriptEntries.filter((scriptAsset)=>{
|
|
5637
|
+
const validFile = __rspack_external_node_fs_5ea92f0c.existsSync(scriptAsset);
|
|
5638
|
+
if (/\.d\.[cm]?ts$/i.test(scriptAsset)) return false;
|
|
5639
|
+
const assetExtension = __rspack_external_node_path_c5b9b54f.extname(scriptAsset);
|
|
5640
|
+
return validFile && ('.js' === assetExtension || '.cjs' === assetExtension || '.mjs' === assetExtension || '.jsx' === assetExtension || '.mjsx' === assetExtension || '.ts' === assetExtension || '.mts' === assetExtension || '.mtsx' === assetExtension || '.tsx' === assetExtension);
|
|
5641
|
+
});
|
|
5642
|
+
return fileAssets;
|
|
5643
|
+
}
|
|
5644
|
+
function getCssEntries(scriptPath) {
|
|
5645
|
+
const scriptEntries = Array.isArray(scriptPath) ? scriptPath || [] : scriptPath ? [
|
|
5646
|
+
scriptPath
|
|
5647
|
+
] : [];
|
|
5648
|
+
const fileAssets = scriptEntries.filter((scriptAsset)=>{
|
|
5649
|
+
const validFile = __rspack_external_node_fs_5ea92f0c.existsSync(scriptAsset);
|
|
5650
|
+
return validFile && (scriptAsset.endsWith('.css') || scriptAsset.endsWith('.scss') || scriptAsset.endsWith('.sass') || scriptAsset.endsWith('.less'));
|
|
5651
|
+
});
|
|
5652
|
+
return fileAssets;
|
|
5653
|
+
}
|
|
5594
5654
|
function createIssue(compiler, message, type = 'error') {
|
|
5595
5655
|
const ErrorCtor = compiler?.rspack?.WebpackError || Error;
|
|
5596
5656
|
const issue = new ErrorCtor(message);
|
|
@@ -6617,18 +6677,30 @@ class WebExtensionPlugin {
|
|
|
6617
6677
|
}
|
|
6618
6678
|
}
|
|
6619
6679
|
const webpack_target_webextension_fork = WebExtensionPlugin;
|
|
6620
|
-
function getBackgroundEntryName(manifest, browser) {
|
|
6680
|
+
function getBackgroundEntryName(manifest, browser, context) {
|
|
6621
6681
|
if (manifest.background) {
|
|
6622
6682
|
if (isGeckoBasedBrowser(String(browser))) return {
|
|
6623
6683
|
pageEntry: "background/script",
|
|
6624
6684
|
tryCatchWrapper: true,
|
|
6625
6685
|
eagerChunkLoading: false
|
|
6626
6686
|
};
|
|
6627
|
-
if (3 === manifest.manifest_version)
|
|
6628
|
-
serviceWorkerEntry
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6687
|
+
if (3 === manifest.manifest_version) {
|
|
6688
|
+
const serviceWorkerEntry = getBackgroundWorkerEntryName({
|
|
6689
|
+
manifest,
|
|
6690
|
+
browser,
|
|
6691
|
+
manifestDir: context.manifestDir,
|
|
6692
|
+
projectPath: context.projectPath
|
|
6693
|
+
});
|
|
6694
|
+
if (!serviceWorkerEntry) return {
|
|
6695
|
+
tryCatchWrapper: true,
|
|
6696
|
+
eagerChunkLoading: false
|
|
6697
|
+
};
|
|
6698
|
+
return {
|
|
6699
|
+
serviceWorkerEntry,
|
|
6700
|
+
tryCatchWrapper: true,
|
|
6701
|
+
eagerChunkLoading: false
|
|
6702
|
+
};
|
|
6703
|
+
}
|
|
6632
6704
|
if (2 === manifest.manifest_version) return {
|
|
6633
6705
|
pageEntry: "background/script",
|
|
6634
6706
|
tryCatchWrapper: true,
|
|
@@ -6692,7 +6764,10 @@ class SetupReloadStrategy {
|
|
|
6692
6764
|
browser: this.browser
|
|
6693
6765
|
}).apply(compiler);
|
|
6694
6766
|
new webpack_target_webextension_fork({
|
|
6695
|
-
background: getBackgroundEntryName(patchedManifest, this.browser
|
|
6767
|
+
background: getBackgroundEntryName(patchedManifest, this.browser, {
|
|
6768
|
+
manifestDir: __rspack_external_node_path_c5b9b54f.dirname(this.manifestPath),
|
|
6769
|
+
projectPath: compiler.options.context
|
|
6770
|
+
}),
|
|
6696
6771
|
hmrConfig: false,
|
|
6697
6772
|
weakRuntimeCheck: true,
|
|
6698
6773
|
contentScriptsMeta
|
|
@@ -6817,7 +6892,10 @@ class SetupChunkLoadingTarget {
|
|
|
6817
6892
|
}
|
|
6818
6893
|
new webpack_target_webextension_fork({
|
|
6819
6894
|
background: {
|
|
6820
|
-
...getBackgroundEntryName(patchedManifest, this.browser
|
|
6895
|
+
...getBackgroundEntryName(patchedManifest, this.browser, {
|
|
6896
|
+
manifestDir: __rspack_external_node_path_c5b9b54f.dirname(this.manifestPath),
|
|
6897
|
+
projectPath: compiler.options.context
|
|
6898
|
+
}),
|
|
6821
6899
|
classicLoader: false
|
|
6822
6900
|
},
|
|
6823
6901
|
hmrConfig: false,
|
|
@@ -8034,19 +8112,20 @@ function resolveCssAsset(compilation, feature) {
|
|
|
8034
8112
|
href: void 0
|
|
8035
8113
|
};
|
|
8036
8114
|
}
|
|
8037
|
-
function handleStaticAsset(compilation, htmlEntry, htmlDir, absolutePath, assetType, cleanPath, search, hash, baseHref, includeList, extname, childNode) {
|
|
8115
|
+
function handleStaticAsset(compilation, htmlEntry, htmlDir, absolutePath, assetType, cleanPath, search, hash, baseHref, includeList, extname, childNode, attributeName) {
|
|
8038
8116
|
const isFilepathListEntry = isFromFilepathList(absolutePath, includeList);
|
|
8039
8117
|
__rspack_external_node_path_c5b9b54f.posix.join('/', cleanPath);
|
|
8118
|
+
const attrName = resolveStaticAttributeName(assetType, attributeName);
|
|
8040
8119
|
let node = childNode;
|
|
8041
8120
|
if (isFilepathListEntry) {
|
|
8042
8121
|
const filepath = getHtmlPageDeclaredAssetPath(includeList, absolutePath, extname);
|
|
8043
|
-
node =
|
|
8122
|
+
node = applyRewrittenStaticUrl(node, attrName, cleanPath, filepath + (search || '') + (hash || ''));
|
|
8044
8123
|
return node;
|
|
8045
8124
|
}
|
|
8046
8125
|
if (cleanPath.startsWith('/')) {
|
|
8047
8126
|
const projectDir = __rspack_external_node_path_c5b9b54f.dirname(__rspack_external_node_path_c5b9b54f.dirname(htmlEntry));
|
|
8048
8127
|
__rspack_external_node_path_c5b9b54f.join(projectDir, 'public', cleanPath.slice(1));
|
|
8049
|
-
node =
|
|
8128
|
+
node = applyRewrittenStaticUrl(node, attrName, cleanPath, cleanPath + (search || '') + (hash || ''));
|
|
8050
8129
|
return node;
|
|
8051
8130
|
}
|
|
8052
8131
|
const baseJoin = baseHref && !/^\w+:\/\//.test(baseHref) ? __rspack_external_node_path_c5b9b54f.resolve(htmlDir, baseHref) : htmlDir;
|
|
@@ -8055,7 +8134,7 @@ function handleStaticAsset(compilation, htmlEntry, htmlDir, absolutePath, assetT
|
|
|
8055
8134
|
const relativeFromHtml = fromRoot && toRoot && String(fromRoot).toLowerCase() !== String(toRoot).toLowerCase() ? __rspack_external_node_path_c5b9b54f.basename(absolutePath) : __rspack_external_node_path_c5b9b54f.relative(baseJoin, absolutePath);
|
|
8056
8135
|
const posixRelative = relativeFromHtml.split(__rspack_external_node_path_c5b9b54f.sep).join('/');
|
|
8057
8136
|
const filepath = joinEmittedAssetName('assets', posixRelative);
|
|
8058
|
-
if (__rspack_external_node_fs_5ea92f0c.existsSync(absolutePath)) node =
|
|
8137
|
+
if (__rspack_external_node_fs_5ea92f0c.existsSync(absolutePath)) node = applyRewrittenStaticUrl(node, attrName, cleanPath, getFilePath(filepath, '', true) + (search || '') + (hash || ''));
|
|
8059
8138
|
return node;
|
|
8060
8139
|
}
|
|
8061
8140
|
function injectJsScript(bodyNode, feature, firstScriptAttrs) {
|
|
@@ -8106,7 +8185,7 @@ function patchHtml(compilation, feature, htmlEntry, includeList) {
|
|
|
8106
8185
|
let bodyNode;
|
|
8107
8186
|
for (const node of htmlDocument.childNodes)if ('html' === node.nodeName) {
|
|
8108
8187
|
for (const htmlChildNode of node.childNodes){
|
|
8109
|
-
if ('head' === htmlChildNode.nodeName || 'body' === htmlChildNode.nodeName) parseHtml(htmlChildNode, ({ filePath, childNode, assetType })=>{
|
|
8188
|
+
if ('head' === htmlChildNode.nodeName || 'body' === htmlChildNode.nodeName) parseHtml(htmlChildNode, ({ filePath, childNode, assetType, attributeName })=>{
|
|
8110
8189
|
const htmlDir = __rspack_external_node_path_c5b9b54f.dirname(htmlEntry);
|
|
8111
8190
|
const { cleanPath, hash, search } = cleanAssetUrl(filePath);
|
|
8112
8191
|
const absolutePath = __rspack_external_node_path_c5b9b54f.resolve(htmlDir, cleanPath);
|
|
@@ -8136,7 +8215,7 @@ function patchHtml(compilation, feature, htmlEntry, includeList) {
|
|
|
8136
8215
|
break;
|
|
8137
8216
|
case 'staticHref':
|
|
8138
8217
|
case 'staticSrc':
|
|
8139
|
-
thisChildNode = handleStaticAsset(compilation, htmlEntry, htmlDir, absolutePath, assetType, cleanPath, search, hash, baseHref, includeList, extname, thisChildNode);
|
|
8218
|
+
thisChildNode = handleStaticAsset(compilation, htmlEntry, htmlDir, absolutePath, assetType, cleanPath, search, hash, baseHref, includeList, extname, thisChildNode, attributeName);
|
|
8140
8219
|
break;
|
|
8141
8220
|
default:
|
|
8142
8221
|
break;
|
|
@@ -8174,11 +8253,12 @@ function patchHtmlNested(compilation, htmlEntry) {
|
|
|
8174
8253
|
encoding: 'utf8'
|
|
8175
8254
|
});
|
|
8176
8255
|
const htmlDocument = __rspack_external_parse5_utilities_78b19c6a.parse(htmlFile);
|
|
8177
|
-
for (const node of htmlDocument.childNodes)if ('html' === node.nodeName)
|
|
8178
|
-
if ('head' === htmlChildNode.nodeName || 'body' === htmlChildNode.nodeName) parseHtml(htmlChildNode, ({ filePath, childNode, assetType })=>{
|
|
8256
|
+
for (const node of htmlDocument.childNodes)if ('html' === node.nodeName) {
|
|
8257
|
+
for (const htmlChildNode of node.childNodes)if ('head' === htmlChildNode.nodeName || 'body' === htmlChildNode.nodeName) parseHtml(htmlChildNode, ({ filePath, childNode, assetType, attributeName })=>{
|
|
8179
8258
|
const htmlDir = __rspack_external_node_path_c5b9b54f.dirname(htmlEntry);
|
|
8180
8259
|
const { cleanPath, hash, search } = cleanAssetUrl(filePath);
|
|
8181
8260
|
const absolutePath = __rspack_external_node_path_c5b9b54f.resolve(htmlDir, cleanPath);
|
|
8261
|
+
const attrName = 'staticSrc' === assetType || 'staticHref' === assetType ? resolveStaticAttributeName(assetType, attributeName) : void 0;
|
|
8182
8262
|
let thisChildNode = childNode;
|
|
8183
8263
|
switch(assetType){
|
|
8184
8264
|
case "script":
|
|
@@ -8197,12 +8277,12 @@ function patchHtmlNested(compilation, htmlEntry) {
|
|
|
8197
8277
|
case 'staticSrc':
|
|
8198
8278
|
if (cleanPath.startsWith('/')) {
|
|
8199
8279
|
warnIfPublicRootAssetMissing(compilation, htmlEntry, cleanPath);
|
|
8200
|
-
thisChildNode =
|
|
8280
|
+
thisChildNode = applyRewrittenStaticUrl(thisChildNode, attrName || resolveStaticAttributeName(assetType), cleanPath, cleanPath + (search || '') + (hash || ''));
|
|
8201
8281
|
} else if (__rspack_external_node_fs_5ea92f0c.existsSync(absolutePath)) {
|
|
8202
8282
|
const relativeFromHtml = __rspack_external_node_path_c5b9b54f.relative(htmlDir, absolutePath);
|
|
8203
8283
|
const posixRelative = relativeFromHtml.split(__rspack_external_node_path_c5b9b54f.sep).join('/');
|
|
8204
8284
|
const filepath = joinEmittedAssetName('assets', posixRelative);
|
|
8205
|
-
thisChildNode =
|
|
8285
|
+
thisChildNode = applyRewrittenStaticUrl(thisChildNode, attrName || resolveStaticAttributeName(assetType), cleanPath, getFilePath(filepath, '', true) + (search || '') + (hash || ''));
|
|
8206
8286
|
}
|
|
8207
8287
|
break;
|
|
8208
8288
|
default:
|
|
@@ -9287,7 +9367,7 @@ function jsonIncludeSummary(totalFeatures, criticalCount) {
|
|
|
9287
9367
|
return `${messaging_prefix('debug')} json include features=${String(totalFeatures)} critical=${String(criticalCount)}`;
|
|
9288
9368
|
}
|
|
9289
9369
|
function isCriticalJsonFeature(feature) {
|
|
9290
|
-
return feature.startsWith('declarative_net_request') || 'storage.managed_schema' === feature;
|
|
9370
|
+
return feature.startsWith('declarative_net_request') || 'storage.managed_schema' === feature || 'storage/managed_schema' === feature;
|
|
9291
9371
|
}
|
|
9292
9372
|
function isPlainObject(value) {
|
|
9293
9373
|
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
@@ -9352,6 +9432,34 @@ function validateJsonAsset(compilation, feature, filePath, buf) {
|
|
|
9352
9432
|
}
|
|
9353
9433
|
return true;
|
|
9354
9434
|
}
|
|
9435
|
+
function isInsideDir(abs, dir) {
|
|
9436
|
+
const rel = __rspack_external_node_path_c5b9b54f.relative(dir, abs);
|
|
9437
|
+
return Boolean(rel && !rel.startsWith('..') && !__rspack_external_node_path_c5b9b54f.isAbsolute(rel));
|
|
9438
|
+
}
|
|
9439
|
+
function firstExisting(candidates) {
|
|
9440
|
+
for (const candidate of candidates)if (candidate && __rspack_external_node_fs_5ea92f0c.existsSync(candidate)) return candidate;
|
|
9441
|
+
}
|
|
9442
|
+
function resolveJsonResource(thisResource, manifestDir, projectPath) {
|
|
9443
|
+
const publicDir = __rspack_external_node_path_c5b9b54f.join(projectPath, 'public');
|
|
9444
|
+
const rawRef = String(thisResource);
|
|
9445
|
+
const looksLikeRootRef = rawRef.startsWith('/') && !rawRef.startsWith('//') && !(projectPath && rawRef.startsWith(projectPath));
|
|
9446
|
+
const isPublicRoot = looksLikeRootRef && (!__rspack_external_node_path_c5b9b54f.isAbsolute(rawRef) || __rspack_external_node_path_c5b9b54f.dirname(rawRef) === __rspack_external_node_path_c5b9b54f.parse(rawRef).root);
|
|
9447
|
+
const joined = __rspack_external_node_path_c5b9b54f.isAbsolute(rawRef) ? rawRef : __rspack_external_node_path_c5b9b54f.join(manifestDir, rawRef);
|
|
9448
|
+
const publicFromProject = isInsideDir(joined, projectPath) ? __rspack_external_node_path_c5b9b54f.join(publicDir, __rspack_external_node_path_c5b9b54f.relative(projectPath, joined)) : '';
|
|
9449
|
+
const publicFromSlash = looksLikeRootRef ? __rspack_external_node_path_c5b9b54f.join(publicDir, rawRef.replace(/^\/+/, '')) : '';
|
|
9450
|
+
const publicFromRelative = __rspack_external_node_path_c5b9b54f.isAbsolute(rawRef) || rawRef.startsWith('public/') ? '' : __rspack_external_node_path_c5b9b54f.join(publicDir, rawRef);
|
|
9451
|
+
const abs = firstExisting([
|
|
9452
|
+
joined,
|
|
9453
|
+
publicFromProject,
|
|
9454
|
+
publicFromSlash,
|
|
9455
|
+
publicFromRelative
|
|
9456
|
+
]) || joined;
|
|
9457
|
+
return {
|
|
9458
|
+
abs,
|
|
9459
|
+
isUnderPublic: isInsideDir(abs, publicDir),
|
|
9460
|
+
isPublicRoot
|
|
9461
|
+
};
|
|
9462
|
+
}
|
|
9355
9463
|
function getProjectPathFromCompilation(compilation, manifestPath) {
|
|
9356
9464
|
return compilation.compiler.options.context || compilation.options.context || __rspack_external_node_path_c5b9b54f.dirname(manifestPath);
|
|
9357
9465
|
}
|
|
@@ -9377,14 +9485,10 @@ function processJsonAssets(compilation, manifestPath, includeList) {
|
|
|
9377
9485
|
resource
|
|
9378
9486
|
];
|
|
9379
9487
|
for (const thisResource of resourceArr)if (thisResource) {
|
|
9380
|
-
const abs =
|
|
9381
|
-
const relToPublic = __rspack_external_node_path_c5b9b54f.relative(publicDir, abs);
|
|
9382
|
-
const isUnderPublic = relToPublic && !relToPublic.startsWith('..') && !__rspack_external_node_path_c5b9b54f.isAbsolute(relToPublic);
|
|
9488
|
+
const { abs, isUnderPublic, isPublicRoot } = resolveJsonResource(thisResource, manifestDir, projectPath);
|
|
9383
9489
|
if (!__rspack_external_node_fs_5ea92f0c.existsSync(abs)) {
|
|
9384
|
-
const rawRef = String(thisResource);
|
|
9385
|
-
const isPublicRoot = rawRef.startsWith('/') && !__rspack_external_node_path_c5b9b54f.isAbsolute(rawRef);
|
|
9386
9490
|
const outputRoot = compilation?.options?.output?.path || '';
|
|
9387
|
-
const displayPath = isPublicRoot ? __rspack_external_node_path_c5b9b54f.join(outputRoot,
|
|
9491
|
+
const displayPath = isPublicRoot ? __rspack_external_node_path_c5b9b54f.join(outputRoot || publicDir, String(thisResource).slice(1)) : abs;
|
|
9388
9492
|
const isFatal = isCriticalJsonFeature(feature);
|
|
9389
9493
|
const notFound = new core_WebpackError(jsonMissingFile(feature, displayPath, {
|
|
9390
9494
|
publicRootHint: isPublicRoot,
|
|
@@ -9440,6 +9544,7 @@ function trackJsonDependencies(compilation, manifestPath, includeList) {
|
|
|
9440
9544
|
if (compilation.errors?.length) return;
|
|
9441
9545
|
const jsonFields = includeList || {};
|
|
9442
9546
|
const manifestDir = __rspack_external_node_path_c5b9b54f.dirname(manifestPath);
|
|
9547
|
+
const projectPath = compilation.compiler.options.context || compilation.options.context || manifestDir;
|
|
9443
9548
|
let added = 0;
|
|
9444
9549
|
for (const field of Object.entries(jsonFields)){
|
|
9445
9550
|
const [, resource] = field;
|
|
@@ -9447,7 +9552,7 @@ function trackJsonDependencies(compilation, manifestPath, includeList) {
|
|
|
9447
9552
|
resource
|
|
9448
9553
|
];
|
|
9449
9554
|
for (const thisResource of resourceArr)if (thisResource) {
|
|
9450
|
-
const abs =
|
|
9555
|
+
const { abs } = resolveJsonResource(thisResource, manifestDir, projectPath);
|
|
9451
9556
|
if (__rspack_external_node_fs_5ea92f0c.existsSync(abs) && !compilation.fileDependencies.has(abs)) {
|
|
9452
9557
|
compilation.fileDependencies.add(abs);
|
|
9453
9558
|
added++;
|
|
@@ -12415,6 +12520,16 @@ function getMainWorldBridgeScripts(manifestPath, browser = 'chrome') {
|
|
|
12415
12520
|
} catch {}
|
|
12416
12521
|
return bridgeScripts;
|
|
12417
12522
|
}
|
|
12523
|
+
function resolveBundleCssProbeMarker(cssPath, hasAsset, assetNames) {
|
|
12524
|
+
if (hasAsset(cssPath)) return cssPath;
|
|
12525
|
+
const wanted = parseCanonicalContentScriptAsset(cssPath);
|
|
12526
|
+
if (!wanted || 'css' !== wanted.extension) return '';
|
|
12527
|
+
for (const name of assetNames()){
|
|
12528
|
+
const parsed = parseCanonicalContentScriptAsset(name);
|
|
12529
|
+
if (parsed && 'css' === parsed.extension && parsed.index === wanted.index) return name;
|
|
12530
|
+
}
|
|
12531
|
+
return '';
|
|
12532
|
+
}
|
|
12418
12533
|
class AddContentScriptWrapper {
|
|
12419
12534
|
static getBridgeScripts(manifestPath, browser = 'chrome') {
|
|
12420
12535
|
return getMainWorldBridgeScripts(manifestPath, browser);
|
|
@@ -12482,6 +12597,29 @@ class AddContentScriptWrapper {
|
|
|
12482
12597
|
}
|
|
12483
12598
|
]
|
|
12484
12599
|
});
|
|
12600
|
+
compiler.hooks.thisCompilation.tap("scripts:add-content-script-wrapper", (compilation)=>{
|
|
12601
|
+
compilation.hooks.processAssets.tap({
|
|
12602
|
+
name: "scripts:resolve-bundle-css-probe",
|
|
12603
|
+
stage: core_Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
12604
|
+
}, ()=>{
|
|
12605
|
+
const assetNames = ()=>compilation.getAssets().map((asset)=>asset.name);
|
|
12606
|
+
for (const asset of compilation.getAssets()){
|
|
12607
|
+
if (!/\.(?:js|mjs)$/.test(asset.name)) continue;
|
|
12608
|
+
const text = asset.source.source().toString();
|
|
12609
|
+
if (!text.includes(CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX)) continue;
|
|
12610
|
+
const pattern = createContentScriptCssProbeMarkerPattern();
|
|
12611
|
+
const replaced = new core_sources.ReplaceSource(asset.source);
|
|
12612
|
+
let match = pattern.exec(text);
|
|
12613
|
+
let touched = false;
|
|
12614
|
+
while(match){
|
|
12615
|
+
replaced.replace(match.index, match.index + match[0].length - 1, resolveBundleCssProbeMarker(match[1], (name)=>Boolean(compilation.getAsset(name)), assetNames));
|
|
12616
|
+
touched = true;
|
|
12617
|
+
match = pattern.exec(text);
|
|
12618
|
+
}
|
|
12619
|
+
if (touched) compilation.updateAsset(asset.name, replaced);
|
|
12620
|
+
}
|
|
12621
|
+
});
|
|
12622
|
+
});
|
|
12485
12623
|
}
|
|
12486
12624
|
}
|
|
12487
12625
|
const basic = [
|
|
@@ -12539,29 +12677,6 @@ function add_public_path_runtime_module_PublicPathRuntimeModule(compiler) {
|
|
|
12539
12677
|
}
|
|
12540
12678
|
return new PublicPathRuntimeModule();
|
|
12541
12679
|
}
|
|
12542
|
-
function getScriptEntries(scriptPath) {
|
|
12543
|
-
const scriptEntries = Array.isArray(scriptPath) ? scriptPath || [] : scriptPath ? [
|
|
12544
|
-
scriptPath
|
|
12545
|
-
] : [];
|
|
12546
|
-
const fileAssets = scriptEntries.filter((scriptAsset)=>{
|
|
12547
|
-
const validFile = __rspack_external_node_fs_5ea92f0c.existsSync(scriptAsset);
|
|
12548
|
-
if (/\.d\.[cm]?ts$/i.test(scriptAsset)) return false;
|
|
12549
|
-
const assetExtension = __rspack_external_node_path_c5b9b54f.extname(scriptAsset);
|
|
12550
|
-
return validFile && ('.js' === assetExtension || '.cjs' === assetExtension || '.mjs' === assetExtension || '.jsx' === assetExtension || '.mjsx' === assetExtension || '.ts' === assetExtension || '.mts' === assetExtension || '.mtsx' === assetExtension || '.tsx' === assetExtension);
|
|
12551
|
-
});
|
|
12552
|
-
return fileAssets;
|
|
12553
|
-
}
|
|
12554
|
-
function getCssEntries(scriptPath) {
|
|
12555
|
-
const scriptEntries = Array.isArray(scriptPath) ? scriptPath || [] : scriptPath ? [
|
|
12556
|
-
scriptPath
|
|
12557
|
-
] : [];
|
|
12558
|
-
const fileAssets = scriptEntries.filter((scriptAsset)=>{
|
|
12559
|
-
const validFile = __rspack_external_node_fs_5ea92f0c.existsSync(scriptAsset);
|
|
12560
|
-
return validFile && (scriptAsset.endsWith('.css') || scriptAsset.endsWith('.scss') || scriptAsset.endsWith('.sass') || scriptAsset.endsWith('.less'));
|
|
12561
|
-
});
|
|
12562
|
-
return fileAssets;
|
|
12563
|
-
}
|
|
12564
|
-
const add_scripts_isRemoteUrl = (entry)=>/^([a-z][a-z0-9+.-]*:)?\/\//i.test(entry);
|
|
12565
12680
|
const isContentScriptFeature = (feature)=>feature.startsWith("content_scripts/");
|
|
12566
12681
|
const isScriptsFolderFeature = (feature)=>feature.startsWith("scripts/");
|
|
12567
12682
|
const isBackgroundScriptsFeature = (feature)=>"background/scripts" === feature;
|
|
@@ -12601,7 +12716,7 @@ class AddScripts {
|
|
|
12601
12716
|
raw
|
|
12602
12717
|
] : [];
|
|
12603
12718
|
for (const entry of rawEntries){
|
|
12604
|
-
if (!entry || 'string' != typeof entry ||
|
|
12719
|
+
if (!entry || 'string' != typeof entry || utils_isRemoteUrl(entry)) continue;
|
|
12605
12720
|
let resolved = entry;
|
|
12606
12721
|
if (!__rspack_external_node_fs_5ea92f0c.existsSync(resolved)) resolved = __rspack_external_node_path_c5b9b54f.isAbsolute(entry) ? entry : entry.startsWith('/') ? __rspack_external_node_path_c5b9b54f.join(manifestDir, entry.slice(1)) : __rspack_external_node_path_c5b9b54f.join(manifestDir, entry);
|
|
12607
12722
|
if (__rspack_external_node_fs_5ea92f0c.existsSync(resolved)) continue;
|
|
@@ -12630,12 +12745,7 @@ class AddScripts {
|
|
|
12630
12745
|
} catch {
|
|
12631
12746
|
manifestJson = {};
|
|
12632
12747
|
}
|
|
12633
|
-
const resolveEntryPath = (entry)=>
|
|
12634
|
-
if (!entry || add_scripts_isRemoteUrl(entry)) return entry;
|
|
12635
|
-
if (entry.startsWith('/') && !__rspack_external_node_path_c5b9b54f.isAbsolute(entry)) return __rspack_external_node_path_c5b9b54f.join(projectPath, entry.slice(1));
|
|
12636
|
-
if (__rspack_external_node_path_c5b9b54f.isAbsolute(entry)) return entry;
|
|
12637
|
-
return __rspack_external_node_path_c5b9b54f.join(manifestDir, entry);
|
|
12638
|
-
};
|
|
12748
|
+
const resolveEntryPath = (entry)=>resolveScriptEntryPath(entry, manifestDir, projectPath);
|
|
12639
12749
|
const claimedByContentScript = new Set();
|
|
12640
12750
|
for (const [feature, scriptPath] of Object.entries(scriptFields)){
|
|
12641
12751
|
if (!isContentScriptFeature(feature)) continue;
|
package/dist/101.mjs
CHANGED
|
@@ -699,7 +699,7 @@ async function config_loader_isUsingExperimentalConfig(projectPath) {
|
|
|
699
699
|
}
|
|
700
700
|
return false;
|
|
701
701
|
}
|
|
702
|
-
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.
|
|
702
|
+
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.11","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.1.1","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","browser-extension-manifest-fields":"^2.3.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","dotenv":"^17.2.3","es-module-lexer":"^2.1.0","extension-from-store":"^0.2.5","fflate":"^0.8.3","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.6.7","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.23","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
|
|
703
703
|
function asAbsolute(p) {
|
|
704
704
|
return __rspack_external_node_path_c5b9b54f.isAbsolute(p) ? p : __rspack_external_node_path_c5b9b54f.resolve(p);
|
|
705
705
|
}
|
package/dist/291.mjs
CHANGED
|
@@ -23,4 +23,11 @@ function parseCanonicalContentScriptAsset(assetName) {
|
|
|
23
23
|
function isCanonicalContentScriptAsset(assetName) {
|
|
24
24
|
return void 0 !== parseCanonicalContentScriptAsset(assetName);
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
const CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX = '__EXTENSIONJS_CSS_PROBE__';
|
|
27
|
+
function getContentScriptCssProbeMarker(entryName) {
|
|
28
|
+
return `${CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX}${entryName}.css__`;
|
|
29
|
+
}
|
|
30
|
+
function createContentScriptCssProbeMarkerPattern() {
|
|
31
|
+
return /__EXTENSIONJS_CSS_PROBE__([^"'`\s\\]+?\.css)__/g;
|
|
32
|
+
}
|
|
33
|
+
export { CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX, CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX, EXTENSIONJS_CONTENT_SCRIPT_LAYER, createContentScriptCssProbeMarkerPattern, getCanonicalContentScriptCssAssetName, getCanonicalContentScriptEntryName, getCanonicalContentScriptJsAssetName, getContentScriptCssProbeMarker, isCanonicalContentScriptAsset, parseCanonicalContentScriptAsset };
|