obsproject/obs-browser

Writing files using FileSystem API throws DOMException: The request is not allowed by the user agent or the platform in the current context.

FHeNuS opened this issue · 5 comments

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

29.0.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/OIUMAHOYtIJg2w7V

OBS Studio Crash Log URL

No response

Expected Behavior

I expected that either when using the file system api or download a file through the BrowserSource of a Custom Dock, that it would download and/or write the file.

Current Behavior

Using the https://github.com/GoogleChromeLabs/browser-fs-access or even directly the native one, through Chrome itself, works like a charm. Whenever is through a BrowserSource or a Custom Dock, reading directories or files works, but writing files not, throwing the exception: DOMException: The request is not allowed by the user agent or the platform in the current context. The file gets created by no actual data is written.
(anonymous) @ script.mjs:158

I've tried running OBS as administrator, settings the CEF switches to allow filesystem api, but it does not work.

Steps to Reproduce

  1. Create a browser source
  2. Point it to: https://googlechromelabs.github.io/browser-fs-access/demo/
  3. Create a Custom Dock and point to the same url: https://googlechromelabs.github.io/browser-fs-access/demo/
  4. Try to open a image file or a directory, it should show the file/directory selection dialog
  5. Click ok, it works fine.
  6. Try to save a file or image, the file save dialog appears, click ok, it should silently fail
  7. Clicking on Inspect on the Custom Dock should show the error on the developer console.

Anything else we should know?

No response

It's important to note that CEF is not Chrome. Is this expected to be supported by CEF? This feels like it might be a Chrome-specific feature, not something part of chromium/CEF.

This does not work in CEF 103 (cefclient.exe), so it will not work in OBS, which currently uses CEF 103.

Thanks for replying everyone. What would you recommend my next step to be? Post this on the CEF project? Any ideas? CEF 103 is from July 2022, any plans to use a newer version?

Hey @RytoEX or @Fenrirthviti , hope you are well! Thanks again for the replies. Any comment on my previous one regarding if there is any thing I can do about this or if there is any plan for the CEF being used to be updated? (I'm trying to understand possible options or alternatives.

CEF cannot be updated any time soon, due to them effectively dropping support for shared textures, which is required for how we use it. The conversation is long and difficult to summarize, but the end result is that there is no ETA at this time when we can update, though it's something we definitely want to do.