[webkit-qt] Preventing net access for specific WebView

Thomas McGuire thomas.mcguire at kdab.com
Mon May 6 02:51:52 PDT 2013


Hi Jan,

On Monday 06 May 2013 10:04:49 Jan Kundrát wrote:
> On Thursday, 14 March 2013 15:10:10 CEST, Thomas McGuire wrote:
> > Any ideas are welcome, I am that desperate that I even
> > considered creating URL
> > scheme delegates for HTTP and HTTPS...
> 
> Hi Thomas,
> have you solved this problem?

Haven't worked on that since, but here is the plan on what I'll do:
- Globally set the SOCKS5 proxy via an environment variable (needs 
https://codereview.qt-project.org/#change,54507)
- Add a new property "networkAccessEnabled" to WebView (which will end up as a 
boolean member in WebPage in the WebProcess)
- In QtNetworkAccessManager::createRequest(), call 
QNAM::setNetworkAccessible(false) if networkAccessEnabled of the originating 
web page is set to false

This way, network requests can be disabled on a per-page basis.

Not sure what to do with WebSockets (SocketStreamHandle class) yet, I don't 
think I can access the originating web page there. I might just 
unconditionally disable streaming sockets for destinations other than 
localhost, as a hacky workaround.

Not sure how upstreamable all this will be, especially considering the work to 
enable the seperate network process.

Regards,
Thomas
-- 
Thomas McGuire | thomas.mcguire at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20130506/c2a8cbe4/attachment.sig>


More information about the webkit-qt mailing list