(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: required method
– webView:didFinishLoadForFrame: required method
– webView:didCommitLoadForFrame: required method
– webView:willCloseFrame: required method
– webView:didChangeLocationWithinPageForFrame: required method
– webView:didReceiveTitle:forFrame: required method
– webView:didReceiveIcon:forFrame: required method
– webView:didFailProvisionalLoadWithError:forFrame: required method
– webView:didFailLoadWithError:forFrame: required method
– webView:didCancelClientRedirectForFrame: required method
– webView:willPerformClientRedirectToURL:delay:fireDate:forFrame: required method
– webView:didReceiveServerRedirectForProvisionalLoadForFrame: required method
– webView:didClearWindowObject:forFrame: required method
– webView:windowScriptObjectAvailable: required method Deprecated in Mac OS X v10.4.11
Invoked when a client redirect is cancelled. (required)
- (void)webView:(WebView *)senderdidCancelClientRedirectForFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
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 changes. (required)
- (void)webView:(WebView *)senderdidChangeLocationWithinPageForFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
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.hInvoked when the JavaScript window object in a frame is ready for loading. (required)
- (void)webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame
The web view sending this message.
The cleared JavaScript window object.
The frame containing the JavaScript window object.
Use this method to set custom properties on the window object before the page is actually loaded.
WebFrameLoadDelegate.hInvoked when content starts arriving for a page load. (required)
- (void)webView:(WebView *)senderdidCommitLoadForFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
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.hInvoked when an error occurs loading a committed data source. (required)
- (void)webView:(WebView *)senderdidFailLoadWithError:(NSError *)errorforFrame:(WebFrame *)frame
The web view containing the frame.
The type of error that occurred during the load.
The frame being loaded.
This method is called after the data source has been committed but resulted in an error.
WebFrameLoadDelegate.hInvoked if an error occurs when starting to load data for a page. (required)
- (void)webView:(WebView *)senderdidFailProvisionalLoadWithError:(NSError *)errorforFrame:(WebFrame *)frame
The web view containing the frame.
Specifies the type of error that occurred during the load.
The frame being loaded.
The frame continues to display the committed data source if there is one.
WebFrameLoadDelegate.hInvoked when a page load completes. (required)
- (void)webView:(WebView *)senderdidFinishLoadForFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
This method is invoked when a location request for frame has successfully completed; that is, when all the resources are done loading. Additional information about the request can be obtained from the data source of frame.
WebFrameLoadDelegate.hInvoked when a page icon changes. (required)
- (void)webView:(WebView *)senderdidReceiveIcon:(NSImage *)imageforFrame:(WebFrame *)frame
The web view containing the frame.
The page icon for a data source.
The frame being loaded.
This method may be invoked multiple times before all resources for frame are completely loaded. Sometimes a page uses a default icon or stored image that changes when the actual images is loaded.
WebFrameLoadDelegate.hInvoked when a provisional data source for a frame receives a server redirect. (required)
- (void)webView:(WebView *)senderdidReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
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 of a frame loads or changes. (required)
- (void)webView:(WebView *)senderdidReceiveTitle:(NSString *)titleforFrame:(WebFrame *)frame
The web view containing the frame.
The newly loaded title.
The frame being loaded.
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.hInvoked when a page load is in progress in a given frame. (required)
- (void)webView:(WebView *)senderdidStartProvisionalLoadForFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
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 object or as a consequence of the user clicking a link displayed in a web frame view. 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. (required)
- (void)webView:(WebView *)senderwillCloseFrame:(WebFrame *)frame
The web view containing the frame.
The frame being loaded.
Invoked right before WebKit is done with frame and the objects it owns.
WebFrameLoadDelegate.hInvoked when a frame receives a client redirect and before it is fired. (required)
- (void)webView:(WebView *)senderwillPerformClientRedirectToURL:(NSURL *)URLdelay:(NSTimeInterval)secondsfireDate:(NSDate *)dateforFrame:(WebFrame *)frame
The web view containing the frame.
The redirect location.
The number of seconds from date before the redirect will be fired.
The date and time to fire the redirect.
The frame 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.hLast updated: 2009-04-08