[webkit-qt] API Change for User Agent URL

Simon Hausmann simon.hausmann at nokia.com
Tue Mar 9 03:17:42 PST 2010


On Tuesday 09 March 2010 ext Holger Freyther, wrote:
> Hi All,
> 
> I have a small issue with our current QWebPage::userAgentForUrl
> implementation. It is obviously called for the main URL, the favicon.ico
> but if I'm not mistaken also for every subresource.
> 
> Every time it is called we are doing the following:
> 	1.) We take the WebCore::String of the KURL and turn it
> 	     into a QByteArray.
> 	2.) We ask QUrl to parse this QByteArray.
> 	3.) Pass it into the virtual function.
> 
> I have created this bug[1] with an alternative API. For me the main usecase
> of this function is user agent spoofing for an entire website. This is why
> I was adding a setUserAgent method. It needs to be set before opening a
> webpage and then applies to all following loads.
> 
> The cost of the API is the onetime conversion of QString to WebCore::String
> and then we can handle the user agent requests of WebCore inside the
> FrameLoaderClient class. It would be nice if you could measure the
> difference of using the old API vs, new API on a n900.

It's sad that we can't make things faster out of the box, but I certainly see 
the benefit of the more convenient API.

I'm in favour of adding the two functions to QWebPage.

Any other opinions?

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100309/249c26ad/attachment.bin>


More information about the webkit-qt mailing list