Repository navigation
Warn when the CEF sandbox cannot work - #8
Merged
Merged
Conversation
When the browser runs without the CEF sandbox (the fallback of obs-rust/obs-studio#1092), it is to warn through the shared fallback warning (obs-rust/obs-studio#2218, obs_frontend_warn_fallback()), not only log. SandboxWarningFor() says whether to warn, with the id "browser.sandbox", the locale keys of the title and of the message for the cause (as root, or no user namespaces and no usable chrome-sandbox), and can_cancel false: the browser has nothing to stop. sandbox-decision.cpp checks every probe case, and that both keys exist in data/locale/en-US.ini (the runner passes its path). The stub never warns, so the four fallback cases fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SandboxWarningFor() warns only for the fallback: id "browser.sandbox", title "Browser source without the sandbox", and the message for the cause: as root, run OBS as a normal user; else allow unprivileged user namespaces, or install chrome-sandbox setuid root. can_cancel is false. UseCefSandbox() passes it to obs_frontend_warn_fallback() (obs-rust/obs-studio#2218), which logs the error line (also on stderr) and shows the dialog with the countdown once the main window has loaded. The plugin's own "CEF sandbox off" error line goes, as the shared one replaces it; the info line when the sandbox is on, or off on a platform without a probe, stays. Needs obs_frontend_warn_fallback() in obs-studio (obs-rust/obs-studio#2238). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vpacher
marked this pull request as ready for review
October 25, 2026 09:22
zackees
approved these changes
Oct 25, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Coordinator review: approved.
SandboxWarningForis pure, warns only whenSandboxFallbackis true, and picks the message for the cause (root, or no namespaces and no usable helper). The test covers all 7 probe cases, including the ones that must not warn, and checks that both locale keys exist inen-US.ini.can_cancel = falsewith a null callback fits: the browser continues either way.obs_frontend_warn_fallbackcopies the strings, so theobs_module_textpointers don't need to outlive the call, and it accepts calls from any thread, so it doesn't matter which thread initializes CEF.- The plugin's own error line is replaced by the shared
[fallback] browser.sandbox: ...line, so the log keeps an error line on stderr. The info line for sandbox on stays. - Dependency: this needs obs-studio at or after 4d7345283 (#2238) for the new frontend export, as the description says. The obs-studio submodule bump should come after that commit, which it does on master.
This was referenced Oct 25, 2026
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 25, 2026
…s) (obs-rust#2378) Moves plugins/obs-browser from 7bab463c9 to 4583599fe, with: - obs-rust/obs-browser#3: the CEF sandbox where it can work on Linux (obs-rust#1092) - obs-rust/obs-browser#5: os_event_init results checked in module load and ExecuteOnBrowser - obs-rust/obs-browser#6: WebAudio resumes after the audio service dies (obs-rust#2328) - obs-rust/obs-browser#7: browser audio that arrives too late to mix is dropped (obs-rust#2335) - obs-rust/obs-browser#8: the fallback warning when the sandbox can't work (obs-rust#2218) One bump instead of three (obs-rust#2333, obs-rust#2351 and ours), as agreed on obs-rust#2351. docs/features.md gets the two audio lines from obs-rust#2333 and obs-rust#2351 as they are, a line for the sandbox, and the browser on the fallback warning line, which obs-rust#2238 merged on 2026-10-25. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Refs obs-rust/obs-studio#1092, obs-rust/obs-studio#2218
Uses
obs_frontend_warn_fallback()from obs-rust/obs-studio#2238 (merged as 4d7345283), so it builds against obs-studio master from that commit on.What and why
When the CEF sandbox cannot work, the browser runs without it (#3). As decided on obs-rust/obs-studio#1092, the user is warned, not only the log. This uses the shared fallback warning of obs-rust/obs-studio#2218:
SandboxWarningFor(probe, decision, &warning)(pure, inbrowser-sandbox): warns only for the fallback, with idbrowser.sandbox, the title "Browser source without the sandbox", the message for the cause, andcan_cancel = false(the browser has nothing to stop).chrome-sandbox: what to allow or install instead.UseCefSandbox()passes it toobs_frontend_warn_fallback(). OBS logs the error line (also on stderr) at once and shows the dialog with the 3-second countdown once the main window has loaded. The plugin's own "CEF sandbox off" error line goes, as the shared line replaces it. The info line (sandbox on, or off on a platform without a probe) stays.data/locale/en-US.ini, in the wording ofdocs/fallback-warning.md(obs-studio).RED → GREEN
27b064b:tests/sandbox-decision.cppchecks every probe case for the warning, and that both locale keys exist inen-US.ini(the runner passes the path). 4 of 7 warning cases fail against the stub.5a0bc56: all cases pass (uv run --no-project python tests/sandbox_decision.py --output-dir …, macOS and Linux).[fallback] browser.sandbox: The Chromium sandbox cannot work because OBS runs as root. …once, also on stderr; the dialog shows the message, the countdown and "Accept anyway" (no Cancel), and accepts after 3 seconds; the browser source renders (the test page's green pixel). No new compiler warnings in obs-browser.AI note: Claude Code (Claude Opus 5.5) wrote the code, the tests, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.