[webkit-qt] Adding a "view source" API for WebView [feedback needed!]
jocelyn.turcotte at nokia.com
Thu May 10 05:32:54 PDT 2012
On Wed, 9 May 2012 17:24:59 -0300
ext Jesus Sanchez-Palencia <jesus at webkit.org> wrote:
> We would need to move that into WebPage::loadURL, which would make us use
> QUrl::fromUserInput there. This has been crucified already on the
> discussions at the bug report. In other words, we would need to:
> 1- remove the view-source scheme;
> 2- sanitize the url by calling QUrl::fromUserInput;
> 3- call WebPage::loadURLRequest using this sanitized and view-source free
I don't think we need to sanitize view-source URLs, they will be generated from the current URL most of the time and if the user really want to enter it manually then he just has to do it properly. Independently if we do it in the web or UI process.
> On the way, back, on the UI Process, we would end up with a url property
> that wouldn't contain the view-source scheme, so some logic would be needed
> there as well in order to re-add it.
Depending on how much edge-case this would force us to handle, it would be worth trying changing the scheme in WebFrame::url if inViewSourceMode() is true, before it goes to the UI process.
But I'm pretty sure that there are URLs poping out of pretty much all sides of WebCore in loader clients, etc. that would need to be converted as well, so I wouldn't be surprised if that doesn't work out of the box.
More information about the webkit-qt