fix download issues in webviews (#108603)

* fix download issues in webviews

* also add allow-download in ts src
This commit is contained in:
Pierre Papin
2020-10-14 23:42:37 +02:00
committed by GitHub
parent f87d1f4609
commit 74335e9bf3
2 changed files with 2 additions and 2 deletions

View File

@@ -492,7 +492,7 @@
const newFrame = document.createElement('iframe');
newFrame.setAttribute('id', 'pending-frame');
newFrame.setAttribute('frameborder', '0');
newFrame.setAttribute('sandbox', options.allowScripts ? 'allow-scripts allow-forms allow-same-origin allow-pointer-lock' : 'allow-same-origin allow-pointer-lock');
newFrame.setAttribute('sandbox', options.allowScripts ? 'allow-scripts allow-forms allow-same-origin allow-pointer-lock allow-downloads' : 'allow-same-origin allow-pointer-lock');
if (host.fakeLoad) {
// We should just be able to use srcdoc, but I wasn't
// seeing the service worker applying properly.

View File

@@ -67,7 +67,7 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
// Wait the end of the ctor when all listeners have been hooked up.
const element = document.createElement('iframe');
element.className = `webview ${options.customClasses || ''}`;
element.sandbox.add('allow-scripts', 'allow-same-origin', 'allow-forms', 'allow-pointer-lock');
element.sandbox.add('allow-scripts', 'allow-same-origin', 'allow-forms', 'allow-pointer-lock', 'allow-downloads');
element.style.border = 'none';
element.style.width = '100%';
element.style.height = '100%';