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

Microsoft Edge iframe-in-iframe "Access Denied" #14

Open
kribblo opened this issue Aug 10, 2017 · 0 comments
Open

Microsoft Edge iframe-in-iframe "Access Denied" #14

kribblo opened this issue Aug 10, 2017 · 0 comments

Comments

@kribblo
Copy link

kribblo commented Aug 10, 2017

Kind of hard to make a good testcase for this one, because it seems a bit random when it occurs, but anyhow:

My company makes games for the internet, which in turn are included in different web pages, sometimes iframes, sometimes not, sometimes dynamically created, sometimes loaded via an URL, you get the picture.

Sometimes, not always, dynamically created iframes lose the document.domain inheritance on Edge. When this happens, window.frameElement.getAttribute('srcdoc'); gives SCRIPT5: Access Denied.

In the end I solved it by implementing the srcdoc functionality like this instead:

iframe.contentWindow.srcdoc = content;
iframe.src = 'javascript:window["srcdoc"]';

I have no idea why this is allowed and not window.frameElement but there you are.

I thought I'd open this issue (and I could provide a pull request if you want me to) in case you want to cover this edge-case as well. It's possibly rare, but real. It still works on all modern browsers AFAICT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant