Major improvements for adding new Google accounts:
1. Temporary profile for new accounts:
- Create isolated temp directory with tempfile.mkdtemp()
- Avoids Chrome profile switching when signing into different account
- Auto-cleanup after authentication completes
2. CDP-based cross-window detection:
- Use Chrome DevTools Protocol to detect NotebookLM pages
- Works even when Chrome opens new windows during login
- Target.getTargets finds pages across all Chrome windows
3. Multi-tab monitoring:
- Check all pages in context, not just the first one
- Handle Google's multi-tab login flow correctly
4. Session capture from other windows:
- Navigate controlled page to NotebookLM after CDP detection
- Extract cookies (session shared across windows)
Co-Authored-By: Claude <noreply@anthropic.com>
Google blocks personal Gmail sign-in with Playwright's bundled Chromium,
showing "This browser or app may not be secure" error. This commit:
- Add patchright_auth.py module using anti-detection Playwright fork
- Route Google auth through Patchright in auth_manager.py
- Add patchright>=1.50.0 to requirements.txt
- Fall back to agent-browser if Patchright unavailable
Key anti-detection techniques:
- ignore_default_args=["--enable-automation"]
- --disable-blink-features=AutomationControlled
- Uses real Chrome via executable_path
- Persistent context for session management
Co-Authored-By: Claude <noreply@anthropic.com>