Feature request: suppress the brief visible Chromium window flash during headed login / cookie refresh
Summary
On macOS, during login / re-login / "Refresh state", the bundled Chromium ("Google Chrome for Testing" via patchright) opens a visible window for ~1–2 seconds before minimizing, then proceeds. Normal searches are already fully headless and show nothing — this flash only occurs on the headed cookie-grab path. It's cosmetic but distracting, especially when the daemon refreshes the session while the user is working.
Environment
- Extension:
Nskha.perplexity-vscodev0.8.44 - OS: macOS (Apple Silicon)
- Browser runtime: Bundled Chromium (Google Chrome for Testing 147.x), patchright v1.59.4
- Launch already includes
--start-minimized, but Chromium still paints the window briefly before honoring it.
What I'd like
An option to make the headed login/refresh launch non-visible or off-screen, e.g. one of:
- A setting / env var (e.g.
PERPLEXITY_LOGIN_OFFSCREEN=1) that positions the window off-screen via--window-position=-32000,-32000(and/or--window-size=1,1) during the cookie-grab, then restores for any step that truly needs user interaction (Cloudflare challenge / OTP). - Or use
--headless=newfor the refresh path when a valid Cloudflare clearance is already cached, falling back to headed only when a challenge is actually required.
Why
The Cloudflare/Turnstile step genuinely needs a real browser on first login, but subsequent refreshes (when clearance is cached) shouldn't need to flash a visible window. Suppressing the flash on the cached-refresh path would make background session maintenance invisible, matching the already-headless search experience.
Notes
--start-minimized is passed today but doesn't prevent the initial paint on macOS. An off-screen position or --headless=new (clearance-cached path only) would.
Thanks for the detailed report and the concrete suggestions — the off-screen-position idea is the route we took.
Diagnosis
There were actually two headed-launch paths painting a window, and your report caught both:
- Login / re-login / "Refresh state" (auto-OTP runner) — launched headed with
--start-minimized, then minimized via CDP after navigation. macOS paints the window before honoring--start-minimized, so it flashed ~1–2s "before minimizing", exactly as you described. - Daemon background session refresh — the Cloudflare-solving bootstrap had no positioning at all and never minimized, so it stayed fully visible for the whole solve. That's the "flash while the daemon refreshes the session while you're working" part.
Fix
Both headed cookie-grab paths now create the window off-screen from the first frame via --window-position=-32000,-32000, so there's no visible paint at all. The already-headless search path is unchanged.
We deliberately went with off-screen positioning rather than --headless=new or --window-size=1,1: a true-headless or 1×1 fingerprint is a Cloudflare/Turnstile bot tell, and an off-screen-but-normal window is actually safer than the old minimize — it keeps document.visibilityState === "visible" and isn't timer-throttled, whereas a minimized window reports "hidden". The interactive manual login window (where you may need to solve a real CF challenge or type an OTP directly in the browser) is intentionally left visible.
Landing in v0.8.45
Verified on Windows (unit + integration tests); the macOS "no-flash" behavior will be confirmed in the pre-release VSIX smoke.
One caveat worth flagging: --window-position is reliably honored on macOS and Windows, but on Linux/Wayland some compositors ignore client-side window placement. It's still a strict improvement there (the window was already fully visible before), but if anyone sees a residual flash on Wayland, please open a follow-up and we'll add a CDP-minimize backstop for that path.