Support "userContext" parameter for "browsingContext.create" command on Android
Categories
(Remote Protocol :: WebDriver BiDi, task, P3)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: [webdriver:backlog])
Assigning tabs/windows to a specific user context id does not seem straightforward on Android.
We will initially throw UnsupportedOperationError if clients try to use browsingContext.create with a userContext parameter on Android.
If possible we should try to support this fully on Android. If it turns out to be more complicated, we might consider throwing as well in browser.createUserContext/removeUserContext on Android until we have full support, because there's not much reason to allow to create user contexts if we cannot create browsing contexts in them.
Reporter | ||
Comment 1•1 year ago
|
||
Note that the closeContainerTabs probably needs to be updated as well, because the current implementation from ContextualIdentityService does not seem like it would work for Android?
Reporter | ||
Comment 2•1 year ago
|
||
(copied from Bug 1874918)
Hi Olivia,
I'm having troubles to create geckoview tabs assigned to a certain container / user context id.
We currently use GeckoViewTabUtil.createNewTab(url) in order to create new tabs. This API only supports a URL string as parameter, so there is no way to set a user context id.
I could see that the userContextId is sometimes used as a cookieStoreId, and this seems exposed via GeckoViewTabBridge.createNewTab, but I think this GeckoViewTabBridge is only meant for webextensions? I tried using this but without success.
I'm not sure if containers/user contexts are fully supported on Android? If yes, do you have a suggestion to easily create a new tab assigned to a specific user context id?
Comment 3•1 year ago
|
||
I think this GeckoViewTabBridge is only meant for webextensions?
That's my understanding as well. IIRC, when working on GeckoViewTabUtil
, I used the web extension pattern as a starting point. I'm thinking the reasoning against using the web extension utilities fully is that we'd need a WebDriver "web extension" that would need to run on the devices to use this API as it stands. (This older Matrix conversation retraces an outline of the options. GeckoViewTabUtil
went with originally "be a ServiceWorker, and call ServiceWorkerDelegate.onNewWindow"
in code here.)
I recall :m_kato is currently updating this whole area in this patch to move away from ServiceWorker, and I'm wondering if the changeover to browserWindow.browserDOMWindow.createContentWindow
might facilitate containers/user contexts? I don't have enough background on that API to say for sure, but maybe :m_kato can say more?
Reporter | ||
Updated•1 year ago
|
Comment 4•1 year ago
|
||
nsIOpenWindowInfo doesn't have userContext (UserContextId) parameter. But I guess that browser element may be able to have userContext attribute for it.
Description
•