Skip to content

Add: httpOnly cookie support#60

Open
liyuankui wants to merge 2 commits intoepiral:mainfrom
liyuankui:fix/pure-cdp-cookies
Open

Add: httpOnly cookie support#60
liyuankui wants to merge 2 commits intoepiral:mainfrom
liyuankui:fix/pure-cdp-cookies

Conversation

@liyuankui
Copy link
Copy Markdown

@liyuankui liyuankui commented Mar 18, 2026

Summary

  • Add cookies CLI command for reading cookies through CDP, including HttpOnly flags and full cookie metadata
  • Main branch has basic cookies support in daemon (cmdGetCookies), but only returns 4 fields (name, value, domain, path)
  • This PR adds CLI access + extends to full metadata (httpOnly, secure, sameSite, expires)
  • Avoid attaching default page before tab_* and cookies, preventing Arc timeouts on non-page-first target lists

What changed

  • Add cookies get|getByName|httpOnly to CLI
  • Extend shared response types with full cookie payloads (not just 4 fields)
  • Fetch cookies through page WebSocket via Network.getCookies
  • Handle tab list and cookies before default page attach

Comparison with main branch

Feature Main branch (daemon only) This PR (CLI)
CLI access ❌ No ✅ Yes
HttpOnly field ❌ No ✅ Yes
Secure field ❌ No ✅ Yes
SameSite field ❌ No ✅ Yes
Expires field ❌ No ✅ Yes
Subcommands ❌ No ✅ getByName, httpOnly filter

Validation

  • npm run build
  • npm test
  • bb-browser --port 9222 --json tab list
  • bb-browser --port 9222 --tab <tab-index> --json cookies httpOnly
  • bb-browser --port 9222 --tab <tab-index> --json cookies getByName <cookie-name>

Locally re-checked with the bb-browser CLI form against an Arc instance on port 9222.

Closes #57

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@liyuankui liyuankui force-pushed the fix/pure-cdp-cookies branch from 7025535 to 0265818 Compare March 18, 2026 02:55
@liyuankui liyuankui changed the title Add: pure CDP cookies command Add: httpOnly cookie support Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bb-browser 是否有办法提取 httponly 的 cookie?

1 participant