summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-10-04 17:36:51 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2018-10-12 14:30:33 +0000
commit75f6f4d3178d9356aff9a5a14f8601ebc8b70c95 (patch)
tree9893a14227ac10b1a5741ccba8b299d4474023d9 /src/core/web_contents_delegate_qt.cpp
parentbd7051912f1f75d89bb2a0ddd35987d71be1f2c6 (diff)
Disable error pages for external URLsv5.12.0-beta2
Failing to launch an external URL triggers a navigation to "chrome-error://chromewebdata". Navigating to "chrome-error://chromewebdata" results in a failed attempt to launch it as an external URL. The cycle repeats until the computer becomes bored. Match Chromium and disable error pages for external URL load failures. Fixes: QTBUG-63378 Change-Id: I6c401532d658744edc56921b55efd0d040a12b1a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 11f64c5a..569b939d 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -602,14 +602,12 @@ void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransitio
}
if (!navigationAllowedByPolicy || !navigationRequestAccepted) {
+ QString errorDescription;
if (!navigationAllowedByPolicy)
- didFailLoad(url, 420, QStringLiteral("Launching external protocol forbidden by WebEngineSettings::UnknownUrlSchemePolicy"));
+ errorDescription = QStringLiteral("Launching external protocol forbidden by WebEngineSettings::UnknownUrlSchemePolicy");
else
- didFailLoad(url, 420, QStringLiteral("Launching external protocol suppressed by WebContentsAdapterClient::navigationRequested"));
- if (settings->testAttribute(WebEngineSettings::ErrorPageEnabled)) {
- EmitLoadStarted(toQt(GURL(content::kUnreachableWebDataURL)), true);
- m_viewClient->webContentsAdapter()->load(toQt(GURL(content::kUnreachableWebDataURL)));
- }
+ errorDescription = QStringLiteral("Launching external protocol suppressed by WebContentsAdapterClient::navigationRequested");
+ didFailLoad(url, net::Error::ERR_ABORTED, errorDescription);
}
}