# offscreen
Documentation: [Chrome Offscreen API](https://developer.chrome.com/docs/extensions/reference/offscreen)
A promise-based wrapper for the Chrome `offscreen` API to create and manage offscreen documents.
## Methods
- [createOffscreen(parameters)](#createOffscreen)
- [closeOffscreen()](#closeOffscreen)
- [hasOffscreen()](#hasOffscreen)
- [getOffscreenContext()](#getOffscreenContext)
- [getOffscreenUrl()](#getOffscreenUrl)
- [getOffscreenPath()](#getOffscreenPath)
- [hasOffscreenUrl(url)](#hasOffscreenUrl)
- [hasOffscreenPath(path)](#hasOffscreenPath)
---
### createOffscreen
```
createOffscreen(parameters: chrome.offscreen.CreateParameters): Promise
```
Creates an offscreen document with the specified parameters.
### closeOffscreen
```
closeOffscreen(): Promise
```
Closes the existing offscreen document.
### hasOffscreen
```
hasOffscreen(): Promise
```
Checks whether an offscreen document is currently open.
### getOffscreenContext
```
getOffscreenContext(): Promise
```
Returns the current offscreen document context, if one is open.
### getOffscreenUrl
```
getOffscreenUrl(): Promise
```
Returns the current offscreen document URL, if one is open.
### getOffscreenPath
```
getOffscreenPath(): Promise
```
Returns the current offscreen document path within the extension, if one is open. Query parameters and hash fragments are not included.
### hasOffscreenUrl
```
hasOffscreenUrl(url: string): Promise
```
Checks whether the current offscreen document matches the given URL.
### hasOffscreenPath
```
hasOffscreenPath(path: string): Promise
```
Checks whether the current offscreen document matches the given extension path. Query parameters and hash fragments are ignored.