MCPcopy Create free account
hub / github.com/dailydotdev/apps / isPageInFocus

Function isPageInFocus

packages/shared/src/features/monetization/viewability.ts:55–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53// Pixels in the viewport are only on screen when the tab is the active one and
54// the browser window itself has focus.
55export const isPageInFocus = (): boolean =>
56 globalThis.document.visibilityState === 'visible' &&
57 globalThis.document.hasFocus();
58
59export interface ViewabilityData extends ViewabilityCriteria {
60 /** Milliseconds between the creative rendering and meeting the criteria. */

Callers 3

evaluateFunction · 0.90
reportViewableFunction · 0.90
evaluateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected