@lvce-editor/renderer-process 8.5.0 → 8.6.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/rendererProcessMain.js +26 -10
- package/package.json +1 -1
|
@@ -11172,14 +11172,36 @@ const ViewletWebViewEvents = {
|
|
|
11172
11172
|
returnValue
|
|
11173
11173
|
};
|
|
11174
11174
|
|
|
11175
|
+
const setIframeCredentialless = ($Iframe, credentialless) => {
|
|
11176
|
+
if (credentialless) {
|
|
11177
|
+
// @ts-ignore
|
|
11178
|
+
$Iframe.credentialless = credentialless;
|
|
11179
|
+
}
|
|
11180
|
+
};
|
|
11181
|
+
|
|
11182
|
+
const setIframeCsp = ($Iframe, csp) => {
|
|
11183
|
+
if (csp) {
|
|
11184
|
+
// @ts-ignore
|
|
11185
|
+
$Iframe.csp = csp;
|
|
11186
|
+
}
|
|
11187
|
+
};
|
|
11188
|
+
|
|
11175
11189
|
const setIframeSandBox = ($Iframe, sandbox) => {
|
|
11176
11190
|
for (const element of sandbox) {
|
|
11177
11191
|
$Iframe.sandbox.add(element);
|
|
11178
11192
|
}
|
|
11179
11193
|
};
|
|
11180
11194
|
|
|
11195
|
+
const setIframeSrc = ($Iframe, src, srcDoc) => {
|
|
11196
|
+
if (src) {
|
|
11197
|
+
$Iframe.src = src;
|
|
11198
|
+
} else if (srcDoc) {
|
|
11199
|
+
$Iframe.srcdoc = srcDoc;
|
|
11200
|
+
}
|
|
11201
|
+
};
|
|
11202
|
+
|
|
11181
11203
|
// TODO could use browser view when running in electron
|
|
11182
|
-
const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '') => {
|
|
11204
|
+
const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true) => {
|
|
11183
11205
|
if (!src && !srcDoc) {
|
|
11184
11206
|
return;
|
|
11185
11207
|
}
|
|
@@ -11191,17 +11213,11 @@ const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '') => {
|
|
|
11191
11213
|
throw new Error('webview wrapper not found');
|
|
11192
11214
|
}
|
|
11193
11215
|
const $Iframe = document.createElement('iframe');
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
$Iframe.csp = csp;
|
|
11197
|
-
}
|
|
11216
|
+
setIframeCredentialless($Iframe, credentialless);
|
|
11217
|
+
setIframeCsp($Iframe, csp);
|
|
11198
11218
|
setIframeSandBox($Iframe, sandbox);
|
|
11219
|
+
setIframeSrc($Iframe, src, srcDoc);
|
|
11199
11220
|
$Iframe.className = 'E2eTestIframe WebViewIframe';
|
|
11200
|
-
if (src) {
|
|
11201
|
-
$Iframe.src = src;
|
|
11202
|
-
} else if (srcDoc) {
|
|
11203
|
-
$Iframe.srcdoc = srcDoc;
|
|
11204
|
-
}
|
|
11205
11221
|
$Parent.append($Iframe);
|
|
11206
11222
|
state.frame = $Iframe;
|
|
11207
11223
|
set$1(1, $Iframe);
|