[webkit-help] intercept all http requests, best way to run headless webkit

Steve Conover sconover at gmail.com
Tue Sep 28 07:53:25 PDT 2010


Hi,

1. I'm using the WebKit cocoa api and would like to intercept all http
traffic.  So, let's say a request is generated by a user action,
whether it's a GET, POST, Ajax GET, etc - I'd like to intercept the
http request, inspect it and do some work, and then return an http
response object that I've created, without the browser attempting to
do any further processing of the request (e.g. going out to the
internet).

What are my options, given my environment?  What would you recommend I do?


2. A more general question: what's the best way to construct a
headless webkit browser these days?  As I mentioned I'm using cocoa,
I've constructed a rudimentary headless Safari browser:

http://github.com/sconover/schnauzer/blob/master/lib/schnauzer.rb

I'm content to be tied to OSX, but obviously a cross-platform solution
would be preferable if that's doable/not too onerous.  What are people
doing these days to create embedded/"server-side" webkit instances?

Regards,
Steve


More information about the webkit-help mailing list