Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Jun 4, 2020

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).

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 <danxuliu@gmail.com>
@danxuliu
Copy link
Member Author

danxuliu commented Jun 4, 2020

/backport to stable19

@danxuliu
Copy link
Member Author

danxuliu commented Jun 4, 2020

/backport to stable18

@danxuliu
Copy link
Member Author

danxuliu commented Jun 4, 2020

/backport to stable17

@ChristophWurst ChristophWurst merged commit ee7f5d7 into master Jun 4, 2020
@delete-merged-branch delete-merged-branch bot deleted the allow-downloads-in-sandboxed-iframe branch June 4, 2020 11:34
t-oster added a commit to t-oster/files_pdfviewer that referenced this pull request Aug 11, 2020
In chrome 83 an iframe is not allowed to initiate a download except when the sandbox=allow-downloads attribute is set.
Same as nextcloud/files_pdfviewer#186
SamuAlfageme pushed a commit to SamuAlfageme/files_pdfviewer that referenced this pull request Apr 15, 2021
In chrome 83 an iframe is not allowed to initiate a download except when the sandbox=allow-downloads attribute is set.
Same as nextcloud/files_pdfviewer#186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants