biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / video / obs-studio / Enable-file-access-and-universal-access-for-file-URL.patch
blobb0c9650ddb90d0caf56480f4593339d27a7a1f76
1 From 0de0a90f8fe5e1e48fa4ec7aa7c825ef88770f9d Mon Sep 17 00:00:00 2001
2 From: Ryan Foster <RytoEX@gmail.com>
3 Date: Mon, 9 Sep 2019 23:55:02 -0400
4 Subject: [PATCH] Enable file access and universal access for file URLs
6 When loading a local file, instead of disabling CEF's web security,
7 enable file access and universal access for file URLs. This should allow
8 local files to make CORS requests without completely disabling CEF's
9 security model.
10 ---
11 obs-browser-source.cpp | 9 ++++++---
12 1 file changed, 6 insertions(+), 3 deletions(-)
14 diff --git a/obs-browser-source.cpp b/obs-browser-source.cpp
15 index 09b3017..1094340 100644
16 --- a/plugins/obs-browser/obs-browser-source.cpp
17 +++ b/plugins/obs-browser/obs-browser-source.cpp
18 @@ -239,9 +239,12 @@ bool BrowserSource::CreateBrowser()
20 #if ENABLE_LOCAL_FILE_URL_SCHEME && CHROME_VERSION_BUILD < 4430
21 if (is_local) {
22 - /* Disable web security for file:// URLs to allow
23 - * local content access to remote APIs */
24 - cefBrowserSettings.web_security = STATE_DISABLED;
25 + /* Enable file access and universal access from file://
26 + * URLs to allow local content access to remote APIs */
27 + cefBrowserSettings.file_access_from_file_urls =
28 + STATE_ENABLED;
29 + cefBrowserSettings.universal_access_from_file_urls =
30 + STATE_ENABLED;
32 #endif
33 auto browser = CefBrowserHost::CreateBrowserSync(