summaryrefslogtreecommitdiffstats
path: root/src/core/content_browser_client_qt.cpp
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2019-11-29 12:19:00 +0100
committerJüri Valdmann <juri.valdmann@qt.io>2019-12-12 09:05:51 +0100
commit558ca97112eb2e82443e9b8ba1a703fee15694dd (patch)
treeb0284c3944071fe671641315fca0ef7680c83bf9 /src/core/content_browser_client_qt.cpp
parent2db73d8f7296cc36c2ea222b83dab98ce27982ea (diff)
Fix registerProtocolHandler with network service
We now get LaunchURL calls for the RPH schemes and have to manually filter them. Change-Id: Ia3f3e9cde392f95d2247899640f4551ae0b9f1a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r--src/core/content_browser_client_qt.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 170fa3193..12d986bb7 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -791,6 +791,14 @@ static void LaunchURL(const GURL& url,
content::WebContents* webContents = web_contents_getter.Run();
if (!webContents)
return;
+
+ ProtocolHandlerRegistry* protocolHandlerRegistry =
+ ProtocolHandlerRegistryFactory::GetForBrowserContext(
+ webContents->GetBrowserContext());
+ if (protocolHandlerRegistry &&
+ protocolHandlerRegistry->IsHandledProtocol(url.scheme()))
+ return;
+
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
contentsDelegate->launchExternalURL(toQt(url), page_transition, is_main_frame, has_user_gesture);
}