Skip to content

Commit e8266d1

Browse files
authored
Add browsingContext.historyUpdated event (#740)
Adds an event that notifies the client whenever a history is updated.
1 parent 2c9b095 commit e8266d1

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

index.bs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,6 +2711,7 @@ BrowsingContextEvent = (
27112711
browsingContext.DomContentLoaded //
27122712
browsingContext.DownloadWillBegin //
27132713
browsingContext.FragmentNavigated //
2714+
browsingContext.HistoryUpdated //
27142715
browsingContext.Load //
27152716
browsingContext.NavigationAborted //
27162717
browsingContext.NavigationFailed //
@@ -4753,6 +4754,48 @@ navigated</dfn> steps given |navigable| and |navigation status|:
47534754

47544755
</div>
47554756

4757+
#### The browsingContext.historyUpdated Event #### {#event-browsingContext-historyUpdated}
4758+
4759+
<dl>
4760+
<dt>Event Type</dt>
4761+
<dd>
4762+
<pre class="cddl local-cddl">
4763+
browsingContext.HistoryUpdated = (
4764+
method: "browsingContext.historyUpdated",
4765+
params: browsingContext.HistoryUpdatedParameters
4766+
)
4767+
4768+
browsingContext.HistoryUpdatedParameters = {
4769+
context: browsingContext.BrowsingContext,
4770+
url: text
4771+
}
4772+
</pre>
4773+
</dd>
4774+
</dl>
4775+
4776+
<div algorithm>
4777+
The [=remote end event trigger=] is the <dfn export>WebDriver BiDi history updated</dfn> steps given |navigable|:
4778+
4779+
1. Let |url| be the result of running the [=URL serializer=],
4780+
given |navigable|'s [=active browsing context=]'s [=active document=]'s <a spec=dom>URL</a>.
4781+
4782+
1. Let |params| be a [=/map=] matching the <code>browsingContext.HistoryUpdatedParameters</code> production,
4783+
with the <code>url</code> field set to |url| and
4784+
the <code>context</code> field set to |navigable|'s [=navigable id=].
4785+
4786+
1. Let |body| be a [=/map=] matching the
4787+
<code>browsingContext.HistoryUpdated</code> production, with the
4788+
<code>params</code> field set to |params|.
4789+
4790+
1. Let |related browsing contexts| be a [=/set=] containing |navigable|'s [=active browsing context=].
4791+
4792+
1. For each |session| in the [=set of sessions for which an event is enabled=]
4793+
given "<code>browsingContext.historyUpdated</code>" and |related browsing contexts|:
4794+
4795+
1. [=Emit an event=] with |session| and |body|.
4796+
4797+
</div>
4798+
47564799
#### The browsingContext.domContentLoaded Event #### {#event-browsingContext-domContentLoaded}
47574800

47584801
<dl>

0 commit comments

Comments
 (0)