Attach (recommended) or Link to PDF file here:
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
What went wrong? (add screenshot)
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
Closing since this looks like a duplicate of #5397, which has more debugging information.
So far, no solution has been proposed
The problem is the viewer. The embedded viewer causes the cross-origin problem. Try creating your own viewer. That will solve the problem. e.g. from here: https://pspdfkit.com/blog/2019/implement-pdf-viewer-pdf-js/
Or if you need a full featured viewer, you can use the Mozilla one from here: http://mozilla.github.io/pdf.js/web/viewer.html (for this one you will need to download the latest pdf.js and pdf.worker.js implementation). I just did that for a project at work, and it works like a charm.
@vaspervnp Why does the embedded viewer cause the problem? What part of the viewer is making the window think that it's url is on a different domain?
@worthy7 It loads the viewer from a local resource namespace. The browser thinks that is a different domain, because it actually is.
Most helpful comment
So far, no solution has been proposed