Open Bug 1599431 Opened 5 years ago Updated 2 years ago

"Page.navigate" has to allow navigation by frameId

Categories

(Remote Protocol :: CDP, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [puppeteer-beta2-mvp])

Right now navigation is only supported for the top-level frame. But Puppeteer also allows to navigate a very specific frame as specified via frameId to Page.navigate().

Here the example from juggler in how it could work:
https://github.com/puppeteer/juggler/blob/master/testing/juggler/content/PageAgent.js#L264-L271

While working on bug 1637640 I noticed that some Puppeteer tests try to navigate a specific frame. Also some users of Puppeteer want to have this feature. I doubt it will be too hard to implement, so I will have a look at.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Depends on: 1637640
Priority: P3 → P1
Whiteboard: [puppeteer-beta-reserve]

As it turned out to make this feature work with Puppeteer we would have to send the loaderId for attached frames within their init lifecycle event. While I thought this works with my patch for bug 1637640, it actually sends undefined from within _onFrameAttached. To let the content Page domain know the loaderId we would have to wait for the first Network request for this particular frame. Sadly this event is sent out after some other page events have already sent out, so we would mix up the ordering.

I think that we need some refactoring here, so that we can define a loaderId for new frames (including the main frame) when they are created. That id should then be used by the Network domain for each and every request. Sadly we can't intercept network requests yet.

Another option would be a channelId to loaderId map.

This is too much work for right now, so I step back from this bug for the moment.

Assignee: hskupin → nobody
Status: ASSIGNED → NEW
Priority: P1 → P3
Whiteboard: [puppeteer-beta-reserve] → [puppeteer-beta2-mvp]
Component: CDP: Page → CDP
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.