diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-06-15 16:47:30 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-07-13 09:25:46 +0000 |
commit | 9e2caf8b8845e1b35dfbfc40fbd856762ddd461a (patch) | |
tree | 25c5087eb839d72e3cf7a7040e63f3b63bfd3882 /src | |
parent | ec73b97ab7bb70178e58fd3bf59e88a168c73f87 (diff) |
Suppress extra loadStarted signal for data URL with specified base URL
In these cases two NavigationHandles are created. One for the data URL
and another one for the base URL. Suppress the loadStarted signal for
data URL one since it is expected to be informed about the base URL.
Change-Id: I1a3006cf552a26b8419bd76454e26c0e33c2e898
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index a6e1fb438..1121714eb 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -197,6 +197,16 @@ void WebContentsDelegateQt::DidStartNavigation(content::NavigationHandle *naviga if (!navigation_handle->IsInMainFrame()) return; + // Suppress extra loadStarted signal for data URL with specified base URL. + if (navigation_handle->GetURL().SchemeIs(url::kDataScheme)) { + content::NavigationEntry *pending_entry = navigation_handle->GetWebContents()->GetController().GetPendingEntry(); + + if (pending_entry && !pending_entry->GetBaseURLForDataURL().is_empty() && + navigation_handle->GetURL() == pending_entry->GetURL()) { + return; + } + } + // Error-pages are not reported as separate started navigations. Q_ASSERT(!navigation_handle->IsErrorPage()); |