Namespace: onPageData

pageNavigation.onPageData

An event that fires when a page visit has ended and data about the visit is available.

Source:

Methods

(static) addListener(listener, options)

Add a listener for the onPageData event.

Parameters:
Name Type Description
listener pageDataListener

The listener to add.

options Object

Options for the listener.

Properties
Name Type Attributes Default Description
matchPatterns Array.<string>

The webpages that the listener should be notified about, specified with WebExtensions match patterns.

privateWindows boolean <optional>
false

Whether to measure pages in private windows.

Source:

(static) hasAnyListeners() → {boolean}

Whether the onPageData event has any listeners.

Source:
Returns:

Whether the event has any listeners.

Type
boolean

(static) hasListener(listener) → {boolean}

Whether a specified listener has been added for the onPageData event.

Parameters:
Name Type Description
listener pageDataListener

The listener to check.

Source:
Returns:

Whether the listener has been added for the event.

Type
boolean

(static) removeListener(listener)

Remove a listener for the onPageData event.

Parameters:
Name Type Description
listener pageDataListener

The listener to remove.

Source:

Type Definitions

pageDataListener(details)

A listener for the onPageData event.

Parameters:
Name Type Description
details Object

Additional information about the page data event.

Properties
Name Type Description
pageId string

The ID for the page, unique across browsing sessions.

url string

The URL of the page, without any hash.

referrer string

The referrer URL for the page, or "" if there is no referrer.

pageVisitStartTime number

The time when the page visit started, in ms since the epoch.

pageVisitStopTime number

The time when the page visit ended, in ms since the epoch.

attentionDuration number

The amount of time in ms that the page had user attention.

audioDuration number

The amount of time in ms that the page was playing audio.

attentionAndAudioDuration number

The amount of time in ms that the page both had user attention and was playing audio.

maxRelativeScrollDepth number

The maximum relative scroll depth on the page.

privateWindow boolean

Whether the page loaded in a private window.

Source: