notebookVB

This commit is contained in:
2026-06-01 07:24:46 +02:00
parent e3522f4017
commit 5073c01692
8 changed files with 1056 additions and 261 deletions
+2 -2
View File
@@ -50,11 +50,11 @@ def api_login(context: BrowserContext) -> int:
return resp.status
def ensure_logged_in(pw) -> tuple[BrowserContext, Page]:
def ensure_logged_in(pw, headless=False) -> tuple[BrowserContext, Page]:
auth_path = Path(AUTH_STATE_PATH)
have_state = auth_path.exists()
browser = pw.chromium.launch(headless=False, args=["--start-maximized"])
browser = pw.chromium.launch(headless=headless, args=["--start-maximized"])
ctx_args = {"no_viewport": True}
if have_state:
ctx_args["storage_state"] = AUTH_STATE_PATH