aboutsummaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-02 22:57:27 -0500
committerGitHub <noreply@github.com>2024-02-03 03:57:27 +0000
commitd7db65a9b3b8d941c6934597862b8010a1ccac64 (patch)
tree5b406707f95243d786be048f8fc20c5fe90d48ae /ext/js
parent17ffea6cb907c12c1af47d3f6f27126f126b168f (diff)
Chrome types update (#614)
* Update chrome types * Fix issues * Update manifest author
Diffstat (limited to 'ext/js')
-rw-r--r--ext/js/background/offscreen-proxy.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/js/background/offscreen-proxy.js b/ext/js/background/offscreen-proxy.js
index 716deddd..8c3f63c9 100644
--- a/ext/js/background/offscreen-proxy.js
+++ b/ext/js/background/offscreen-proxy.js
@@ -59,7 +59,6 @@ export class OffscreenProxy {
*/
async _hasOffscreenDocument() {
const offscreenUrl = chrome.runtime.getURL('offscreen.html');
- // @ts-expect-error - API not defined yet
if (!chrome.runtime.getContexts) { // chrome version below 116
// Clients: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/clients
// @ts-expect-error - Types not set up for service workers yet
@@ -68,12 +67,13 @@ export class OffscreenProxy {
return await matchedClients.some((client) => client.url === offscreenUrl);
}
- // @ts-expect-error - API not defined yet
const contexts = await chrome.runtime.getContexts({
- contextTypes: ['OFFSCREEN_DOCUMENT'],
+ contextTypes: [
+ /** @type {chrome.runtime.ContextType} */ ('OFFSCREEN_DOCUMENT')
+ ],
documentUrls: [offscreenUrl]
});
- return !!contexts.length;
+ return contexts.length > 0;
}
/**