[webkit-qt] API Change for User Agent URL

Holger Freyther zecke at selfish.org
Tue Mar 9 01:46:46 PST 2010


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.

z


[1] https://bugs.webkit.org/show_bug.cgi?id=33875
	


More information about the webkit-qt mailing list