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

Steve Conover sconover at gmail.com
Wed Oct 6 17:55:22 PDT 2010


Another couple of questions - hoping people on webkit-dev might be able to help.

-Steve


---------- Forwarded message ----------
From: Steve Conover <sconover at gmail.com>
Date: Tue, Sep 28, 2010 at 7:53 AM
Subject: intercept all http requests, best way to run headless webkit
To: webkit-help at lists.webkit.org


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-dev mailing list