You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(headless): drop dead chrome pid kill code - #2761
Comments only. Checked on macOS: after a SIGKILL of httpx during a screenshot, its Chrome processes exit, so the PID kill fallback is not needed. Conflicts with #2559 are expected; I will rebase after it lands.
Summary by CodeRabbit
Updates
Browser startup now uses an installed browser on local setups and systems detected as using musl; other environments continue to use the downloaded Chromium browser.
When an installed browser is required but unavailable, browser startup now returns an error instead of proceeding.
No actionable comments were generated in the recent review.
Walkthrough
Headless browser startup uses Leakless. Browser selection uses an installed browser when useLocal is true or the host is detected as musl; otherwise, it uses go-rod’s downloaded Chromium. The change also removes commented-out Chrome PID tracking and cleanup code.
Changes
Headless browser lifecycle
Layer / File(s)
Summary
Browser selection, startup, and cleanup runner/headless.go
Browser selection uses an installed browser for local-browser or musl hosts. Startup enables Leakless(true). The code removes commented-out Chrome PID tracking and cleanup. Browser.Close still closes the browser engine and removes the temporary directory.
projectdiscovery/httpx#2734: Moves screenshot and browser code to the ProjectDiscovery rod fork, whose process-group cleanup is cited as the basis for removing the PID-kill code.
Merge Risk: Minimal · up to dea5e
This PR deletes dead, commented-out Chrome PID-kill code and its TODO, so runtime behavior is unchanged. There is no identified merge risk.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Out of Scope Changes check
The PR description and the linked issue describe a deletion-only change: removing the commented-out PID-kill code and TODO in runner/headless.go. The AI-generated summary reports +0/-8 lines for runne…
Provide the base-to-head text diff for runner/headless.go (or make the changed blobs available) so the changed hunks can be compared against the PR scope. Confirm that the musl-detection, browser-selection, Leakless, and network-policy code…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "chore(headless): drop dead chrome pid kill code" matches the main change. The PR removes the commented-out Chrome PID-kill code and its TODO from runner/headless.go, which the linked issue …
Linked Issues check
[#2760] requires removing the commented-out Chrome PID-kill code and its TODO from runner/headless.go. The reviewed head version of runner/headless.go contains no PID-kill code, no commented-out PID-k…
Full details: Title check
Explanation
The title "chore(headless): drop dead chrome pid kill code" matches the main change. The PR removes the commented-out Chrome PID-kill code and its TODO from runner/headless.go, which the linked issue #2760 requests. The title names the file scope (headless) and the removed code. The raw summary also lists related browser-selection and musl-detection changes that the title does not mention, but the removal of dead PID-kill code is the primary objective.
Full details: Linked Issues check
Explanation
[#2760] requires removing the commented-out Chrome PID-kill code and its TODO from runner/headless.go. The reviewed head version of runner/headless.go contains no PID-kill code, no commented-out PID-kill block, and no related TODO. Browser startup uses launcher.New().Leakless(true), and the Browser struct has no PID field. The issue's premise (the projectdiscovery/rod fork terminates the browser process group) is the rationale for removal; this PR does not change that premise. The PR description reports a macOS check that Chrome exits after SIGKILL of httpx. That check is author-reported and was not reproduced here. No coding requirement remains unmet in the reviewed head.
Full details: Out of Scope Changes check
Explanation
The PR description and the linked issue describe a deletion-only change: removing the commented-out PID-kill code and TODO in runner/headless.go. The AI-generated summary reports +0/-8 lines for runner/headless.go, which fits that scope. However, the same summary describes present-tense changes to browser selection (preferSystemBrowser, hostUsesMusl, muslHost, glibc/musl loader matching, NewBrowser error on missing Chrome) and to Leakless(true) startup. These changes are not mentioned in the PR description. The diff could not be read because changed blobs are missing from the checkout. The base revision of runner/headless.go was not read, so it is not established whether these changes are present in the merge base or introduced by this PR. The reviewed head file also contains network-policy, request-hijacking, and header-handling code that the PR description does not mention. Scope cannot be decided without the base-to-head diff.
Resolution
Provide the base-to-head text diff for runner/headless.go (or make the changed blobs available) so the changed hunks can be compared against the PR scope. Confirm that the musl-detection, browser-selection, Leakless, and network-policy code exists at the merge base and is not added by this PR. If any of these hunks are added here, either justify them against the linked issue or remove them.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A rabbit checks the browser’s trail Leakless starts it without a tail Old PID notes are swept away The browser closes at end of day Musl hosts choose an installed way
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Essentials
Run ID: 455b7833-19d7-496e-9f43-d0ba3f318e0a
Commits
Reviewing files that changed from the base of the PR and between 200e6ff and dea5efc.
Files selected for processing: 1
runner/headless.go
Files with no reviewable changes: 1
runner/headless.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2760
Comments only. Checked on macOS: after a SIGKILL of httpx during a screenshot, its Chrome processes exit, so the PID kill fallback is not needed. Conflicts with #2559 are expected; I will rebase after it lands.
Summary by CodeRabbit