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

Check for same origin before using window.top #239

Open
sdir456 opened this issue Dec 27, 2017 · 1 comment
Open

Check for same origin before using window.top #239

sdir456 opened this issue Dec 27, 2017 · 1 comment

Comments

@sdir456
Copy link

sdir456 commented Dec 27, 2017

With #207 top.document should be used to attach the event handlers. When the top window is from a different origin (e.g. the site is embedded in an iframe from a different origin) then access to window.top (and therefore top.document) is prohibited by the browser. This leads to the following exception:
image

Therefore access to window.top should be avoided or at least there should be a check if its safe to acces it (try catch?).

edit:
I don't know why, but there is a commit that reverts the changes from #207
see 106c198
But its not already releaset so that the current released version still contains the access of window.top

@sdir456 sdir456 changed the title Check for SameOriginPolicy before using window.top Check for same origin before using window.top Dec 27, 2017
@sneetsher
Copy link
Contributor

sneetsher commented Mar 11, 2019

Or jQuery .focusout() could be used on the control component itself instead of click on top/parent element.

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

No branches or pull requests

3 participants