update refactoring and add new features

This commit is contained in:
2026-07-24 20:55:58 -07:00
parent 7f12bc7f40
commit 03fbbbcf28
69 changed files with 16332 additions and 17600 deletions
+3
View File
@@ -7,7 +7,10 @@ import `plugins.playwright` even when Playwright itself is not installed.
from __future__ import annotations
from .runtime import USER_AGENT
__all__ = [
"USER_AGENT",
"PlaywrightTimeoutError",
"PlaywrightTool",
"PlaywrightDefaults",
+8 -5
View File
@@ -65,15 +65,18 @@ def _find_filename_from_cd(cd: str) -> Optional[str]:
return None
USER_AGENT = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/120.0.0.0 Safari/537.36"
)
@dataclass(slots=True)
class PlaywrightDefaults:
browser: str = "chromium" # chromium|firefox|webkit
headless: bool = True
user_agent: str = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/120.0.0.0 Safari/537.36"
)
user_agent: str = USER_AGENT
viewport_width: int = 1920
viewport_height: int = 1080
navigation_timeout_ms: int = 90_000