Bug 35168

Summary: Please add WebFrameLoadDelegate callback for "didReceiveHead"
Product: WebKit Reporter: Dan Wood <dwood>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Enhancement    
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.6   

Dan Wood
Reported 2010-02-19 11:52:39 PST
I am finding that it would be useful to get a callback in my WebFrameLoadDelegate when the <head> element of a page has been loaded, so I can examine the various head elements (language, meta tags, scripts, etc.) as soon as possible. We have a very handy callback webView:didReceiveTitle:forFrame: and a similar one for the icon, but these are too specialized. It would be very useful to just have a general notification of the entire <head> being loaded. I could then inspect the DOM for the pieces I need. I have two suggestions for what this callback could look like. A simpler API would be one that just requires you to fetch the DOMDocument for the frame, so the API might look like this: - (void)webView:(WebView *)sender didReceiveHeadForFrame:(WebFrame *)frame Or, since the obvious thing you will need once you have received the head is to do some checking of the Head DOMNode, the API might look like this: - (void)webView:(WebView *)sender didReceiveHead:(DOMNode *)headNode forFrame:(WebFrame *)frame However, in practice, it might not be that useful to give us the head, since the client might actually want to invoke something like [[frame DOMDocument] getElementsByTagName:@"meta"] right away, and won't really care about the DOMNode of the head that got passed to it. So I would vote for the first, simpler API.
Attachments
Note You need to log in before you can comment on or make changes to this bug.