From 3d5bcb1e721dd90ad11ec54d73d2222941a6137f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 4 Jun 2020 13:02:52 +0200 Subject: Allow downloads in sandboxed iframe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now it was possible to initiate a download from an iframe, but the HTML spec has been updated to prevent that unless "allow-downloads" is set in the "sandbox" attribute of the iframe. As the PDF viewer shows the PDF file in an iframe the "allow-downloads" attribute is needed to be able to download the PDF file by clicking on the "Download" button of the UI in browsers that have implemented the spec change (like Chromium 83; other browsers are expected to follow). Signed-off-by: Daniel Calviño Sánchez --- js/previewplugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/previewplugin.js b/js/previewplugin.js index 67835fe..dec4712 100644 --- a/js/previewplugin.js +++ b/js/previewplugin.js @@ -54,7 +54,7 @@ var isSecureViewerAvailable = function () { var shown = true; var $iframe; var viewer = OC.generateUrl('/apps/files_pdfviewer/?file={file}', {file: downloadUrl}); - $iframe = $('