Usage
🚀 Launch
powershell
powershell -ExecutionPolicy Bypass -File .\scripts\launch_logged_in_chrome.ps1🧹 Close the dedicated browser
powershell
powershell -ExecutionPolicy Bypass -File .\scripts\close_logged_in_chrome.ps1⚙️ Use a custom profile directory or port
powershell
powershell -ExecutionPolicy Bypass -File .\scripts\launch_logged_in_chrome.ps1 `
-UserDataDir "D:\Prj\my-google-agent-profile" `
-Port 9333 `
-Url "https://mail.google.com/"🔄 Typical automation flow
- Launch dedicated Chrome
- Log into Google manually
- Check the CDP port
- Attach Playwright
- Navigate to Gmail or another Google app
- Keep reusing the attached browser for follow-up tasks
✉️ Example Gmail navigation
javascript
await attachedPage.goto("https://mail.google.com/mail/u/0/#inbox", {
waitUntil: "domcontentloaded",
});