From 8f960c8ea86e7e83fa52a9a48f6216a4d604247a Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Wed, 17 Jun 2026 11:09:22 -0400 Subject: [PATCH 01/14] adds page for navigationstarted --- .../browsingcontext/contextcreated/index.md | 2 +- .../browsingcontext/contextdestroyed/index.md | 2 +- .../navigationstarted/index.md | 70 +++++++++++++++++++ files/sidebars/webdriver.yaml | 10 +++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextcreated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextcreated/index.md index e2f491f328945ea..1ef98ff2c753b86 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextcreated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextcreated/index.md @@ -11,7 +11,7 @@ The `browsingContext.contextCreated` [event](/en-US/docs/Web/WebDriver/Reference ## Event data -The `params` field in the event notification is a [context object](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree#contexts) with the following properties: +The `params` field in the event notification is a [context object](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree#contexts) with the following fields: - `children` - : An array of [context objects](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree#contexts) that represents child contexts. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextdestroyed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextdestroyed/index.md index 29c769c896974f8..057603531681f65 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextdestroyed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/contextdestroyed/index.md @@ -11,7 +11,7 @@ The `browsingContext.contextDestroyed` [event](/en-US/docs/Web/WebDriver/Referen ## Event data -The `params` field in the event notification is a [context object](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree#contexts) with the following properties, describing the discarded context and its subtree: +The `params` field in the event notification is a [context object](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree#contexts) with the following fields, describing the discarded context and its subtree: - `children` - : An array of [context objects](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree#contexts) that represents child contexts. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md new file mode 100644 index 000000000000000..882d631afadea70 --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -0,0 +1,70 @@ +--- +title: "`browsingContext.navigationStarted` event" +short-title: navigationStarted +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.navigationStarted_event +sidebar: webdriver +--- + +The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a navigation to a new document begins in a context. + +## Description + +The navigation to a different page can be triggered by the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, by user interaction with elements on the page, or by JavaScript running in the page's context. + +> [!NOTE] +> This event is not emitted when the initial `about:blank` page is loaded for a new top-level browsing context. + +This event does not fire for same-document navigations. +For navigations to a URL fragment, see [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated). +For URL changes made through the History API without a full navigation, see [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated). + +## Event data + +The `params` field in the event notification is a navigation object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the navigation is occurring. +- `navigation` + - : A string that contains the ID of the navigation, or the value `null` if the navigation does not have an associated navigation ID. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the URL being loaded. + +## Examples + +### Receiving an event when a cross-document navigation starts + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationStarted`. + +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtained from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). The browser sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: + +```json +{ + "type": "event", + "method": "browsingContext.navigationStarted", + "params": { + "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", + "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", + "timestamp": 1781646423959, + "url": "https://example.com" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated) event +- [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated) event +- [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) event +- [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) event diff --git a/files/sidebars/webdriver.yaml b/files/sidebars/webdriver.yaml index 33bdbc8f5d90756..e1e73ef4e4d9732 100644 --- a/files/sidebars/webdriver.yaml +++ b/files/sidebars/webdriver.yaml @@ -62,6 +62,16 @@ sidebar: code: true - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/contextDestroyed code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated + code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated + code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted + code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed + code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted + code: true - link: /Web/WebDriver/Reference/BiDi/Modules/emulation code: true - link: /Web/WebDriver/Reference/BiDi/Modules/input From 9cde0b9235e29df4075f53b455ba131ec68f5c5f Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Thu, 18 Jun 2026 16:59:21 -0400 Subject: [PATCH 02/14] adds page for navigationcommitted, navigationfailed --- .../navigationcommitted/index.md | 73 +++++++++++++++++++ .../browsingcontext/navigationfailed/index.md | 61 ++++++++++++++++ .../navigationstarted/index.md | 8 +- 3 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md new file mode 100644 index 000000000000000..7325f68d2125fd6 --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -0,0 +1,73 @@ +--- +title: "`browsingContext.navigationCommitted` event" +short-title: navigationCommitted +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.navigationCommitted_event +sidebar: webdriver +--- + +The `browsingContext.navigationCommitted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the browser commits a navigation and begins loading the new document. + +## Description + +A navigation is committed when the browser has accepted the URL from the server response and begun loading the new page, but before any content has been parsed or rendered. Page content is not yet available at this point. + +In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) and before [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) and [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. + +If you set `wait` to `"none"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.navigationCommitted` fires. + +This event does not fire for same-document navigations. +For navigations to a URL fragment, see [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated). +For URL changes made through the History API without a full navigation, see [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated). + +## Event data + +The `params` field in the event notification is a navigation object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the navigation is committed. +- `navigation` + - : A string that contains the ID of the navigation that is committed, or the value `null` if the navigation does not have an associated navigation ID. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the URL being loaded, including any basic auth credentials. + +## Examples + +### Receiving an event when a cross-document navigation commits + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationCommitted`. + +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). +The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (since this example only subscribes to `browsingContext.navigationCommitted`, that notification is not received). +Once the browser accepts the server response and commits to loading the page, it sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: + +```json +{ + "type": "event", + "method": "browsingContext.navigationCommitted", + "params": { + "context": "9f271a75-04b2-4b35-80cc-e22427d446fc", + "navigation": "dc716296-7076-4ec0-b446-51c6fb5fefe8", + "timestamp": 1781715436774, + "url": "https://example.com" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event +- [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) event +- [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated) event +- [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated) event diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md new file mode 100644 index 000000000000000..0a7f449abaf31ff --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -0,0 +1,61 @@ +--- +title: "`browsingContext.navigationFailed` event" +short-title: navigationFailed +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.navigationFailed_event +sidebar: webdriver +--- + +The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the browser cannot successfully load a URL. + +## Description + +In the lifecycle of a failed navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) when the navigation cannot be completed. + +## Event data + +The `params` field in the event notification is a navigation object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the navigation failed. +- `navigation` + - : A string that contains the ID of the failed navigation, or the value `null` if the navigation does not have an associated navigation ID. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the URL being loaded. + +## Examples + +### Receiving an event when a cross-document navigation fails + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationFailed`. + +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load a URL, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (since this example only subscribes to `browsingContext.navigationFailed`, that notification is not received). The browser sends the following notification if the navigation cannot be completed, where the `context` value matches the context ID you passed to `browsingContext.navigate`: + +```json +{ + "type": "event", + "method": "browsingContext.navigationFailed", + "params": { + "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", + "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", + "timestamp": 1712345678901, + "url": "https://not-a-valid-domain.example" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event +- [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) event diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 882d631afadea70..78d2cc6e9784cda 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -13,6 +13,10 @@ The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Refere The navigation to a different page can be triggered by the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, by user interaction with elements on the page, or by JavaScript running in the page's context. +For cross-document navigations, this event is the first in the sequence of navigation events and fires when the browser begins fetching the URL. +If the navigation succeeds, [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) fires next, when the browser has accepted the response and begun loading the new page. +If the navigation fails, [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) fires instead. + > [!NOTE] > This event is not emitted when the initial `about:blank` page is loaded for a new top-level browsing context. @@ -64,7 +68,7 @@ Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference ## See also -- [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated) event -- [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated) event - [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) event - [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) event +- [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated) event +- [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated) event From c8b644680a6923f8e5770d1edab5774d8fabfa4b Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Fri, 19 Jun 2026 13:33:32 -0400 Subject: [PATCH 03/14] adds pages for hisotrynavigated and fragmentuppdated --- .../fragmentnavigated/index.md | 60 ++++++++++++++++++ .../browsingcontext/historyupdated/index.md | 63 +++++++++++++++++++ .../navigationcommitted/index.md | 7 ++- .../browsingcontext/navigationfailed/index.md | 7 ++- .../navigationstarted/index.md | 7 ++- 5 files changed, 138 insertions(+), 6 deletions(-) create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md new file mode 100644 index 000000000000000..6c838cf951b35be --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md @@ -0,0 +1,60 @@ +--- +title: "`browsingContext.fragmentNavigated` event" +short-title: fragmentNavigated +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.fragmentNavigated_event +sidebar: webdriver +--- + +The `browsingContext.fragmentNavigated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a same-document navigation to a [URL fragment](/en-US/docs/Web/URI/Reference/Fragment) occurs in a context. + +## Event data + +The `params` field in the event notification is a navigation object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the fragment navigation is occurring. +- `navigation` + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the updated URL, including the fragment. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the fragment navigation is occurring. + +## Examples + +### Receiving a fragment navigation event + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.fragmentNavigated`. + +Suppose a navigation to a section on `https://example.com/page` occurs. The browser sends the following notification: + +```json +{ + "type": "event", + "method": "browsingContext.fragmentNavigated", + "params": { + "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", + "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", + "timestamp": 1712345678901, + "url": "https://example.com/page#section-2" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event +- [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated) event diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md new file mode 100644 index 000000000000000..5f30c85c6e9de1e --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md @@ -0,0 +1,63 @@ +--- +title: "`browsingContext.historyUpdated` event" +short-title: historyUpdated +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.historyUpdated_event +sidebar: webdriver +--- + +The `browsingContext.historyUpdated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the active URL in a context is updated programmatically without a full navigation. + +## Description + +This event fires when {{domxref("History.pushState", "history.pushState()")}} or {{domxref("History.replaceState", "history.replaceState()")}} is called to update the URL, or when {{domxref("Document.open", "document.open()")}} is called to replace the document. +These calls change the active URL in the context. + +`browsingContext.historyUpdated` fires specifically when the URL is changed programmatically, unlike [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated), which fires for same-document navigations to a URL fragment. + +## Event data + +The `params` field in the event notification is a history update object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the history update is occurring. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the updated URL. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the history update is occurring. + +## Examples + +### Receiving an event when `history.pushState()` is called + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.historyUpdated`. + +Suppose {{domxref("History.pushState", "history.pushState()")}} is called to update the URL to `https://example.com/new-path`. The browser sends the following notification: + +```json +{ + "type": "event", + "method": "browsingContext.historyUpdated", + "params": { + "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", + "timestamp": 1781888825943, + "url": "https://example.com/new-path" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event +- [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated) event diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index 7325f68d2125fd6..a25a8419bc1f2fe 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.navigationCommitted_event sidebar: webdriver --- -The `browsingContext.navigationCommitted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the browser commits a navigation and begins loading the new document. +The `browsingContext.navigationCommitted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the browser commits a cross-document navigation and begins loading the new page. ## Description @@ -28,11 +28,14 @@ The `params` field in the event notification is a navigation object with the fol - `context` - : A string that contains the ID of the context in which the navigation is committed. - `navigation` - - : A string that contains the ID of the navigation that is committed, or the value `null` if the navigation does not have an associated navigation ID. + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded, including any basic auth credentials. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation is committed. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 0a7f449abaf31ff..315d04051cef18a 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.navigationFailed_event sidebar: webdriver --- -The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the browser cannot successfully load a URL. +The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation cannot be completed. ## Description @@ -20,11 +20,14 @@ The `params` field in the event notification is a navigation object with the fol - `context` - : A string that contains the ID of the context in which the navigation failed. - `navigation` - - : A string that contains the ID of the failed navigation, or the value `null` if the navigation does not have an associated navigation ID. + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation failed. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 78d2cc6e9784cda..0728e238454d73b 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.navigationStarted_event sidebar: webdriver --- -The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a navigation to a new document begins in a context. +The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation begins in a context. ## Description @@ -31,11 +31,14 @@ The `params` field in the event notification is a navigation object with the fol - `context` - : A string that contains the ID of the context in which the navigation is occurring. - `navigation` - - : A string that contains the ID of the navigation, or the value `null` if the navigation does not have an associated navigation ID. + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation is occurring. ## Examples From 516d90bd7312d2d689b1a8ce1415e27f7b4aa3f5 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Wed, 24 Jun 2026 18:58:08 -0400 Subject: [PATCH 04/14] adds pages for domcontentloaded and load --- .../browsingcontext/domcontentloaded/index.md | 72 +++++++++++++++++++ .../modules/browsingcontext/load/index.md | 72 +++++++++++++++++++ .../navigationcommitted/index.md | 4 +- .../browsingcontext/navigationfailed/index.md | 6 +- .../navigationstarted/index.md | 11 +-- files/sidebars/webdriver.yaml | 4 ++ 6 files changed, 163 insertions(+), 6 deletions(-) create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md create mode 100644 files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md new file mode 100644 index 000000000000000..927fe1da3cafbbd --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -0,0 +1,72 @@ +--- +title: "`browsingContext.domContentLoaded` event" +short-title: domContentLoaded +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.domContentLoaded_event +sidebar: webdriver +--- + +The `browsingContext.domContentLoaded` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the HTML document has been parsed during a cross-document navigation in a context. + +## Description + +In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) and before [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. + +At this point, the HTML has been parsed, equivalent to the {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event firing in the context, but subresources such as stylesheets and images may still be loading. + +## Event data + +The `params` field in the event notification is a navigation object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the HTML document is being parsed. +- `navigation` + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the URL being loaded. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the HTML document is being parsed. + +## Examples + +### Receiving an event when a document is parsed + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.domContentLoaded`. + +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). + +The browser first fires [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) and [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) events (those notifications are not received since the subscription in this example is only to `browsingContext.domContentLoaded`). + +Once the HTML has been parsed, the browser sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: + +```json +{ + "type": "event", + "method": "browsingContext.domContentLoaded", + "params": { + "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", + "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", + "timestamp": 1712345678901, + "url": "https://example.com" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event +- [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) event +- [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) event +- [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) event diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md new file mode 100644 index 000000000000000..06f871878560626 --- /dev/null +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -0,0 +1,72 @@ +--- +title: "`browsingContext.load` event" +short-title: load +slug: Web/WebDriver/Reference/BiDi/Modules/browsingContext/load +page-type: webdriver-event +browser-compat: webdriver.bidi.browsingContext.load_event +sidebar: webdriver +--- + +The `browsingContext.load` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation has fully completed in a context. + +## Description + +In the lifecycle of a successful navigation, this event fires after [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) and is the final event in the sequence. + +At this point, the document and all its subresources have finished loading, equivalent to the {{domxref("Window/load_event", "load")}} event firing. + +## Event data + +The `params` field in the event notification is a navigation object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the document has fully loaded. +- `navigation` + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. +- `timestamp` + - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the URL of the document that has fully loaded. +- `userContext` {{optional_inline}} + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the document has fully loaded. + +## Examples + +### Receiving an event when a document has fully loaded + +Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.load`. + +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). + +The browser first fires [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted), [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted), and [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) events (those notifications are not received since the subscription in this example is only to `browsingContext.load`). + +Once the document and all its subresources have finished loading, the browser sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: + +```json +{ + "type": "event", + "method": "browsingContext.load", + "params": { + "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", + "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", + "timestamp": 1712345678901, + "url": "https://example.com" + } +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event +- [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) event +- [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) event +- [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) event diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index a25a8419bc1f2fe..9cdd67209233ccf 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -44,7 +44,9 @@ The `params` field in the event notification is a navigation object with the fol Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationCommitted`. Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). -The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (since this example only subscribes to `browsingContext.navigationCommitted`, that notification is not received). + +The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (that notification is not received since the subscription in this example is only to `browsingContext.navigationCommitted`). + Once the browser accepts the server response and commits to loading the page, it sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: ```json diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 315d04051cef18a..0600f09b885c580 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -35,7 +35,11 @@ The `params` field in the event notification is a navigation object with the fol Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationFailed`. -Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load a URL, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (since this example only subscribes to `browsingContext.navigationFailed`, that notification is not received). The browser sends the following notification if the navigation cannot be completed, where the `context` value matches the context ID you passed to `browsingContext.navigate`: +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load a URL, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). + +The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (that notification is not received since the subscription in this example is only to `browsingContext.navigationFailed`). + +The browser sends the following notification if the navigation cannot be completed, where the `context` value matches the context ID you passed to `browsingContext.navigate`: ```json { diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 0728e238454d73b..0563ad246a9a984 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -13,8 +13,9 @@ The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Refere The navigation to a different page can be triggered by the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, by user interaction with elements on the page, or by JavaScript running in the page's context. -For cross-document navigations, this event is the first in the sequence of navigation events and fires when the browser begins fetching the URL. +For cross-document navigations, this is the first in the sequence of navigation events and fires when the browser begins fetching the URL. If the navigation succeeds, [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) fires next, when the browser has accepted the response and begun loading the new page. +After that, [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) fires when the HTML has been parsed, and [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) fires last when the document and all its subresources have finished loading. If the navigation fails, [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) fires instead. > [!NOTE] @@ -29,7 +30,7 @@ For URL changes made through the History API without a full navigation, see [`br The `params` field in the event notification is a navigation object with the following fields: - `context` - - : A string that contains the ID of the context in which the navigation is occurring. + - : A string that contains the ID of the context in which the navigation is starting. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. @@ -38,7 +39,7 @@ The `params` field in the event notification is a navigation object with the fol - `url` - : A string that contains the URL being loaded. - `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation is occurring. + - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation is starting. ## Examples @@ -46,7 +47,9 @@ The `params` field in the event notification is a navigation object with the fol Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationStarted`. -Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtained from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). The browser sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: +Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load `https://example.com`, passing the context ID you obtained from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). + +The browser sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`: ```json { diff --git a/files/sidebars/webdriver.yaml b/files/sidebars/webdriver.yaml index e1e73ef4e4d9732..d4a8ff2d8e7a52f 100644 --- a/files/sidebars/webdriver.yaml +++ b/files/sidebars/webdriver.yaml @@ -66,6 +66,10 @@ sidebar: code: true - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded + code: true + - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/load + code: true - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted code: true - link: /Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed From 08aa2dc06ac2c101b93660b9714c9449166605c4 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Wed, 24 Jun 2026 19:19:36 -0400 Subject: [PATCH 05/14] adds wait info --- .../bidi/modules/browsingcontext/domcontentloaded/index.md | 4 +++- .../reference/bidi/modules/browsingcontext/load/index.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index 927fe1da3cafbbd..fffeb793f204849 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -15,6 +15,8 @@ In the lifecycle of a successful navigation, this event fires after [`browsingCo At this point, the HTML has been parsed, equivalent to the {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event firing in the context, but subresources such as stylesheets and images may still be loading. +If you set `wait` to `"interactive"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.domContentLoaded` fires. + ## Event data The `params` field in the event notification is a navigation object with the following fields: @@ -50,7 +52,7 @@ Once the HTML has been parsed, the browser sends the following notification, whe "params": { "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", - "timestamp": 1712345678901, + "timestamp": 1782342489906, "url": "https://example.com" } } diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index 06f871878560626..306fe28e127c1c1 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -15,6 +15,8 @@ In the lifecycle of a successful navigation, this event fires after [`browsingCo At this point, the document and all its subresources have finished loading, equivalent to the {{domxref("Window/load_event", "load")}} event firing. +If you set `wait` to `"complete"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.load` fires. + ## Event data The `params` field in the event notification is a navigation object with the following fields: @@ -50,7 +52,7 @@ Once the document and all its subresources have finished loading, the browser se "params": { "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", - "timestamp": 1712345678901, + "timestamp": 1782343062410, "url": "https://example.com" } } From 2ee77ae8ad946cde825817b87d5567a231f10e01 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Mon, 13 Jul 2026 13:14:58 -0400 Subject: [PATCH 06/14] removes usercontext --- .../bidi/modules/browsingcontext/domcontentloaded/index.md | 2 -- .../bidi/modules/browsingcontext/fragmentnavigated/index.md | 2 -- .../bidi/modules/browsingcontext/historyupdated/index.md | 2 -- .../reference/bidi/modules/browsingcontext/load/index.md | 2 -- .../bidi/modules/browsingcontext/navigationcommitted/index.md | 2 -- .../bidi/modules/browsingcontext/navigationfailed/index.md | 2 -- .../bidi/modules/browsingcontext/navigationstarted/index.md | 2 -- 7 files changed, 14 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index fffeb793f204849..5e65c77774c9908 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -30,8 +30,6 @@ The `params` field in the event notification is a navigation object with the fol - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the HTML document is being parsed. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md index 6c838cf951b35be..5b38eb16cc08a77 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md @@ -22,8 +22,6 @@ The `params` field in the event notification is a navigation object with the fol - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the updated URL, including the fragment. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the fragment navigation is occurring. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md index 5f30c85c6e9de1e..67328f3b7d3c70e 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md @@ -26,8 +26,6 @@ The `params` field in the event notification is a history update object with the - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the updated URL. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the history update is occurring. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index 306fe28e127c1c1..9b9a26abe5960ed 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -30,8 +30,6 @@ The `params` field in the event notification is a navigation object with the fol - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL of the document that has fully loaded. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the document has fully loaded. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index 9cdd67209233ccf..22100aec78cfc96 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -34,8 +34,6 @@ The `params` field in the event notification is a navigation object with the fol - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded, including any basic auth credentials. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation is committed. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 0600f09b885c580..857755425ee43ee 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -26,8 +26,6 @@ The `params` field in the event notification is a navigation object with the fol - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation failed. ## Examples diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 0563ad246a9a984..af4d2f82004c642 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -38,8 +38,6 @@ The `params` field in the event notification is a navigation object with the fol - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. -- `userContext` {{optional_inline}} - - : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the navigation is starting. ## Examples From 3a3464d618587950887096af8ac79a31ab34b882 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Mon, 13 Jul 2026 13:31:55 -0400 Subject: [PATCH 07/14] drops UTC --- .../bidi/modules/browsingcontext/domcontentloaded/index.md | 2 +- .../bidi/modules/browsingcontext/fragmentnavigated/index.md | 2 +- .../bidi/modules/browsingcontext/historyupdated/index.md | 2 +- .../reference/bidi/modules/browsingcontext/load/index.md | 2 +- .../bidi/modules/browsingcontext/navigationcommitted/index.md | 2 +- .../bidi/modules/browsingcontext/navigationfailed/index.md | 2 +- .../bidi/modules/browsingcontext/navigationstarted/index.md | 2 +- .../webdriver/reference/bidi/modules/log/entryadded/index.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index 5e65c77774c9908..3a4cd47915f9f4b 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -27,7 +27,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md index 5b38eb16cc08a77..5e089dd8c6a26ac 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md @@ -19,7 +19,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the updated URL, including the fragment. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md index 67328f3b7d3c70e..b11e0655c269088 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md @@ -23,7 +23,7 @@ The `params` field in the event notification is a history update object with the - `context` - : A string that contains the ID of the context in which the history update is occurring. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the updated URL. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index 9b9a26abe5960ed..ad2ed18f29269c5 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -27,7 +27,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL of the document that has fully loaded. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index 22100aec78cfc96..29ff4e04c390248 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -31,7 +31,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded, including any basic auth credentials. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 857755425ee43ee..c516d6111ca0f8e 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -23,7 +23,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index af4d2f82004c642..ab162098736d22b 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -35,7 +35,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - - : A non-negative integer that represents the time in UTC when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` - : A string that contains the URL being loaded. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/log/entryadded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/log/entryadded/index.md index 303415f18429370..9a71fc941c9b89f 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/log/entryadded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/log/entryadded/index.md @@ -37,7 +37,7 @@ All log entry objects include the following fields: - : A string that contains the log message or `null` if not available. For console entries, it is the concatenation of all stringified arguments joined by spaces, and for JavaScript errors, it is generally the error message. The exact format is browser-dependent, so don't rely on this value for assertions in tests. - `timestamp` - - : A non-negative integer that represents the time when the log entry was created, in UTC, as milliseconds elapsed since the epoch ({{jsxref("Date.now()")}}). + - : A non-negative integer that represents the time when the log entry was created, as milliseconds elapsed since the epoch ({{jsxref("Date.now()")}}). - `type` - : A string that identifies the source of the log entry. It has one of the following values: - `"console"`: Indicates that the log entry was generated from a call to a console API method (for example, {{domxref("console/log_static", "console.log()")}}, {{domxref("console/warn_static", "console.warn()")}}). Log entry objects of this type include [additional fields](#console_log_entry_fields). From fec949803e417b57f2bf2de897d3b11791756879 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Mon, 13 Jul 2026 14:49:08 -0400 Subject: [PATCH 08/14] updates navigation id desc --- .../bidi/modules/browsingcontext/domcontentloaded/index.md | 3 ++- .../modules/browsingcontext/fragmentnavigated/index.md | 3 ++- .../reference/bidi/modules/browsingcontext/load/index.md | 3 ++- .../modules/browsingcontext/navigationcommitted/index.md | 3 ++- .../bidi/modules/browsingcontext/navigationfailed/index.md | 7 ++++--- .../modules/browsingcontext/navigationstarted/index.md | 3 ++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index 3a4cd47915f9f4b..a692df9a11b1c9c 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -25,7 +25,8 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the HTML document is being parsed. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md index 5e089dd8c6a26ac..cf845d8d29e26d3 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md @@ -17,7 +17,8 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the fragment navigation is occurring. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index ad2ed18f29269c5..8bcf49b7427cb09 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -25,7 +25,8 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the document has fully loaded. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index 29ff4e04c390248..13ec2556223cae7 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -29,7 +29,8 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the navigation is committed. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index c516d6111ca0f8e..2d249dc039c0039 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -7,11 +7,11 @@ browser-compat: webdriver.bidi.browsingContext.navigationFailed_event sidebar: webdriver --- -The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation cannot be completed. +The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation is blocked. ## Description -In the lifecycle of a failed navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) when the navigation cannot be completed. +In the lifecycle of a navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) when the navigation is blocked, for example because of a security or CSP restriction or because a user cancels the unload prompt. ## Event data @@ -21,7 +21,8 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the navigation failed. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index ab162098736d22b..1bb54c08966146d 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -33,7 +33,8 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the navigation is starting. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` From 5c6922ad26b2f89abc87fd941a098fdae7874a8e Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Mon, 13 Jul 2026 21:13:29 -0400 Subject: [PATCH 09/14] updates navigationFailed example --- .../browsingcontext/navigationfailed/index.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 2d249dc039c0039..712ce0fdfcadef8 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -11,7 +11,7 @@ The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Referen ## Description -In the lifecycle of a navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) when the navigation is blocked, for example because of a security or CSP restriction or because a user cancels the unload prompt. +In the lifecycle of a navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) when the navigation is blocked, for example because of a security or CSP restriction or because the client cancels the unload prompt. ## Event data @@ -21,8 +21,7 @@ The `params` field in the event notification is a navigation object with the fol - : A string that contains the ID of the context in which the navigation failed. - `navigation` - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. - The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. + This ID matches the `navigation` value in the response of the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands. - `timestamp` - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). - `url` @@ -30,15 +29,16 @@ The `params` field in the event notification is a navigation object with the fol ## Examples -### Receiving an event when a cross-document navigation fails +### Receiving an event when a cross-document navigation is blocked -Assume you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationFailed`. +Consider the following scenario: you have a [WebDriver BiDi connection](/en-US/docs/Web/WebDriver/How_to/Create_BiDi_connection) and an [active session](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new) with a [subscription](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/subscribe) to `browsingContext.navigationFailed`. +The session's `unhandledPromptBehavior` capability is configured to dismiss [`beforeunload`](/en-US/docs/Web/API/Window/beforeunload_event) prompts. +The current page also has a `beforeunload` handler that calls [`event.preventDefault()`](/en-US/docs/Web/API/Event/preventDefault) to warn before leaving. -Suppose you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load a URL, passing the context ID you obtain from [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree). +Suppose there are unsaved changes on this page and you use [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) to load a different URL. -The browser first fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event (that notification is not received since the subscription in this example is only to `browsingContext.navigationFailed`). - -The browser sends the following notification if the navigation cannot be completed, where the `context` value matches the context ID you passed to `browsingContext.navigate`: +The browser opens the `beforeunload` prompt, fires a [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) event, and blocks the navigation. +The browser sends the following notification, where the `context` value matches the context ID you passed to `browsingContext.navigate`, and the `navigation` value is the ID of the blocked navigation: ```json { @@ -47,8 +47,7 @@ The browser sends the following notification if the navigation cannot be complet "params": { "context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa", "navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab", - "timestamp": 1712345678901, - "url": "https://not-a-valid-domain.example" + "timestamp": 1712345678901 } } ``` From 349d127a2b3dc055456d2399e10fbb1286c1eaf4 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Wed, 15 Jul 2026 11:35:07 -0400 Subject: [PATCH 10/14] adds events to module landing page --- .../reference/bidi/modules/browsingcontext/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/index.md index d813393e24f710a..ff2da15ef5d28a1 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/index.md @@ -39,6 +39,13 @@ Calling [`browsingContext.getTree`](/en-US/docs/Web/WebDriver/Reference/BiDi/Mod - [`browsingContext.contextCreated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/contextCreated) - [`browsingContext.contextDestroyed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/contextDestroyed) +- [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) +- [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated) +- [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated) +- [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) +- [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) +- [`browsingContext.navigationFailed`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed) +- [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) ## Specifications From c99e88a8773b01d3b66994b1bd2407967956561f Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Thu, 16 Jul 2026 22:42:12 -0400 Subject: [PATCH 11/14] removes navigationStarted from desc --- .../bidi/modules/browsingcontext/navigationfailed/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 712ce0fdfcadef8..731183e3a094b5b 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -11,7 +11,7 @@ The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Referen ## Description -In the lifecycle of a navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) when the navigation is blocked, for example because of a security or CSP restriction or because the client cancels the unload prompt. +In the lifecycle of a navigation, this event fires when the navigation is blocked, for example because of a security or CSP restriction or because the client cancels the unload prompt. ## Event data From 8c8f69c03e84c62bb36157990894f02d7ebb72c8 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Fri, 17 Jul 2026 14:59:50 -0400 Subject: [PATCH 12/14] fixes tech feedback --- .../bidi/modules/browsingcontext/domcontentloaded/index.md | 4 ++-- .../bidi/modules/browsingcontext/fragmentnavigated/index.md | 2 +- .../bidi/modules/browsingcontext/historyupdated/index.md | 2 +- .../reference/bidi/modules/browsingcontext/load/index.md | 2 +- .../bidi/modules/browsingcontext/navigationcommitted/index.md | 2 +- .../bidi/modules/browsingcontext/navigationfailed/index.md | 2 +- .../bidi/modules/browsingcontext/navigationstarted/index.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index a692df9a11b1c9c..bf53a9595f117e0 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -13,13 +13,13 @@ The `browsingContext.domContentLoaded` [event](/en-US/docs/Web/WebDriver/Referen In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) and before [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. -At this point, the HTML has been parsed, equivalent to the {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event firing in the context, but subresources such as stylesheets and images may still be loading. +At this point, the HTML has been parsed, but subresources such as stylesheets and images may still be loading. This event is equivalent to the {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event firing in the context. If you set `wait` to `"interactive"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.domContentLoaded` fires. ## Event data -The `params` field in the event notification is a navigation object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the HTML document is being parsed. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md index cf845d8d29e26d3..4c595db51324000 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md @@ -11,7 +11,7 @@ The `browsingContext.fragmentNavigated` [event](/en-US/docs/Web/WebDriver/Refere ## Event data -The `params` field in the event notification is a navigation object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the fragment navigation is occurring. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md index b11e0655c269088..b60e4efaab58e20 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md @@ -18,7 +18,7 @@ These calls change the active URL in the context. ## Event data -The `params` field in the event notification is a history update object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the history update is occurring. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index 8bcf49b7427cb09..3a118fa955f40e9 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -19,7 +19,7 @@ If you set `wait` to `"complete"` for the [`browsingContext.navigate`](/en-US/do ## Event data -The `params` field in the event notification is a navigation object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the document has fully loaded. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index 13ec2556223cae7..fd377d15ba6a98e 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -23,7 +23,7 @@ For URL changes made through the History API without a full navigation, see [`br ## Event data -The `params` field in the event notification is a navigation object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the navigation is committed. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index 731183e3a094b5b..d9bf5bb177f4b0d 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -15,7 +15,7 @@ In the lifecycle of a navigation, this event fires when the navigation is blocke ## Event data -The `params` field in the event notification is a navigation object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the navigation failed. diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 1bb54c08966146d..5e735b69bf1acae 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -27,7 +27,7 @@ For URL changes made through the History API without a full navigation, see [`br ## Event data -The `params` field in the event notification is a navigation object with the following fields: +The `params` field in the event notification is an object with the following fields: - `context` - : A string that contains the ID of the context in which the navigation is starting. From 676ead948bf0908587c5f0d502b65953f4bb2889 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Thu, 30 Jul 2026 12:55:47 -0400 Subject: [PATCH 13/14] fixes desc position --- .../browsingcontext/domcontentloaded/index.md | 16 +++++----- .../browsingcontext/historyupdated/index.md | 14 ++++----- .../modules/browsingcontext/load/index.md | 16 +++++----- .../navigationcommitted/index.md | 24 +++++++-------- .../browsingcontext/navigationfailed/index.md | 8 ++--- .../navigationstarted/index.md | 30 +++++++++---------- 6 files changed, 54 insertions(+), 54 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index bf53a9595f117e0..87e3b77e76f28eb 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -9,14 +9,6 @@ sidebar: webdriver The `browsingContext.domContentLoaded` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the HTML document has been parsed during a cross-document navigation in a context. -## Description - -In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) and before [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. - -At this point, the HTML has been parsed, but subresources such as stylesheets and images may still be loading. This event is equivalent to the {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event firing in the context. - -If you set `wait` to `"interactive"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.domContentLoaded` fires. - ## Event data The `params` field in the event notification is an object with the following fields: @@ -32,6 +24,14 @@ The `params` field in the event notification is an object with the following fie - `url` - : A string that contains the URL being loaded. +## Description + +In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationCommitted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted) and before [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. + +At this point, the HTML has been parsed, but subresources such as stylesheets and images may still be loading. This event is equivalent to the {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event firing in the context. + +If you set `wait` to `"interactive"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.domContentLoaded` fires. + ## Examples ### Receiving an event when a document is parsed diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md index b60e4efaab58e20..2e9cac32269149b 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md @@ -9,13 +9,6 @@ sidebar: webdriver The `browsingContext.historyUpdated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the active URL in a context is updated programmatically without a full navigation. -## Description - -This event fires when {{domxref("History.pushState", "history.pushState()")}} or {{domxref("History.replaceState", "history.replaceState()")}} is called to update the URL, or when {{domxref("Document.open", "document.open()")}} is called to replace the document. -These calls change the active URL in the context. - -`browsingContext.historyUpdated` fires specifically when the URL is changed programmatically, unlike [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated), which fires for same-document navigations to a URL fragment. - ## Event data The `params` field in the event notification is an object with the following fields: @@ -27,6 +20,13 @@ The `params` field in the event notification is an object with the following fie - `url` - : A string that contains the updated URL. +## Description + +This event fires when {{domxref("History.pushState", "history.pushState()")}} or {{domxref("History.replaceState", "history.replaceState()")}} is called to update the URL, or when {{domxref("Document.open", "document.open()")}} is called to replace the document. +These calls change the active URL in the context. + +`browsingContext.historyUpdated` fires specifically when the URL is changed programmatically, unlike [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated), which fires for same-document navigations to a URL fragment. + ## Examples ### Receiving an event when `history.pushState()` is called diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index 3a118fa955f40e9..a19f52bada7279e 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -9,14 +9,6 @@ sidebar: webdriver The `browsingContext.load` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation has fully completed in a context. -## Description - -In the lifecycle of a successful navigation, this event fires after [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) and is the final event in the sequence. - -At this point, the document and all its subresources have finished loading, equivalent to the {{domxref("Window/load_event", "load")}} event firing. - -If you set `wait` to `"complete"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.load` fires. - ## Event data The `params` field in the event notification is an object with the following fields: @@ -32,6 +24,14 @@ The `params` field in the event notification is an object with the following fie - `url` - : A string that contains the URL of the document that has fully loaded. +## Description + +In the lifecycle of a successful navigation, this event fires after [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) and is the final event in the sequence. + +At this point, the document and all its subresources have finished loading, equivalent to the {{domxref("Window/load_event", "load")}} event firing. + +If you set `wait` to `"complete"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.load` fires. + ## Examples ### Receiving an event when a document has fully loaded diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md index fd377d15ba6a98e..7f54c6cb80a1ada 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationcommitted/index.md @@ -9,18 +9,6 @@ sidebar: webdriver The `browsingContext.navigationCommitted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the browser commits a cross-document navigation and begins loading the new page. -## Description - -A navigation is committed when the browser has accepted the URL from the server response and begun loading the new page, but before any content has been parsed or rendered. Page content is not yet available at this point. - -In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) and before [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) and [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. - -If you set `wait` to `"none"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.navigationCommitted` fires. - -This event does not fire for same-document navigations. -For navigations to a URL fragment, see [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated). -For URL changes made through the History API without a full navigation, see [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated). - ## Event data The `params` field in the event notification is an object with the following fields: @@ -36,6 +24,18 @@ The `params` field in the event notification is an object with the following fie - `url` - : A string that contains the URL being loaded, including any basic auth credentials. +## Description + +A navigation is committed when the browser has accepted the URL from the server response and begun loading the new page, but before any content has been parsed or rendered. Page content is not yet available at this point. + +In the lifecycle of a successful navigation, this event fires after [`browsingContext.navigationStarted`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted) and before [`browsingContext.domContentLoaded`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/domContentLoaded) and [`browsingContext.load`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/load) events. + +If you set `wait` to `"none"` for the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) and [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) commands, they return as soon as `browsingContext.navigationCommitted` fires. + +This event does not fire for same-document navigations. +For navigations to a URL fragment, see [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated). +For URL changes made through the History API without a full navigation, see [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated). + ## Examples ### Receiving an event when a cross-document navigation commits diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md index d9bf5bb177f4b0d..07588b05b2c6a19 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationfailed/index.md @@ -9,10 +9,6 @@ sidebar: webdriver The `browsingContext.navigationFailed` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation is blocked. -## Description - -In the lifecycle of a navigation, this event fires when the navigation is blocked, for example because of a security or CSP restriction or because the client cancels the unload prompt. - ## Event data The `params` field in the event notification is an object with the following fields: @@ -27,6 +23,10 @@ The `params` field in the event notification is an object with the following fie - `url` - : A string that contains the URL being loaded. +## Description + +In the lifecycle of a navigation, this event fires when the navigation is blocked, for example because of a security or CSP restriction or because the client cancels the unload prompt. + ## Examples ### Receiving an event when a cross-document navigation is blocked diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 5e735b69bf1acae..6ae1f8145f906f6 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -9,6 +9,21 @@ sidebar: webdriver The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation begins in a context. +## Event data + +The `params` field in the event notification is an object with the following fields: + +- `context` + - : A string that contains the ID of the context in which the navigation is starting. +- `navigation` + - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. + If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. + The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. +- `timestamp` + - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). +- `url` + - : A string that contains the URL being loaded. + ## Description The navigation to a different page can be triggered by the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, by user interaction with elements on the page, or by JavaScript running in the page's context. @@ -25,21 +40,6 @@ This event does not fire for same-document navigations. For navigations to a URL fragment, see [`browsingContext.fragmentNavigated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/fragmentNavigated). For URL changes made through the History API without a full navigation, see [`browsingContext.historyUpdated`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/historyUpdated). -## Event data - -The `params` field in the event notification is an object with the following fields: - -- `context` - - : A string that contains the ID of the context in which the navigation is starting. -- `navigation` - - : A string that contains the [UUID](/en-US/docs/Glossary/UUID) that uniquely identifies this navigation. - If the navigation was started using the [`browsingContext.navigate`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate) or [`browsingContext.reload`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload) command, this ID matches the `navigation` value in the command's response. - The same ID is shared by all events related to this navigation, including other navigation events in the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#events) module and events in the [`network`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/network) module. -- `timestamp` - - : A non-negative integer that represents the time when the event was fired, as milliseconds elapsed since the [epoch](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date). -- `url` - - : A string that contains the URL being loaded. - ## Examples ### Receiving an event when a cross-document navigation starts From 0c8e69c206d8b8eedf333601b915e2e07c404298 Mon Sep 17 00:00:00 2001 From: Dipika Bhattacharya Date: Wed, 5 Aug 2026 11:17:17 -0400 Subject: [PATCH 14/14] adds link to context --- .../bidi/modules/browsingcontext/domcontentloaded/index.md | 2 +- .../bidi/modules/browsingcontext/fragmentnavigated/index.md | 2 +- .../bidi/modules/browsingcontext/historyupdated/index.md | 2 +- .../reference/bidi/modules/browsingcontext/load/index.md | 2 +- .../bidi/modules/browsingcontext/navigationstarted/index.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md index 87e3b77e76f28eb..4faf4cb69abbe77 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/domcontentloaded/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.domContentLoaded_event sidebar: webdriver --- -The `browsingContext.domContentLoaded` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the HTML document has been parsed during a cross-document navigation in a context. +The `browsingContext.domContentLoaded` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the HTML document has been parsed during a cross-document navigation in a [context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#contexts). ## Event data diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md index 4c595db51324000..5e8a0ca56ad7d76 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/fragmentnavigated/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.fragmentNavigated_event sidebar: webdriver --- -The `browsingContext.fragmentNavigated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a same-document navigation to a [URL fragment](/en-US/docs/Web/URI/Reference/Fragment) occurs in a context. +The `browsingContext.fragmentNavigated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a same-document navigation to a [URL fragment](/en-US/docs/Web/URI/Reference/Fragment) occurs in a [context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#contexts). ## Event data diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md index 2e9cac32269149b..b1f41317f7244d7 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/historyupdated/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.historyUpdated_event sidebar: webdriver --- -The `browsingContext.historyUpdated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the active URL in a context is updated programmatically without a full navigation. +The `browsingContext.historyUpdated` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when the active URL in a [context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#contexts) is updated programmatically without a full navigation. ## Event data diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md index a19f52bada7279e..96f24c5f92ab5cc 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/load/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.load_event sidebar: webdriver --- -The `browsingContext.load` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation has fully completed in a context. +The `browsingContext.load` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation has fully completed in a [context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#contexts). ## Event data diff --git a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md index 6ae1f8145f906f6..bd3bc09f54bd308 100644 --- a/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md +++ b/files/en-us/web/webdriver/reference/bidi/modules/browsingcontext/navigationstarted/index.md @@ -7,7 +7,7 @@ browser-compat: webdriver.bidi.browsingContext.navigationStarted_event sidebar: webdriver --- -The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation begins in a context. +The `browsingContext.navigationStarted` [event](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules#events) of the [`browsingContext`](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext) module fires when a cross-document navigation begins in a [context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext#contexts). ## Event data