---
title: "getScreenshotOfVisibleArea(completionHandler:)"
framework: safariservices
role: symbol
role_heading: Instance Method
path: "safariservices/sfsafaripage/getscreenshotofvisiblearea(completionhandler:)"
---

# getScreenshotOfVisibleArea(completionHandler:)

## Declaration

```swift
func getScreenshotOfVisibleArea(completionHandler: @escaping @Sendable (NSImage?) -> Void)
```

```swift
func screenshotOfVisibleArea() async -> NSImage?
```

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func screenshotOfVisibleArea() async -> NSImage? For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.

## See Also

### Instance Methods

- [getContainingTab(completionHandler:)](safariservices/sfsafaripage/getcontainingtab(completionhandler:).md)
