-
Notifications
You must be signed in to change notification settings - Fork 22
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
documentViewer broken with extrenal URLs after 6.1 #464
Comments
Can you try something. Just somewhere in your own JS code that loads AFTER the PFE code can you add this line... var HOSTED_VIEWER_ORIGINS = ['null', 'http://mozilla.github.io']; Where the URL is the root URL of the PDF you are trying to load? |
Nothing, the same exception, I try even debugging the pdf.viewer.js and this code overrides the variable I'm defining in my code, I'm including this code at the end of the file. |
OK I ripped out that check and updated my notes for any future upgrade to remove this JS. You can try this 6.1.1-SNAPSHOT I built for your. Grab the latest one in the DIR from today. |
Thank you. How could I include that in my project? I'm using maven, and I'm including primefaces extensions with a dependency:
|
Don't think snapshot is hosted in maven, so I guess you need to include a local jar file with some setup in Here is the stackoverflow link that might be helpful to you |
thank you |
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
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 (mozilla/pdf.js#7153) but unfortunatelly with Primefaces-extension I dont have an option, and changing manually that file inside of the jar is an option I dont want to apply
The text was updated successfully, but these errors were encountered: