Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Knowing when WebView load has completed



On Dec 7, 2005, at 3:33 PM, Rush Manbert wrote:

Another dumb question. I want to get the HTML text for the web page that is being displayed in my WebView. I found a code snippet in the archives that does that, but I need to know when all of the data has been loaded.

Another search led me to:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame*) frame


If I register as the FrameLoadDelegate so I receive these calls, then when (frame == [myWebView mainFrame]) is the loading complete?

I tried this with ebay.com and I saw one call to didFinishLoadForFrame AFTER I had received the one that had the mainFrame ID, so I am suspicious of my approach. It looks like I got all of the data by copying it when I saw mainFrame, but there are race conditions galore.

The only other approach I can see is to count calls to webView:didCommitLoadForFrame and count down calls to webView:didFinishLoadForFrame and webView:didFailLoadWithError:forFrame and whenever they go to zero I conclude that a page load has completed.

Does anyone have a definitive answer?

Each frame is independent.

So if you need to know when all frames are loaded, you will need to keep count.

    -- Darin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >Knowing when WebView load has completed (From: Rush Manbert <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.