A proxy for the Safari app.


class SFSafariApplication : NSObject


The SFSafariApplication class is used by a Safari app extension to access the active Safari window, open a new window, and update the toolbar items on a window. An application that acts as a host container for a Safari app extension can use this class to send messages to the app extension. There is no object instance for this class.


Communicating With the App Extension

Working with Windows

class func getActiveWindow(completionHandler: (SFSafariWindow?) -> Void)

Calls the completion handler with the active browser window.

class func showPreferencesForExtension(withIdentifier: String, completionHandler: ((Error?) -> Void)?)

Launches Safari and opens the preferences panel for a Safari app extension.

Updating Toolbar Items

class func setToolbarItemsNeedUpdate()

Updates the enabled states and badges of toolbar items.


Inherits From

Conforms To

See Also

Safari App Extensions

Safari App Extensions

Learn how Safari app extensions extend the web-browsing experience in Safari by leveraging web technologies and native code.

class SFSafariExtension

A proxy for the Safari extension.

class SFSafariWindow

A proxy for a Safari window.

class SFSafariPage

A proxy for a Safari webpage.

class SFSafariTab

A proxy for a tab in a Safari window.