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

IE 11 can't load pdf #139

Closed
kubydog opened this issue Sep 11, 2019 · 7 comments
Closed

IE 11 can't load pdf #139

kubydog opened this issue Sep 11, 2019 · 7 comments
Assignees
Labels
bug Something isn't working Can't reproduce the bug You've reported a bug, but the feature works fine on my machine. So I don't know how to help you. Please send me a reproducer A reproducer is a minimal but working project showing the problem. wontfix This will not be worked on

Comments

@kubydog
Copy link

kubydog commented Sep 11, 2019

Hello @stephanrauh, the pdf viewer is broken on IE 11
Error Message: file origin does not match viewer's
image

I did research on this error and found it is caused by view-es5.js. In my project, I did a quick fix based on mozilla/pdf.js#7153, but it needs me to modify the source code

Is there any easy way to avoid this?

ngx-extended-pdf-viewer version: 1.5.1
angular version: 7

After I fixed the pdf loading issue. I got issues of changing page:
By scrolling:
image

By selecting thumbnail:
image

By entering page number in page input box, nothing happen, doesn't go to the page entered.

Chrome works fine

@stephanrauh
Copy link
Owner

What was your change to the source code? Did you modify the array HOSTED_VIEWER_ORIGINS?

@kubydog
Copy link
Author

kubydog commented Sep 11, 2019

I added two lines code in view.js
var LOCAL_AUTO_DETECT_ORIGIN = window.location.origin;

var HOSTED_VIEWER_ORIGINS = ['null', 'http://mozilla.github.io', 'https://mozilla.github.io'];

HOSTED_VIEWER_ORIGINS.push(LOCAL_AUTO_DETECT_ORIGIN);

@stephanrauh stephanrauh added the bug Something isn't working label Sep 29, 2019
@stephanrauh
Copy link
Owner

Quick sign-of-life: I've started to investigate your topic. As far as I remember, I've already integrated your fix, but I was interrupted by private life. I hope I can find some spare time for this project soon, in a week or two. Stay tuned!

Best regards,
Stephan

@RobinBomkampDv
Copy link

Having the same problem. Any solutions upcoming?

@stephanrauh
Copy link
Owner

@kubydog The problems with scrolling and entering the page number should be a thing of the past. Update to version 1.7.0, and everything should be OK. If these errors still occur, report them at #154.

@stephanrauh
Copy link
Owner

@rbdv159 I assume you're referring to the "file origin" message?

@stephanrauh
Copy link
Owner

@rbdv159 @kubydog After thinking about it for a while, I don't believe this is an error. You've stumbled upon a protection against CORS attacks. No browser except IE11 will accept PDF files that don't come from the same URL as the Angular application.

I've tried to reproduce the bug, but I didn't manage to do so. Every combination that came to my mind either works or is rightfully blocked by the CORS protection.

The HOSTED_VIEWER_ORIGINS bit is a CORS protection, too. It has been added to the PDF viewer because the viewer is also added the Firefox and Chrome natively.

The `window.location.origin´ doesn't make any difference. In my tests, that is. I'll add it as soon as you manage to convince me it's useful. What's your precise scenario?

I'll close the ticket now, but I'm still listening to the channel. Don't hesitate to leave your suggestions or - even better - your reproducer (i.e. a small, simple, but complete project showing the bug).

Best regards,
Stephan

@stephanrauh stephanrauh added wontfix This will not be worked on Can't reproduce the bug You've reported a bug, but the feature works fine on my machine. So I don't know how to help you. Please send me a reproducer A reproducer is a minimal but working project showing the problem. labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Can't reproduce the bug You've reported a bug, but the feature works fine on my machine. So I don't know how to help you. Please send me a reproducer A reproducer is a minimal but working project showing the problem. wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants