-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
Object.create fails for IE<9 if document.domain is set #150
Comments
The use of the iframe is a recent addition. We may be able to back it out. Thanks. |
Looks like we can’t back it out. This is our only recourse for getting Object.create(null) to work on IE. @angus-c, one issue I see with the solution you tried is that there is a chance that the onload handler is introducing a race between the iframe loading and the first use of Object.create. Does the domain need to be assigned after the load event? |
The code is currently in an IIFE - so gets invoked even if Object.create(null) Yes agree about the sync issue. On Wed, Feb 6, 2013 at 12:47 PM, Kris Kowal [email protected]:
|
Okay. Let’s set up the iframe on the first use. |
@angus-c, can you check out the pull request I just posted and let me know if that resolves the issue for you? |
Actually, I believe We used something like this in FuseJS: // `cache` and the listener only need to be set up once.
var cache = [];
if (typeof attachEvent != "undefined") {
attachEvent("onunload", function() {
cache.length = 0;
});
// ...
var doc = new ActiveXObject("htmlfile");
doc.write("<script><\/script>");
doc.close();
cache.push(doc);
var empty = doc.parentWindow.Object.prototype;
// ... |
FuseJS is exactly who I was thinking of earlier: "I know people have used hidden iframes or SOMETHING for shims in old IE and been successful". I think that is likely to be the winner, as I have a feeling the above delayed-loading solution doesn't address the underlying problem (haven't tested it though). |
@kitcambridge, go for it! |
Working on a branch now—we'll probably want to keep the frame around for cases where the browser doesn't support |
Still failing in same place - not sure why, given your change - hard to On Wed, Feb 6, 2013 at 1:08 PM, Kris Kowal [email protected] wrote:
|
Yap, as Kit pointed out we used, in part, iframes and ActiveX for "Sandboxed Natives". The |
Here is notes from an old WIP rewrite of Sandboxed Natives (I should really revisit that):
|
Another possible way to quasi-emulate |
If the main document has domain attribute set then we get a permission denied error trying to access
iframe.contentWindow.Object
(due to same-domain restriction)Tried to patch it up with very hokey iframe.src code:
but it didn't do the trick.
This issue is preventing twitter.com from upgrading to latest es5-shim
The text was updated successfully, but these errors were encountered: