Add documentation about watcher architecture
Categories
(DevTools :: Shared Components, enhancement, P2)
Tracking
(firefox116 fixed)
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: fabrice, Assigned: ochameau)
Details
Attachments
(3 files)
The context of this bug is the revival of Servo's devtools support (see https://github.com/servo/servo/issues/29831).
Servo doesn't advertise watcher support, so when we enter the devtools toolbox for a tab, the init sequence never completes:
- we enter https://searchfox.org/mozilla-central/rev/af5be0d1e0ff1e44bd37896d95cca9f21d47ec9c/devtools/shared/commands/target/target-command.js#457
types
is empty at https://searchfox.org/mozilla-central/rev/af5be0d1e0ff1e44bd37896d95cca9f21d47ec9c/devtools/shared/commands/target/target-command.js#469 because we have a tab descriptor but no frame watcher.- we end up at https://searchfox.org/mozilla-central/rev/af5be0d1e0ff1e44bd37896d95cca9f21d47ec9c/devtools/shared/commands/target/target-command.js#518 that never resolves because
_resolveOnFirstTarget
is never called.
My understanding is that _resolveOnFirstTarget
relies on switchToTarget()
to be called and that never happens in our case (that seems hooked up to local remoteness change).
If the analysis above is correct, what is the best path forward? If it's actually mandatory to implement a frame watcher, I would suggest to at least add some error reporting and early return in startListening()
.
Reporter | ||
Comment 1•4 months ago
|
||
Here's the reply to the getTab(n)
Servo is sending:
DBG-SERVER: Got: {
"from": "root",
"tab": {
"actor": "tabDescription13",
"title": "Example Domain",
"url": "http://example.com/",
"outerWindowID": 1,
"browsingContextId": 1,
"browserId": 1,
"selected": true,
"isZombieTab": false,
"traits": {
"watcher": false,
"supportsReloadDescriptor": false
}
}
}
Updated•4 months ago
|
Comment 2•4 months ago
|
||
Alex, you offered to add some documentation about watcher which could help Servo and others implement devtools support.
As discussed we could also add a test which does raw RDP so that we can check it still works and easily shared working code with others.
Updated•4 months ago
|
Assignee | ||
Comment 3•4 months ago
|
||
This is no longer used. The returned promise should be used instead.
There was also some old lefovers in WebConsole Front related to network events.
As we no longer have legacy listeners, this is no longer used.
The frontend code now uses DevToolsClient.request directly to query the NetworkEventActor's.
Updated•4 months ago
|
Assignee | ||
Comment 4•4 months ago
|
||
Try to document navigating throught the Root, Watcher, Target and Console actors
to listen for console messages and evalute some JS code.
Assignee | ||
Comment 5•4 months ago
|
||
This is a long overdue update to better describe the key actors:
root, descriptor, watcher, target and target-scope actors.
Assignee | ||
Updated•4 months ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6850948b14c0 [devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/0fe632ebb487 [devtools] Document basic usages of RDP via a simple mochitest. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/636272515c00 [devtools] Update actors documentation. r=devtools-reviewers,bomsy
Comment 7•3 months ago
|
||
Backed out for causing mochitest failures in devtools/shared/webconsole/test/chrome/test_network_security-hsts.html
Backout link: https://hg.mozilla.org/integration/autoland/rev/d41d6f44d6fc8e92117ad8d201074cf717a215b4
Assignee | ||
Updated•3 months ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fac27ddff8d5 [devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/aceb5aaeb650 [devtools] Document basic usages of RDP via a simple mochitest. r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/9bdc41648c38 [devtools] Update actors documentation. r=devtools-reviewers,bomsy
Comment 9•3 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fac27ddff8d5
https://hg.mozilla.org/mozilla-central/rev/aceb5aaeb650
https://hg.mozilla.org/mozilla-central/rev/9bdc41648c38
Description
•