Skip to content

Latest commit

 

History

History
98 lines (61 loc) · 2.06 KB

File metadata and controls

98 lines (61 loc) · 2.06 KB

offscreen

Documentation: Chrome Offscreen API

A promise-based wrapper for the Chrome offscreen API to create and manage offscreen documents.

Methods


createOffscreen

createOffscreen(parameters: chrome.offscreen.CreateParameters): Promise<void>

Creates an offscreen document with the specified parameters.

closeOffscreen

closeOffscreen(): Promise<void>

Closes the existing offscreen document.

hasOffscreen

hasOffscreen(): Promise<boolean>

Checks whether an offscreen document is currently open.

getOffscreenContext

getOffscreenContext(): Promise<chrome.runtime.ExtensionContext | undefined>

Returns the current offscreen document context, if one is open.

getOffscreenUrl

getOffscreenUrl(): Promise<string | undefined>

Returns the current offscreen document URL, if one is open.

getOffscreenPath

getOffscreenPath(): Promise<string | undefined>

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<boolean>

Checks whether the current offscreen document matches the given URL.

hasOffscreenPath

hasOffscreenPath(path: string): Promise<boolean>

Checks whether the current offscreen document matches the given extension path. Query parameters and hash fragments are ignored.