Closed Bug 1636373 Opened 4 years ago Closed 4 years ago

Runtime.executionContextsCleared should only be emitted for top-frame navigation

Categories

(Remote Protocol :: CDP, defect, P1)

defect

Tracking

(firefox79 fixed)

RESOLVED FIXED
Firefox 79
Tracking Status
firefox79 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [puppeteer-beta-reserve])

Attachments

(1 file)

Right now the event is emitted when all execution contexts for a window have been removed. But that is not correct. Instead it should only be emitted when all contexts of a tab target get removed due to a navigation in the top level browsing context, or when the tab gets closed.

Also when the Runtime gets disabled the event has to be fired.

Priority: -- → P3

This broken behavior on this bug actually blocks my work on bug 1637640. Given that we emit Runtime.executionContextsCleared also for frames Puppeteer looses certain cached execution contexts, and the returned Promise from executionContext() in DOMWorld.js is hanging.

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

I moved out the part for Runtime.disable into bug 1644661.

Summary: Runtime.executionContextsCleared should only be emitted for top-frame navigation and Runtime.disable → Runtime.executionContextsCleared should only be emitted for top-frame navigation

This also fixes a hang in Puppeteer's DOMWorld.js when resolving
the current executionContext promise. With the extra event all
the Puppeteer internal contexts for the tab target have been destroyed.

Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5b83370e0913 [remote] Only emit Runtime.executionContextsCleared event for top-level execution contexts. r=remote-protocol-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
Component: CDP: Runtime → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: