Closed Bug 1719505 Opened 4 years ago Closed 3 years ago

Set "navigator.webdriver" property to true when Remote Agent is enabled

Categories

(Remote Protocol :: Agent, task, P2)

task
Points:
2

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [bidi-m3-mvp], [wptsync upstream])

Attachments

(6 files)

With bug 1632821 the navigator.webdriver property is always true when Marionette is active. There is the follow-up bug 1696425 to even set it only when there is an active WebDriver session.

The same needs to be done for the Remote Agent when --remote-debugging-port has been specified on the command line. Whereby here we have to differentiate between WebDriver BiDi and CDP.

For WebDriver BiDi the property should behave similar to Marionette and rely on an active WebDriver session.

For CDP it would be up to us, but I would suggest to bind it to an active WebSocket connection.

For the implementation it might make sense to have a single property on the Remote Agent component that can be checked, and which internally will check all supported protocols. We could call the property active, or isInAutomation to match other modules in Firefox.

Lets discuss the priority in next weeks WebDriver meeting.

Points: --- → 2
Priority: -- → P3
Whiteboard: [webdriver:triage]
Whiteboard: [bidi-m1-mvp]
See Also: → 1720838

We actually already have a check in Navigator.cpp but that doesn't seem to work:
https://searchfox.org/mozilla-central/rev/9c91451cc2392d942a42493fc895f5aeeddde45d/dom/base/Navigator.cpp#2126-2133

Maybe we need a specific instance of Remote Agent for content processes like we have in Marionette. Lets wait for bug 1720676 being landed, which is including quite a big refactoring that we can base on here.

The work on this bug should block bug 1696425.

Blocks: 1696425
Depends on: 1720676
Whiteboard: [bidi-m1-mvp] → [bidi-m2-mvp]
Priority: P3 → --

Not related to our milestone 2 work. Will have to check for dependencies.

Flags: needinfo?(hskupin)
Whiteboard: [bidi-m2-mvp]
Blocks: 1753997
Flags: needinfo?(hskupin)
Priority: -- → P3
Whiteboard: [bidi-m3-mvp]

We should discuss if this is a feature that we definitely need immediately before enabling BiDi on release channels. Alternatively I would suggest to have the same behavior as Marionette for now by setting navigator.webdriver=true when the Remote Agent is enabled via the command line argument. That would be more in-par with Marionette and easier to implement.

Whiteboard: [bidi-m3-mvp] → [bidi-m3-mvp][webdriver:triage]

Given that bug 1696425 covers the truth state of the property for an active WebDriver session, lets use this bug to set the property whenever the Remote Agent is enabled as well.

See Also: 1696425
Summary: Set "navigator.webdriver" for active connections via Remote Agent → Set "navigator.webdriver" property to true when Remote Agent is enabled
Priority: P3 → P2
Whiteboard: [bidi-m3-mvp][webdriver:triage] → [bidi-m3-mvp]

As long as the Remote Agent can be started and stopped during the lifetime of Firefox this feature is not doable. As such we have to fix bug 1717899 first.

Depends on: 1717899
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Depends on: 1766802

The "session.new" command currently doesn't work because the
transport is started after sending the command. This needed
to be flipped.

Also it is helpful to have the event loop of the current
transport available as property on the BiDi session directly.

Depends on D144978

Both methods have been removed via bug 1717899 and can no
longer be used.

Depends on D144979

Both components are related to WebDriver and should expose the
same flag for their running state.

Depends on D144980

When accessing the nsIRemoteAgent interface from a content
process the running state cannot be determined without
communicating with the Remote Agent class from the parent
process.

Similar to Marionette this patch adds a dedicated class of
the Remote Agent for content processes, and exports an
instance of the appropriate class depending on in which
process the Remote Agent gets created in.

Depends on D144982

Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/621024810236 [wdspec] Fix browser fixture for already existing CDP or BiDi port files. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/3e3df2a6b1e3 [wdspec] Improvements for WebDriver BiDi Python client. r=webdriver-reviewers,jgraham https://hg.mozilla.org/integration/autoland/rev/f40c2fe6872d [remote] Remove no longer used methods from Remote Agent interface. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/674fe8523cf6 [remote] Unify Remote Agent's running state with Marionette. r=webdriver-reviewers,mossop,smaug,keeler,jdescottes https://hg.mozilla.org/integration/autoland/rev/8df69b3445e5 [remote] Add Remote Agent class for content processes. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/915b5331f6b2 [remote] Add CDP and WebDriver BiDi tests for navigator.webdriver. r=webdriver-reviewers,jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33869 for changes under testing/web-platform/tests
Whiteboard: [bidi-m3-mvp] → [bidi-m3-mvp], [wptsync upstream]
Upstream PR was closed without merging

I missed to rename the listening property of the Remote Agent to running in the following files:

  • toolkit/content/aboutSupport.js
  • toolkit/modules/Troubleshoot.jsm
  • toolkit/modules/tests/browser/browser_Troubleshoot.js

I'm going to push once try reports the failing test as passing.

Flags: needinfo?(hskupin)
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7d59f342563c [wdspec] Fix browser fixture for already existing CDP or BiDi port files. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/7ac82aff1852 [wdspec] Improvements for WebDriver BiDi Python client. r=webdriver-reviewers,jgraham https://hg.mozilla.org/integration/autoland/rev/4feb57751cba [remote] Remove no longer used methods from Remote Agent interface. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/553219c11b69 [remote] Unify Remote Agent's running state with Marionette. r=webdriver-reviewers,mossop,smaug,keeler,jdescottes https://hg.mozilla.org/integration/autoland/rev/ff65f4a77f37 [remote] Add Remote Agent class for content processes. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/871093f41bb1 [remote] Add CDP and WebDriver BiDi tests for navigator.webdriver. r=webdriver-reviewers,jdescottes
Upstream PR merged by moz-wptsync-bot
See Also: → 1675471
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: