Namespace: onPageTransitionData

pageTransition.onPageTransitionData

An event that fires when data about a page transition is available. The event will fire after the pageManager.onPageVisitStart event, when DOM content has loaded (for ordinary page loads) or just after the URL changes (for History API page loads).

Source:

Methods

(static) addListener(listener, options)

Add a listener for the onPageTransitionData event.

Parameters:
Name Type Description
listener pageTransitionDataListener

The listener to add.

options Object

Options for the listener.

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

Match patterns for pages where the listener should be notified about transition data.

privateWindows boolean <optional>
false

Whether to notify the listener about page transitions in private windows and whether to consider pages loaded in private windows when generating time-based transition information.

Source:

(static) hasAnyListeners() → {boolean}

Whether the onPageTransitionData 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 onPageTransitionData event.

Parameters:
Name Type Description
listener pageTransitionDataListener

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 onPageTransitionData event.

Parameters:
Name Type Description
listener pageTransitionDataListener

The listener to remove.

Source:

Type Definitions

pageTransitionDataListener(details)

A listener for the onPageTransitionData event.

Parameters:
Name Type Description
details Object

Additional information about the page transition 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. Note that we recommend against using referrers for analyzing page transitions.

tabId number

The ID for the tab containing the page, unique to the browsing session. Note that if you send a message to the content script in the tab, there is a possible race condition where the page in the tab changes before your message arrives. You should specify a page ID (e.g., pageId) in your message to the content script, and the content script should check that page ID against its current page ID to ensure that the message was received by the intended page.

isHistoryChange boolean

Whether the page transition was caused by a URL change via the History API.

isOpenedTab boolean

Whether the page is loading in a tab that was newly opened from another tab.

openerTabId number

If the page is loading in a tab that was newly opened from another tab (i.e., isOpenedTab is true), the tab ID of the opener tab. Otherwise, tabs.TAB_ID_NONE. Note that if you send a message to the content script in the tab, there is a possible race condition where the page in the tab changes before your message arrives. You should specify a page ID (e.g., tabSourcePageId) in your message to the content script, and the content script should check that page ID against its current page ID to ensure that the message was received by the intended page.

transitionType string

The transition type, from webNavigation.onCommitted or webNavigation.onHistoryStateUpdated.

transitionQualifiers Array.<string>

The transition qualifiers, from webNavigation.onCommitted or webNavigation.onHistoryStateUpdated.

tabSourcePageId string

The ID for the most recent page in the same tab. If the page is opening in a new tab, then the ID of the most recent page in the opener tab. The value is "" if there is no such page.

tabSourceUrl string

The URL, without any hash, for the most recent page in the same tab. If the page is opening in a new tab, then the URL of the most recent page in the opener tab. The value is "" if there is no such page.

tabSourceClick boolean

Whether the user recently clicked or pressed enter/return on the most recent page in the same tab. If the page is loading in a tab that was newly opened by another tab, then whether the user recently clicked or pressed enter/return on the most recent page in the opener tab. The value is false if there is no such page.

timeSourcePageId string

The ID for the most recent page that loaded into any tab. If this is the first page visit after the extension starts, the value is "". Note that we recommend against using time-based page transition data.

timeSourceUrl string

The URL for the most recent page that loaded into any tab. If this is the first page visit after the extension starts, the value is "". Note that we recommend against using time-based page transition data.

Source: