Display web content in windows. Implement browser features such as following user-activated links, managing a back-forward list, and managing a history of recently visited pages.


WebKit provides a set of classes to display web content in windows, and implements browser features such as following links when clicked by the user, managing a back-forward list, and managing a history of pages recently visited. WebKit greatly simplifies the complicated process of loading webpages—that is, asynchronously requesting web content from an HTTP server where the response may arrive incrementally, in random order, or partially due to network errors. WebKit also simplifies the process of displaying that content which can contain various MIME types, and compound frame elements each with their own set of scroll bars.



Safari Tools and Features

Optimize your web content for Safari using browser-supported features and tools.


protocol WKNavigationDelegate

The methods of the WKNavigationDelegate protocol help you implement custom behaviors that are triggered during a web view's process of accepting, loading, and completing a navigation request.

class WKProcessPool

A WKProcessPool object represents a pool of Web Content processes.

class WKWindowFeatures

A WKWindowFeatures object specifies optional attributes for the containing window when a new web view is requested.

class WKWebView

An object that displays interactive web content, such as for an in-app browser.

class WKWebViewConfiguration

A collection of properties used to initialize a web view.

class WKPreferences

A WKPreferences object encapsulates the preference settings for a web view.

protocol WKUIDelegate

The WKUIDelegate class provides methods for presenting native user interface elements on behalf of a webpage.

Viewing Desktop or Mobile Web Content Using a Web View

Implement a simple iPad web browser that can view either the desktop or mobile version of a website.


class WKNavigation

A WKNavigation object contains information for tracking the loading progress of a webpage.

class WKNavigationAction

A WKNavigationAction object contains information about an action that may cause a navigation, used for making policy decisions.

class WKNavigationResponse

A WKNavigationResponse object contains information about a navigation response, used for making policy decisions.

Back-Forward List

class WKBackForwardList

A WKBackForwardList object maintains a list of visited pages used to go back and forward to the most recent page.

class WKBackForwardListItem

A WKBackForwardListItem object represents a webpage in the back-forward list of a web view.

Element and Frame Information

class WKFrameInfo

A WKFrameInfo object contains information about a frame on a webpage.

Website Data

class WKWebsiteDataRecord

A WKWebsiteDataRecord object represents website data grouped by the originating URL’s domain name and suffix.

class WKWebsiteDataStore

A WKWebsiteDataStore object represents various types of data used by a chosen website. Data types include cookies, disk and memory caches, and persistent data such as WebSQL, IndexedDB databases, and local storage.

File Loading

class WKOpenPanelParameters

A WKOpenPanelParameters object contains the parameters that a file upload control has specified.


class WKUserContentController

A WKUserContentController object provides a way for JavaScript to post messages and inject user scripts to a web view.

class WKScriptMessage

A WKScriptMessage object contains information about a message sent from a webpage.

class WKUserScript

A WKUserScript object represents a script that can be injected into a webpage.

protocol WKScriptMessageHandler

A class conforming to the WKScriptMessageHandler protocol provides a method for receiving messages from JavaScript running in a webpage.

URL Scheme Handling

protocol WKURLSchemeHandler

A protocol for loading resources with URL schemes that WebKit doesn't know how to handle.

protocol WKURLSchemeTask

A task created to load a resource.

First-party webpages

class WKSecurityOrigin

A WKSecurityOrigin object consists of a host name, a protocol, and a port number. A first-party load is any load URL has the same security origin as the requesting web site. First-party webpages can access each other’s resources such as scripts and databases.


class WKPreviewElementInfo

The WKPreviewElement object contains information for previewing a webpage.

protocol WKPreviewActionItem

The WKPreviewActionItem protocol provides access to the properties of a Preview action item.



Create automated tests of your web content using WebDriver commands.

macOS WebDriver Commands for Safari 11.1 and earlier

Test your web content using the WebDriver commands supported by Safari 11.1 and earlier.

macOS WebDriver Commands for Safari 12 and later

Test your web content using the WebDriver commands supported by Safari 12 and later.

About WebDriver for Safari

Enhance testing of your web content using Safari’s enhancements to WebDriver.

Testing with WebDriver in Safari

Enable WebDriver and run a test.


struct WKError

Possible error values that can be returned from WebKit APIs.


WebKit Enumerations

WebKit enumerations affecting multiple classes.

WebKit Data Types

WebKit data types affecting multiple classes.