Conversation
jmagly
pushed a commit
to jmagly/carbonyl
that referenced
this pull request
May 21, 2026
Implements --dump-text[=<mode>] (innertext/accessibility/raw-dom) plus --idle and --max-wait tunables. Renderer-side text extraction via a content::WebContentsObserver in chromium/src/carbonyl/src/browser/dump_text_handler.{cc,h}, wired into headless_shell.cc::OnBrowserStart via patch 0027. Bypasses the terminal renderer for clean single-process invocation; chromium subprocesses inherit shell_mode=1 to prevent ANSI noise.
Verified end-to-end against runtime-a98928556d7c96c1: example.com body text extracted to stdout (130 bytes, exit 0), --dump-text=raw-dom emits full HTML (530 bytes), --idle and pipe semantics correct.
Known follow-ups (separate issues): accessibility mode pending fathyb#4, empty-error-page exit semantics, runtime-hash.sh excluding Rust sources, std::_Exit teardown warning.
Closes fathyb#88
Refs fathyb#4 fathyb#5
jmagly
pushed a commit
to jmagly/carbonyl
that referenced
this pull request
May 21, 2026
…athyb#93) EmitAndExit now posts HeadlessBrowserImpl::ShutdownWithExitCode() to the UI thread instead of calling std::_Exit. Chromium runs its destructor chain in order; the WebContentsObserver hook fires and self-deletes the handler. Verified against runtime-74bd7a3a33b7bf56: WebFrame LEAKED line gone from stderr; exit code 0 with correct text on stdout; example.com smoke test 130 bytes clean. API: StartFor now takes (WebContents*, HeadlessBrowser*). Patch 0027 updated to pass the existing OnBrowserStart browser pointer through. GN dep added: //headless:headless_browser (HeadlessBrowserImpl + ShutdownWithExitCode). Wider closure but :dump_text is only consumed by headless_shell, no cycle risk. Closes fathyb#93 Refs fathyb#88
jmagly
pushed a commit
to jmagly/carbonyl
that referenced
this pull request
May 22, 2026
DumpTextHandler now observes DidFinishNavigation and exits 6 with empty stdout when the latest primary-frame navigation was a chromium error page or had a non-OK net::Error code. Previously, unreachable URLs exited 0 with empty stdout because chromium loads its internal error page as a real document and our handler extracted its empty body. Verified against runtime-f6d15927b1241217: - https://example.com → exit 0, 130 bytes (regression check) - http://10.255.255.1:1/never → exit 6, empty stdout, logs net::ERR_UNSAFE_PORT - https://invalid.invalid/ → exit 6, empty stdout, logs net::ERR_NAME_NOT_RESOLVED Known cosmetic: stderr log says net::net::ERR_* (double net:: prefix because ErrorToString already prefixes). Trivial fix; not worth a rebuild cycle. HTTP error status codes (404, 500) are NOT treated as nav failures — those are real HTML served by the server. Closes fathyb#91 Refs fathyb#88
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #72