# Browser Source: What info is available to the page?



## rjhall90 (Jul 12, 2018)

Does OBS inject any JS variables or make any information known to the page it's displaying (or not displaying)? I tried to use the on focus/on blur functions in JS to detect this, but the Chromium built into OBS seems to always have the page "unfocused". Is there a way to detect the Browser Source layout's visibility/location/etc to ensure that it's fully displayed on screen? I'm attempting to build something predicated on the fact that I can detect page visibility, but the OBS docs are sparse on the Browser Source details.


----------



## dodgepong (Jul 15, 2018)

Yes, you can find information on JS bindings here: https://github.com/obsproject/obs-browser/blob/master/README.md


----------



## rjhall90 (Jul 16, 2018)

dodgepong said:


> Yes, you can find information on JS bindings here: https://github.com/obsproject/obs-browser/blob/master/README.md



That's awesome, thank you. I don't suppose OBS provides any data through JS that can get the X/Y location of the scene, does it?


----------



## dodgepong (Jul 16, 2018)

Source information is not available via the JS API, no.


----------



## rjhall90 (Jul 20, 2018)

Sorry for all the questions, but the docs on the page linked are rather sparse.

Is there a situation where a Browser Source would be visible but not active, or active but not visible? I tried occluding it with another fullscreen overlay and there were no callbacks. I also tried hiding or showing the source, but that gets a callback for both, false and true equivalently.


----------



## Osiris (Jul 20, 2018)

https://github.com/obsproject/obs-browser

This mentions both a callback for show/hide and active/inactive


----------



## rjhall90 (Jul 28, 2018)

I apologize if I didn't phrase my question correctly. I did see those callbacks, but I can't seem to cause 'visible' or 'active' to change independently of each other. If I hide the source, both become false. If I show the source, both become true. Is there any way that one would be true and the other would be false?


----------



## Osiris (Jul 28, 2018)

Difference between them only really exists in studio mode.


----------



## rjhall90 (Jul 31, 2018)

Osiris said:


> Difference between them only really exists in studio mode.


And that's the missing link. Thank you so much to both of you!


----------

