CDP Integration¶
Stargrazer communicates with Chromium via the Chrome DevTools Protocol over WebSocket.
Connection Flow¶
- Browser starts with
--remote-debugging-port=9222 - App polls
http://127.0.0.1:9222/jsonfor available targets - Connects to page or service worker targets via WebSocket
- Sends CDP commands as JSON messages with incrementing IDs
Cookie Operations¶
Reading (via extension)¶
The cookies extension's service worker has access to chrome.cookies.getAll():
// Executed via Runtime.evaluate on the extension's service worker
const cookies = await chrome.cookies.getAll({domain: ".facebook.com"});
return JSON.stringify(cookies);
Writing¶
Cookies are injected via Network.setCookie:
{
"method": "Network.setCookie",
"params": {
"name": "c_user",
"value": "100000856037530",
"domain": ".facebook.com",
"path": "/",
"secure": true,
"url": "https://www.facebook.com/"
}
}
Netscape Format Parsing¶
Users paste cookies in Netscape/curl format:
Fields: domain, includeSubdomains, path, secure, expiry, name, value (tab-separated).
Navigation¶
New tabs are created via the HTTP endpoint:
Page navigation uses Page.navigate:
Stealth Flags¶
Key flags applied to hide automation:
--disable-blink-features=AutomationControlled— Removesnavigator.webdriver--disable-infobars— No "controlled by automation" bar--disable-features=AutomationControlled— Removes feature flag