Closed Bug 1601695 Opened 4 years ago Closed 4 months ago

Schedule script evaluation for scripts enqueued by Page.addScriptToEvaluateOnNewDocument's source argument

Categories

(Remote Protocol :: CDP, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: impossibus, Unassigned)

References

Details

(Whiteboard: [puppeteer-beta2-mvp])

The content-document-global-created observer notification looks relevant.

Summary: Schedule script evaluation for scripts enqueued by Page.addScriptToEvaluateOnNewDocument → Schedule script evaluation for scripts enqueued by Page.addScriptToEvaluateOnNewDocument's source argument
Priority: P3 → P2
Whiteboard: [puppeteer-beta-mvp]

Scripts to execute will actually be hold within the frame tree instance of the current target. That said we need its implementation done, which I'm working on via bug 1605359 right now. Once that is done we can use the frameAttached event to run all the registered scripts.

Depends on: 1605359

While Page.getFrameTree gives us the list of already existent frames so that a script added later will be run in all frames, we also need Page.frameAttached to call all the scripts when a new frame gets added. This can be done once bug 1599413 has been fixed.

Depends on: 1599413

Temporarily moving to Reserve Backlog as it is blocked on Bug 1599413 and to accommodate Bug 1599260 moving into the MVP Backlog.

Whiteboard: [puppeteer-beta-mvp] → [puppeteer-beta-reserve]

As a side-node. When this gets implemented we will have to make sure that tests also check for the correct frameId reported in the generated execution contexts, especially for a test which navigates to a frameset. I would like to defer those tests for now because without bug 1637640 been done, it is very hard to do.

Whiteboard: [puppeteer-beta-reserve] → [puppeteer-beta2-mvp]
Component: CDP: Page → CDP
Severity: normal → S3

Over on bug 1806413 we are getting this feature currently implemented for WebDriver BiDi.

See Also: → 1806413

We are not going to finish this API for CDP while WebDriver BiDi has full support via script.addPreloadScript already.

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.