Framework

WebKit

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.

Overview

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.

Topics

Safari

Safari Tools and Features

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

Initialization

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.

WKProcessPool

A WKProcessPool object represents a pool of Web Content processes.

WKWindowFeatures

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

WKWebView

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

WKWebViewConfiguration

A collection of properties used to initialize a web view.

WKPreferences

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

WKUIDelegate

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

Navigation

WKNavigation

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

WKNavigationAction

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

WKNavigationResponse

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

Back-Forward List

WKBackForwardList

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

WKBackForwardListItem

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

Element and Frame Information

WKFrameInfo

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

Website Data

WKWebsiteDataRecord

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

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

WKOpenPanelParameters

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

Scripts

WKUserContentController

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

WKScriptMessage

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

WKUserScript

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

WKScriptMessageHandler

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

URL Scheme Handling

WKURLSchemeHandler

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

WKURLSchemeTask

A task created to load a resource.

First-party webpages

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.

Preview

WKPreviewElementInfo

The WKPreviewElement object contains information for previewing a webpage.

Deprecated
WKPreviewActionItem

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

Deprecated

Netscape Plug-in APIs and Data Types

Netscape Plug-in APIs and Data Types

Contains functions, data types, structures, and enumerations associated with the Netscape plug-in. Only shows the structure of this information, no extra information is provided.

WebDriver

macOS WebDriver Commands for Safari 11.1 and earlier

WebDriver is a browser-automation API that you use to create automated tests of your web content. The Safari implementation of WebDriver supports the Selenium JSON Wire Protocol.

macOS WebDriver Commands for Safari 12 and later

WebDriver is a browser-automation API that you use to create automated tests of your web content. The Safari implementation of WebDriver supports the W3C endpoints.

About WebDriver for Safari

Read about Safari’s enhanced implementation of a common API for test automation.

Testing with WebDriver in Safari

Enable WebDriver and run a test.

Reference

WebKit Enumerations

WebKit enumerations affecting multiple classes.

WebKit Data Types

WebKit data types affecting multiple classes.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software