Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] PDF printing,add allow-modals attribute in iframe #359

Open
ebijun opened this issue Feb 7, 2020 · 0 comments
Open

[FIX] PDF printing,add allow-modals attribute in iframe #359

ebijun opened this issue Feb 7, 2020 · 0 comments

Comments

@ebijun
Copy link

ebijun commented Feb 7, 2020

In previewing PDF document,
OSF.io use PDF.js and pdf.worker.min.js,to Preview/Print file.
and Print button always failed with
"iframe sandbox parameter should contain "allow-modals" parameter."

Because In OSF,pdf.worker.min.js called in iframe tag,

<iframe name="result" sandbox="allow-forms allow-popups allow-scripts allow-same-origin" frameborder="0">

To fix Print button failure,add "allow-modals",in iframe tag,

<iframe name="result" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin" frameborder="0">

so please add allow-modals attribute,to Print button.tested and works well on NII environment.

https://github.com/CenterForOpenScience/modular-file-renderer/blob/develop/mfr/server/static/js/mfr.js#L82

self.pymParent.iframe.setAttribute('sandbox', 'allow-scripts allow-popups allow-same-origin');
to
self.pymParent.iframe.setAttribute('sandbox', 'allow-scripts allow-popups allow-same-origin allow-modals');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant