Repository navigation
Conversation
The original hardkoded/playwright-sharp repository no longer exists. PlaywrightSharp was transferred to Microsoft and continues as microsoft/playwright-dotnet. This commit copies the full source tree from main at ad8e09c (feat(test-adapter): support TestIdAttribute in runsettings). Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
cursor Bot
pushed a commit
that referenced
this pull request
Sep 22, 2026
WebKit records first-party user interaction for click/tap/form entry only; a modifier-only Shift pulse does not qualify under ITP How-To #1. Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
cursor Bot
pushed a commit
that referenced
this pull request
Sep 22, 2026
Mouse click at (1,1) was counted by document click listeners (ViewScaleShouldResetAfterNavigation). Type into a temporary offscreen input via Input.dispatchKeyEvent + Page.insertText instead, which still satisfies ITP How-To #1 without click side effects. Keep child-frame skip for frameset documents. Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
kblok
added a commit
that referenced
this pull request
Oct 3, 2026
* Stop installing WebKit test HTTPS cert into Linux system CAs.
Ubuntu CI ran update-ca-certificates on the ASP.NET testCert so
WebKit/libsoup treated https://localhost as trusted. page.goto then
succeeded and Bad SSL / ignoreHTTPSErrors isolation tests saw
caughtException null. Chromium was unaffected (own root store).
Keep exporting key.pfx/testCert.cer for Kestrel only; tests that need
successful HTTPS must use IgnoreHTTPSErrors, matching upstream.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Reject in-flight APIRequest fetches on context close like upstream Dispose.
Prefer per-fetch abort signals across UA/cookie/SendAsync/body awaits so a
Windows hang-route that still yields HTTP success cannot mask
"Request context disposed" when Close races WaitForRequest.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix Chromium expect/crash/mouse and WebKit click/WS CI failures.
Last-chance blank text recovery for 1ms expect timeouts, abort-aware
evaluate retries, utility-world drag setup, chrome://crash fallback,
shorter WebKit action signal polls with Page.enable epilogue and rAF
stability, Darwin WS close-frame drain, and lazy-iframe aria skip.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix WebKit CI product bugs: viewport race, force click, wait logs, RSA, nav, workers.
Tolerate missing target session when applying emulated viewport during NewPage.
Skip ActionSignals waits for force clicks so overlay handlers do not hang.
Use a one-shot preview+visibility probe and merge wait logs so intermediate
nodes survive timeout call logs. Harden requestStorageAccess evaluate (window
anchor, returnByValue). Resolve child WaitForNavigation on matching responses
and match frames by id. Retry Worker.workerCreated when the page session is
briefly unavailable.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Revert WaitForNavigation Response resolve and harden related CI fixes.
Resolving waitForNavigation on the document Response completed before
FrameNavigated and regressed click/fill/select navigation waits across
Chromium. Restore FrameNavigated-only commit, dispose aborted HttpClients
off the CloseAsync thread, keep WaitForSelector two-step visibility probes
with merge-only timeout logs, lengthen the WebKit empty action poll to
640ms, and tighten WebKit aria/RSA/scroll/route-override handling.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix evaluate navigation abort, goto/auto-wait races, and WebKit click settle.
Restore RaceDestroyed NavigationMessage so hanging evaluates fail instead of
retrying after reload. Treat ERR_ABORTED as superseded navigation, keep
document request across lifecycle clear, reset clock ticks on install, and
order load waiters before clickload. WebKit: abort-proof document retains,
navigable-target settle after click, redirect response URL keying, stronger
aria fail-closed and RSA gesture, wait-log preview persistence.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Revert over-broad ERR_ABORTED swallow; fix redirects, SSL clicks, aria.
Page.navigate ERR_ABORTED must still fail for 204 / canceled / replaced
navigations. Stop intercepting Chromium redirect hops, fail-closed WebKit
bad-SSL click retains, harden aria lazy-iframe and RSA gesture, persist
Darwin wait-visible logs, and tighten expect last-chance / HAR header match.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix tip CI: APIRequest abort RST, lazy visibility, clock pause, RSA.
Windows Abort hung because fetch unwind sync-Disposed HttpClient while
SendAsync waited on the hang route; track sockets and RST on close, and
always background-dispose clients. Skip getComputedStyle on loading=lazy
iframes (Darwin WaitForSelector wedge). Prefer ChildFrames for aria stitch.
Do not await clock real-time dispose (pauseAt/runFor deadlock). Restore
async RSA under emulateUserGesture with frame-session pulse first.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix WebKit macOS RSA, clock awaitPromise deadlock, lazy iframe waits.
RSA: pulse parent iframe click then OOPIF frame-session last (no early
return); only pulse after the window anchor so activation survives into
async callFunctionOn.
Clock: kick pauseAt/runFor off a microtask and poll a marker so Darwin
WIP does not hold awaitPromise across embedder.setTimeout (deadlock).
WaitForSelector: document-scoped AtomicSelectorRead visibility on WebKit
before constructing handles; skip InitializePreview callFunctionOn that
wedged loading=lazy iframe objectIds.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix aria iframe stitch order and clock injector evaluate.
ContentFrame-first again so ChildFrames creation-order no longer swaps
srcdoc stitches after remove/re-add. Match fallback ChildFrames by
name/src. Only microtask-defer pauseAt/runFor/fastForward — wrapping the
injector script broke install with Unexpected token.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix WebKit preview/strict waits and APIRequest abort RST.
Restore InitializePreview via PreviewNodeFunction (AtomicSelectorRead
already avoids lazy-iframe handle construction). Propagate WaitForSelector
strict violations instead of swallowing them into 30s polls. Skip
AtomicSelectorRead for enter-frame selectors so FrameSelector validation
runs. Abort sockets with Close(0) for a true RST on Windows hang routes.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden Abort RST ordering, lazy iframe preview, aria stitch, RSA pulse.
Abort: RST sockets before completing abort gates; NetworkStream ownsSocket
false so HttpClient dispose cannot FIN under AbortSocket. Preview: skip
callFunctionOn for iframe/frame via describeNode (timeout = skip) so Darwin
ReturnEmptySnapshot does not wedge. Aria: FrameElement identity match and
250ms ContentFrame races so Windows frameset/srcdoc stitch finishes in budget.
RSA: page-proxy-only fast click without slow hit-test or frame-session Input.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Revert ownsSocket:false APIRequest hang; skip iframe preview.
SocketsHttpHandler never finished responses when ConnectCallback streams
did not own the socket, so credential and timeout fetches hit 30s.
Keep RST-before-abort-gate. Skip WebKit InitializePreview for iframe/frame
so callFunctionOn cannot wedge Darwin ReturnEmptySnapshot.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Stop WebKit query tag evaluate from breaking getByTestId.
Reading window.__pwQueryTag after querySelector returned a remote object
on WebKit and threw on GetByTestId. Skip iframe preview from the selector
instead. Do not touch iframe contentDocument in aria capture-ready, and
bound FrameElement identity so Darwin stitch stays inside the snapshot budget.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Skip iframe preview on QueryAll; fix Abort waiter race and RSA click.
WaitForSelector used StrictSelector → QuerySelectorAll, which still ran
InitializePreview on lazy iframes and wedged Darwin ReturnEmptySnapshot.
Thread initializePreview:false for iframe/frame selectors through unwrap.
SimpleServer notifies WaitForRequest after the hang-route registers
RequestAborted so Windows Abort RST cannot race registration. Defer
HttpClient dispose slightly after RST. RSA pulse clicks iframe center via
one cheap querySelector. Aria resolves ChildFrame by name/src (incl. data:)
before ContentFrame/identity.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix RSA click evaluate and lazy-iframe layout wedge.
The storage-access pulse evaluated a function object, so WebKit threw before the click. Lazy iframe snapshots still called getComputedStyle, which wedges Darwin. Frameset stitch now searches descendant frames and keeps budget for children.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Seed load after setContent when only lazy iframes remain.
Darwin never fires load for that document, so ReturnEmptySnapshot waited out the test timeout and wedged the worker. Also keep the full aria-snapshot budget so reload auto-wait is not cut short, and give socket RST a little longer before HttpClient dispose.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Abort fetches before socket close and keep committed navigations.
Publish the APIRequest abort gate after arming linger-0 so a cancelled hang route cannot return 200, and Close(0) cannot deadlock Windows. Return a committed 2xx when a newer navigation reports ERR_ABORTED, seed lazy-iframe load from HTML instead of evaluate, and wait for request extra-info before sealing raw headers.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Recover committed navigations and avoid lazy-frame evaluate wedges.
Return a committed 2xx when Page.navigate reports ERR_ABORTED after the document response was observed, match navigation responses by frame id, stitch aria iframes by name/src before capture-ready gates, skip init-script evaluate on frames without a context, and read the RSA click rect without consuming user activation.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix macOS WebKit CI: aria stitch, popup order, blank goto, RSA.
Keep SnapshotForAI budget for iframe children, report popups before
exposeFunction without requiring openerId, seed about:blank navigations
when load events are skipped, and grant storageAccess before RSA.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden Darwin WebKit fixes from CI investigator findings.
Reject blank ChildFrames for data: aria stitch so ContentFrame is used;
make ReportAsNew mark+emit atomic; restore OOPIF target-session RSA
pulse on WebKit 2251; replay blank→blank lifecycle after navigate like
Chromium instead of FrameNavigated seeding.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Revert blank lifecycle sync-replay that broke WebKit evaluate/init.
Synchronous Load replay after blank→blank navigate raced NewPage
bootstrap and destroyed execution contexts (mass WebKit CI failures).
Restore readyState seeding instead. Also retain CSS coverage across
styleSheetId reuse when resetOnNavigation is false, and drain
in-flight waitForFunction polls before surfacing timeout.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix popup URL, RSA origin grant, aria iframe stitch, CSS retain.
Report window.open popups only after the first non-blank URL so
BrowserContext Page observers see the committed destination. Grant
storageAccess for the frame origin and gate OOPIF Input pulses on
EnableFrameSessions. Fall back to querySelector for Darwin data:
iframe aria stitching. Always retain CSS coverage by source URL when
resetOnNavigation is false.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix WebKit popup blank wait, RSA pulse, and aria enter-frame stitch.
Align first-non-initial navigation with Chromium so about:blank commits
complete popup prepare promptly; wait separately for non-blank destination
URLs. Report context Page (and Video) before opener Popup emit, and skip
binding dispatch when the popup already closed. Always pulse requestStorageAccess
Input on a target session (prefer frame-* when present). Prefer aria
enter-frame for data: iframe children on Darwin WebKit 2251.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix about:blank popup emit race, closed popup Page report, RSA Input hang.
Chromium PrepareForPopupReportAsync no longer waits 5s for a non-blank URL
when the popup already committed about:blank (tests use a 5s CTS). WebKit
always raises BrowserContext.Page after prepare, including immediately
closed javascript: popups. Cap frame-session RSA Input pulses at 1.5s and
catch TimeoutException so Darwin frame-* hangs cannot fail the evaluate.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix RSA activation race, Chromium aria ChildFrames stitch, frame detach errors.
Do not await Darwin frame-* Input before requestStorageAccess evaluate —
waiting burns page-proxy transient activation. Keep blank ChildFrames when
the body has content so Chromium nested HTTP iframes stitch. Surface
Frame was detached from WaitForFrameContextAsync and RewriteError instead
of "context not yet available" after detach.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix Darwin RSA page-proxy-only gesture and data: aria iframe stitch.
Drop frame-* Input pulses (Console-only sessions never ACK on 2251) and
force enter-frame for data: iframes whose Url stays about:blank forever.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Await Target.detachedFromTarget in CRPage.ClosePageAsync.
closeTarget alone returned before context.Pages was updated, so a short
delay in protocol tests could still see the page under CI load.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Align Darwin requestStorageAccess with upstream utilityScript evaluate.
Keep the raw RSA function form, drop Input pulse and storageAccess
grantPermissions, and invoke under callFunctionOn+emulateUserGesture+
awaitPromise after Target.activate and iframe focus.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden Darwin RSA: raw function plus page-proxy Input pulse.
Keep InvokeIfFunction off for requestStorageAccess, restore page-proxy
iframe click immediately before callFunctionOn+emulateUserGesture, and
best-effort storageAccess grant — still never Input on frame-* sessions.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Align Darwin RSA with upstream sync callFunctionOn; pass proxy creds through shim.
requestStorageAccess was still False on macOS 2251: the async CFO wrapper
diverged from utilityScript.evaluate (sync invoke + native Promise for
awaitPromise). Drop Input pulse and storageAccess grant (upstream does
neither); activate + setActiveAndFocused immediately before CFO.
WebKitMacProxyBypassShim now copies Username/Password onto BrowserProxy so
CFNetwork retries CONNECT after 407/close (Darwin CONNECT-auth flake).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Bind Darwin RSA to UtilityScript callFunctionOn; harden data: aria stitch.
Window-anchored CFO still returned False for requestStorageAccess on macOS
2251. Install a minimal page-world UtilityScript and use the upstream
evaluateWithArguments wire shape (objectId + emulateUserGesture +
awaitPromise); drop pre-CFO setActiveAndFocused which clears activation.
For AI aria snapshots, keep blank ChildFrames that already have body
children and fall back to FrameLocator when aria-ref enter-frame misses
after Focus (ShouldSupportManyPropertiesOnIframes).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Pulse page-proxy Input before Darwin RSA UtilityScript CFO.
UtilityScript-only and Input+window CFO each failed on macOS 2251 OOPIF
requestStorageAccess. Cross-origin frames do not inherit parent transient
activation; install UtilityScript first, then page-proxy iframe click,
then upstream-shaped callFunctionOn+emulateUserGesture. Use globalThis.eval
like upstream this.global.eval. Never Input on Console-only frame sessions.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Run Darwin RSA under real Input click; retry active iframe aria stitch.
emulateUserGesture + UtilityScript CFO still returned False for
requestStorageAccess on macOS 2251 OOPIFs. Arm a one-shot click listener
in the child document, deliver a page-proxy Input pulse into the iframe,
then await the promise so RSA runs under trusted activation (MiniBrowser
auto-accepts the panel).
When AI aria stitch leaves iframe [active] childless after Focus, retry
once via FrameLocator with a fresh budget (ShouldSupportManyPropertiesOnIframes).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden Darwin RSA: timeout click path and UtilityScript fallback.
If the page-proxy Input pulse misses the OOPIF, settle false after 2.5s
instead of hanging the NUnit budget, then retry under UtilityScript
callFunctionOn + emulateUserGesture.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Grant storageAccess for Darwin RSA; unblock blank→blank GoTo.
Restore Emulation.grantPermissions(storageAccess) for * and the frame
origin before the click/UtilityScript RSA path so ITP can succeed when
MiniBrowser panel auto-accept does not. Complete blank→blank navigation
waiters immediately after the navigate RPC and make lifecycle readyState
seeding non-blocking so WaitForMainExecutionContextAsync cannot hang
about:blank GoTo past the NUnit budget (ConsoleEvent / GetByTestId).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Revert blank→blank sync waiter complete; keep RSA grant and safe seed.
Completing blank→blank load waiters immediately after Navigate raced the
in-flight document swap on Darwin and caused widespread "Execution
context was destroyed" failures. Keep Emulation.grantPermissions for
storageAccess and the non-blocking readyState seed path.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Complete blank→blank waiters only after readyState seed exhausts.
After ~1s of non-blocking readyState polls with no usable context,
finish pending blank→blank load waiters so GoTo cannot hang for the
full NUnit budget — without the immediate-on-RPC complete that raced
document swap on Darwin.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Stop burning Darwin RSA on a click-handler first attempt.
The click-arm path called requestStorageAccess under Input, which rejects
on Darwin's one-shot storage-access panel (~850ms False on tip 495d8c0),
then the UtilityScript fallback ran with no fresh pulse. Grant, activate,
pulse immediately before UtilityScript callFunctionOn+emulateUserGesture.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Align Darwin RSA UtilityScript with upstream evaluate args.
Pass isFunction/returnByValue/serialize/expression/argCount like
javascript.ts, serialize returnByValue booleans as {b:v}, drop the
non-upstream storageAccess grantPermissions, and keep the Input pulse
immediately before callFunctionOn+emulateUserGesture.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Record Darwin first-party ITP interaction before RSA.
macOS WebKit rejects cross-site requestStorageAccess unless the
embedee origin has had first-party user interaction. After http(s)
GoTo, deliver a one-shot page-proxy Input click so Resource Load
Statistics records that interaction before the test navigates away.
Also align UtilityScript evaluate with upstream promiseAware async
IIFE + argCount slicing.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Use Shift key for Darwin first-party ITP interaction.
Prefer Input.dispatchKeyEvent Shift over a (1,1) mouse click after
http(s) GoTo so Resource Load Statistics still records interaction
without activating top-left page content.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Use mouse click for Darwin ITP first-party interaction.
WebKit records first-party user interaction for click/tap/form entry only;
a modifier-only Shift pulse does not qualify under ITP How-To #1.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Blur after Darwin ITP pulse so frameset aria [active] stays clean.
Mouse click for first-party ITP leaves the hit iframe focused; blur
restores document focus without clearing Resource Load Statistics.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Restore focus after Darwin ITP pulse.
Mouse click for first-party ITP was leaving keyboard.html's textarea
blurred and frameset iframes [active]; save/restore activeElement.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Skip Darwin ITP mouse pulse on frameset documents.
A (1,1) click focuses a child frame and breaks aria [active]; RSA
first-party visits use ordinary documents, so leave frameset hosts unmarked.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Detect frameset via main-frame context for ITP skip.
Default Runtime.evaluate on the target can run in a child frame
(tagName HTML), so the FRAMESET skip never fired.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Skip Darwin ITP pulse when main frame has child frames.
FRAMESET tagName evaluate still missed on Darwin (child/HTML context),
so the mouse pulse kept marking frameset aria nodes [active]. After
GoTo load, framesets always have child frames; RSA set-cookie pages
do not — skip the pulse structurally instead.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Resolve waitForCrash when Crash already fired.
WebKit can raise Crash before waitForEvent('crash') subscribes
(Crash-then-wait race in page-event-crash tests), hanging the waiter
for 30s. Replay the page after subscribe when HasCrashed is already set.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Use form-entry for Darwin ITP first-party pulse.
Mouse click at (1,1) was counted by document click listeners
(ViewScaleShouldResetAfterNavigation). Type into a temporary
offscreen input via Input.dispatchKeyEvent + Page.insertText
instead, which still satisfies ITP How-To #1 without click side
effects. Keep child-frame skip for frameset documents.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Recover superseded goto responses; stitch srcdoc iframes by DOM index.
Keep a short history of committed navigation responses so ERR_ABORTED
recovery still finds the first document after a second goto overwrites
_lastCommitted. Resolve multi-srcdoc aria iframe refs via querySelectorAll
index + element identity when name/src cannot disambiguate.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Flush Darwin proxy shim responses before closing sockets.
CFNetwork intermittently missed proxied CONNECT 407 and HTTP document
bodies when the accept-loop disposed the client socket before the
bytes reached WebKit, causing ShouldReconnectWithCredentialsAfterConnect407
timeouts and empty titles on proxied navigations.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Prefer focused child frame when stitching active iframe aria.
Darwin data: iframes after FocusAsync can leave CaptureChildYaml empty
even when iframe [active] is present. Prefer document.hasFocus() frames,
then FrameLocator, then any populated child frame so nested AX nodes
appear under the active iframe.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Forward WebKit CONNECT auth instead of always injecting.
Always injecting Proxy-Authorization on the upstream CONNECT hop
made the first attempt look authenticated, so CFNetwork often skipped
the 407 retry and left reconnect counts at 1. Forward the client's
auth header when present; inject stored credentials only when the
browser proxy has no Username field.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Treat child-frame detach as transient; drop orphaned willCheck retains.
Page-scoped locator clicks must retry across iframe remove+reattach
instead of failing on Frame was detached. Non-navigating WebKit clicks
drop speculative policy retains so scroll=none in-viewport clicks do
not hang under tight 2s budgets.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden Darwin CONNECT 407 delivery; share fill actionability deadline.
Force Connection: close on non-200 CONNECT responses, half-close the
write side, and give CFNetwork time to observe the 407 before dispose.
Fill visible+editable waits now share one timeout budget, and element
state probes race the remaining deadline so wedged evaluates cannot
outrun NUnit timeouts.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Omit proxy URL userinfo on Darwin WebKit for CONNECT 407 retry.
CFNetwork preemptively authenticates when credentials are embedded in
--proxy=/createContext proxyServer, so OfficialTestProxy records only
one CONNECT after a forced 407. Match upstream: Darwin keeps creds on
Username/Password + ExtraHTTPHeaders; Linux/Windows still embed
userinfo because libsoup/curl need it for CONNECT auth.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Unwedge Darwin blank→blank GoTo without CA2025 fire-and-forget.
Race a 2s blank→blank probe in NavigateAsync WhenAny and seed lifecycle
only when Playwright.navigate is still open; mark committed so waiters
can complete while the RPC stays wedged. Await the seed task on exit.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Retry upstream CONNECT with credentials after Darwin shim 407.
WebKitMacProxyBypassShim is the TCP client of the real proxy. When the
upstream closes after a CONNECT 407, probe without auth then reconnect
with Proxy-Authorization so OfficialTestProxy records both attempts even
when CFNetwork only opens one shim hop.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Offer Darwin shim CONNECT credentials on first hop, retry on 407.
Probing upstream without auth first made credential-pickup observe a
null Proxy-Authorization on the initial CONNECT. Send known credentials
immediately, then reconnect once after a 407 so both reconnect-count and
auth-header pickup stay correct.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Prefer WebKit Console.message text over handle previews.
Parameter JoinConsoleArgs can replace a clear warn string with
JSHandle@ placeholders when args are object-id handles, so
BlocksServiceWorkerRegistration never sees the blocked-registration
console text. Keep protocol message.text when present.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden Darwin WebKit console for frame sessions.
Revert preferring Console.message.text (broke PageEventConsole
previews and init-script multi-arg text). Keep JoinConsoleArgs
previews unless they are JSHandle@ placeholders. Await frame
Console.enable like upstream, resume paused frames after enable,
and use Runtime.consoleAPICalled as a deduped fallback so
service-worker-block warns are not lost to the enable race.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Gate Darwin Runtime console fallback on frame Console readiness.
Always forwarding Runtime.consoleAPICalled alongside frame
Console.messageAdded risks duplicate PageEventConsole deliveries.
Only use the Runtime path while any frame Console.enable is still
pending (or no frame session exists yet).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Remove Darwin console RaiseConsole text dedupe.
The 250ms same-text dedupe collapsed two consecutive
console.log('hello') into one and failed ShouldEmitSameLogTwice.
FrameConsolesReady already gates the Runtime fallback; keep that
and trust Console.messageAdded / repeat-count for steady-state logs.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Do not Target.resume WebKit frame sessions after Console.enable.
Upstream only resumes page/provisional targets. Awaiting
Console.enable then resuming paused frames can deadlock when
enable needs an unpaused target, hanging child-frame navigations
(ChildFrameGoToShouldNavigate).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Detect Chromium form/link clicks for ActionSignals expectNavigation.
Windows suite load was resolving click() before form navigations
armed the barrier (ShouldAwaitFormGetOnClick got click|route|navigated).
Match WebKit: mark submit/link targets as expectNavigation, keep
retains armed, and lengthen the Chromium empty poll for those clicks.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Wait for WebKit target recycle before setBootstrapScript.
Darwin can clear the inner session between InitializedTask and
ApplyContextChrome; SyncBootstrapScriptAsync must keep polling instead
of treating a completed init as a hard failure.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden AI aria iframe stitch under Windows suite load.
Stop racing CaptureChildYaml with an outer WhenAny that abandons
still-running ContentFrame/AX work, raise element stitch budget, and
retry sole-iframe captures via FrameLocator when the primary path
misses (AiModeShouldIncludeIframeContents).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Never assign fN aria prefixes to the main frame.
EnsurePrefixes can race away after UsedEmptyMainPrefix is set but
before the empty prefix is written; a later PrefixForAsync then minted
f1 and broke ShouldShowVisibleChildrenOfHiddenElements (f1e1 vs e1).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Recover aborted goto by loaderId; RST APIRequest before abort gate.
Carry CDP loaderId on NavigationException and await the document
response when Page.navigate returns ERR_ABORTED under concurrent GoTo
(ShouldReturnFromGotoIfNewNavigationIsStarted).
On context close, finish socket Close(0) off-thread before publishing
the APIRequest abort gate so hang-route servers see RequestAborted
before NetworkStream dispose (ShouldAbortRequestsWhenBrowserContextCloses).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Restore main-frame aria ref renumber after navigation.
Only mark UsedEmptyMainPrefix after a successful empty-prefix write so
EnsurePrefixes RaceOrDefault abandonment cannot mint f1 on the first
snapshot, while cross-document navigations still gain fN refs.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Harden concurrent-goto ERR_ABORTED recovery on Chromium.
Treat Page.navigate ERR_ABORTED with a loaderId as a successful navigate
result, keep recent navigation requests after map removal, and poll live
captured/recent responses so ShouldReturnFromGotoIfNewNavigationIsStarted
can still return the document 200 under Windows suite load.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Keep throwing on Page.navigate ERR_ABORTED; soft-fail aria child capture.
Reverting ERR_ABORTED-as-success restores ShouldFailWhenCanceled/
Replaced/Returns204. Concurrent goto still recovers via the hardened
loaderId/recent-response path. Swallow PlaywrightException when a child
frame AX capture is destroyed so iframe stubs can fall back.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Write empty videos via image2pipe; harden APIRequest abort RST.
Bundled ffmpeg often lacks lavfi, so empty recordings left no .webm.
Pipe a white JPEG through the same image2pipe path as live frames.
Also wait longer and RST sockets again after the abort gate so hang-
route servers see RequestAborted under Windows suite load.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix CA2025 in empty-video image2pipe writer.
Await stderr drain before disposing the ffmpeg Process.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fix WebKit child-frame goto lifecycle and WaitForRequest races.
Child frame.goto now waits on per-frame load/DOMContentLoaded instead of
polling readyState under concurrent hung navigations. SimpleServer buffers
early request arrivals so WaitForRequest still observes WebKit's fast
Playwright.navigate (ShouldReturnMatchingResponses).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Fail dead WebKit target wraps fast; exhaust data: goto waiters.
Darwin suite load can recycle the inner target so sendMessageToTarget
faults while the inner waiter hung for 20s. Fail those wraps immediately
and retry SyncBootstrap across replacement sessions. Also exhaust-complete
pending load waiters for data: navigations when readyState seed cannot run.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(testserver): snapshot WaitForRequest HttpRequest headers safely
Kestrel disposes the feature collection after the response, so tests that
retain HttpRequest from WaitForRequest and read Headers later can hit
ObjectDisposedException (ShouldSendExtraHeadersWithConnectRequest on
Windows headful). Snapshot the request while headers are live, copying
into a case-insensitive HeaderDictionary so "user-agent" lookups still
match wire casing.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): retry context init-script evaluate on new pages
NewPage about:blank exists before Page.setBootstrapScript can apply, so
ApplyInitScripts evaluates scripts on the current document. On Darwin a
transient evaluate failure was swallowed, leaving markers unset when the
follow-up about:blank goto is same-document. Retry evaluate for 5s before
soft-failing (AddInitScriptAsyncShouldApplyToNewPage flake on macOS CI).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): install context init scripts before Target.resume
NewPage was applying context AddInitScript only in ApplyContextChrome after
resume, so the first about:blank often missed Page.setBootstrapScript.
Darwin about:blank→about:blank is frequently same-document and does not
re-run bootstrap; a swallowed EvaluateOnCurrent failure then left
window.__fromContext unset (AddInitScriptAsyncShouldApplyToNewPage).
Mirror Chromium ApplyInitScriptsBeforeResumeAsync / upstream allInitScripts:
sync string init scripts into bootstrap before Target.resume, skip duplicate
ApplyAll on target recycle, and keep EvaluateOnCurrent as a post-resume backup.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): restore popup expose before resume; NewPage-only before-resume
Protocol popups install expose + init scripts in ApplyEmulationToPageAsync
before Target.resume so window.mul is defined. NewPage keeps
ApplyInitScriptsBeforeResumeAsync. When already installed, skip
EvaluateOnCurrent to avoid InitScriptShouldRunOnlyOnceInPopup double-fire.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): restore NewPage EvaluateOnCurrent after before-resume
Skipping EvaluateOnCurrent when scripts were already installed before
resume removed Darwin's post-resume evaluate retry (Mac locale WS shim /
target recycle), causing NUnit hangs in PressAsyncDispatchesKey and
EmulateMediaPrintMatches. Keep the skip only for protocol popups so
InitScriptShouldRunOnlyOnceInPopup still fires once.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): finish before-resume before InitializedTask
NewPage awaited InitializedTask then ApplyInitScriptsAsync while
ApplyInitScriptsBeforeResumeAsync could still be running, installing
the same string scripts twice into Page.setBootstrapScript
(ShouldBeCallableFromInsideAddInitScript saw context,context,page).
Signal InitializedTask only after before-resume (and resume), and mark
scripts installed when the full ApplyInitScripts path wins a race.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): timeout LocaleHandshakeProxy outbound connects
Darwin forces LocaleHandshakeProxy on every WebKit context. Unbounded
TcpClient.ConnectAsync to hosts like nonexistent.invalid can hang past
the 30s test budget so RequestFailed never fires for data:-page fetch
tests. Cap DNS+connect at 5s like WebKitMacProxyBypassShim.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): drop stale clock realtime + skip AddScriptTag preview
MacOS WebKit shard2 timed out on RunForShouldNotRunNestedImmediate when a
cancelled realtime embedder callback still started concurrent _runTo after
_innerPause, and on FrameAddScriptTag when fire-and-forget InitializePreview
callFunctionOn wedged Darwin alongside handle.EvaluateAsync.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): retain CSS sheets across nav; full SOCKS ClientHello for MITM
Windows headful shard failures: CSS coverage lost /one.css when
styleSheetAdded was dropped across navigations (seed from Network
responseReceived + await pending tracks), and TLS client-cert error
pages aborted on truncated SOCKS ClientHello (read full TLS record
before AuthenticateAsServer).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): tighter proxy connect budget; bound Darwin NewPage evaluates
Mac shards failed RequestFailedShouldFire when LocaleHandshakeProxy's 5s
connect CancelAfter raced the test's 5s CTS (abort DNS and return SOCKS
failure under 2s). LaunchAsyncHandleSIGTERMFalseShouldStartAPage hit empty
30s stacks when UA/WS shim evaluates hung on recycled targets — budget those
probes. Also stretch ToHaveText last-chance Actual read for Win headful.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): hide SW favicon events; prefer completed evaluate over destroy race
Windows headful recorded an extra service-worker favicon request in the
advanced SW network annotation table — filter favicon like page network.
WaitForURL ShouldWork failed when RaceDestroyedAsync threw on a concurrent
context destroy even though Runtime.evaluate had already completed for a
navigating script; prefer the completed CDP task.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): apply offline on provisional sessions like upstream
Mac shards timed out on ShouldEmulateNavigatorOnLineAcrossNavigations when
about:blank/data navigations swap targets without Network.setEmulateOfflineState.
Mirror upstream _initializeSession / _updateState: push offline to provisional
and re-apply on session init so navigator.onLine survives process-swap.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): recover aborted goto by loaderId; record late HAR failures
Win headful ShouldReturnFromGotoIfNewNavigationIsStarted still threw
ERR_ABORTED because IsUsableNavigationResponse ignored loaderId when URLs
were present. Prefer documentId match and pass it on the fast recover path.
Also materialize HAR entries when RequestFailed races ahead of Request so
failed CSS keeps _transferSize -1.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): avoid awaitPromise on clock pauseAt kickoff
Darwin WebKit PauseAtShouldJumpAndStayFrozen timed out because the
deferred clock kickoff contained Promise.then/async, so CanWrapExpression
forced EvaluateHandle + SerializeAwaitedJs (awaitPromise) and starved
embedder timers. Schedule via queueMicrotask with bracket then-access and
slow the poll loop.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): do not drop iframe FrameAttached when parent id is stale
Darwin mac shard1 hung on ContextFrameAttachedShouldFireOnIframe when
Page.frameAttached arrived with a parentFrameId not yet in the frame map
(main-frame id swap race). Fall back to the live main frame like a
same-page iframe, and accept parentId as an alternate wire name.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): schedule clock pauseAt via builtins.setTimeout macrotask
queueMicrotask can flush inside Darwin Runtime.evaluate before the call
returns, so pauseAt awaiting embedder.setTimeout deadlocks the same
evaluate (ClockInstallOptionsTests 30s hangs on mac shard2). Always kick
deferred controller work off builtins.setTimeout(0).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): skip style-tag preview; start thenable evaluate before Yield
AddStyleTag content handles used InitializePreview callFunctionOn, which
wedged Darwin WebKit sessions (mac shard2 30s hangs cascading into later
timeouts). Skip preview like AddScriptTag.
For Promise evaluates, send Runtime.evaluate before Task.Yield so
Clock.RunForAsync racing after `Task t = page.EvaluateAsync(...)` sees
fake timers already scheduled — fixes ReplacesGlobalPerformanceNow
awaitPromise timeouts when Yield-before-send let RunFor finish first.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): aria iframe stitch budget; faster TLS error-page MITM
Windows CI tip failures: ShouldPersistIframeReferences left empty iframe
lines when the shared 3s page budget was spent before multi-srcdoc stitch,
and BrowserShouldNotHangOnTlsErrorsDuringTls12Handshake aborted when the
origin handshake delayed the client-cert error page past Chromium's SOCKS
timeout. Refresh stitch budget for iframe YAML, wait for same-origin
iframe bodies, retry multi-iframe stitch by DOM index, shorten the MITM
origin handshake to 2s, accept 503 error-page responses on aborted
recovery, and ignore chrome://crash fallbacks after the page has closed.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: drain Load before clickload; emit dialogs sync when listeners exist
Windows tip failures: ShouldWorkWithWaitForLoadStateLoad recorded
clickload before load when Task.Delay(1) returned under suite load
before Page.Load RCA continuations. DialogAcceptShouldWork hung 30s
when Dialog emit was deferred via Task.Run while Click waited on the
alert. Strengthen LifecycleWaiter drain and raise Dialog immediately
when page/context listeners are already attached.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: bound toHaveURL aria snapshot; recover ERR_SOCKET_NOT_CONNECTED
Mac WebKit CI hung ToHaveURLResolvePredicateAfterRetries for the full
NUnit 30s when expect timed out and SnapshotAccessibility raced a
delayed Task.Run GoTo. Bound the failure-path aria snapshot (2s) and
keep accepting a late FrameNavigated URL match while it runs.
Also treat net::ERR_SOCKET_NOT_CONNECTED like other aborted navigations
so the client-cert MITM error page can recover under Ubuntu headful
(BrowserShouldNotHangOnTlsErrorsDuringTls12Handshake).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: harden abort-nav recovery, cert MITM proxy hop, click waits
Recover ERR_ABORTED goto when loaderId disagrees with the Network
document id by URL-matching the committed response. Force IPv4 when
ClientCertificatesProxy connects to a localhost user/env proxy, and
strip inherited HTTPS_PROXY from the browser process. Do not arm
navigable click waits on transient evaluate failure. Expire both
trailing-slash cookie path variants on clear.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: drop late willCheck retains; keep cert MITM accept loop alive
Non-navigating clicks keep dropping orphaned WebKit policy retains
while the signal barrier waits so a late willCheck cannot burn the
scroll:none budget. ClientCertificatesProxy AcceptLoop survives
transient SocketExceptions, and outbound proxy connects use
FormatServer plus a 2s budget.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: defer WK replace-nav interrupt; recompute expect Pass after Actual recovery
Queue competing-navigation TrySetException off the sync NavigateAsync
stack so route callbacks can assign anotherPromise before CatchAsync
observes the fault. After a last-chance toHaveText Actual probe, recompute
matched so not.toHaveText MatcherResult.Pass stays true under 1ms timeouts.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: scope aria DomIndex stitch; harden MITM error-page tunnel races
Nested iframe DomIndex retries used page-level FrameLocator.Nth, which
restitched top-level siblings under Windows load. Prefer http/1.1 for
cert MITM error pages but echo h2 when that is all the ClientHello
offered; shorten origin handshake cancel; soft-grace ERR_SOCKET_NOT_CONNECTED
gotos so the HTML error document can still commit.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: drop MITM goto soft-grace that hung on empty frame.Url
The ERR_SOCKET_NOT_CONNECTED soft-recover treated empty/about:blank
frame URLs as committed and then waited out the full navigation
timeout (NUnit 30s). Keep paint-side MITM hardening and Network
URL-only abort recovery instead.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: popup dialog init, goto abort recovery, video offload, WK redirects
Report popups before post-resume evaluate so inline prompt() cannot
deadlock WaitForPage. Recover ERR_ABORTED goto via parallel ring poll
and TracksDocumentNavigation. Deliver screencast frames off the CDP
loop without per-frame Flush. Finish WK redirect hops without
duplicate or missing RequestFinished events.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: enable worker Network with Runtime; bound popup getFrameTree
PlzDedicatedWorker fetches the nested worker main script while paused;
awaiting Runtime.enable before Network.enable dropped RequestFinished
under CI load. Bound popup getFrameTree so inline prompt cannot stall
reportAsNew.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): await worker Network.enable; seal nested ExtraInfo
PlzDedicatedWorker delivers nested-worker loadingFinished on the worker
session. AddWorkerSessionAsync no longer swallows a 3s Network.enable
timeout before resume. Seal provisional response headers when Chromium
sets hasExtraInfo without responseReceivedExtraInfo (playwright#39948).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): arm worker Network.enable on attach; seal ExtraInfo sync
Start AddWorkerSessionAsync from OnAttachedToTarget/AttachChildWorker
before any async yield so PlzDedicatedWorker loadingFinished is not
raced. Seal provisional response headers synchronously when hasExtraInfo
lacks responseReceivedExtraInfo (avoid thread-pool-starved deferred seals).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): drop accidental NoteDialogOpened from worker attach fix
Keep PlzDedicatedWorker Network.enable-on-attach; remove the unrelated
dialog commit helper that broke SA1202 (internal after private).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): resume workers without awaiting Network.enable ack
Match official attach order: Network.enable is sent on attach with
listeners registered, then resume without awaiting enable. Avoids rare
CI hangs when Network.enable stalls while PlzDedicatedWorker script
traffic already finished.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* Revert "fix(chromium): resume workers without awaiting Network.enable ack"
This reverts commit 75f0298dc2eab3f6e8e7268abfd5fc7af42740ea.
* fix(webkit): retry SetContent evaluate after process-swap dispose
SendEvaluateAsync mapped TargetClosed from a disposed provisional session
as a hard page close. Remap like EvaluateHandleAsync and retry
EvaluateInFrameAsync on the replacement world so
BrowserContext.Events.Response SetContent survives Linux CI process-swap
races. Also fold held NoteDialogOpened popup dialog report and WebKit
redirect RequestFinished emit fixes.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): return 401 from goto auth; keep WK popup contexts
IsUsableNavigationResponse rejected 401, so cross-process credential
gotos recovered a prior localhost 200 after 127.0.0.1→localhost URL
normalization. Accept final non-redirect statuses.
Also stop dropping WebKit execution contexts solely because the target
session looks disposed, and do not MarkDestroyed on "context not yet
available" evaluate retries — that cleared about:blank popup worlds on
macOS (ShouldExposeFunctionsInPopups).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): do not destroy execution worlds on evaluate retry
EvaluateInFrameAsync remapped TargetClosed to a navigation error and then
MarkDestroyed the frame world. about:blank popups never received a
replacement Runtime.executionContextCreated, so mac CI hung on
ShouldExposeFunctionsInPopups / InitScriptShouldRunOnlyOnceInPopup /
ShouldWorkWithoutNavigationInPopup. Retry with a short delay only;
process-swap already clears contexts.
Also restore the simple TryGetFrameContext lookup.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: recover MITM TLS abort, WK blank/NewPage races, concurrent goto
Paint client-cert error pages before Chromium SOCKS patience expires,
restore a safe MITM soft-grace that rejects empty frame URLs, and widen
aborted-goto response recovery. Soft-tolerate WK bootstrap close during
NewPage chrome (with one retry) and seed file→about:blank when navigate
wedges on Darwin.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): return early after MITM soft-grace lifecycle settle
Avoid falling through into the full navigation-timeout lifecycle wait
when a client-cert tunnel abort already looks committed — that path
recreated the NUnit 30s hang under suite load.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): harden MITM abort commit check and concurrent-goto recovery
Accept ERR_ABORTED navigate when a usable document response is already
committed; prefer usable Network responses when loaderId points at an
aborted stub; tighten MITM soft-grace to lifecycle/503 (not URL-only).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): return final response after redirect capture latch
The concurrent-goto OnResponse guard latched on intermediate 3xx
responses whose URL matched the goto target, blocking the redirect
destination 200. Only protect final document captures, walk the
redirect chain on return, and give client-cert handshakes 550ms before
ForceClose so Windows suite load does not ERR_PROXY_CONNECTION_FAILED.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): defer ExtraInfo header seal; prefer ExtraInfo pairs
Immediate provisional seal on loadingFinished raced responseReceivedExtraInfo
and locked comma-joined Network.responseReceived headers into HeadersArray
(ShouldReportAllHeaders on Windows). Restore a 750ms deferred seal and let
ApplyExtraHeaders upgrade WaitForRawHeadersAsync after a provisional seal.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(video): serialize empty-recording finalize; await shared Stop
Concurrent page-close StopAsync callers could return before WriteWhiteVideo
finished, and back-to-back no-frame ffmpeg launches under Windows suite load
could drop a .webm. Share one stop task, serialize white-frame encodes, and
fall back to a minimal WebM placeholder when ffmpeg fails
(ShouldCloseFfmpegEvenIfThereWereNoFrames).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(dialog): sync waitForEvent match; replay open under ScheduleOpen defer
macOS WebKit shard5 hung ContextWaitForDialogShouldResolveOnAlert for 30s
with an empty NUnit stack. Resolve dialog waits inline (like Load) so the
TCS completes during RaiseDialog, replay still-open dialogs after subscribe
when ScheduleOpen deferred the raise, and give ScheduleOpen a 1ms turn so
waiters can attach before auto-dismiss under suite-load pressure.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium,webkit): stage downloads away from .crdownload; retry WK TargetClosed
Chromium allowAndName writes into .pw-pending and promotes finished files into
DownloadsPath so Windows directory polls never open a locked .crdownload
(LaunchPersistent AcceptDownloads). PathAsync still tracks the browser artifact
so page-close cleanup keeps working.
WebKit RaceDestroyed maps session-swap TargetClosed to the navigation
destroyed-context error, and selector waits retry TargetClosed mid-probe
(ViewScaleShouldResetAfterNavigation). Slightly widen aborted-navigate response
wait for concurrent-goto recovery under Windows suite load.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(networkidle,downloads): keep waiting when idle revoked; atomic promote
Recalculate networkidle on frame attach and inflight request start, wake
lifecycle waiters when networkidle is removed, and stage download promotes
via temp+rename so Windows directory polls never read a mid-copy lock.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): poll for committed response on concurrent-goto ERR_ABORTED
Page.navigate can report ERR_ABORTED before the document request is in
the recent ring under Windows suite load. Keep polling URL/loaderId for
a usable committed response instead of giving up immediately.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium,certs): recover concurrent-goto commits; prefer TLS auth errors
Accept Page.navigate ERR_ABORTED when FrameNavigated already committed the
document, and track Fetch-paired / type-omitted main-frame navigations so
the document 200 stays findable under Windows suite load. On MITM handshake
budget expiry, prefer AuthenticationException text so HTTP/2 self-signed
origins still paint "self-signed certificate".
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): back off clock poll so Darwin timers can drain
After scheduling clock pauseAt/runFor/fastForward on builtins.setTimeout(0),
wait before polling and increase the poll delay so Runtime.evaluate does not
starve embedder timers under macOS WebKit suite load
(RunForShouldAcceptMinuteSecondString).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): avoid awaitPromise on sync handle evaluates
Darwin WIP can wedge on Runtime.callFunctionOn awaitPromise:true for
sync STYLE/SCRIPT handle reads (mac shard2 ShouldReturnStyleElementHandle
30s empty-stack timeouts cascading into Launch/GoTo hangs). Evaluate
handles with awaitPromise:false first and only await thenables, matching
GetPropertyOnHandleAsync. Align AddStyleTag inline content with the
AddScriptTag path and bound sentinel polls so hung evaluates cannot
outlive their timeout.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): Yield before replace-nav interrupt fault
ThreadPool.QueueUserWorkItem still raced CatchAsync on Darwin under suite
load so anotherPromise stayed null in ShouldFailWhenReplacedByAnotherNavigation.
Await Task.Yield before TrySetException so NavigateAsync returns its Task
to the hanging route callback first.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): skip pre-resume UA evaluate; budget EvaluateOnCurrent
Darwin ApplyEmulation runs before Target.resume; probing/stamping
navigator.userAgent on a paused target wedges Runtime.evaluate for the
full 20s WKSession timeout and eats LaunchAsyncHandleSIGINTFalse's
NUnit 30s budget. Defer UA probes/stamps until InitializedTask completes,
bound stamp evaluates, and cap EvaluateOnCurrent attempts with WhenAny.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): latch document 200 after late Fetch promotion
Windows headful shard4 failed ShouldReturnFromGotoIfNewNavigationIsStarted
with ERR_ABORTED when responseReceived beat Fetch Document promotion, so
the committed 200 never entered the recovery ring. Latch the existing
response on promotion, treat main-frame Other/empty-type GETs as document
navigations, and adopt those URL matches in TryFindNavigationRequest.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): honor networkidle revoke; bound trace screenshots
GoToFrameAsync only treats lifecycle as ready while currently present and
re-waits after a revoked networkidle, matching SetContent. Trace action
screenshots use raw CDP with a hard budget so abandoned WaitForFonts
cannot deadlock ScreenshotGates across before/action/after phases.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): networkidle-only revoke wait; keep load fast-path
The previous GoToFrameAsync wait loop treated any lifecycle Contains as
done and skipped waiting when a stale load was still latched, breaking
normal navigations. Scope revoke-safe waiting and Contains-only
fast-path to networkidle; leave load/domcontentloaded on sawTargetLifecycle.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: Darwin bare-eval wrap, element shot wait order, frame eval retry
Route bare expressions like `1 + 1` through returnByValue serialize so
Darwin avoids MaterializeAsync awaitPromise wedges. Wait for element
visibility before screenshot decorations/fonts, and shorten the fonts
budget. Retry destroyed-context frame evaluates after iframe goto.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: narrow bare-eval wrap; wait stable after animations
Broad CanWrapExpression wrapping of any semicolon-free expression
routed property-access evaluates (e.g. document.body.textContent)
through returnByValue serialize and caused Darwin WebKit empty-stack
timeouts. Keep wrapping only simple sync expressions like `1 + 1`.
Remove the pre-CaptureAsync Stable wait so infinite CSS/Web animations
can be frozen inside CaptureAsync before visibility/stable checks.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): harden filtered clearCookies expire-in-place
Darwin CFNetwork can leave document.cookie rows after a single
expires:0 setCookies. Re-expire until getAllCookies is clean, expire
leading-dot domain variants, and clear matched non-HttpOnly names via
document.cookie Max-Age=0 on open pages (ShouldRemoveCookiesByNameRegex).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: retry screenshot mid-nav; avoid awaitPromise on primitives
Treat WebKit "Execution context is not yet available" as a destroyed/
navigating race so screenshot decorations retry and surface the official
navigating error (ShouldWorkWhileNavigating). MaterializeAsync now reads
inline number/boolean/string payloads instead of SerializeAwaitedJs,
avoiding Darwin awaitPromise wedges on Date.now() / matchMedia. Cookie
document.cookie clears use a wrappable IIFE.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): wrap sync IIFEs; strip trailing semicolons for serialize
Allow CanWrapExpression on sync IIFEs even when the body mentions
Promise/.then so clock kickoff stays on returnByValue and does not
deadlock Darwin awaitPromise. Strip trailing semicolons before
parenthesizing in WithSerializedResult so injectors like
`(() => {…})();` stay valid.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix: latch doc responses; keep drag setup off main world; sync unnamed cookies
Promote and latch main-frame GET document responses even before Fetch
marks TracksDocumentNavigation so concurrent-goto ERR_ABORTED recovery
still finds the committed 200 under Windows suite load.
Never fall back to the page main world for HTML5 drag setup/cleanup —
that drops textarea text selection on headful Chromium.
On Linux WebKit, reconcile empty-name cookie values from live
document.cookie into CookiesAsync so Cookies→AddCookies roundtrips do
not resurrect a stale protocol value.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): wait for peer navigate before superseding GoTo
Under Windows suite load a second Page.navigate can abort the first before
Network.requestWillBeSent / frameNavigated, so concurrent-goto recovery never
sees the committed 200. Track in-flight frame navigations and wait for the
peer to start (and briefly for commit) before sending a superseding navigate;
hung cancel/replace peers still abort after a short grace.
Also flush handleJavaScriptDialog without an async state machine so
fire-and-forget Accept from Dialog handlers schedules the CDP write promptly.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): require live lifecycle after GoTo; replay data: load
sawTargetLifecycle could stay true after a later frameNavigated cleared
LifecycleEvents to only commit, so GoTo returned without load present
(GoToShouldClearLifecycleOnNewNavigation under Windows suite load).
Require the target lifecycle to be currently recorded, reset the mid-
navigate saw flag on new-document commits, and replay DCL/load for data:
URLs that commit without a second loadEventFired.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): restore sawTargetLifecycle GoTo fast-path with FrameNavigated reset
Require live lifecycle only for networkidle; keep sawTargetLifecycle OR
Contains for other events so MITM/TLS and dialog paths do not hang, while
clearing sawTargetLifecycle on new-document FrameNavigated and replaying
data: DOMContentLoaded/load so GoToCannotClearLifecycle flakes stay fixed.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): replay GoTo load when FrameNavigated wipes lifecycle
Keep sawTargetLifecycle OR Contains for non-networkidle so MITM/TLS
does not hang, but when GoTo resolves with only {commit} left in
LifecycleEvents, replay DOMContentLoaded/load so EmptyPage assertions
and waitUntil stay honest after a mid-wait FrameNavigated clear.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): keep lifecycle across same-loader FrameNavigated
Skip ClearLifecycleEvents when frameNavigated repeats the same loaderId
so a late re-commit cannot wipe load after GoTo resolved. Also ensure
promised DCL/load is recorded on successful GoTo exit (including MITM).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): reject oversized screenshots before CDP capture
Validate full-page/clip dimensions against the 32767 device-pixel cap
(same as WebKit) so a too-tall capture throws PlaywrightException instead
of crashing the page, allowing scale:css retries to succeed.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): defer navigation requestfinished until Response is set
loadingFinished can race ahead of responseReceived on redirect hops and
emit DONE before the 302 Response event. Skip the page requestfinished
while Response is null so ShouldSupportRedirects sees GET,302,DONE.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): keep deferred nav requests for late Response + snap SSL timing
loadingFinished removed navigations from the request map before Response
arrived, so deferred requestfinished never resumed after fulfill/redirect
races (RouteRequestUrl hang). Keep the entry until Response is attached.
Also snap RequestStart/ResponseStart forward when WebKit float-rounds SSL
timings a few sub-ms out of order (ShouldWorkForSsl).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): park deferred nav finishes off the live request map
Keeping Response-less finished navigations in _requestsById blocked
WebKit requestId reuse and hung later navigations (macOS IsVisible
data: GoTo timeout). Park them in a side map so late Response/DONE
still attach without colliding with new requests.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): broaden data: GoTo lifecycle replay after navigate
Require only a missing waitUntil event — not commit/DocumentId parity —
so persistent+HAR data: navigations under CI load do not hang when
FrameNavigated races Page.navigate (ShouldHavePagesInPersistentContext).
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): clear deferred-nav inflight idempotently
Deferred navigation requestfinished left requests counted as inflight until
a late Response path ran, which could wedge networkidle / provisional-swap
commit under CI load. Clear inflight on defer, track request ids so finish
is idempotent, and reset page inflight on cross-document navigations.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): gate data: GoTo lifecycle replay on landed nav
Replaying load before FrameNavigated could complete GoTo while the browser
was still on about:blank, so QuerySelector returned null
(FillAsyncSetsInputValue on Windows CI). Require commit, DocumentId match,
or a data: frame URL before replaying — without requiring all of them, so
persistent+HAR races that skip a fresh commit still complete.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): confirm data: GoTo via readyState when events lag
After gating lifecycle replay on landed navigation, persistent data: GoTo
under Windows suite load could hang the full timeout when FrameNavigated
and commit never arrived (DialogAcceptShouldWork). Poll location.href and
document.readyState briefly so a usable data: document still completes
GoTo without replaying against about:blank.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(chromium): ignore stale commit when gating data: GoTo
LifecycleEvents still contains commit from about:blank until
FrameNavigated clears it, so treating commit alone as landed made
GoTo return before the data: DOM existed (PressAsyncDispatchesKey).
Require DocumentId/URL match or evaluate readyState confirmation.
Co-authored-by: Darío Kondratiuk <dariokondratiuk@gmail.com>
* fix(webkit): further back off clock poll under Darwin suite load
Increase initial settle and poll delay after scheduling runFor/pauseAt
on builtins.setTimeout so Runtime.evaluate does n…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: blocked on repo access
The first revision incorrectly imported
microsoft/playwright-dotnetbecause this agent cannot seehardkoded/playwright-sharp. That import has been reverted.GitHub returns 404 for private repos the token cannot access. This Cloud Agent’s GitHub App installation only includes
hardkoded/playwright-native.What I need
Grant this agent read access to
https://github.com/hardkoded/playwright-sharp, then send a follow-up:playwright-sharpto the same Cursor GitHub App installation that already hasplaywright-nativeGitHub → hardkoded org → Settings → GitHub Apps → Cursor → Repository access → add
playwright-sharpreporead access tohardkoded/playwright-sharpAfter that I will copy the full private source tree into this repo and update this PR.