-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Enable IE 11 compability of Angular + pdf.js #15772
Comments
Can you post a demo where the actual pdf.js and AngularJS files are used? I cannot reproduce the issue. To clarify, what you mean is that AngularJS autoboostrap is not working in IE11 when pdf.js is included? |
The workaround for this is simple. If you are using
It is unlikely that we will fix this on our side. It is |
I'd add that libraries shouldn't modify properties of objects they don't own as it causes issues like that (& many others). If they need a particular API that is missing in some supported environments they may wrap its usage in a function that will use the shimmed version if the native one is not available. |
Thanks for the discussion the argument are valid and good. So I'll close this issue. |
Thanks for closing. |
Faced with this issue on Firefox and angular 1.6.x |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
Currently pdf.js defines
document.currentScript
but notlink.origin
norlink.protocol
. If angular starts it checks if it is allowed to bootstrap automatically it checks for currentScript and asume that this will be enough to filter IE. This check will not work in combination with pdf.jsIf the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
To demonstrate this behaviour there is a plnkr with a minimal environment, that shows the problem: http://plnkr.co/edit/YFCQM2Px0QU0KnGzsAlM?p=preview
What is the expected behavior?
Angular should check also for link.origin and link.protocol if they are implemented, to make sure that it works correctly with e.g. pdf.js
What is the motivation / use case for changing the behavior?
pdf.js is widely used to render pdfs and angular is spreaded for web-apps. They will occur on the same page more often than probably expected, because they work in similiar domains, so they shouldn't interfier each other.
Which versions of AngularJS, and which browser / OS are affected by this issue? Did this work in previous versions of AngularJS? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
The whole angular 1.6.x tree is affected. The problem only occurs on IE 11 on each Windows.
Other information (e.g. stacktraces, related issues, suggestions how to fix)
Probably there can be a additional check for link.origin like:
And there can be a case for the undefined protocol:
The text was updated successfully, but these errors were encountered: