[webkit-dev] Change in how subresources work?

Rob Napier rnapier at employees.org
Fri Nov 23 19:24:01 PST 2007


Prior to 10.4.11, I had a WebKit program that worked like this:

* Load a Flash/Javascript app into a WebFrame
* Whenever the Flash app queries the server in a particular way (checked
with didFinishLoadingFromDataSource), grab the data it downloaded

The code looks like this:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [[webView mainFrame] loadRequest:
        [NSURLRequest requestWithURL:[NSURL URLWithString:@MYURL]]];
}

- (id)webView:(WebView *)sender identifierForInitialRequest:(NSURLRequest
*)request fromDataSource:(WebDataSource *)dataSource {
    return request;
}

-(void)webView:(WebView *)sender resource:(id)identifier
didFinishLoadingFromDataSource:(WebDataSource *)dataSource {
    if( [[[identifier URL] absoluteString]
rangeOfString:@"MYREQUEST"].location != NSNotFound ) {
        WebResource *r = [dataSource subresourceForURL:[identifier URL]];
        [self doStuff:[r data]];
    }
}

This seemed to work fine until I upgraded to 10.4.11 (also apparently broken
for Leopard). The problem seems to be that the relevant resource doesn't get
put into [dataSource subresources]. I note that quite a few resources aren't
being put here that I thought used to be. At first brush it seems to be
things that aren't cached. Is this an intentional change to WebKit or am I
misunderstanding something? Is there a more reliable way to get the
downloaded (but not necessarily visible) content from a webView?

-Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20071123/1ca005fe/attachment-0001.html


More information about the webkit-dev mailing list