-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
External PDFs are not displayed #15
Comments
When you say "internal absolute URL" you mean an URL that has the same domain as the page where the pdf viewer is used, but it's passed as an absolute URL (starting with |
No. I mean the content is external, from a different domain. |
* introduce an option to provide trusted origins to the pdfjs code * if an origin belongs to the list of the trusted origins defined in XWiki, then the origin error is not trown anymore by pdfjs, instead it will fallback on default browsers behavior * the CORS still needs to be configured by each website/server owner
This fix is not enough as it is in order to display PDF's from different origins. It only provides a mechanism to define some trusted origin to bypass the pdfjs check that throws origin error. |
Steps to reproduce:
*Add an absolute URL from an external source in the File field
"Name of the PDF file or absolute URL to the PDF file"
e.g.: https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
Results:
The following error is displayed
Note that it works for internal absolute URLs, including from subwikis.
It seems that the pdf.js doesn't allow foreign origin URLs only for hosted viewers : mozilla/pdf.js#7153 and mozilla/pdf.js#6916
The text was updated successfully, but these errors were encountered: