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

External PDFs are not displayed #15

Closed
CamiAndrei opened this issue Jul 3, 2020 · 4 comments
Closed

External PDFs are not displayed #15

CamiAndrei opened this issue Jul 3, 2020 · 4 comments
Assignees
Milestone

Comments

@CamiAndrei
Copy link

CamiAndrei commented Jul 3, 2020

Steps to reproduce:

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

@lucaa
Copy link

lucaa commented Jul 6, 2020

Note that it works for internal absolute URLs, including from subwikis.

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 https://... ) instead of being passed as relative to the domain (starting with a /...) , right?

@CamiAndrei
Copy link
Author

CamiAndrei commented Jul 6, 2020

No. I mean the content is external, from a different domain.

acotiuga added a commit that referenced this issue Aug 26, 2020
* 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
@acotiuga acotiuga self-assigned this Aug 26, 2020
@acotiuga acotiuga added this to the 2.1 milestone Aug 26, 2020
@acotiuga
Copy link

acotiuga commented Aug 26, 2020

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.
In addition, each XWiki instance owner is responsible to configure the CORS mechanism.

@acotiuga
Copy link

acotiuga commented Aug 27, 2020

pdfAdmin

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

No branches or pull requests

3 participants