Skip to content

Conversation

@deemonrider
Copy link

This is a follow up to: #499 as the previous approach failed when duplicating a browser source reference.
This time I tried to stay with the implementation more closely with how the WebSocket handles it and giving developers the same flexibility.

Description

This new feature adds:

  • getSceneItemList
image
  • getSceneItemTransform
image
  • getBrowserInputSettings
image

Motivation and Context

I was really shocked to discover that this feature doesn't exist. Thinking about what information a browser should be able to read out, this would be my first thought:

  1. Missing essential information: window.outerWidth / screen.width or similar tells you the size of the browser source itself BUT not if a user messed up the aspect ratio or scaled down the source via transforming. Currently, the only way to get this information is by using the websocket. This leads to the next big issue:
  2. HTTPS websites can't access a non-secure Websocket: When providing browser sources to streamers, they are usually all served via HTTPS— The issue? Mixed Content. When serving the Browser Source via HTTPS, we can't access the non-secure websocket. This means I would need to host a separate HTTP overlay just to be able to read out how my source is configured. Serving a browser source without HTTPS is no longer acceptable and will discourage users, as HTTP is widely considered insecure.
  3. Least Privilliges: Additionally, WebSockets grant me full rights to do whatever I want—technically. So as a user, you wouldn't really want to have that enabled just to read out some basic information. This implementation is read-only and can't harm anyone but provide essential value.

I decided to bundle these three functions into a single PR since they are closely related:

  • First, you can call getSceneItemList to retrieve all items in a scene.
  • Next, use getBrowserInputSettings to identify which of those items are relevant.
  • Finally, you can fetch the transformation details for each item individually using its unique ID.

How Has This Been Tested?

Environment: Windows 11 x64, OBS Studio 31.1.2 (build 104)

  • I've used the buildin obs debugging tool to access the console and compare the output to the settings I've changed of the browser source and then called in the console:
  • I've tested the permission behavior handling if the user removes all permissions of the browser source -> returns null like the other functions.
  • I've duplicated a browser source so I have two times the object in my sources to ensure this is working now aswell.

Types of changes

New feature (non-breaking change which adds functionality)
Documentation (a change to documentation pages)

Checklist:

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

@deemonrider deemonrider mentioned this pull request Aug 23, 2025
6 tasks
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.

1 participant