From cab058ba28a7ceebd3786002a933e7930e0e7ffe Mon Sep 17 00:00:00 2001 From: Cristian Amarie Date: Wed, 10 Feb 2021 18:30:43 +0000 Subject: [PATCH] Fix loading of URL without scheme (fixes issue #3079) --- libcef/browser/frame_host_impl.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index ccfff5605..b82cf00da 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -350,6 +350,13 @@ void CefFrameHostImpl::LoadURLWithExtras(const std::string& url, // Any necessary fixup of the URL will occur in // [CefBrowserHostBase|CefFrameHostImpl]::Navigate(). GURL gurl(url); + if (!url.empty() && !gurl.is_valid() && !gurl.has_scheme()) { + std::string fixed_scheme(url::kHttpScheme); + fixed_scheme.append(url::kStandardSchemeSeparator); + std::string new_url = url; + new_url.insert(0, fixed_scheme); + gurl = GURL(new_url); + } if (frame_id == CefFrameHostImpl::kMainFrameId) { // Load via the browser using NavigationController.