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

Allow setting a root to be the screen rather than the page viewport #471

Open
chrishtr opened this issue May 11, 2021 · 0 comments
Open

Comments

@chrishtr
Copy link

chrishtr commented May 11, 2021

Proposal: add an option to measure relative to the screen.

Currently, an IntersectionObserver can observe relative to a specific root element, or if not specified, relative to the implicit root, which is the visual viewport of the browser window.

However, there are cases where it would be better to measure relative to the screen instead. Examples include:

a. Content embedded within a WebView that is itself embedded within a native application. The most common example of this is a native app advertisement delivered via WebView.

Currently, this use case is polyfilled by libraries such as the Open Measurement SDK. However, this polyfill has a few challenges, such as the need to use more CPU than necessary to implement (e.g. via polling loops), needed coordination between script code within the WebView and native code, and difficulties in situations where the WebView is larger than the ad creative and is partially off-screen.

b. A browser window that is partially offscreen. Ad visibility measurements would like to know if an ad is not visible on the screen in these cases.

It is not possible to polyfill this use case.

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