<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SafariServices",
  "identifier" : "/documentation/SafariServices/SFSafariWindow",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Safari Services"
    ],
    "preciseIdentifier" : "c:objc(cs)SFSafariWindow"
  },
  "title" : "SFSafariWindow"
}
-->

# SFSafariWindow

A proxy for a Safari window.

```
class SFSafariWindow
```

## Topics

### Working with Tabs

[`-  getActiveTabWithCompletionHandler:`](/documentation/SafariServices/SFSafariWindow/getActiveTab(completionHandler:))

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

[`-  openTabWithURL:makeActiveIfPossible:completionHandler:`](/documentation/SafariServices/SFSafariWindow/openTab(with:makeActiveIfPossible:completionHandler:))

Opens a tab at the end of the tab bar.

### Getting the Toolbar Item

[`-  getToolbarItemWithCompletionHandler:`](/documentation/SafariServices/SFSafariWindow/getToolbarItem(completionHandler:))

Gets the extension’s toolbar item from the target window.

### Instance Methods

[`-  close`](/documentation/SafariServices/SFSafariWindow/close())

[`-  getAllTabsWithCompletionHandler:`](/documentation/SafariServices/SFSafariWindow/getAllTabs(completionHandler:))

## Relationships

### Conforms To

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)