Add support for --unsafely-treat-insecure-origin-as-secure flag (issue #2574)

This commit is contained in:
Chris Dziemborowicz 2019-01-18 16:45:31 +00:00 committed by Marshall Greenblatt
parent 1a86240c93
commit 7ecc5d31ea
2 changed files with 8 additions and 0 deletions

View File

@ -705,6 +705,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kPpapiFlashPath,
switches::kPpapiFlashVersion,
switches::kUncaughtExceptionStackSize,
switches::kUnsafelyTreatInsecureOriginAsSecure,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
arraysize(kSwitchNames));

View File

@ -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();
}