@lvce-editor/extension-management-worker 4.21.0 → 4.22.0
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.
|
@@ -1738,9 +1738,10 @@ const isHttpLocation = () => {
|
|
|
1738
1738
|
return Reflect.has(globalThis, 'location') && globalThis.location.protocol.startsWith('http');
|
|
1739
1739
|
};
|
|
1740
1740
|
const getRuntimeContext = async (assetDir, platform) => {
|
|
1741
|
+
const shouldInferPlatform = isMissingPlatform(platform);
|
|
1741
1742
|
const resolvedAssetDir = isMissingAssetDir(assetDir) ? await invoke$3('Layout.getAssetDir') : assetDir;
|
|
1742
|
-
const resolvedPlatform =
|
|
1743
|
-
if (isHttpLocation() && isStaticHttpAssetDir(resolvedAssetDir)) {
|
|
1743
|
+
const resolvedPlatform = shouldInferPlatform ? await invoke$3('Layout.getPlatform') : platform;
|
|
1744
|
+
if (shouldInferPlatform && isHttpLocation() && isStaticHttpAssetDir(resolvedAssetDir)) {
|
|
1744
1745
|
return {
|
|
1745
1746
|
assetDir: resolvedAssetDir,
|
|
1746
1747
|
platform: Web
|
|
@@ -2068,8 +2069,10 @@ const createWebViewWorkerRpc2 = async (rpcInfo, port) => {
|
|
|
2068
2069
|
});
|
|
2069
2070
|
};
|
|
2070
2071
|
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2072
|
+
const sourcePathMarker = '/extension-management-worker/src/';
|
|
2073
|
+
const getExtensionHostSubWorkerUrl = (currentUrl = import.meta.url) => {
|
|
2074
|
+
const relativePath = currentUrl.includes(sourcePathMarker) ? '../../../../extension-host-sub-worker/src/extensionHostSubWorkerMain.js' : '../../extension-host-sub-worker/dist/extensionHostSubWorkerMain.js';
|
|
2075
|
+
return new URL(relativePath, currentUrl).href;
|
|
2073
2076
|
};
|
|
2074
2077
|
const extensionHostSubWorkerUrl = getExtensionHostSubWorkerUrl();
|
|
2075
2078
|
|