Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

WebFrameLoadDelegate Protocol Reference

(informal protocol)

Framework
/System/Library/Frameworks/WebKit.framework
Availability
Available in Mac OS X v10.2 with Safari 1.0 and later.
Available in Mac OS X v10.2.7 and later.
Companion guide
Declared in
WebFrameLoadDelegate.h

Overview

WebView frame load delegates implement this informal protocol to be notified while frame loads are in progress. Delegates are notified when a frame load starts, when a page title or icon is loaded, when a redirect occurs, when a data source is committed, and when the change is complete. The webView:didStartProvisionalLoadForFrame: method is invoked when a frame load starts, and the webView:didFinishLoadForFrame: method is invoked when the change is done. However, depending on the content being loaded, some of the other methods defined in this protocol may be invoked multiple times. All the methods in this protocol are optional.

Tasks

State Change Messages

Data Received Messages

Error Messages

Client and Server Redirect Messages

WebScript Messages

Instance Methods

webView:didCancelClientRedirectForFrame:

Invoked when a client redirect has been cancelled.

- (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame

Discussion

This might happen if a frame changes locations before a pending client redirect is fired. The client redirect occurred in frame.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:didChangeLocationWithinPageForFrame:

Invoked when the scroll position within a frame has changed.

- (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame

Discussion

Typically, invoked when the user clicks on an anchor within a page. Additional information about the request can be obtained from the data source of frame.

Availability
Declared In
WebFrameLoadDelegate.h

webView:didCommitLoadForFrame:

Handles notification that content has started arriving for a page load.

- (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame

Discussion

This method is invoked when a data source transitions from a provisional to committed state—that is, once the data source of frame has received one byte or more of data. This method is invoked after a webView:didStartProvisionalLoadForFrame: message but before a webView:didFinishLoadForFrame: message is sent to the delegate.

In some cases, a single frame load may be committed more than once. This happens in the case of multipart/x-mixed-replace, also known as a “server push.” In this case, a single frame load results in multiple documents loaded in sequence. This method is invoked once for each document that is successfully loaded.

Availability
Declared In
WebFrameLoadDelegate.h

webView:didFailLoadWithError:forFrame:

Handles failure of a partially completed page load.

- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame

Discussion

This method is invoked when sender fails to load a committed data source for frame. The error argument specifies the type of error that occurred during the load. This method is called after the data source has been committed but resulted in an error.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:didFailProvisionalLoadWithError:forFrame:

Handles failure to start loading data for a page.

- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame

Discussion

This method is invoked when sender fails to load a provisional data source for frame. The error argument specifies the type of error that occurred during the load. The frame will continue to display the committed data source if there is one.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:didFinishLoadForFrame:

Handles notification that a page load has completed.

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame

Discussion

This method is invoked when a location request for frame has successfully; that is, when all the resources are done loading. Additional information about the request can be obtained from the data source of frame.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:didReceiveIcon:forFrame:

Handles notification of a page icon change.

- (void)webView:(WebView *)sender didReceiveIcon:(NSImage *)image forFrame:(WebFrame *)frame

Discussion

This method is invoked when the page icon for a data source, designated by image, has loaded or changed. Note that this method may be invoked multiple times before all resources for frame are completely loaded. Sometimes a page will use a default icon or stored image that will change when the actual images is loaded.

Availability
Declared In
WebFrameLoadDelegate.h

webView:didReceiveServerRedirectForProvisionalLoadForFrame:

Invoked when a provisional data source for a frame receives a server redirect.

- (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame

Discussion

A server redirect is when one URL location is redirected to another. Additional information about the new request can be obtained from the data source of frame.

Availability
Declared In
WebFrameLoadDelegate.h

webView:didReceiveTitle:forFrame:

Invoked when the page title for a frame has loaded or changed.

- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame

Discussion

The title argument contains the newly loaded title. Note that this method may be invoked multiple times before all resources for frame are completely loaded. Delegates might implement this message to display the page title to the user.

Availability
Declared In
WebFrameLoadDelegate.h

webView:didStartProvisionalLoadForFrame:

Handles notification that a page load is in progress in a given frame.

- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame

Discussion

This method is invoked when a new client request is made by sender to load a provisional data source for frame. This method may be invoked after sending loadRequest: to a WebFrame or as a consequence of the user clicking a link displayed in a WebFrameView. Delegates might implement this method to notify the user that a request is in progress. Additional information about the request can be obtained from the data source of frame.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:willCloseFrame:

Invoked when a frame will be closed.

- (void)webView:(WebView *)sender willCloseFrame:(WebFrame *)frame

Discussion

Invoked right before Web Kit is done with frame and the objects it owns.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:

Invoked when a frame receives a client redirect and before it is fired.

- (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame

Discussion

The URL argument contains the redirect location, seconds specifies the number of seconds from date before the redirect will be fired, and frame is where the redirect occurred. Delegates might implement this method to display progress while a client redirect is pending. If a client redirect is cancelled the webView:didCancelClientRedirectForFrame:delegate method is invoked.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

webView:windowScriptObjectAvailable:

Invoked when a frame’s scripting object for a page is available.

- (void)webView:(WebView *)sender windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject

Discussion

The windowScriptObject argument is the window object in the scripting environment. This method is invoked before the page is actually loaded.

Availability
See Also
Declared In
WebFrameLoadDelegate.h

Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice