From 3c3045a5cb71123e43836002862c6f455bdceb03 Mon Sep 17 00:00:00 2001 From: Cristian Amarie Date: Fri, 15 Jun 2018 20:14:47 +0000 Subject: [PATCH] Add http:// prefix to browser creation URLs if necessary (issue #2427) --- libcef/browser/browser_host_impl.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 599e2c853..97cd97813 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -268,6 +268,12 @@ CefRefPtr CefBrowserHost::CreateBrowserSync( create_params.window_info.reset(new CefWindowInfo(windowInfo)); create_params.client = client; create_params.url = GURL(url.ToString()); + if (!url.empty() && + !create_params.url.is_valid() && + !create_params.url.has_scheme()) { + std::string new_url = std::string("http://") + url.ToString(); + create_params.url = GURL(new_url); + } create_params.settings = settings; create_params.request_context = request_context;