Skip to content

Merge OBS 33.0.1 browser updates - #60

Open
aleksandr-voitenko wants to merge 42 commits into
streamlabsfrom
obs_merge_33
Open

aleksandr-voitenko wants to merge 42 commits into
streamlabsfrom
obs_merge_33

Conversation

@aleksandr-voitenko

Copy link
Copy Markdown
Collaborator

No description provided.

RytoEX and others added 30 commits May 1, 2026 11:15
Implicit capture of 'this' with a capture default of '=' is deprecated
in C++20. While the standard recommends replacing '=' with '=, this',
that syntax is not C++17 compatible, and we will likely need some
transition period where obs-studio and its modules are still built
using C++17.
CEF is initialized in a browser manager thread on Windows and Linux,
which happens asynchronously. The graphics tick function may be
called before CEF initialization completes, which leads to
asserts and other issues. Ensure this does not happen by checking
for CEF init completion.
Current CEF requires compiling as C++20.
Uses Xcode's own Info.plist generation code and also adds the app
category key to address warnings emitted by Xcode during packaging.
Add a dummy Browser Client to introduce limitations into the Chrome UI
windows that can be opened in uncontrolled edge cases. Chrome UI windows
are unmanaged by default. By returning something other than null in
GetDefaultClient() we can lock it down in various ways.

OnBeforePopup, OnOpenURLFromTab can probably be removed as they don't
get called. There's no direct way to stop the Chrome UI window from
being opened, so instead close it immediately.

Disable Various Chrome Settings in custom docks & browser sources
via SetPreferences. For more, check `chrome/common/pref_names.h`.

Chrome's default error display is now used by CEF, so on top of the
existing override in browser docks, a similar override has been added
to browser sources which just redirects to about:blank.

Also blocks
 - Chrome Extensions, as they are largely untested and unpredictable
 - MediaRouter, which provides Cast.. functionality
 - CalculateNativeWinOcclusion, which lowers FPS for hidden pages
 - LiveCaption, which provides automatic captions
 - DocumentPictureInPictureAPI, which provides PiP widgets (YouTube)
 - StorageNotificationService, when approaching low cache space

A data migration function is included. It moves some directories into a
new 'Default' profile subdirectory, and performs the necessary renaming
of certain files to ensure the new Profile loads.
Additionally, the cookie directories for each service integration must
be moved into the root config directory, as subdirectories in their
current form (obs_profile_cookies/<cookie_id>) are not supported. This
is intentional, and according to Marshall this was never a supported
setup. cache_path *must* be a direct child of the root_cache_path.
Invalid cache_path_ is silently treated as Incognito Mode and cookies
are not stored.
While media access permissions are relegated to legacy behaviour by
default, most remaining permissions are denied implicitly. WebSocket
requests seem to be treated differently yet, where an additional case is
handled for a website attempting to access local devices.

This recreates behaviour from previous CEF versions in modern releases.

Reference
https://github.com/chromium/chromium/blob/8408977/services/network/public/cpp/features.cc#L273-L279
Using LoadURL() replaces the address of the current page, which means
the Reload button will unintentionally reload the about:blank page.
Restore audio muting in OnLoadStart when Control audio via OBS is
enabled to prevent audio from bypassing OBS monitoring.
Use the .clang-format file from obs-studio.
Use the updated .clang-format file to apply the changes.
Keep up to date. Remove CI warnings.
Use obs-studio's .gersemirc.
OnShowPermissionPrompt is only called *once* when a page requests
permission. If it is denied, even automatically, this code path
will never be triggered again.
Fails to compile when this warning is turned into an error.
Adds additional hardening to the custom scheme handler for local files
to ensure they are coming from a local file frame context.

A fetch request made from an insecure page (http://) with the option
"no-cors" may be delivered to the scheme handler successfully.

A request made from a secure page (https://) already fails due to
mixed content restrictions.

This is additional protections for what is ultimately legacy
functionality dating back to the original OBS Classic and we should
consider removing the http://absolute handler entirely in a future
update, instead preferring the sane defaults and handling of Chromium
itself as it pertains to local files.
Passing a std::string to std::filesystem will use the system codepage.
On Windows, this means it will interpret const char* as ANSI but the
paths returned by libobs are utf8.

If the path only contains ASCII characters, then everything is fine. If
the path contains non ASCII characters, then it leads to errors.
See chromiumembedded/cef#3960

Specific to Windows 11, if Chromium detects that the main process is
running as Administrator, it will attempt to relaunch it without admin.
As our main process is obs64 and not obs-browser-page.exe or similar,
not only does the main process stay, the user is shown failure dialogs
from OBS itself *and* CEF fails to initialize.
RytoEX and others added 12 commits October 20, 2026 15:52
Defers the scheduling of browser initialisation to the next iteration of
the Qt event loop to allow dock state restoration to finish before CEF
will attempt to attach its browser window to the dock's widget
hierarchy.

Attempting to initialize a browser immediately will lead to CEF crashing
during the same attempt on Windows, as the CEF event loop runs
independently and thus might interact with incomplete widget hierarchy.
The current YouTube dock implementation uses a `urlChanged` event as the
trigger to refresh the chat dock opportunistically, as authentication
cookies might now be present and the chat dock could end up in a
"logged-in" state.

This reload itself will trigger the `onBeforeBrowse` event handler
however, which then attempts to acquire the global lock held by the
outer `onBeforeBrowse` handler and thus deadlocks the application.

Deferring the `urlChanged` event to the next iteration of the event loop
allows `onBeforeBrowse` to finish to completion and release the lock.
Work around a race condition where the call to Resize() could occur
before the browser context existed, resulting in the default size 100x30
until next manual resize of the parent window or dock.

The wrapper container and Resize() function are only used on non-macOS
platforms.
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.

8 participants