mirror of
https://github.com/browser-use/browser-use.git
synced 2026-09-14 19:59:47 +08:00
4573b5222f
Pyright / code-style CI on PR #4681 flagged two issues, both real and from this patch: 1. Page.handleFileChooser isn't exposed by cdp_use's PageClient, so the attribute access fails type checking. It isn't needed either: per CDP spec, Page.setInterceptFileChooserDialog(true) alone causes Chromium to suppress the native dialog ("native file chooser dialog is not shown"). The page simply sees no file selected, which is the desired behavior when no upload is in flight. 2. The Page.fileChooserOpened callback signature is sync (FileChooserOpenedEvent, Optional[str]) -> None, not async. Simplify the patch to the minimum required: just enable interception. The protection is unchanged — Chromium still blocks the modal dialog that would wedge the renderer. Drop the custom handler entirely since the interception flag itself delivers the fix and no downstream logic needs a synthesized cancel.