diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-17 18:18:23 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-18 10:35:11 +0000 |
commit | 4bac2cb5084c68354e43fb456e4d20d4f70b223a (patch) | |
tree | 0cd2bb2fa8ebbc92b889a452852cf2c4969bb9ff | |
parent | deac302bc4df07d6c761035ffcad738a035b471a (diff) |
Fix Http User-agent string setting
Chromium has multiple places where it reads the user-agent, we were
only setting one, which appears to no longer be used for most cases.
This instead sets it by using the webcontent user-agent override.
Change-Id: I77d4d0a21424feda7a18140fb72baacdd6f816ca
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
-rw-r--r-- | src/core/web_contents_adapter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 9ed0d7d72..848e8086e 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -392,6 +392,7 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient) // Qt returns a flash time (the whole cycle) in ms, chromium expects just the interval in seconds const int qtCursorFlashTime = QGuiApplication::styleHints()->cursorFlashTime(); rendererPrefs->caret_blink_interval = 0.5 * static_cast<double>(qtCursorFlashTime) / 1000; + rendererPrefs->user_agent_override = d->browserContextAdapter->httpUserAgent().toStdString(); d->webContents->GetRenderViewHost()->SyncRendererPrefs(); // Create and attach observers to the WebContents. @@ -469,6 +470,7 @@ void WebContentsAdapter::load(const QUrl &url) Q_D(WebContentsAdapter); content::NavigationController::LoadURLParams params(toGurl(url)); params.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); + params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; d->webContents->GetController().LoadURLWithParams(params); d->webContents->Focus(); } |