Type Method

openWindow(with:completionHandler:)

Opens a new window with the desired webpage.

Declaration

class func openWindow(with url: URL, completionHandler: ((SFSafariWindow?) -> Void)? = nil)

Parameters

url

The URL to navigate to. The URL scheme must be http or https.

completionHandler

A block to call when the URL is loaded in a new window.

See Also

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.