@lvce-editor/iframe-worker 5.8.0 → 5.9.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 +8 -6
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -1204,7 +1204,7 @@ const start = async (previewServerId, webViewPort) => {
|
|
|
1204
1204
|
const setInfo = async (previewServerId, webViewId, webViewRoot, contentSecurityPolicy, iframeContent) => {
|
|
1205
1205
|
await invoke('WebViewServer.setInfo', previewServerId, webViewId, webViewRoot, contentSecurityPolicy, iframeContent);
|
|
1206
1206
|
};
|
|
1207
|
-
const setHandler = async (previewServerId, frameAncestors, webViewRoot, contentSecurityPolicy, iframeContent) => {
|
|
1207
|
+
const setHandler = async (previewServerId, frameAncestors, webViewRoot, contentSecurityPolicy, iframeContent, remotePathPrefix) => {
|
|
1208
1208
|
await invoke('WebViewServer.setHandler', previewServerId, frameAncestors, webViewRoot, contentSecurityPolicy, iframeContent);
|
|
1209
1209
|
};
|
|
1210
1210
|
|
|
@@ -1221,7 +1221,7 @@ const register$3 = async (previewServerId, webViewPort, frameAncestors, webViewR
|
|
|
1221
1221
|
await setInfo(previewServerId, webViewId, webViewRoot, csp, iframeContent);
|
|
1222
1222
|
};
|
|
1223
1223
|
|
|
1224
|
-
const register$2 = async (previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent) => {
|
|
1224
|
+
const register$2 = async (previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, remotePathPrefix) => {
|
|
1225
1225
|
// TODO apply something similar for electron
|
|
1226
1226
|
// TODO pass webview root, so that only these resources can be accessed
|
|
1227
1227
|
// TODO pass csp configuration to server
|
|
@@ -1248,9 +1248,9 @@ const getModule = platform => {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
};
|
|
1250
1250
|
|
|
1251
|
-
const register = async (previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId) => {
|
|
1251
|
+
const register = async (previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId, remotePathPrefix) => {
|
|
1252
1252
|
const fn = getModule(platform);
|
|
1253
|
-
return fn(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, webViewId);
|
|
1253
|
+
return fn(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, webViewId, remotePathPrefix);
|
|
1254
1254
|
};
|
|
1255
1255
|
|
|
1256
1256
|
const create2 = async ({
|
|
@@ -1304,7 +1304,8 @@ const create2 = async ({
|
|
|
1304
1304
|
port2
|
|
1305
1305
|
} = getPortTuple();
|
|
1306
1306
|
const portId = create$1();
|
|
1307
|
-
|
|
1307
|
+
const remotePathPrefix = '/remote';
|
|
1308
|
+
await register(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId, remotePathPrefix);
|
|
1308
1309
|
await invoke$1('WebView.create', id, iframeSrc, sandbox, iframeCsp, credentialless, permissionPolicyString, frameTitle);
|
|
1309
1310
|
|
|
1310
1311
|
// TODO maybe iframe waitForLoad is not needed. since it cannot be used detect errors anyway
|
|
@@ -1406,7 +1407,8 @@ const create3 = async ({
|
|
|
1406
1407
|
port2
|
|
1407
1408
|
} = getPortTuple();
|
|
1408
1409
|
const portId = create$1();
|
|
1409
|
-
|
|
1410
|
+
const remotePathPrefix = '/remote';
|
|
1411
|
+
await register(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId, remotePathPrefix);
|
|
1410
1412
|
await invoke$1('WebView.create', id, iframeSrc, sandbox, iframeCsp, credentialless, permissionPolicyString, frameTitle);
|
|
1411
1413
|
|
|
1412
1414
|
// TODO maybe iframe waitForLoad is not needed. since it cannot be used detect errors anyway
|