-
-
Notifications
You must be signed in to change notification settings - Fork 894
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
Support for IE8 when document.domain is set #306
Conversation
SUPPORTS_ACTIVEX = false; | ||
} | ||
|
||
return SUPPORTS_ACTIVEX && document.domain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this if (!document.domain) { return false; }
on the first line of the function, to avoid the try/catch when it's not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 👍
This is great - I suspect this can't be tested for without making a separate HTML file, since |
@ljharb agreed that testing this specific edge case might be a bit tricky given the IE8 environment and |
@danjamin It would be super helpful if you could set up a jsfiddle, that used rawgit.com to point to your PR's test file, and set |
@ljharb I'll give it a shot -- will ping you when it's ready |
Thanks! |
@ljharb turns out jsfiddle doesn't let you adjust the it has 2 pages (/broken and /fixed) -- if you visit both in IE8 you will see that the broken one has the "Permission Denied" error where as the fixed one does not error on the The only real difference between /broken and /fixed is that one points at es5-shim/master of es5-sham.js and the other at the version in the branch in my fork being pull requested. |
Awesome, that's good enough for me! https://github.com/danjamin/es5-shim/commit/c471214c1c8c4f6a1042c2ef53a0e69cf2ac5ad0 confirms it for me in my testing. |
Support for IE8 when document.domain is set
Cool -- glad I could help 😃 |
In relation to issue #150 -- took commit 4f738ac and applied it to es5-sham
Basically, the problem is that in IE < 9, when
document.domain
is set, using the es5-sham causes a "Permission denied" error. What this fix does, is uses a different approach to the Object.create polyfill when this situation arises. It leaves the original iframe approach intact for all other cases.For those of us still supporting IE8 😩, and where
document.domain
is necessary for an API being used via iframes (x-origin reasons), this fix should allow es5-sham to be used without error.