Implement Target.targetInfoChanged
Categories
(Remote Protocol :: CDP, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: impossibus, Assigned: canadahonk)
References
(Blocks 1 open bug)
Details
(Whiteboard: [puppeteer-beta2-mvp])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
The Puppeteer unit test for this expects a Target.targetInfoChanged
CDP event after Page.close
in Puppeteer.
Puppeteer emits its own Events.Browser.TargetChanged when it sees Target.targetInfoChanged
Firefox Browser target events should work (launcher.spec.js:382:5)
Message:
expect.toEqual failed:
{
"0": "CREATED",
"1": "DESTROYED"
} ≈ {
"0": "CREATED",
"1": "CHANGED",
"2": "DESTROYED"
}
Stack:
Error: expect.toEqual failed:
{
"0": "CREATED",
"1": "DESTROYED"
} ≈ {
"0": "CREATED",
"1": "CHANGED",
"2": "DESTROYED"
Comment 1•5 years ago
|
||
This event doesn't need to be emitted for Page.close
only, but for each instance a target changes. Note that we don't have implemented this event at all. Also there is even no meta bug filed yet. Could you do that?
Reporter | ||
Comment 2•5 years ago
|
||
It's actually for targetInfoChanged, for which we have a meta bug. (I updated my original comment as well to reflect this.)
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
As the spec does not specify, from looking at Chromium source, Target.targetInfoChanged
is emitted when a target is:
- Navigated
- Attached
- Detached (not implemented)
As detached is not implemented, it might be good for this (or the meta) to depend on detach as otherwise Page.close
, etc would not emit a Target.targetInfoChanged
event.
Assignee | ||
Comment 4•2 years ago
|
||
Added new "target-changed" event to TargetList generally, which Target
domain now subscribes to with Target.setDiscoverTargets, and emits a
Target.targetInfoChanged event when recieved.
Target.targetInfoChanged is emitted when certain things happen to a target:
- Top frame navigation (via observing document-element-inserted in TargetList)
- Attached (via attachToTarget in Target domain)
- Detached (not implemented - see Bug 1549536)
These are not specified in the spec but you can find by searching Chromium source:
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/target_handler.cc?q=targetInfoChanged
Puppeteer tests look to depend on this event quite a bit as they
always expect it in event histories, hopefully should fix several
results (TODO: retest and check changes).
WIP, needs tests.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
(In reply to CanadaHonk [:CanadaHonk] from comment #3)
As detached is not implemented, it might be good for this (or the meta) to depend on detach as otherwise
Page.close
, etc would not emit aTarget.targetInfoChanged
event.
I've added a comment to bug 1636979 to indicate that this event needs to be fired as well.
Updated•1 years ago
|
Description
•