Skip to content

Commit 1dc81d6

Browse files
committed
Add local-network-access to iframe permissions policy
1 parent 5a1c4e6 commit 1dc81d6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/vs/workbench/contrib/webview/browser/pre/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@
10531053
}
10541054
newFrame.setAttribute('sandbox', Array.from(sandboxRules).join(' '));
10551055

1056-
const allowRules = ['cross-origin-isolated;', 'autoplay;'];
1056+
const allowRules = ['cross-origin-isolated;', 'autoplay;', 'local-network-access;'];
10571057
if (!isFirefox && options.allowScripts) {
10581058
allowRules.push('clipboard-read;', 'clipboard-write;');
10591059
}

src/vs/workbench/contrib/webview/browser/webviewElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ export class WebviewElement extends Disposable implements IWebviewElement, Webvi
402402
element.className = `webview ${options.customClasses || ''}`;
403403
element.sandbox.add('allow-scripts', 'allow-same-origin', 'allow-forms', 'allow-pointer-lock', 'allow-downloads');
404404

405-
const allowRules = ['cross-origin-isolated', 'autoplay'];
405+
const allowRules = ['cross-origin-isolated', 'autoplay', 'local-network-access'];
406406
if (!isFirefox) {
407407
allowRules.push('clipboard-read', 'clipboard-write');
408408
}

src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class WebWorkerExtensionHost extends Disposable implements IExtensionHost
138138
const iframe = document.createElement('iframe');
139139
iframe.setAttribute('class', 'web-worker-ext-host-iframe');
140140
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
141-
iframe.setAttribute('allow', 'usb; serial; hid; cross-origin-isolated;');
141+
iframe.setAttribute('allow', 'usb; serial; hid; cross-origin-isolated; local-network-access;');
142142
iframe.setAttribute('aria-hidden', 'true');
143143
iframe.style.display = 'none';
144144

0 commit comments

Comments
 (0)