On Oct 29, 2008, at 9:30 AM, Andrew S. Townley wrote:

Fair enough. What I'm looking for at a minimum is the headers associated with each HTTP response.

You'd get at those through the resource load delegate. When a resource is loaded the delegate receives an Objective-C method call, named:

    webView:resource:didReceiveResponse:fromDataSource:

The response argument is an NSURLResponse object. After determining that it's an HTTP response, using -[NSObject isKindOfClass:] it can be cast to NSHTTPURLResponse and you can use methods such as - [NSHTTPURLResponse allHeaderFields] and -[NSHTTPURLResponse statusCode] on it.

It would be nice to also be able to extract any HTML meta tags and have access to those as well.

That can be done with the DOM API. Something like this:

DOMNodeList *metaElements = [[webView mainFrameDocument] getElementsByTagName:@"meta"];
    NSUInteger count = [metas length];
    for (NSUInteger i = 0; i < count; ++i) {
        DOMElement *metaElement = (DOMElement *)[metaElements item:i];
        NSString *nameAttribute = [metaElement getAttribute:@"name"];
        // ... more work here
    }

FYI, some of the things you mentioned from the Firefox dialog are things that are either part of the networking library or part of the browser application proper, and not controlled or tracked by WebKit.

    -- Darin

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to