Skip to content

Commit

Permalink
Add browsingContext.historyUpdated event (#740)
Browse files Browse the repository at this point in the history
Adds an event that notifies the client whenever a history is updated.
  • Loading branch information
OrKoN authored Oct 22, 2024
1 parent 2c9b095 commit e8266d1
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2711,6 +2711,7 @@ BrowsingContextEvent = (
browsingContext.DomContentLoaded //
browsingContext.DownloadWillBegin //
browsingContext.FragmentNavigated //
browsingContext.HistoryUpdated //
browsingContext.Load //
browsingContext.NavigationAborted //
browsingContext.NavigationFailed //
Expand Down Expand Up @@ -4753,6 +4754,48 @@ navigated</dfn> steps given |navigable| and |navigation status|:

</div>

#### The browsingContext.historyUpdated Event #### {#event-browsingContext-historyUpdated}

<dl>
<dt>Event Type</dt>
<dd>
<pre class="cddl local-cddl">
browsingContext.HistoryUpdated = (
method: "browsingContext.historyUpdated",
params: browsingContext.HistoryUpdatedParameters
)

browsingContext.HistoryUpdatedParameters = {
context: browsingContext.BrowsingContext,
url: text
}
</pre>
</dd>
</dl>

<div algorithm>
The [=remote end event trigger=] is the <dfn export>WebDriver BiDi history updated</dfn> steps given |navigable|:

1. Let |url| be the result of running the [=URL serializer=],
given |navigable|'s [=active browsing context=]'s [=active document=]'s <a spec=dom>URL</a>.

1. Let |params| be a [=/map=] matching the <code>browsingContext.HistoryUpdatedParameters</code> production,
with the <code>url</code> field set to |url| and
the <code>context</code> field set to |navigable|'s [=navigable id=].

1. Let |body| be a [=/map=] matching the
<code>browsingContext.HistoryUpdated</code> production, with the
<code>params</code> field set to |params|.

1. Let |related browsing contexts| be a [=/set=] containing |navigable|'s [=active browsing context=].

1. For each |session| in the [=set of sessions for which an event is enabled=]
given "<code>browsingContext.historyUpdated</code>" and |related browsing contexts|:

1. [=Emit an event=] with |session| and |body|.

</div>

#### The browsingContext.domContentLoaded Event #### {#event-browsingContext-domContentLoaded}

<dl>
Expand Down

0 comments on commit e8266d1

Please sign in to comment.