Since AttachedSession is already heap-based, it's inspector_session is at a
fixed address and thus can own the session.
Also, hook in some noop callbacks on deinit.
Encode the !important'ness of a rule into its priority (we have the bit to
spare). This keeps the !important calculation the build-side, not the read side
and is more consistent with how the StyleManager generally works.
CSSStyleDeclaration `getPropertyValue` is now !important aware. Whereas before
an inline value would always win, it now cedes to an !important stylesheet rule
`Inspector` now supports several sessions; `startSession` allocates one (the V8 channel keeps its address) and `stopSession` frees it. They all connect to the same context group so every session see every context.
`BrowserContext.session_id` stays the primary session's id for the many event call sites.
Playwright's `browserContext.newCDPSession` must get its response on that session, not the primary one. Playwright keys its pending callbacks by session, finds none for that id, and throws
"Assertion error", which takes the whole process down.
Addresses #1838 and #1839.
select() delegated to setSelectionRange(), which throws InvalidStateError
for input types where the selection API doesn't apply (email, number,
date, ...). Per spec select() never throws.
email and number still have selectable text, so they now keep the
internal selection/caret: select() + Input.insertText replaces the
value like Chrome. This is what Playwright's locator.fill() does, which
failed with 'locator.fill: undefined' on type=email.
A flag given without its value, or an extra positional, failed with
only `FATAL exit err=MissingArgument`, not naming the flag. The parser
now logs which flag is missing its value or which argument is extra,
with a hint pointing at the command's help, and a missing fetch URL is
caught while parsing, next to run's missing script. Since each of these
is logged where it's found, main exits without the generic `exit` line.
`-h` works wherever `--help` does, instead of being taken as a URL.
The --obey-robots tip is for a person at a terminal, so it's skipped
when stderr isn't one; scripts capturing stderr no longer get it on
every run.
The .networkidle/.networkalmostidle wait conditions read
Frame._notified_network_idle, the one-shot latch behind CDP's lifecycle
event. Once a frame has been idle it stays .done, so waiting on it after
an action that loads a popup or navigates an iframe resolved at once.
Track instead, per Runner, how long the network has been idle and meet
the condition once that has held for 500ms. The frame latch stays for
the CDP events.
`.done` waits for full quiescence, which a page running ads or polling
never reaches, so every navigating click ran its 10s budget out and gave
up. On hostelworld.com one click cost 10,141ms against 2,705ms waiting
for networkidle, with both producing an identical page: same URL, same
5023 nodes, same 2403 characters of text.
The same navigation issued as a `goto` costs 1.2-2.2s, because `goto`
defaults to `load`. `load` alone is not enough for a caller that reads
the DOM next, though: on that page it yields 961 nodes against
networkidle's 5023.
Closes#3641
The easy-handle pool is shared by every client in the process. When other
sessions hold all of it, a new navigation's request sits in pending_queue,
but Runner resolved a frame still in `.pre` as soon as in-flight activity
was zero, which ignores pending transfers. goto then reported success on
an empty document.
Wait on `activity.idle()` instead, and make a goto that times out before
any response arrives a NavigationTimeout error rather than a soft timeout.
Fixes#3636