[webkit-gtk] Dynamic user agent

Gustavo Noronha Silva gns at gnome.org
Wed May 7 11:30:01 PDT 2014


Hey,

On Ter, 6 Mai, 2014 at 7:54 , Carlos Garcia Campos <cgarcia at igalia.com> 
wrote:
> My first idea was to keep them static in the source code, similar to
> plugin quirks, but I agree that information might become obsolete 
> soon.

I wrote something exactly like this a while ago, specifically so that 
Google would stop misbehaving, so we did have something like this, but 
I think it was never ported to WebKit2

There's a FrameLoaderClient method that is called to get the User-Agent 
and is given a URL, so hooking there and having a list of sites and 
User-Agents would be enough; we could make that list be a text (or 
json) file that would make it easier to update, mapping domain patterns 
to user agents.

That's what we used to do:

http://trac.webkit.org/browser/releases/WebKitGTK/webkit-2.4.1/Source/WebKit/gtk/webkit/webkitwebsettings.cpp#L1647

Gustavo Noronha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20140507/bc9d8500/attachment.html>


More information about the webkit-gtk mailing list