IE 11 issue - "Access Denied" in getOwnPropertyNames
gursharan001 opened this issue · 21 comments
Reference fix in knockout - SteveSanderson/knockout-es5#43
Reproduced using minimal ES2016 getting started kit (and upgrading everything to latest version). To reproduce, add an iframe which refers to any other domain e.g., adding below to index.html produces error in IE11
<iframe src="https://xkcd.com"></iframe>
Attached a minimal project to reproduce.
polyfill-error.zip
I think we've got a fix coming. See this PR: #21 Give it a try and let me know if it fixes your issues.
PR fixes the issue in aurelia polyfill with the repro code.
However, in my application the same error is now raised in Babel browser.js file (5.8.38). I don't have a repro for it at this point so I am not sure what is going wrong.
I managed to reproduce this error which is not fixed by PR: #21 Attaching the repro code.
Is it an error in our polyfills or in babel's browser.js?
The error is in babel's browser.js.
This should be fixed now.
I am also still seeing this issue with the latest version of aurelia-polyfills
Me too - any fix or workaround available?
I've been investigating this issue more. It does not occur on Chrome, Firefox and Edge (all latest versions) but it occurs 100% of the time on IE11. Just as @dtaalbers I am using Auth0 that opens a new window a brief moment for authentication.
@dtaalbers have you found any workaround that works with the auth0 authentication flow?
@EisenbergEffect should we raise a new issue or can this be re-opened?
edit: I'm also using the latest version of aurelia-polyfills (1.1.1) and I'm using the same package versions as in the latest skeleton-typescript-webpack.
Any update on how to fix this?
+1
Same as @mikeesouth we're not seeing this in current releases of Chrome or Firefox. Only on IE 11 (we're using 11.0.9600.18617) 100% of the time as well.
Is there a solution available for this? I just installed the recent aurelia cli 4.1.2 and polyfills 1.2.1, but am still running into this issue on IE 11.
In aurelia-polyfills.js i changed the definition of
descriptor.value = function getOwnPropertyNames(o)
to the following:
descriptor.value = function getOwnPropertyNames(o) { var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; if (_toString(o) === '[object Window]') { try { return originalObjectGetOwnPropertyNames(o); } catch (e) { // IE bug where layout engine calls userland gOPN for cross-domain "window" objects return [].concat([], cachedWindowNames); } } return gOPN(o).filter(onlyNonSymbols); };
When using IE 11 and opening the developer toolbar and having an IFrame inserted anywhere in your document you will get in trouble because IE tries to call getOwnPropertyNames but that is not allowed if the IFrame domain is different from the document domain. I am really not an expert on this, most credit goes to https://github.com/ljharb
Sorry for the formatting of the code.
That's f****ing awesome!!! Is there a PR to try?
@magnusdanielson Would you be interested in submitting a PR?
Sure, I will give it a try.
I'll ping you when done.
@magnusdanielson Any news on the PR?
I'm also having this issue! Any update @magnusdanielson?