(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 |
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.
– webView:didStartProvisionalLoadForFrame:
– webView:didFinishLoadForFrame:
– webView:didCommitLoadForFrame:
– webView:willCloseFrame:
– webView:didChangeLocationWithinPageForFrame:
– webView:didCancelClientRedirectForFrame:
– webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:
– webView:didReceiveServerRedirectForProvisionalLoadForFrame:
Invoked when a client redirect has been cancelled.
- (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame
This might happen if a frame changes locations before a pending client redirect is fired. The client redirect occurred in frame.
WebFrameLoadDelegate.hInvoked when the scroll position within a frame has changed.
- (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hHandles notification that content has started arriving for a page load.
- (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hHandles failure of a partially completed page load.
- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hHandles failure to start loading data for a page.
- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hHandles notification that a page load has completed.
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hHandles notification of a page icon change.
- (void)webView:(WebView *)sender didReceiveIcon:(NSImage *)image forFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hInvoked when a provisional data source for a frame receives a server redirect.
- (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hInvoked when the page title for a frame has loaded or changed.
- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hHandles notification that a page load is in progress in a given frame.
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
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.
WebFrameLoadDelegate.hInvoked when a frame will be closed.
- (void)webView:(WebView *)sender willCloseFrame:(WebFrame *)frame
Invoked right before Web Kit is done with frame and the objects it owns.
WebFrameLoadDelegate.hInvoked 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
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.
WebFrameLoadDelegate.hInvoked when a frame’s scripting object for a page is available.
- (void)webView:(WebView *)sender windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject
The windowScriptObject argument is the window object in the scripting environment. This method is invoked before the page is actually loaded.
WebFrameLoadDelegate.h
Last updated: 2006-05-23