Closed juaoose closed 10 months ago
I did a fair bit of digging on this today.
Our code just runs a janky JSON.parse()
on a string (within the V8 context), with a strong assumption that the string contains a valid JSON string. However, this isn't always the case.
It seems the correct way to do this is to parse the data directly, rather than throwing it into V8. Unfortunately, this means converting from a CefValue to a CefV8Value, which there is no built-in utility function for.
I was successfully able to implement the suggestion from this forum post, and handle the data directly in CEF before letting V8 convert it into a JS value properly. I can confirm this code snippet fixes the issue. I'll submit a PR in the coming days.
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
29.0.1
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/BdNarNPBbQaO1YOz
OBS Studio Crash Log URL
No response
Expected Behavior
Whenever using
window.obsstudio.getScenes
orwindow.obsstudio.getTransitions
in OBS, I expect to receive the list of scenes or transitions available.Current Behavior
If one uses
window.obsstudio.getScenes
orwindow.obsstudio.getTransitions
whenever a scene with special characters such as ', ", \ the callback passed to the functions is not invoked.Steps to Reproduce
$ ./obs64.exe --remote-debugging-port=9222
http://localhost:9222/
) by runningwindow.obsstudio.getScenes((a) => {console.log(a)})
for the previously created browser source. The callback will be invoked> ['OverlayTest', 'Webcam', 'Desktop', 'Demo', 'Other']
The same happens for transitions
getTransitions
Anything else we should know?
No response