Skip to content

Temporarily recreate implied Localhost permissions - #547

Merged
RytoEX merged 1 commit into
obsproject:masterfrom
WizardCM:media-access-transition
Oct 8, 2026
Merged

RytoEX merged 1 commit into
obsproject:masterfrom
WizardCM:media-access-transition

Conversation

@WizardCM

@WizardCM WizardCM commented Oct 8, 2026

Copy link
Copy Markdown
Member

Description

Allow requests to localhost from non-localhost pages. This is a common method of self-hosting tools for OBS.

Warning

This implementation uses OnShowPermissionPrompt, which is only called the first time such a request is made. If it was previously denied (even silently+automatically), that denial is saved permanently.
CEF does not currently provide methods to re-request or to clear/edit previously denied requests.

For the above reason, the handling of the permission prompt is only managed for the one permission, which is labelled as "Apps on device" in Chrome's Site Permissions page.

Motivation and Context

While adding disable-features=LocalNetworkAccessChecks would solve this, it has a wider scope of side effects than I'm comfortable with.

How Has This Been Tested?

Launch a HTTPS-hosted webpage that performs a fetch request to http://localhost:3000

Windows 10.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added the kind/bug Categorizes issue or PR as related to a bug. label Oct 8, 2026
Comment thread panel/browser-panel-client.cpp Outdated
Comment thread browser-client.cpp Outdated
@PatTheMav

Copy link
Copy Markdown
Member

This implementation uses OnShowPermissionPrompt, which is only called the first time such a request is made. If it was previously denied (even silently+automatically), that denial is saved permanently. CEF does not currently provide methods to re-request or to clear/edit previously denied requests.
For the above reason, the handling of the permission prompt is only managed for the one permission, which is labelled as "Apps on device" in Chrome's Site Permissions page.

Yeah that's unfortunately become a necessity because bad actors would otherwise just spam the request to coerce people into giving a site permissions they actually don't want to give


So this is just a workaround to reinstate the behaviour of the prior CEF version until we can do proper permission management for docks and sources?

@WizardCM

WizardCM commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

So this is just a workaround to reinstate the behaviour of the prior CEF version until we can do proper permission management for docks and sources?

Correct, the goal in a future OBS release is to provide a method for users to individually allow/deny these permission requests themselves, pending UX design by Warchamp. I'd like to also provide a nice UI for managing existing permissions, but as mentioned there is currently no CEF API we can pull from.

@RytoEX

RytoEX commented Oct 8, 2026

Copy link
Copy Markdown
Member

LGTM I will squash the commit.

OnShowPermissionPrompt is only called *once* when a page requests
permission. If it is denied, even automatically, this code path
will never be triggered again.
@RytoEX
RytoEX force-pushed the media-access-transition branch from c397ea2 to 49c262b Compare October 8, 2026 16:39
@RytoEX
RytoEX merged commit 058c30f into obsproject:master Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

Chrome Runtime regression: Local Network Access blocked

3 participants