()
| 18 | let creating: Promise<void> | null | boolean = null; |
| 19 | |
| 20 | async function hasDocument() { |
| 21 | const offscreenUrl = chrome.runtime.getURL(OFFSCREEN_DOCUMENT_PATH); |
| 22 | const existingContexts = await chrome.runtime.getContexts({ |
| 23 | contextTypes: [chrome.runtime.ContextType.OFFSCREEN_DOCUMENT], |
| 24 | documentUrls: [offscreenUrl], |
| 25 | }); |
| 26 | return existingContexts.length > 0; |
| 27 | } |
| 28 | |
| 29 | async function setupOffscreenDocument() { |
| 30 | if (typeof chrome.offscreen?.createDocument !== "function") { |
no test coverage detected