@lvce-editor/iframe-worker 5.3.0 → 5.5.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 +7 -2
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -960,7 +960,7 @@ const getIframeSrcRemote = (webViews, webViewPort, webViewId, locationProtocol,
|
|
|
960
960
|
// TODO when running in remote, try scope webviews by path or if possible by domain
|
|
961
961
|
if (platform$1 === Electron) {
|
|
962
962
|
const webViewId = webView.id;
|
|
963
|
-
iframeSrc = `${webViewScheme}://${webViewId}
|
|
963
|
+
iframeSrc = `${webViewScheme}://${webViewId}`;
|
|
964
964
|
} else if (platform$1 === Remote) {
|
|
965
965
|
webViewRoot = webView.uri;
|
|
966
966
|
iframeSrc = createLocalHostUrl(locationProtocol, locationHost, isGitpod, webViewPort);
|
|
@@ -1004,6 +1004,7 @@ const getDefaultBaseUrl = webView => {
|
|
|
1004
1004
|
}
|
|
1005
1005
|
return '';
|
|
1006
1006
|
};
|
|
1007
|
+
|
|
1007
1008
|
const getWebViewBaseUrl = (webView, locationOrigin) => {
|
|
1008
1009
|
const defaultBaseUrl = getDefaultBaseUrl(webView);
|
|
1009
1010
|
if (defaultBaseUrl.startsWith(locationOrigin)) {
|
|
@@ -1109,7 +1110,7 @@ const getWebViewOrigin = (webViewPort, platform, webViewScheme, webViewId) => {
|
|
|
1109
1110
|
|
|
1110
1111
|
const getIframePermissionPolicy = webView => {
|
|
1111
1112
|
const extensionAllow = webView.allow || [];
|
|
1112
|
-
return extensionAllow;
|
|
1113
|
+
return ['cross-origin-isolated', ...extensionAllow];
|
|
1113
1114
|
};
|
|
1114
1115
|
|
|
1115
1116
|
const getWebViews = async () => {
|
|
@@ -1290,6 +1291,10 @@ const create2 = async ({
|
|
|
1290
1291
|
const portId = create$1();
|
|
1291
1292
|
await register(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId);
|
|
1292
1293
|
await invoke$1('WebView.create', id, iframeSrc, sandbox, iframeCsp, credentialless, permissionPolicyString, frameTitle);
|
|
1294
|
+
|
|
1295
|
+
// TODO maybe iframe waitForLoad is not needed. since it cannot be used detect errors anyway
|
|
1296
|
+
// and causes flash of unstyled content, maybe a better way would be to just send the
|
|
1297
|
+
// port and wait for the first port message
|
|
1293
1298
|
await invoke$1('WebView.load', id);
|
|
1294
1299
|
const origin = getWebViewOrigin(webViewPort, platform, webViewScheme, webViewId);
|
|
1295
1300
|
const portType = '';
|