[webkit-gtk] Dynamic user agent
Carlos Garcia Campos
cgarcia at igalia.com
Thu May 8 07:07:34 PDT 2014
El mié, 07-05-2014 a las 18:27 -0003, Gustavo Noronha Silva escribió:
> 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
I didn't know it :-P
>
> 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
Thanks for the pointer. I've wrote a patch, for now it only converts the
latest changes we've made to the UA string as site specific quirks. Do
we still need a specific UA string for google sites now that we don't
have Chromium/Chrome in our UA?
See https://bugs.webkit.org/show_bug.cgi?id=132681
Adding new quirks should be easy.
>
> Gustavo Noronha
--
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20140508/4f26bad4/attachment.sig>
More information about the webkit-gtk
mailing list