Deprecated WebUIDelegate Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in OS X v10.4.11

webView:runJavaScriptAlertPanelWithMessage:

Displays a JavaScript alert panel. (Deprecated in OS X v10.4.11. Use webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: instead.)

- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message
Parameters
sender

The web view that sent the message.

message

The message to display in the alert panel.

Discussion

This method is used to display a panel when JavaScript code calls alert. Delegates should visually indicate that this panel comes from JavaScript. The panel should have, for example, a single OK button. No action is taken if you do not implement this method.

Availability
  • Available in OS X v10.2 with Safari 1.0 and later.
  • Available in OS X v10.2.7 and later.
  • Deprecated in OS X v10.4.11.
Declared In
WebUIDelegate.h

webView:runJavaScriptConfirmPanelWithMessage:

Displays a JavaScript confirm panel. (Deprecated in OS X v10.4.11. Use webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame: instead.)

- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message
Parameters
sender

The web view that sent the message.

message

The message to display in the confirmation panel.

Discussion

This method is used to display a confirmation panel when JavaScript code calls confirm. It returns YES if confirmed, NO otherwise. Delegates should visually indicate that this panel comes from JavaScript. The panel should have, for example, an OK and Cancel button. No action is taken if you do not implement this method.

Availability
  • Available in OS X v10.2 with Safari 1.0 and later.
  • Available in OS X v10.2.7 and later.
  • Deprecated in OS X v10.4.11.
Declared In
WebUIDelegate.h

webView:runJavaScriptTextInputPanelWithPrompt:defaultText:

Displays a JavaScript text input panel and returns the entered text. (Deprecated in OS X v10.4.11. Use webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame: instead.)

- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText
Parameters
sender

The web view that sent the message.

prompt

The message to display in the text input panel.

defaultText

Default placeholder text to display in the text field.

Discussion

This method is used to provide an alternative prompt panel when JavaScript code calls prompt. Delegates should visually indicate that this panel comes from JavaScript. The panel should have an OK and Cancel button, and an editable text field. If you do not implement this method, a JavaScript text input panel is displayed.

Availability
  • Available in OS X v10.2 with Safari 1.0 and later.
  • Available in OS X v10.2.7 and later.
  • Deprecated in OS X v10.4.11.
Declared In
WebUIDelegate.h

webView:setContentRect:

Sets the window’s content view frame to the specified content rectangle. (Deprecated in OS X v10.4.11. Content rectangle calculations are automatic.)

- (void)webView:(WebView *)sender setContentRect:(NSRect)contentRect
Parameters
sender

The web view that sent the message.

contentRect

The location and size of the window’s content area.

Discussion

The content view is the highest accessible NSView object in the view hierarchy displayed in the window. A web view invokes this method instead of setting the content view’s frame directly, allowing delegates to augment the behavior by, for example, avoiding auto-saving of the size.

If this method is not implemented by the delegate, then webView:setFrame: is invoked with the rectangle returned by sending the NSWindow method frameRectForContentRect:styleMask: to the window.

Availability
  • Available in OS X v10.2 with Safari 1.0 and later.
  • Available in OS X v10.2.7 and later.
  • Deprecated in OS X v10.4.11.
Declared In
WebUIDelegate.h

webViewContentRect:

Returns a web view window's content rectangle. (Deprecated in OS X v10.4.11. Content rectangle calculations are automatic.)

- (NSRect)webViewContentRect:(WebView *)sender
Parameters
sender

The web view that sent the message.

Return Value

The content rectangle of the window that contains the web view.

Discussion

The content view is the highest accessible NSView object in the view hierarchy displayed in the window. A web view invokes this method instead of setting the content view’s frame directly, allowing delegates to alter the size that is returned.

Availability
  • Available in OS X v10.2 with Safari 1.0 and later.
  • Available in OS X v10.2.7 and later.
  • Deprecated in OS X v10.4.11.
Declared In
WebUIDelegate.h