summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-24 10:40:08 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-24 10:40:08 +0200
commit5dd44f34a58b966ddc374d828b1979b9c689b1b5 (patch)
treec9beec83e2454bc7d001bdc116620b3cc323d7a4 /src/core/web_contents_delegate_qt.cpp
parent57363264cd0ff4b2f45f5344e18436fe419e2e95 (diff)
parentb73e4ce6f7cfe35a85b9a41e1a5ab36783e5edb0 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/3rdparty src/core/core_chromium.pri tests/auto/quick/qmltests/BLACKLIST tests/auto/quick/qquickwebengineview/BLACKLIST tests/auto/widgets/qwebenginepage/BLACKLIST tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp tests/auto/widgets/qwebengineview/BLACKLIST Change-Id: I11b26f5eebde29c4c62247b90e11e3ae40789fe4
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 93f441636..f18617f8e 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -234,6 +234,11 @@ void WebContentsDelegateQt::AddNewContents(content::WebContents* source, std::un
{
Q_UNUSED(source)
QSharedPointer<WebContentsAdapter> newAdapter = createWindow(std::move(new_contents), disposition, initial_pos, user_gesture);
+ // Chromium can forget to pass user-agent override settings to new windows (see QTBUG-61774 and QTBUG-76249),
+ // so set it here. Note the actual value doesn't really matter here. Only the second value does, but we try
+ // to give the correct user-agent anyway.
+ if (newAdapter)
+ newAdapter->webContents()->SetUserAgentOverride(newAdapter->profileAdapter()->httpUserAgent().toStdString(), true);
if (newAdapter && !newAdapter->isInitialized())
newAdapter->loadDefault();
if (was_blocked)
@@ -575,7 +580,7 @@ void WebContentsDelegateQt::FindReply(content::WebContents *source, int request_
Q_UNUSED(source)
Q_UNUSED(selection_rect)
Q_UNUSED(active_match_ordinal)
- if (final_update) {
+ if (final_update && request_id > m_lastReceivedFindReply) {
m_lastReceivedFindReply = request_id;
m_viewClient->didFindText(request_id, number_of_matches);
}