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
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
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 =
29 + cefBrowserSettings.universal_access_from_file_urls =
33 auto browser = CefBrowserHost::CreateBrowserSync(