WebView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/WebKit.framework |
| Availability | Available in OS X v10.2 with Safari 1.0 and later. Available in OS X v10.2.7 and later. |
| Companion guide | |
| Declared in | WebView.h |
Overview
WebView is the core view class in the WebKit framework that manages interactions between the WebFrame and WebFrameView classes. To embed web content in your application, you just create a WebView object, attach it to a window, and send a loadRequest: message to its main frame.
Behind the scenes, WebFrame objects encapsulate the content contained in a single frame element. A hierarchy of WebFrame objects is used to model an entire webpage where the root is called the main frame. There is a WebFrameView object per WebFrame object used to display the frame content. Therefore, there is a parallel hierarchy of WebFrameView objects used to render an entire page. The WebView object is also the parent view of this hierarchy. You do not need to create WebFrame and WebFrameView objects directly. These objects are automatically created when the page loads, either programmatically or by the user clicking a link.
You customize your embedded web content by implementing WebView delegates to handle certain aspects of the process. WebView objects have multiple delegates because the process of loading a webpage is asynchronous and complicated if errors occur. All the WebView delegates use informal protocols so you only need to implement only the delegates and methods that define the behavior you wish to change—default implementations are already provided.
For example, you might want to implement the frame load and resource load delegates to monitor the load progress and display status messages. Applications that use multiple windows may want to implement a user interface delegate. See the individual informal delegate protocols for more details: WebFrameLoadDelegate Protocol Reference, WebPolicyDelegate Protocol Reference, WebResourceLoadDelegate Protocol Reference, and WebUIDelegate Protocol Reference.
Another way to monitor load progress with less control is to observe the WebViewProgressEstimateChangedNotification, WebViewProgressFinishedNotification, and WebViewProgressStartedNotification notifications. For example, you could observe these notifications to implement a simple progress indicator in your application. You update the progress indicator by invoking the estimatedProgress method to get an estimate of the amount of content that is currently loaded.
A WebView object is intended to support most features you would expect in a web browser except that it doesn’t implement the specific user interface for those features. You are responsible for implementing the user interface objects such as status bars, toolbars, buttons, and text fields. For example, a WebView object manages a back-forward list by default, and has goBack: and goForward: action methods. It is your responsibility to create the buttons that would send theses action messages. Note, there is some overhead in maintaining a back-forward list and page cache, so you should disable it if your application doesn’t use it.
You use a WebPreferences object to encapsulate the preferences of a WebView object, such as the font, text encoding, and image settings. You can modify the preferences for individual WebView objects or specify a shared WebPreferences object using the setPreferencesIdentifier: method. Use the setAutosaves: WebPreferences method to specify whether the preferences should be automatically saved to the user defaults database.
You can also extend WebKit by implementing your own document view and representation classes for specific MIME types. Use the registerViewClass:representationClass:forMIMEType: class method to register your custom classes with a WebView object.
Tasks
Registering Document Views and Representations
Initializing Views
Closing the View
Getting the Main Frame
Loading Content
Drawing
-
– drawsBackground -
– setDrawsBackground: -
– setShouldUpdateWhileOffscreen: -
– shouldUpdateWhileOffscreen
Moving Back and Forward
-
– setMaintainsBackForwardList: -
– backForwardList -
– canGoBack -
– goBack -
– goBack: -
– canGoForward -
– goForward -
– goForward: -
– goToBackForwardItem:
Changing the Text Size
Getting and Setting Delegates
-
– downloadDelegate -
– setDownloadDelegate: -
– frameLoadDelegate -
– setFrameLoadDelegate: -
– policyDelegate -
– setPolicyDelegate: -
– resourceLoadDelegate -
– setResourceLoadDelegate: -
– UIDelegate -
– setUIDelegate:
Getting and Setting the Window
Getting and Setting Preferences
Getting and Setting Frame Contents
-
– isLoading -
– selectedFrame -
– setMainFrameURL: -
– mainFrameURL -
– mainFrameTitle -
– mainFrameIcon -
– mainFrameDocument
Getting and Setting Content Information
-
+ canShowMIMEType: -
+ MIMETypesShownAsHTML -
+ setMIMETypesShownAsHTML: -
+ canShowMIMETypeAsHTML: -
– supportsTextEncoding -
– customTextEncodingName -
– setCustomTextEncodingName: -
– textSizeMultiplier -
– setTextSizeMultiplier:
Searching the Document
Getting and Setting the Group Name
Getting and Setting User-agent Strings
-
– userAgentForURL: -
– applicationNameForUserAgent -
– setApplicationNameForUserAgent: -
– customUserAgent -
– setCustomUserAgent:
Processing JavaScript
Using the Pasteboard
-
+ URLFromPasteboard: -
+ URLTitleFromPasteboard: -
– pasteboardTypesForElement: -
– pasteboardTypesForSelection -
– writeElement:withPasteboardTypes:toPasteboard: -
– writeSelectionWithPasteboardTypes:toPasteboard:
Dragging
Cut, Copy and Paste Action Methods
Content Alignment Action Methods
Changing the Font, Color and Other Attributes When Editing
Spell-checking Action Methods
Find Panel Action Method
Controlling Speakable Text
Getting and Setting Document Editing Attributes
-
– isEditable -
– setEditable: -
– smartInsertDeleteEnabled -
– setSmartInsertDeleteEnabled: -
– isContinuousSpellCheckingEnabled -
– setContinuousSpellCheckingEnabled: -
– spellCheckerDocumentTag -
– undoManager -
– editingDelegate -
– setEditingDelegate: -
– editableDOMRangeForPoint:
Editing Documents
-
– replaceSelectionWithNode: -
– replaceSelectionWithText: -
– replaceSelectionWithMarkupString: -
– replaceSelectionWithArchive: -
– deleteSelection -
– moveToBeginningOfSentence: -
– moveToBeginningOfSentenceAndModifySelection: -
– moveToEndOfSentence: -
– moveToEndOfSentenceAndModifySelection: -
– selectSentence: -
– toggleContinuousSpellChecking: -
– toggleSmartInsertDelete: -
– canMakeTextStandardSize -
– makeTextStandardSize: -
– maintainsInactiveSelection
Selecting Content in the Document
Getting and Setting CSS Properties
-
– computedStyleForElement:pseudoElement: -
– mediaStyle -
– setMediaStyle: -
– typingStyle -
– setTypingStyle: -
– styleDeclarationWithText: -
– applyStyle:
Using WebScript
Class Methods
canShowMIMEType:
Returns whether the receiver can display content of a given MIME type.
Parameters
- MIMEType
The MIME type of the content.
Return Value
YES if the receiver can display content of the specified MIME type where MIMEType is one of the standard types like “image/gif”; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hcanShowMIMETypeAsHTML:
Returns whether the receiver interprets a MIME type as HTML.
Parameters
- MIMEType
The MIME type of the content.
Return Value
YES if the receiver interprets MIMEType as HTML; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hMIMETypesShownAsHTML
Returns a list of MIME types that WebKit renders as HTML.
Return Value
An array containing NSString objects that represent the MIME types WebKit attempts to render as HTML.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hregisterURLSchemeAsLocal:
Adds the specified URL scheme to the list of local schemes.
Parameters
- scheme
The scheme to add to the list.
Discussion
You need to register a scheme as local to access resources with file URLs and to have the same security checks as a local file.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hregisterViewClass:representationClass:forMIMEType:
Specifies the view and representation objects to be used for specific MIME types.
Parameters
- viewClass
A class conforming to the
WebDocumentViewprotocol that displays the specified MIME types.- representationClass
The class conforming to
WebDocumentRepresentationprotocol that represents the specified MIME types.- MIMEType
The MIME type of the content.
This may be a primary MIME type or subtype. For example, if MIMEType is “video/” the specified view and representation objects are used for all video types. More specific subtype mappings, such as “image/gif”, takes precedence over primary type matching, such as “image/”.
Discussion
After invoking this method, when MIMEType content is encountered, instances of representationClass and viewClass are created to handle and display it.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hsetMIMETypesShownAsHTML:
Sets the MIME types that WebKit attempts to render as HTML.
Parameters
- MIMETypes
An array of
NSStringobjects representing the MIME types. Typically, you create the MIMETypes array by adding additional types to the array returned by theMIMETypesShownAsHTMLclass method.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hURLFromPasteboard:
Returns a URL from the specified pasteboard.
Parameters
- pasteboard
The pasteboard containing a URL.
Return Value
The URL from the specified pasteboard or nil if there’s no URL on pasteboard.
Discussion
This method supports multiple pasteboard types including NSRULPboardType.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hURLTitleFromPasteboard:
Returns the title of a URL from the specified pasteboard.
Parameters
- pasteboard
The pasteboard containing the URL.
Return Value
The title of the URL on pasteboard. Returns nil if there’s no URL on pasteboard or the URL has no title.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hInstance Methods
alignCenter:
An action method that applies center alignment to selected content or all content if there’s no selection.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.halignJustified:
An action method that applies full justification to selected content or all content if there’s no selection.
Parameters
- sender
The object that sent this message.
Discussion
This method behaves similar to the alignJustified: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.halignLeft:
An action method that applies left justification to selected content or all content if there’s no selection.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.halignRight:
An action method that applies right justification to selected content or all content if there is no selection.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.happlicationNameForUserAgent
Returns the receiver’s application name that is used in the user-agent string.
Return Value
The application name to use in the user-agent string. The user-agent is used by websites to identify the client browser.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.happlyStyle:
Applies the CSS typing style to the current selection.
Parameters
- style
The style to apply to the current selection.
Discussion
This method does nothing if there is no current selection or if the current selection is collapsed.
This method hides the complexities of applying styles to elements. If necessary, this method will make multiple passes over the range of the current selection to ensure that the requested style is applied to the elements in that range, and takes into account the complexities of CSS style application rules. This method also simplifies styling attributes so that the minimum number of styling directives are used to yield a given computed style.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hbackForwardList
Returns the receiver’s back-forward list.
Return Value
The receiver’s back-forward list.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hcanGoBack
Returns whether the previous location can be loaded.
Return Value
YES if able to move backward; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hcanGoForward
Returns whether the next location can be loaded.
Return Value
YES if able to move forward; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hcanMakeTextLarger
Returns whether the text can be made larger.
Return Value
YES if able to make the text larger; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hcanMakeTextSmaller
Returns whether the text can be made smaller.
Return Value
YES if able to make the text smaller; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hcanMakeTextStandardSize
Returns whether the current text size is a multiple of 1.
Return Value
YES if the current text size is a multiple of 1; otherwise, NO.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hchangeAttributes:
An action method that changes the attributes of the current selection.
Parameters
- sender
The object that sent this message.
Discussion
This method behaves similar to the changeAttributes: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hchangeColor:
Sets the color of the selected content.
Parameters
- sender
The object that sent this message.
Discussion
This method is invoked by the NSColorPanel sender and behaves similar to the changeColor: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hchangeDocumentBackgroundColor:
Sets the background color of the selected content.
Parameters
- sender
The object that sent this message.
Discussion
This method is invoked by the NSColorPanel sender and behaves similar to the changeDocumentBackgroundColor: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hchangeFont:
An action method that changes the font of the selection, or all content if there is no selection.
Parameters
- sender
The object that sent this message.
Discussion
If the receiver doesn’t use the Fonts panel, this method does nothing.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hcheckSpelling:
An action method that searches for a misspelled word in the receiver.
Parameters
- sender
The object that sent this message.
Discussion
This action method starts a search at the end of the selection and continues until it reaches a word suspected of being misspelled or the end of the content. If a word isn’t recognized by the spelling server, a showGuessPanel: message is sent to the receiver which opens the Guess panel and allows the user to make a correction or add the word to the local dictionary.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hclose
Closes the web view when it’s no longer needed.
Discussion
Closes the web view by unloading its webpage and canceling any pending load requests. A closed web view no longer responds to new requests nor sends delegate messages. It is invoked automatically if the receiver’s enclosing window or host window is closed and sending shouldCloseWithWindow to the receiver returns YES. Use this method to stop the receiver from loading and sending delegate messages.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hcomputedStyleForElement:pseudoElement:
Returns the computed style of an element and its pseudo element.
Parameters
- element
The element whose computed style is returned.
- pseudoElement
The pseudo element for element.
Return Value
An immutable object describing the computed style of element and pseudoElement according to the Cascading Style Sheets Specification at http://www.w3.org/TR/CSS21. Returns nil if the receiver doesn’t display element.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hcopy:
Action method that copies the selected content to the general pasteboard.
Parameters
- sender
The object that sent this message.
Discussion
This action method copies the selected content onto the general pasteboard, in as many formats as the receiver supports. For example, a plain text object uses NSStringPboardType for plain text, and a rich text object also uses NSRTFPboardType.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hcopyFont:
An action method that copies font information onto the font pasteboard.
Parameters
- sender
The object that sent this message.
Discussion
This action method copies the font information for the first character of the selection (or for the insertion point) onto the font pasteboard as NSFontPboardType.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hcustomTextEncodingName
Returns the custom text encoding name.
Return Value
The receiver’s custom text encoding name or nil if no custom text encoding name was set.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hcustomUserAgent
Returns the receiver’s custom user-agent string.
Return Value
The user-agent string to identify the client browser. The custom user-agent string is used for all URLs.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hcut:
An action method that deletes selected content and puts it on the general pasteboard.
Parameters
- sender
The object that sent this message.
Discussion
This action method deletes the selected content and places it onto the general pasteboard, in as many formats as the receiver supports. For example, a plain text object uses NSStringPboardType for plain text, and a rich text object also uses NSRTFPboardType.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hdelete:
An action method that deletes the selected content.
Parameters
- sender
The object that sent this message.
Discussion
The pasteboard is unaffected by invoking this method.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hdeleteSelection
Deletes the receiver’s current selection unless it’s collapsed.
Discussion
No content is removed if the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) or if there is no current selection.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hdownloadDelegate
Return the receiver’s download delegate.
Return Value
The receiver’s download delegate that implements the WebDownload protocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hdrawsBackground
Returns whether the web view draws a background.
Return Value
YES if a background is drawn; otherwise, NO.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.heditableDOMRangeForPoint:
Returns the editable DOM object located at a given point.
Parameters
- point
The location of the editable DOM object.
Return Value
A single range object of the editable DOM object located at point in the receiver’s coordinates.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.heditingDelegate
Returns the receiver’s editing delegate.
Return Value
The receiver’s editing delegate.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.helementAtPoint:
Returns a dictionary description of the element at a given point in the receiver’s coordinates.
Parameters
- point
The point to represent as a dictionary.
Return Value
A dictionary description of the element at point in the receiver’s coordinates.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hestimatedProgress
Returns an estimate, as a percentage, of the amount of content that is currently loaded.
Return Value
A number ranging from 0 to 1.0 and, once a load completes, 1.0 until a new load starts, at which point it resets to 0.
The value is an estimate based on the total number of bytes expected to be received for a document, including all its possible subresources. For more accurate load progress information, implement delegates conforming to the WebFrameLoadDelegate and WebResourceLoadDelegate informal protocols.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hframeLoadDelegate
Return the receiver’s frame load delegate.
Return Value
A frame load delegate that conforms to the WebFrameLoadDelegate protocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hgoBack
Loads the previous location in the back-forward list.
Return Value
YES if able to move backward; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hgoBack:
An action method that loads the previous location in the back-forward list.
Parameters
- sender
The object that sent this message.
Discussion
This method does nothing if it is unable to move backward.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hgoForward
Loads the next location in the back-forward list.
Return Value
YES if able to move forward; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hgoForward:
An action method that loads the next location in the back-forward list.
Parameters
- sender
The object that sent this message.
Discussion
This method does nothing if it is unable to move forward.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hgoToBackForwardItem:
Loads a specific location from the back-forward list and sets it as the current item.
Parameters
- item
The index of the location to load. This method sets the current item in the back-forward list to item.
Return Value
YES if item is in the back-forward list; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hgroupName
Returns the receiver’s group name.
Return Value
The receiver’s group name.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hhostWindow
Returns the receiver’s host window.
Return Value
The receiver’s host window.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hinitWithFrame:frameName:groupName:
Initializes the receiver with a frame rectangle, frame name, and group name.
Parameters
- frameRect
The frame rectangle for the created view object.
- frameName
The web frame’s name. This should not be one of the predefined frame names (see the
WebFramefindFrameNamed:method for a description of their meaning), but a custom name or a name used in HTML source. This parameter can benil.- groupName
An arbitrary identifier used to group related frames. For example, JavaScript running in a frame can access any other frame in the same group. It's up to the application how it chooses to scope related frames. This parameter can be
nil.
Return Value
An initialized view object or nil if the object couldn't be created.
Discussion
This method is the designated initializer for the WebView class.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hisContinuousSpellCheckingEnabled
Returns whether the web view has continuous spell-checking enabled.
Return Value
YES if the object has continuous spell-checking enabled; otherwise, NO.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hisEditable
Returns whether the user is allowed to edit the document.
Return Value
YES if the receiver allows the user to edit the HTML document, NO if it doesn’t.
Discussion
You can change the receiver’s document programmatically regardless of this setting.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hisLoading
Returns whether the web view is loading content.
Return Value
YES if the web view is currently loading any resources; otherwise, NO.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmainFrame
Returns the main frame, the root of the web frame hierarchy for this page.
Return Value
The main frame.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hmainFrameDocument
Returns the DOM document for the main frame.
Return Value
The DOM document for the main frame.
Discussion
Invoking this method is equivalent to [[webView mainFrame] DOMDocument].
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmainFrameIcon
Returns the site’s favicon.
Return Value
The site’s icon. Returns nil if no favicon is provided.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmainFrameTitle
Returns the HTML title of the loaded page.
Return Value
The HTML title of the loaded page. Returns @"" if the loaded document is not HTML.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmainFrameURL
Returns the URL that the main frame loads.
Return Value
The main frame URL string.
Discussion
This method is functionally equivalent to invoking [[[[[webView mainFrame] provisionalDataSource] request] URL] absoluteString].
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmaintainsInactiveSelection
Returns whether the selection is maintained when focus is lost.
Return Value
YES if the selection is maintained when focus is lost; otherwise, NO.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmakeTextLarger:
Action method that increases the text size by one unit.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hmakeTextSmaller:
Action method that reduces the text size by one unit.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hmakeTextStandardSize:
Resets the text size to a multiple of 1.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmediaStyle
Returns the receiver’s CSS media property.
Return Value
The receiver’s CSS media property. nil if no media style was set.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hmoveDragCaretToPoint:
Moves the drag caret that indicates the destination of a drag operation to a given point.
Parameters
- point
The point to move the drag caret to.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hmoveToBeginningOfSentence:
Moves the insertion point to the beginning of the current sentence.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmoveToBeginningOfSentenceAndModifySelection:
Moves the insertion point and extends the selection to the beginning of the current sentence.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmoveToEndOfSentence:
Moves the insertion point to the end of the current sentence.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hmoveToEndOfSentenceAndModifySelection:
Moves the insertion point and extends the selection to the end of the current sentence.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hpaste:
An action method that pastes content from the pasteboard at the insertion point or over the selection.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hpasteAsPlainText:
An action method that pastes pasteboard content as plain text.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hpasteAsRichText:
An action method that pastes pasteboard content into the receiver as rich text, maintaining its attributes.
Parameters
- sender
The object that sent this message.
Discussion
The text is inserted at the insertion point if there is one; otherwise, it replaces the selection.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hpasteboardTypesForElement:
Returns an array of pasteboard types for an element.
Parameters
- element
The element whose pasteboard types you want.
Return Value
An array of pasteboard types for an element.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hpasteboardTypesForSelection
Returns an array of pasteboard types that can be used for the current selection of the receiver.
Return Value
An array of pasteboard types that can be used for the current selection of the receiver.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hpasteFont:
An action method that pastes font information from the font pasteboard.
Parameters
- sender
The object that sent this message.
Discussion
This action method pastes font information from the font pasteboard onto the selected content or insertion point of a rich text object, or over all text of the receiver.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hperformFindPanelAction:
An action method that opens the Find menu and Find panel.
Parameters
- sender
The object that sent this message.
Discussion
This method behaves similar to the performFindPanelAction: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hpolicyDelegate
Returns the receiver's policy delegate.
Return Value
A policy delegate that conforms to the WebPolicyDelegate protocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hpreferences
Returns the receiver’s preferences.
Return Value
The receiver’s preferences or the standard preferences, if the preferences were not set using the setPreferences: method.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hpreferencesIdentifier
Returns the identifier of the receiver’s preferences.
Return Value
The preferences identifier.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hreload:
An action method that reloads the current page.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hreloadFromOrigin:
Action method that performs an end-to-end revalidation using cache-validating conditionals if possible.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.6 and later.
See Also
-
reloadFromOrigin(WebView) -
– reload:
Declared In
WebView.hremoveDragCaret
Removes the drag caret that indicates the destination of a drag operation.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hreplaceSelectionWithArchive:
Replaces the current selection with an archive's contents.
Parameters
- archive
The archive that replaces the current selection.
Discussion
If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the archive, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the archive is not inserted.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hreplaceSelectionWithMarkupString:
Replaces the current selection with mixed text and markup.
Parameters
- markupString
The markup string that replaces the current selection.
Discussion
If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the markup, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the markup is not inserted.
See HTML Clipboard Format for a specification of the supported HTML markup.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hreplaceSelectionWithNode:
Replaces the receiver’s current selection with the specified DOM node.
Parameters
- node
The node that replaces the current selection. If
nil, aNOT_FOUND_ERRDOM error is thrown as an exception. Use thedeleteSelectionmethod to delete the selection.
Discussion
If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the node, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the node is not inserted.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hreplaceSelectionWithText:
Replaces the current selection with a string of text.
Parameters
- text
The text that replaces the current selection.
Discussion
If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the text, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the text is not inserted.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hresourceLoadDelegate
Returns the receiver’s resource load delegate.
Return Value
A resource load delegate that conforms to the WebResourceLoadDelegate protocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsearchFor:direction:caseSensitive:wrap:
Searches a document view for a string and highlights it if it is found.
Parameters
- string
The search string.
- forward
If
YESthe direction of the search is forward; ifNO, the direction is backward.- caseFlag
If
YESif the search is case sensitive; otherwise, it is not.- wrapFlag
If
YESif the search wraps; otherwise, it does not.
Return Value
YES if the search is successful; otherwise, NO.
Discussion
The search for string begins from the current selection and continues in the direction specified by forward. The search continues across all frames.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hselectedDOMRange
Returns the range of the current selection.
Return Value
The range of the current selection. nil if nothing is selected.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hselectedFrame
Returns the frame with the active selection.
Return Value
The frame that contains the first responder. If it doesn’t exist, the frame that contains a non-zero-length selection; otherwise, nil.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hselectionAffinity
Returns the current selection affinity.
Return Value
The preferred direction of selection—upward or downward—of the receiver’s current selection. For example, if text wraps across line boundaries, the value returned by this method indicates whether or not the insertion point appears after the last charactrer of the first line or before the first character of the following line.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hselectSentence:
Selects the entire sentence around the insertion point.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hsetApplicationNameForUserAgent:
Sets the application name used in the user-agent string.
Parameters
- applicationName
The application name to use in the user-agent string. The user-agent is used by websites to identify the client browser.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hsetContinuousSpellCheckingEnabled:
Sets whether the web view has continuous spell-checking enabled.
Parameters
- flag
YESif the object should have continuous spell-checking enabled; otherwise,NO.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hsetCustomTextEncodingName:
Sets the custom text encoding name.
Parameters
- encodingName
A text encoding name. If
nil, the default encoding is restored.
Discussion
This method overrides the default text encoding, including any encoding that is specified in the webpage header or HTTP response. Invoking this method stops any load in progress. The default encoding is restored when the main frame changes to a new location, or if encodingName is nil.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetCustomUserAgent:
Sets the receiver’s custom user-agent string.
Parameters
- userAgentString
The custom user-agent string. The user-agent string is used by websites to identify the client browser. The custom user-agent string is used for all URLs. If
nil, then the receiver constructs a user-agent string that produces the best rendering results for each URL.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hsetDownloadDelegate:
Sets the receiver's shared download delegate.
Parameters
- delegate
The download delegate that implements the
WebDownloadprotocol.
Discussion
WebKit may create WebDownload objects automatically to handle downloads that start with a webpage or link.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetDrawsBackground:
Sets whether a default background is drawn when the webpage has no background set.
Parameters
- drawsBackround
If
YES, a default background is drawn; ifNO, it is not.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hsetEditable:
Sets whether the receiver allows the user to edit its HTML document.
Parameters
- flag
YESif the receiver allows the user to edit the document.NOif an element in the receiver’s document can be edited only if theCONTENTEDITABLEattribute has been set on the element or one of its parent elements.
Discussion
You can change the receiver’s document programmatically regardless of this setting. By default a WebView object is not editable.
Normally, an HTML document is not editable unless the elements within the document are editable. This method provides a low-level way to make the contents of a WebView object editable without altering the document or DOM structure.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hsetEditingDelegate:
Sets the receiver’s editing delegate.
Parameters
- delegate
The editing delegate for the web view that conforms to the
WebEditingDelegateprotocol.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hsetFrameLoadDelegate:
Sets the receiver's frame load delegate.
Parameters
- delegate
A frame load delegate that conforms to the
WebFrameLoadDelegateprotocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetGroupName:
Sets the receiver's group name.
Parameters
- groupName
An arbitrary identifier used to group related frames.
Discussion
You might use this method to set the group name of a WebView object after it is loaded from a nib file.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hsetHostWindow:
Sets the receiver's host window.
Parameters
- hostWindow
A host window.
Discussion
This method sets the receiver’s host window to hostWindow. Your application should only use this method if a web view is going to be removed from its window temporarily, and you want the web view to continue operating (for example, you don’t want to interrupt a load in progress). Since the receiver maintains a copy of hostWindow, it is your responsibility to set the host window to nil before closing the window to avoid consuming excess memory.
For example, you might invoke this method if you attach a web view to an NSTabView object (as in a tabbed browser implementation). The NSTabView object takes views out of the window when they are not in the active tab, so you need to invoke this method before the web view is removed from its window. If you don't invoke this method, plug-ins will stop operating when the web view is removed from its window.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetMainFrameURL:
Sets the URL that the main frame loads.
Parameters
- URLString
The main frame URL string.
Discussion
This method is functionally equivalent to invoking [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:URLString]]].
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hsetMaintainsBackForwardList:
Sets whether to use a back-forward list.
Parameters
- flag
If
NO, clears the back-forward list and relinquishes ownership the page cache; otherwise, it does not.
Discussion
The back-forward list maintains a page cache, so applications that do not use the goForward or goBack methods should disable it.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetMediaStyle:
Sets the receiver’s CSS media property.
Parameters
- mediaStyle
The CSS media property for the receiver.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hsetPolicyDelegate:
Sets the receiver's policy delegate.
Parameters
- delegate
A policy delegate that conforms to the
WebPolicyDelegateprotocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetPreferences:
Sets the receiver’s preferences.
Parameters
- preferences
The web view’s preferences.
Discussion
Typically, you do not invoke this method directly. Use the setPreferencesIdentifier: method to change the receiver’s preferences.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetPreferencesIdentifier:
Sets the receiver's preferences identifier, creating a preferences object if needed.
Parameters
- anIdentifier
The unique identifier for the preferences—it is fixed to the keys used to store the receiver’s preferences in the user defaults database.
WebViewobjects can share instances of theWebPreferencesclass by using the same preferences identifier.
Discussion
This method sets the receiver’s preferences to the specified preferences object if it exists. Otherwise, this method creates a new WebPreferences object for the receiver initialized with anIdentifier. Use this method to change the preferences used by the receiver’s WebFrameView objects. If you do not directly set the preferences, WebFrameView objects use the preferences returned by the standardPreferences class method of WebPreferences.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetResourceLoadDelegate:
Sets the receiver's resource load delegate.
Parameters
- delegate
A resource load delegate that conforms to the
WebResourceLoadDelegateprotocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetSelectedDOMRange:affinity:
Selects a range of nodes.
Parameters
- range
The range of nodes to select. If range is
nil, the current selection is cleared. This method raises aDOMRangeExceptonif the range has been detached or refers to nodes not displayed by the receiver.- selectionAffinity
See the selectionAffinity method for information on selection affinity.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hsetShouldCloseWithWindow:
Sets whether the web view should close when its window or host window closes.
Parameters
- close
If
YES, the web view should close; otherwise, it should not.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hsetShouldUpdateWhileOffscreen:
Sets whether the web view should update even when it is not in a window that is currently visible.
Parameters
- updateWhileOffscreen
If
YES, the web view updates regardless if it is visible. IfNO, it updates only if it is visible, possibly improving performance, and then updates automatically when it becomes visible. The default value isYES.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
WebView.hsetSmartInsertDeleteEnabled:
Sets whether the receiver should insert or delete spaces around selected words to preserve proper spacing and punctuation.
Parameters
- flag
If
YES, the receiver performs smart insert and delete; ifNO, it inserts and deletes exactly what’s selected.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hsetTextSizeMultiplier:
Change the font size multiplier for text displayed in web frame view objects managed by the receiver.
Parameters
- multiplier
A fractional percentage value where
1.0denotes 100%.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hsetTypingStyle:
Sets the receiver’s CSS typing style.
Parameters
- style
The receiver’s CSS typing style.
Discussion
The typing style is reset automatically when the receiver’s selection changes.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hsetUIDelegate:
Sets the receiver's user interface delegate.
Parameters
- delegate
A user interface delegate that conforms to the
WebUIDelegateprotocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hshouldCloseWithWindow
Returns whether the web view should close when its window or host window closes.
Return Value
If YES, the web view should close; otherwise, it should not.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.hshouldUpdateWhileOffscreen
Returns whether the web view should update even when it is not visible.
Return Value
YES if it should update even when it is not visible; otherwise, NO.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
WebView.hshowGuessPanel:
An action method that shows a spelling correction panel.
Parameters
- sender
The object that sent this message.
Discussion
This action method opens the Spelling panel, allowing the user to make a correction during spell checking.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hsmartInsertDeleteEnabled
Returns whether smart-space insertion and deletion is enabled.
Return Value
YES if the receiver inserts or deletes space around selected words so as to preserve proper spacing and punctuation. NO if it inserts and deletes exactly what’s selected.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hspellCheckerDocumentTag
Returns the spell-checker document tag for this document.
Return Value
The document tag for this web view. A tag identifying the receiver’s text as a document for the spell-checker server. See the NSSpellChecker and NSSpellServer class specifications for more information on how this tag is used.
The return value changed from unsigned int to a NSUInteger in OS X v10.5.
Availability
- Available in OS X v10.3.9 and later.
See Also
-
spellCheckerDocumentTag(NSTextView)
Declared In
WebView.hstartSpeaking:
An action method that starts speaking the selected text or all text if there’s no selection.
Parameters
- sender
The object that sent this message.
Discussion
Speech continues asynchronously until the end of the text or until terminated by invoking the stopSpeaking: method. This method behaves similar to the startSpeaking: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hstopLoading:
An action method that stops the loading of any web frame content managed by the receiver.
Parameters
- sender
The object that sent this message.
Discussion
Stops any content in the process of being loaded by the main frame or any of its children frames. Does nothing if no content is being loaded.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hstopSpeaking:
An action method that stops speaking that is in progress.
Parameters
- sender
The object that sent this message.
Discussion
This action method stops speech that was previously started with startSpeaking:. This method behaves similar to the stopSpeaking: method in NSTextView.
Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hstringByEvaluatingJavaScriptFromString:
Returns the result of running a script.
Parameters
- script
The script to run.
Return Value
The result of running a JavaScript specified by script, or an empty string if the script failed.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.hstyleDeclarationWithText:
Returns the CSS style declaration for the specified text.
Parameters
- text
The text whose style declaration is returned.
Return Value
The style declaration for text.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hsupportsTextEncoding
Returns whether the document view supports different text encodings.
Return Value
YES if the receiver’s document view can support different text encodings; otherwise, NO.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
Declared In
WebView.htakeStringURLFrom:
Sets the receiver’s current location by obtaining a URL string from the sender.
Parameters
- sender
The object that sent this message.
Discussion
This method sets the receiver’s current location to the value obtained by sending a stringValue message to sender, then starts loading the URL returned by sender.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
-
loadRequest:(WebFrame)
Declared In
WebView.htextSizeMultiplier
Returns the font size multiplier for text displayed in web frame view objects managed by the receiver.
Return Value
The font size multiplier, a fractional percentage value where 1.0 denotes 100%.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.htoggleContinuousSpellChecking:
Toggles whether continuous spell checking is available.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.htoggleSmartInsertDelete:
Toggles whether spaces around selected words are inserted or deleted to preserve proper spacing and punctuation.
Parameters
- sender
The object that sent this message.
Availability
- Available in OS X v10.4.11 and later.
Declared In
WebView.htypingStyle
Returns the receiver’s CSS typing style.
Return Value
The receiver’s CSS typing style.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hUIDelegate
Returns the receiver's user interface delegate.
Return Value
A user interface delegate that conforms to the WebUIDelegate protocol.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hundoManager
Returns the receiver’s undo manager.
Return Value
The receiver’s undo manager.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.huserAgentForURL:
Returns the appropriate user-agent string for a given URL.
Parameters
- URL
The URL that you need the user-agent string for.
Return Value
The user-agent string for a given URL. The user-agent string is used by websites to identify the client browser.
Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hwindowScriptObject
Returns the receiver’s window object from the scripting environment.
Return Value
The receiver’s window object.
Availability
- Available in OS X v10.3.9 and later.
See Also
-
objectForWebScript(WebPlugIn) (WebFrameLoadDelegate) -
webView:windowScriptObjectAvailable:
Declared In
WebView.hwriteElement:withPasteboardTypes:toPasteboard:
Writes an element to the pasteboard using a list of types.
Parameters
- element
The element to write to the pasteboard.
- types
The pasteboard types to use for the element.
- pasteboard
The pasteboard to use for writing.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hwriteSelectionWithPasteboardTypes:toPasteboard:
Writes the receiver’s current selection to a pasteboard using a list of types.
Parameters
- types
The pasteboard types to use for the selection.
- pasteboard
The pasteboard to use for writing.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hConstants
Element Dictionary Keys
Predefined keys used to access an element dictionary.
extern NSString *WebElementDOMNodeKey; extern NSString *WebElementFrameKey; extern NSString *WebElementImageAltStringKey; extern NSString *WebElementImageKey; extern NSString *WebElementImageRectKey; extern NSString *WebElementImageURLKey; extern NSString *WebElementIsSelectedKey; extern NSString *WebElementLinkURLKey; extern NSString *WebElementLinkTargetFrameKey; extern NSString *WebElementLinkTitleKey; extern NSString *WebElementLinkLabelKey;
Constants
WebElementDOMNodeKeyThe DOMNode for this element.
Available in OS X v10.3 and later.
Declared in
WebView.h.WebElementFrameKeyThe WebFrame object associated with this element.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementImageAltStringKeyAn NSString of the ALT attribute of an image element.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementImageKeyAn NSImage representing an image element.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementImageRectKeyAn NSValue containing an NSRect, the size of an image element.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementImageURLKeyAn NSURL containing the location of an image element.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementIsSelectedKeyAn NSNumber used as a BOOL value to indicate whether a text element is selected or not. Zero value indicates false, true otherwise.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementLinkURLKeyAn NSURL containing the location of a link if the element is within an anchor.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementLinkTargetFrameKeyThe WebFrame object associated with the target of the anchor.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementLinkTitleKeyAn NSString containing the title of an anchor.
Available in OS X v10.2 and later.
Declared in
WebView.h.WebElementLinkLabelKeyAn NSString containing the text within an anchor.
Available in OS X v10.2 and later.
Declared in
WebView.h.
Discussion
These constants represent predefined keys used to access an element dictionary. An element dictionary is an NSDictionary representation of an HTML element, as in a clicked or selected element. Some methods in the WebPolicyDelegate informal protocol have an element dictionary argument. The descriptions below describe the dictionary value for the key.
Notifications
WebViewDidBeginEditingNotification
userInfo dictionary.Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hWebViewDidChangeNotification
userInfo dictionary. Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hWebViewDidChangeSelectionNotification
userInfo dictionary. Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hWebViewDidChangeTypingStyleNotification
userInfo dictionary. Availability
- Available in OS X v10.3.9 and later.
See Also
Declared In
WebView.hWebViewDidEndEditingNotification
userInfo dictionary. Availability
- Available in OS X v10.3.9 and later.
Declared In
WebView.hWebViewProgressEstimateChangedNotification
WebViewProgressStartedNotification notification is posted. The notification object is the WebView for which the progress value has changed. This notification does not contain a userInfo dictionary.Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hWebViewProgressFinishedNotification
userInfo dictionary.Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.hWebViewProgressStartedNotification
userInfo dictionary.Availability
- Available in OS X v10.2 with Safari 1.0 and later.
- Available in OS X v10.2.7 and later.
See Also
Declared In
WebView.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-02-24)