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.