@lvce-editor/iframe-worker 3.6.0 → 3.6.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/iframeWorkerMain.js +8 -0
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -937,6 +937,9 @@ const getWebViewPath = (webViews, webViewId) => {
|
|
|
937
937
|
}
|
|
938
938
|
return webView.path;
|
|
939
939
|
};
|
|
940
|
+
const isWindowsPath = path => {
|
|
941
|
+
return path.startsWith('A:/') || path.startsWith('B:/') || path.startsWith('C:/') || path.startsWith('D:/') || path.startsWith('E:/');
|
|
942
|
+
};
|
|
940
943
|
const getWebViewUri = (webViews, webViewId) => {
|
|
941
944
|
const webViewPath = getWebViewPath(webViews, webViewId);
|
|
942
945
|
if (!webViewPath) {
|
|
@@ -956,6 +959,9 @@ const getIframeSrcRemote = (webViews, webViewPort, webViewId, locationProtocol,
|
|
|
956
959
|
}
|
|
957
960
|
let iframeSrc = webViewUri;
|
|
958
961
|
let webViewRoot = webViewUri;
|
|
962
|
+
|
|
963
|
+
// TODO simplify path handling, always use uris so that paths on windows, linux and macos are the same
|
|
964
|
+
|
|
959
965
|
if (platform$1 === Electron) {
|
|
960
966
|
const relativePath = new URL(webViewUri).pathname.replace('/index.html', '');
|
|
961
967
|
iframeSrc = `${WebView}://-${relativePath}/`;
|
|
@@ -965,6 +971,8 @@ const getIframeSrcRemote = (webViews, webViewPort, webViewId, locationProtocol,
|
|
|
965
971
|
if (webViewUri.startsWith('file://')) {
|
|
966
972
|
// ignore
|
|
967
973
|
webViewRoot = webViewUri.slice('file://'.length).replace('/index.html', '');
|
|
974
|
+
} else if (isWindowsPath(relativePath)) {
|
|
975
|
+
webViewRoot = relativePath;
|
|
968
976
|
} else {
|
|
969
977
|
webViewRoot = root + relativePath;
|
|
970
978
|
}
|