mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00

As Joel noticed recently, MessageManager in firefox doesn't guarantee message delivery if the opposite end hasn't been initialized yet. In this case, message will be silently dropped on the ground. To fix this, we establish a handshake in SimpleChannel to make sure that both ends are initialized, end buffer outgoing messages until this happens. Drive-by: serialize dialog events to only deliver *after* the `Page.ready` protocol event. Otherwise, we deliver dialog events to the unreported page.