Instance Method

openTab(with:makeActiveIfPossible:completionHandler:)

Opens a tab at the end of the tab bar.

Declaration

func openTab(with url: URL, makeActiveIfPossible activateTab: Bool, completionHandler: ((SFSafariTab?) -> Void)? = nil)

Parameters

url

The URL to navigate to.

activateTab

true to make the tab active; otherwise false.

completionHandler

A block called after the tab is opened.

Discussion

If the extension cannot access the URL, no tab is opened.

See Also

Working with Tabs

func getActiveTab(completionHandler: (SFSafariTab?) -> Void)

Calls the completion handler with the active tab in the target window.