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

Prevent iframe from scrolling parent container #7134

Open
ms609 opened this issue Mar 11, 2022 · 1 comment
Open

Prevent iframe from scrolling parent container #7134

ms609 opened this issue Mar 11, 2022 · 1 comment

Comments

@ms609
Copy link

ms609 commented Mar 11, 2022

An iframe can cause its parent window to scroll to another position, for example using document.body.scrollIntoView();

There seems to be no way to override (prohibit) this behaviour under the present w3c specification. StackOverflow user Kaiido has suggested a solution that exploits a bug in Chrome, which raises the question as to whether a CSS solution to prevent cross-source scrolling would be possible.

Further details at the StackOverflow answer.

@Malvoz
Copy link
Contributor

Malvoz commented Mar 13, 2022

See related: w3c/webappsec-permissions-policy#171 / the vertical-scroll document policy feature.

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