summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-10 10:31:31 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-10 10:31:31 +0200
commita4cef2531fc29d874cec9613e2d2ad7ccd5ad937 (patch)
tree5539faab39cbb372a1530b115e9b9dc1e09492ae /src/core/web_contents_delegate_qt.cpp
parent4746bb904bf6841137d5b50357bf79c852bf5d06 (diff)
parentd35cd072c3f56aa285871a151adc30d9d81f3ea3 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: .qmake.conf tests/auto/quick/qmltests/BLACKLIST tests/auto/quick/qquickwebengineview/BLACKLIST Change-Id: I29b68dec8692d0369a2dda56350ee62d3ad73e08
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index c8fac0d54..f260a17b9 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -232,6 +232,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)