- Code: Select all
//--------------CEFBrowserApp.cpp
void FCEFBrowserApp::OnRegisterCustomSchemes(CefRefPtr<CefSchemeRegistrar> registrar)
{
// To registrar file scheme
registrar->AddCustomScheme("file", true, true, false);
}
void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
{
// Added this to allow file upload for HTTPS server
CommandLine->AppendSwitch("allow-running-insecure-content");
}
//-----------WebBrowserSingleton.cpp
TSharedPtr<IWebBrowserWindow> FWebBrowserSingleton::CreateBrowserWindow(const FCreateBrowserWindowSettings& WindowSettings)
{
// Specify CEF browser settings here.
CefBrowserSettings BrowserSettings;
// To access local files
BrowserSettings.web_security = STATE_DISABLED;
}
As CEF is a lightweight wrapper around Chromium itself, just wanted to know about the security breach that I might have to face with above changes. Also If there's a
way to prevent any malicious attacks or any other way to access local files without disabling security flags.
Thanks,
- Dipen