xwikisas / macro-pdfviewer

0 stars 4 forks source link

External PDFs are not displayed #15

Closed CamiAndrei closed 4 years ago

CamiAndrei commented 4 years ago

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 : https://github.com/mozilla/pdf.js/issues/7153 and https://github.com/mozilla/pdf.js/pull/6916

lucaa commented 4 years ago

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 commented 4 years ago

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

acotiuga commented 4 years ago

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 commented 4 years ago

pdfAdmin