[webkit-qt] Adding a "view source" API for WebView [feedback needed!]

Tor Arne Vestbø tor.arne.vestbo at nokia.com
Wed May 9 04:57:57 PDT 2012


On 08.05.12 16:52, Jesus Sanchez-Palencia wrote:
> Three approaches were suggested so far:
> 1- Implementing support to "view-source:http://www.foo.com" directly on
> the webView.url property, following view-source uri scheme [1] [2];
> *Pros: straight-forward API, follows other browsers implementations [2];
> *Cons: adds complexity to the url property, adds complexity to browser
> implementation for handling multiple url schemes (discussion about this
> on the bug).

I think this is the easiest option, as it does not need new API on the 
QML side. But, the logic of picking up view-source should happen on the 
web process side -- the UI side should know nothing about this special 
behavior (hence no complexity added to the url property).

It also makes it easy to add action to the default context menus to view 
page source and view frame source (we have to handle both cases).

(Chrome actually uses "view-source:http://foo.com", it's just that it 
hides the http scheme in the url bar (try copying the url into a text 

> 3- Implementing a WebViewSource { }, that inherits from WebView.
> *Pros: a specialized and separate component,

This is to me the least ideal solution, as a specialized and separate 
component is a con to me, indicating that we could not find a good API 
that ties in with the existing WebView or base QML items.

Tor Arne

More information about the webkit-qt mailing list