Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make --timeout option consistent across all commands (including javascript) #118

Open
beetleb opened this issue Sep 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@beetleb
Copy link

beetleb commented Sep 9, 2023

Currently the javascript command doesn't support a timeout option.

(Wider context: I'm trying to use Readability as you described here).

@simonw simonw added the enhancement New feature or request label Mar 9, 2024
@simonw
Copy link
Owner

simonw commented Mar 9, 2024

Huh, right now the sub-commands shot and multi and accessibility have the --timeout option but javascript and html and pdf do not.

@simonw simonw changed the title Add --timeout to javascript command Make --timeout option consistent across all commands (including javascript) Mar 9, 2024
@simonw
Copy link
Owner

simonw commented Mar 9, 2024

It's used like this:

context = browser_obj.new_context(**context_args)
if timeout:
context.set_default_timeout(timeout)

So it needs to be passed like this:

with sync_playwright() as p:
context, browser_obj = _browser_context(
p,
auth,
scale_factor=scale_factor,
browser=browser,
browser_args=browser_args,
user_agent=user_agent,
timeout=timeout,
reduced_motion=reduced_motion,
auth_username=auth_username,
auth_password=auth_password,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants