BrowsingContextInspector

Represents a browsing context related events. Described in https://w3c.github.io/webdriver-bidi/#module-contexts-events. While BrowsingContext class represents a browsing context lifecycle and related commands. This class is specific to listening to events. Events can be subscribed to multiple browsing contexts or all of them.

Constructor

new BrowsingContextInspector()

Methods

(async) onBrowsingContextCreated(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.contextCreated' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onBrowsingContextDestroyed(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.contextDestroyed' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onBrowsingContextLoaded(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.load' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onDomContentLoaded(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.domContentLoaded' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onFragmentNavigated(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.fragmentNavigated' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onNavigationStarted(callback) → {Promise.<void>}

Subscribe to the 'browsingContext.navigationStarted' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onUserPromptClosed(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.userPromptClosed' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>

(async) onUserPromptOpened(callback) → {Promise.<void>}

Subscribes to the 'browsingContext.userPromptOpened' event.

Parameters:
NameTypeDescription
callbackfunction

The callback function to handle the event.

Returns:
  • A promise that resolves when the event is emitted.
Type: 
Promise.<void>