documentViewer broken after 6.1

Community Driven Extensions Project
Post Reply
ybendek
Posts: 84
Joined: 05 Aug 2011, 17:52

17 Jun 2017, 22:40

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???

User avatar
Melloware
Posts: 215
Joined: 22 Apr 2013, 15:48

18 Jun 2017, 15:22

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
PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces 6.1 / PF Extensions 6.1.1

ybendek
Posts: 84
Joined: 05 Aug 2011, 17:52

19 Jun 2017, 03:24

Thank you....

User avatar
Melloware
Posts: 215
Joined: 22 Apr 2013, 15:48

12 Jul 2017, 01:48

This will be fixed in 6.2 and has been fixed with a SNAPSHOT release for those that need this right now.
PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces 6.1 / PF Extensions 6.1.1

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests