x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Allow files access from CEF browser and Disable Web Security

I want to make file system accessible from a web browser using CEF Library. In order to do this, I tried following options :

**file_access_from_file_urls = STATE_ENABLED;

universal_access_from_file_urls = STATE_ENABLED;

web_security = STATE_DISABLED;**

Here are some changes which were made

 TSharedPtr<IWebBrowserWindow> FWebBrowserSingleton::CreateBrowserWindow(const FCreateBrowserWindowSettings& WindowSettings)
 {
 #if WITH_CEF3
     static bool AllowCEF = !FParse::Param(FCommandLine::Get(), TEXT("nocef"));
     if (AllowCEF)
     {
         // Information used when creating the native window.
         CefWindowInfo WindowInfo;
 
         // Specify CEF browser settings here.
         CefBrowserSettings BrowserSettings;
 
         // Disable plugins
         BrowserSettings.plugins = STATE_DISABLED;
         BrowserSettings.file_access_from_file_urls = STATE_ENABLED;
         BrowserSettings.universal_access_from_file_urls = STATE_ENABLED;
         BrowserSettings.web_security = STATE_DISABLED;
     }
 }

Also made changes in the OnBeforeCommandLineProcessing method of CEF Library where the user can change the settings of the browser.

Here is the sample code

 void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
 {
   CommandLine->AppendSwitch("allow-file-access-from-files");
   CommandLine->AppendSwitch("disable-gpu");
   CommandLine->AppendSwitch("disable-web-security"); 
   CommandLine->AppendSwitch("disable-gpu-compositing");
 }


I'm trying to disable web security inside the Unreal Engine Web Browser. Is there is any extra setting which we need to do in order to disable the web security and allow the files to be accessed by the following path

file:///C:/image.jpg (Please note that opening the sample url in browser loads the image)

I'm basically using web browser inside the unreal engine which uses CEF library C++. I know that accessing the files is possible by creating a server on the local machine and then access files using URL but I would like to customize the CEF library in c++ to disable the web security.

Product Version: UE 4.15
Tags:
more ▼

asked Jul 17 '17 at 03:45 PM in Using UE4

HarshMakadia gravatar image

HarshMakadia
8 2 3

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question