mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Merge pull request #278185 from jeanp413/jp/possible-possum
Fix add `local-network-access` to iframe permissions policy
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
content="default-src 'none'; script-src 'sha256-ZcIhtIuU4M9PbKfs7w/CLqHimFJRK8L7mYTXOfiUv0I=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
content="default-src 'none'; script-src 'sha256-TaWGDzV7c9rUH2q/5ygOyYUHSyHIqBMYfucPh3lnKvU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport"
|
||||
@@ -1053,7 +1053,7 @@
|
||||
}
|
||||
newFrame.setAttribute('sandbox', Array.from(sandboxRules).join(' '));
|
||||
|
||||
const allowRules = ['cross-origin-isolated;', 'autoplay;'];
|
||||
const allowRules = ['cross-origin-isolated;', 'autoplay;', 'local-network-access;'];
|
||||
if (!isFirefox && options.allowScripts) {
|
||||
allowRules.push('clipboard-read;', 'clipboard-write;');
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ export class WebviewElement extends Disposable implements IWebviewElement, Webvi
|
||||
element.className = `webview ${options.customClasses || ''}`;
|
||||
element.sandbox.add('allow-scripts', 'allow-same-origin', 'allow-forms', 'allow-pointer-lock', 'allow-downloads');
|
||||
|
||||
const allowRules = ['cross-origin-isolated', 'autoplay'];
|
||||
const allowRules = ['cross-origin-isolated', 'autoplay', 'local-network-access'];
|
||||
if (!isFirefox) {
|
||||
allowRules.push('clipboard-read', 'clipboard-write');
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ export class WebWorkerExtensionHost extends Disposable implements IExtensionHost
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('class', 'web-worker-ext-host-iframe');
|
||||
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
|
||||
iframe.setAttribute('allow', 'usb; serial; hid; cross-origin-isolated;');
|
||||
iframe.setAttribute('allow', 'usb; serial; hid; cross-origin-isolated; local-network-access;');
|
||||
iframe.setAttribute('aria-hidden', 'true');
|
||||
iframe.style.display = 'none';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user