-
Notifications
You must be signed in to change notification settings - Fork 320
Description
Environment
| Component | Version |
|---|---|
| Node.js | v18.12.0 |
| Client (Chrome/Chromium/...) | 124.0.6367.79 |
| OS running Node.js | Windows 11 |
| OS running the client | Windows 11 |
| chrome-remote-interface | v0.33.0 |
Is the client running in a container? NO
Description
I am trying to read all frames via Page.getFrameTree(). It works at the start. The frames are all visible. But after a short moment a FrameDetached, Reason: swap-event is fired.
Now the question is, how to “handle” this correctly?
http://127.0.0.1:9222/json/list shows the correct IFrames. However, Page.getFrameTree() does not - although I would expect it to.
Unfortunately, this topic has not (yet) been dealt with here. Puppeteer seems to have found a way to do this, but I couldn't find the right place in the code base. Probably because Puppeteer pays attention to Target.targetCreated at the same time?
It also feels as if the IFrame is a “separate process”. If I connect directly via CDP({ target: webSocketDebuggerUrl }) (while webSocketDebuggerUrl is the url to the IFrame; parentId is the page which contains that IFrame), then it works.
Example
const CDP = require('chrome-remote-interface');
async function main() {
// I don't have an example (yet).
}
main().catch((error) => {
console.error(error);
});