Page 1 of 1

documentViewer broken after 6.1

Posted: 17 Jun 2017, 22:40
by ybendek
Hello Guys

I have been using this component without problems until I upgrade to 6.1.1, now when I'm including an external URL an exception is displayed in console and the file is not displayed

VM1172 pdf.viewer.js.jsf?ln=primefaces-extensions&v=6.1.1:20481 Uncaught (in promise) Error: file origin does not match viewer's
at validateFileURL (VM1172 pdf.viewer.js.jsf?ln=primefaces-extensions&v=6.1.1:20481)
at webViewerInitialized (VM1172 pdf.viewer.js.jsf?ln=primefaces-extensions&v=6.1.1:20500)
at <anonymous>

I found that now is required that the URL should be in the same server, apparently you could edit the variable HOSTED_VIEWER_ORIGINS to include the url as is mention in this forum (https://github.com/mozilla/pdf.js/issues/7153) but how could be fixed from PrimeExtensions???

Re: documentViewer broken after 6.1

Posted: 18 Jun 2017, 15:22
by Melloware
You are correct. The latest Mozilla PDF.js for security reasons prevents you from having a URL that is not from your server (think XSS). To make this work I would have to hack their JS to remove that check and then every time we upgrade the Mozilla PDF.js we would have to re-apply those fixes.

Do me a favor and report this bug on our GitHub page while I think about how to fix it...

https://github.com/primefaces-extension ... com/issues

Re: documentViewer broken after 6.1

Posted: 19 Jun 2017, 03:24
by ybendek
Thank you....

Re: documentViewer broken after 6.1

Posted: 12 Jul 2017, 01:48
by Melloware
This will be fixed in 6.2 and has been fixed with a SNAPSHOT release for those that need this right now.