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

Jesus Sanchez-Palencia jesus at webkit.org
Tue May 8 07:52:32 PDT 2012


Hi,

At https://bugs.webkit.org/show_bug.cgi?id=84953 we have been discussing
about implementing a "View Source" API for QQuickWebView (WebView for
QtQuick2).

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).
*!* Personal Pros: me gusta.


2- Implementing a bool webView.experimental.viewInSourceMode property.
*Pros: straight-forward API, doesn't add any complexity to the url property;
*Cons: transfers the entire decision on how to enable this to the browser
implementation.
*!* Personal Cons: no me gusta.


3- Implementing a WebViewSource { }, that inherits from WebView.
*Pros: a specialized and separate component, doesn't add any complexity to
the url property;
*Cons: not that straight-forward API (?!?), transfers the entire decision
on how to enable this to the browser implementation.
*!* Personal Pros: me gusta mucho.


Since this came up quite late on the entire API design for the brand new
QtWebKit, I would like to hear from you guys what you think.

Cheers and thanks in advance,
jesus


[1] http://www.iana.org/assignments/uri-schemes/prov/view-source
[2] http://en.wikipedia.org/wiki/View-source_URI_scheme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20120508/b575be38/attachment.html>


More information about the webkit-qt mailing list