@lvce-editor/iframe-worker 5.2.0 → 5.3.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.
- package/dist/iframeWorkerMain.js +11 -11
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -1094,17 +1094,17 @@ const getWebViewFrameAncestors = (locationProtocol, locationHost) => {
|
|
|
1094
1094
|
return frameAncestors;
|
|
1095
1095
|
};
|
|
1096
1096
|
|
|
1097
|
-
const getWebViewOrigin = (webViewPort, platform, webViewScheme) => {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1097
|
+
const getWebViewOrigin = (webViewPort, platform, webViewScheme, webViewId) => {
|
|
1098
|
+
switch (platform) {
|
|
1099
|
+
case Electron:
|
|
1100
|
+
return `${webViewScheme}://${webViewId}`;
|
|
1101
|
+
case Remote:
|
|
1102
|
+
// TODO support gitpod / codespaces
|
|
1103
|
+
return `http://localhost:${webViewPort}`;
|
|
1104
|
+
default:
|
|
1105
|
+
// TODO
|
|
1106
|
+
return '*';
|
|
1106
1107
|
}
|
|
1107
|
-
return origin;
|
|
1108
1108
|
};
|
|
1109
1109
|
|
|
1110
1110
|
const getIframePermissionPolicy = webView => {
|
|
@@ -1291,7 +1291,7 @@ const create2 = async ({
|
|
|
1291
1291
|
await register(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId);
|
|
1292
1292
|
await invoke$1('WebView.create', id, iframeSrc, sandbox, iframeCsp, credentialless, permissionPolicyString, frameTitle);
|
|
1293
1293
|
await invoke$1('WebView.load', id);
|
|
1294
|
-
const origin = getWebViewOrigin(webViewPort, platform, webViewScheme);
|
|
1294
|
+
const origin = getWebViewOrigin(webViewPort, platform, webViewScheme, webViewId);
|
|
1295
1295
|
const portType = '';
|
|
1296
1296
|
await setPort(id, port1, origin, portType);
|
|
1297
1297
|
await invokeAndTransfer$1('ExtensionHostWebView.create', webViewId, port2, uri, id, origin);
|