Contents

openTab(with:makeActiveIfPossible:completionHandler:)

Opens a tab at the end of the tab bar.

Declaration

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

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