Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend browsingContext.DownloadWillBegin with suggestedFilename #890

Merged
merged 2 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2913,6 +2913,9 @@ The progress of navigation is communicated using an immutable

<dt><dfn export for="WebDriver BiDi navigation status" id="navigation-status-url">url</dfn></dt>
<dd>The URL which is being loaded in the navigation</dd>

<dt><dfn export for="WebDriver BiDi navigation status" id="navigation-status-suggested-filename">suggestedFilename</dfn></dt>
<dd>If the navigation is a download, suggested filename, otherwise null.</dd>
</dl>

### Definition ### {#module-browsingContext-definition}
Expand Down Expand Up @@ -5267,8 +5270,13 @@ complete</dfn> steps given |navigable| and |navigation status|:
<pre class="cddl local-cddl">
browsingContext.DownloadWillBegin = (
method: "browsingContext.downloadWillBegin",
params: browsingContext.NavigationInfo
params: browsingContext.DownloadWillBeginParams
)

browsingContext.DownloadWillBeginParams = {
suggestedFilename: text,
browsingContext.NavigationInfo
}
</pre>
</dd>
</dl>
Expand All @@ -5277,8 +5285,16 @@ complete</dfn> steps given |navigable| and |navigation status|:
The [=remote end event trigger=] is the <dfn export>WebDriver BiDi download
started</dfn> steps given |navigable| and |navigation status|:

1. Let |params| be the result of [=get the navigation info=] given |navigable|
and |navigation status|.
1. Let |navigation info| be the result of [=get the navigation info=] given |navigable| and
|navigation status|.

1. Let |params| be a [=/map=] matching the <code>browsingContext.DownloadWillBeginParams</code>
production, with the <code>context</code> field set to |navigation info|["<code>context</code>"],
the <code>navigation</code> field set to |navigation info|["<code>navigation</code>"], the
<code>timestamp</code> field set to |navigation info|["<code>timestamp</code>"], the
<code>url</code> field set to |navigation info|["<code>url</code>"] and
<code>suggestedFilename</code> field set to |navigation status|'s
<code>suggestedFilename</code>.

1. Let |body| be a [=/map=] matching the
<code>browsingContext.DownloadWillBegin</code> production, with the
Expand Down