Open Bug 1696425 Opened 3 years ago Updated 2 years ago

navigator.webdriver active flag has to be bound to the WebDriver (Marionette, BiDi) and CDP session lifetime

Categories

(Remote Protocol :: Agent, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

Details

(Whiteboard: [webdriver:backlog])

As per the WebDriver spec the active state of navigator.webdriver needs to be bound to the active Session. If there is no session the property has to return false.

https://w3c.github.io/webdriver/#webidl-592684117

The webdriver-active flag is set to true when the user agent is under remote control. It is initially false.

When closing the session:

Set the webdriver-active flag to false.

Via bug 1632821 I recently updated the WebIDL definition to no longer depend on the marionette.enabled preference but when Marionette is actually running. That means we have to restrict it even more at some point.

So far no-one complained, as such we will work on it when needed.

Lets do it when we have the new Session module.

Depends on: 1691402
Depends on: 1691047
Depends on: 1691399
See Also: → 1719505
Depends on: 1719505
Summary: navigator.webdriver active flag has to be bound to the session lifetime → navigator.webdriver active flag has to be bound to the WebDriver session lifetime
See Also: 1719505
Component: Marionette → Agent
Product: Testing → Remote Protocol
Summary: navigator.webdriver active flag has to be bound to the WebDriver session lifetime → navigator.webdriver active flag has to be bound to the WebDriver session lifetime (Marionette, WebDriver BiDi)
Version: Default → unspecified

With all the dependencies fixed we could now check what's required to actually get the navigator.webdriver property bound to an active WebDriver and CDP session.

Going the easiest way we could just add a new property on the Remote Agent parent process class which checks all the supported protocols if active sessions exist. This information could then be forwarded similarly to running to the Remote Agent content process class.

The downside doing it exactly this way might trigger a performance issue. Right now navigator.webdriver is marked as a cached constant. That means it's read once, which then no longer holds. Having to retrieve the current value each time requires the instantiation of the content process class for the Marionette and Remote Agent implementation, which are both a JSM. Getting instances of JSM services/interfaces via XPConnect from C++/Rust is way slower as when having a C++/Rust component.

We may try the above steps first, and do extensive performance testing. If issues arise we could refactor the content processes classes of both components into a C++ or Rust component. Both of them should see code changes very rarely and as such shouldn't require a full build.

We should discuss the priority and strategy in a triage meeting.

Whiteboard: [webdriver:backlog][webdriver:triage]
Summary: navigator.webdriver active flag has to be bound to the WebDriver session lifetime (Marionette, WebDriver BiDi) → navigator.webdriver active flag has to be bound to the WebDriver (Marionette, BiDi) and CDP session lifetime

As discussed we will not work on this particular feature in the foreseeable future. It's less likely that users are in such a situation and might only happen when using an eg. daily Firefox profile with remote protocols enabled - which is something that we do not encourage to do at all.

As such lets keep in the backlog but post-pone any work.

Whiteboard: [webdriver:backlog][webdriver:triage] → [webdriver:backlog]
You need to log in before you can comment on or make changes to this bug.