You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds support for the Disposable return type that 12 driver methods now
return as of 1.59.1, so users can use them as context managers:
async with await page.route("**/*", handler):
...
# handler is automatically unrouted on exit
Affected methods (Page & BrowserContext): add_init_script,
expose_binding, expose_function, route. Plus Tracing.group and
Screencast.{start,show_overlay,show_actions}.
Two flavors:
- Disposable(ChannelOwner) wraps a driver-side Disposable channel
(used where the protocol returns one, e.g. addInitScript).
- DisposableStub is a Python-side wrapper that calls a dispose lambda
on exit (used for client-side pairings like route/unroute and
tracing.group/group_end).
Codegen rewrites both classes to AsyncContextManager/SyncContextManager
in the generated public API so consumers see standard Python types.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments