diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 8e7a817e9..112de4653 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -705,6 +705,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( switches::kPpapiFlashPath, switches::kPpapiFlashVersion, switches::kUncaughtExceptionStackSize, + switches::kUnsafelyTreatInsecureOriginAsSecure, }; command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames, arraysize(kSwitchNames)); diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index bdefce076..df2579d15 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -51,6 +51,7 @@ #include "build/build_config.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/constants.mojom.h" +#include "chrome/common/secure_origin_whitelist.h" #include "chrome/common/url_constants.h" #include "chrome/renderer/chrome_content_renderer_client.h" #include "chrome/renderer/loadtimes_extension_bindings.h" @@ -409,6 +410,12 @@ void CefContentRendererClient::RenderThreadStarted() { pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); } + for (auto& origin_or_hostname_pattern : + secure_origin_whitelist::GetWhitelist()) { + blink::WebSecurityPolicy::AddOriginTrustworthyWhiteList( + blink::WebString::FromUTF8(origin_or_hostname_pattern)); + } + if (extensions::ExtensionsEnabled()) extensions_renderer_client_->RenderThreadStarted(); }