[webkit-reviews] review denied: [Bug 95697] [WebKit2] [GTK] Add API for controlling the user agent : [Attachment 162588] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 7 01:13:16 PDT 2012


Carlos Garcia Campos <cgarcia at igalia.com> has denied Martin Robinson
<mrobinson at webkit.org>'s request for review:
Bug 95697: [WebKit2] [GTK] Add API for controlling the user agent
https://bugs.webkit.org/show_bug.cgi?id=95697

Attachment 162588: Patch
https://bugs.webkit.org/attachment.cgi?id=162588&action=review

------- Additional Comments from Carlos Garcia Campos <cgarcia at igalia.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=162588&action=review


As I said this is not enough, if WKPageSetCustomUserAgent() is not called when
the user agent property changes, the new user agent won't be sent to the
WebProcess and it won't have any effect. See how it's done for zoom-text-only
and allow-modal-dialogs properties in webkitWebViewSetSettings(). You should
connect to the notify of user-agent from the view and call
WKPageSetCustomUserAgent() from the callback using the new user agent string.
You should also check that this is actually happening in the unit tests. See
languages test in TestWebKitWebContext, you could use a soup server and get the
header "User-Agent" after doing any request to check it's what you want.

> Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp:1085
> +    WKRetainPtr<WKStringRef> userAgent=
adoptWK(WKStringCreateWithUTF8CString(priv->userAgent.data()));

userAgent= -> userAgent =

> Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp:2636
> + * @application_name: The application name used to create the user agent. If
the value passed
> + * is %NULL or the empty string, the default user agent will be used.
> + * @application_version: The application version used to create the user
agent. If the value passed
> + * is %NULL or the empty string, the version of Safari at the time of this
release will be used.

Leave a single line, and add the explanation in the body.

@application_name: (allow-none): The application name used to create the user
agent.
@application_version: (allow-none): The application version used to create the
user agent.

> Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp:2642
> + */
> +
> +void webkit_settings_set_user_agent_with_application_details(WebKitSettings*
settings, const char* applicationName, const char* applicationVersion)

extra line there


More information about the webkit-reviews mailing list