Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Problem with didCommitLoadForFrame delegate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with didCommitLoadForFrame delegate?



Hi

I am seeing a problem with using the didCommitLoadForFrame delegate
with a WebView in an Objective C cocoa application.

Basically when loading certain pages I am getting two callbacks to
didCommitLoadForFrame, the first dataSource contains the correct URL
of the newly loaded page and the second contains about:blank. It
doesn't happen on loading all pages but where it does happen, it
happens consistently.

I am not seeing anything funny about the HTTP headers[1] for the pages
where I see two callbacks compared to those where I only see one.

I have knocked up a quick sample application[2] which demonstrates
this in a simple as possible project. In the sample, I have a
didCommitLoadForFrame delegate which looks like this:

- (void)webView: (WebView*)sender didCommitLoadForFrame: (WebFrame*)frame {
  NSURL *url = [[[frame dataSource] request] URL];
  NSLog(@"Committed '%@'", url);
}

If you look at the log after trying both URL's that the app hits, you see this:

Committed 'http://en.wikipedia.org/wiki/Ocean'
Committed 'http://en.wikipedia.org/wiki/Arctic_Ocean'
Committed 'about:blank'

I see this behaviour on about 50% of wikipedia pages but it is not
specific to wikipedia, it occurs across many sites across the web.

Cheers
Dave

[1] - http://www.pastie.org/private/wcpkpftlpll6xmiau0niq
[2] - http://files.shinydevelopment.com/WebViewCommitBug.zip

--
e-mail: email@hidden
web: http://shinydevelopment.com

Shiny Development Ltd. is registered in England, Registration Number:
05805802. Registered Office: 4 Claridge Court, Lower Kings Road,
Berkhamsted, Herts., HP4 2AF.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.