feat(hybrid): expose the crawl's BrowserContextID - #1839
Conversation
Neo - PR Security ReviewNo exploitable security issues in this delta — the two changed lines are a blank-line removal and a doc-comment reword with zero impact on behavior or attack surface. What Neo reviewed
Comment |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. WalkthroughThe crawler now exposes its browser context ID through a new exported method. The method returns an empty string when no browser is configured. ChangesBrowser context access
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to This is a small read-only API addition with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
A rabbit hops where browser contexts glow Comment |
New creates a browser context per crawler but never surfaces its id, so an embedding program cannot dispose the context out of band. That matters against a shared, long-lived browser reached over -chrome-ws-url: if a crawl's process dies without running Close, the context stays resident and consumes the browser's memory for a crawl that no longer exists. Adds a read-only accessor; no behaviour change.
b8cd277 to
f992703
Compare
Proposed changes
hybrid.Newcreates a browser context per crawler (Target.createBrowserContext, since #1751) but the id is never exposed, so a program embedding katana cannot dispose that context out of band.That matters when katana attaches to a shared, long-lived browser over
-chrome-ws-url: if a crawl's process dies without reachingClose, the context stays resident and holds the browser's memory for a crawl that no longer exists. With the id recorded, a supervisor can reap orphaned contexts.Read-only accessor, 11 lines, no behaviour change.
Checklist
go build ./...,go vet ./pkg/engine/hybrid/)Summary by CodeRabbit