Summary: | [Qt] Ability to set custom userAgent for WebKit2/WebKit | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Zoltan Horvath <zoltan> | ||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, hausmann, kenneth, kimmo.t.kinnunen | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Attachments: |
|
Description
Zoltan Horvath
2010-08-19 07:50:25 PDT
We could copy the current code into a (build with webkit2 only) qWebKitDefaultUserAgentForPlatform() method, and then use that for WebKit2. I am in favor of the qWebKitDefaultUserAgentForPlatform() method in general, so what do you think Simon? time for QtWebKitGlobal.h ? :-) Btw, we also want to write "MeeGo Handset UX" when Q_WS_MAEMO_6 (or what ever it is called on Harmattan) is defined - and Mobile Safari as well. I think we want something similar to Android: Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17 –Nexus We currently do: "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%" So I guess the following would be nice: Mozilla/5.0 (MeeGo Handset UX; U; Linux armv7l; en-US; *vendor addition*) AppleWebKit/*** (KHTML, like Gecko) Mobile Safari/*** Created attachment 69776 [details]
Patch implementing API to set custom user agent
Comment on attachment 69776 [details] Patch implementing API to set custom user agent Rejecting patch 69776 from commit-queue. kimmo.t.kinnunen@nokia.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights. Comment on attachment 69776 [details]
Patch implementing API to set custom user agent
Did you test if setting setCustomUserAgent(QString()) turns off the custom user agent?
(In reply to comment #4) > (From update of attachment 69776 [details]) > Did you test if setting setCustomUserAgent(QString()) turns off the custom user agent? It actually doesn't. That causes user agent to be just "Mozilla/5.0" instead of "Mozilla/5.0 (Macintosh; ..." That's probably another bug where string constructed from a null QString gets converted to a empty string? String WebPage::userAgent() const { if (!m_customUserAgent.isNull()) return m_customUserAgent; Comment on attachment 69776 [details] Patch implementing API to set custom user agent Clearing flags on attachment: 69776 Committed r69108: <http://trac.webkit.org/changeset/69108> All reviewed patches have been landed. Closing bug. |