Skip to content

Commit 253ce09

Browse files
committed
define getUserContexts
1 parent 19d010e commit 253ce09

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

index.bs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,9 +1221,10 @@ Issue: Define how this works.
12211221

12221222
# User Contexts # {#user-contexts}
12231223

1224-
A <dfn interface>UserContext</dfn> is an aggregation of browsing contexts that separates the browsing contexts in one user context from browsing contexts in another user context.
1224+
A <dfn>user context</dfn> is an aggregation of browsing contexts that separates the browser state for browsing contexts in one user context from browsing contexts in another user context.
1225+
The user agent contains at least one user context, the <dfn>default user context</dfn>.
12251226

1226-
Note: User contexts are a WebDriver BiDi-specific equivalent to private browsing modes (https://www.w3.org/2001/tag/doc/private-browsing-modes/).
1227+
Note: User contexts are a WebDriver-specific abstraction to allow working with private browsing modes (https://www.w3.org/2001/tag/doc/private-browsing-modes/).
12271228
While we don't want to pose any restrictions on the implementations of private browsing modes, we want to allow to perform basic operations with private browsing
12281229
contexts. A user context can be seen as a user agent in terms of the Infra spec but currently WebDriver BiDi spec is not compliant with that definition of the user agent.
12291230

@@ -1822,7 +1823,7 @@ The [=remote end steps=] with |session| and <var ignore>command parameters</var>
18221823

18231824
#### The browser.createUserContext Command #### {#command-browser-createUserContext}
18241825

1825-
The <dfn export for=commands>browser.createUserContext</dfn> command creates a {{UserContext}} of browsing contexts.
1826+
The <dfn export for=commands>browser.createUserContext</dfn> command creates a [=user context=] in the user agent.
18261827

18271828
<dl>
18281829
<dt>Command Type</dt>
@@ -1850,7 +1851,7 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a {
18501851

18511852
#### The browser.closeUserContext Command #### {#command-browser-closeUserContext}
18521853

1853-
The <dfn export for=commands>browser.closeUserContext</dfn> command closes the userContext and all browsing contexts in it without running <code>beforeunload</code> handlers.
1854+
The <dfn export for=commands>browser.closeUserContext</dfn> command closes a user context and all browsing contexts in it without running <code>beforeunload</code> handlers.
18541855

18551856
<dl>
18561857
<dt>Command Type</dt>
@@ -1880,7 +1881,7 @@ The <dfn export for=commands>browser.closeUserContext</dfn> command closes the u
18801881

18811882
#### The browser.getUserContexts Command #### {#command-browser-getUserContexts}
18821883

1883-
The <dfn export for=commands>browser.getUserContexts</dfn> command returns a list of existing userContexts in the browser instance.
1884+
The <dfn export for=commands>browser.getUserContexts</dfn> command returns a list of existing user contexts in the user agent.
18841885

18851886
<dl>
18861887
<dt>Command Type</dt>
@@ -1908,6 +1909,27 @@ The <dfn export for=commands>browser.getUserContexts</dfn> command returns a lis
19081909

19091910
<div algorithm="remote end steps for browser.getUserContexts">
19101911

1912+
The [=remote end steps=] are:
1913+
1914+
1. Let |user contexts| be the result of implementation-specific steps to get [=user contexts=] from the user agent.
1915+
1916+
1. Let |user context info list| be an empty [=/list=].
1917+
1918+
1. For each |user context| in |user contexts|:
1919+
1920+
1. If the |user context| is the [=default user context=], continue.
1921+
1922+
1. Let |info| be a [=/map=] matching the <code>browser.UserContextInfo</code>
1923+
production with the <code>userContext</code> field set to |user context|'s ID.
1924+
1925+
1. Append |info| to |user context info list|.
1926+
1927+
1. Let |result| be a [=/map=] matching the
1928+
<code>browser.getUserContextsResult</code> production with the <code>userContexts</code>
1929+
field set to |user context info list|.
1930+
1931+
1. Return [=success=] with data |result|.
1932+
19111933
</div>
19121934

19131935
## The browsingContext Module ## {#module-browsingContext}

0 commit comments

Comments
 (0)