From 6721966e5bc362c98c452f5ff114ea830d1e383b Mon Sep 17 00:00:00 2001 From: Shiba <44804845+DeepDoge@users.noreply.github.com> Date: Wed, 27 Jul 2022 06:43:58 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8D=99=20added=20timeout=20to=20resol?= =?UTF-8?q?ver=20api=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/yt/urlResolve.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/yt/urlResolve.ts b/src/modules/yt/urlResolve.ts index 4f0adf8..be3807d 100644 --- a/src/modules/yt/urlResolve.ts +++ b/src/modules/yt/urlResolve.ts @@ -53,7 +53,12 @@ export async function resolveById(params: Paramaters, progressCallback?: (progre publicKey })) - const apiResponse = await fetch(url.toString(), { cache: 'no-store' }) + const controller = new AbortController() + // 5 second timeout: + const timeoutId = setTimeout(() => controller.abort(), 5000) + const apiResponse = await fetch(url.toString(), { cache: 'no-store', signal: controller.signal }) + clearTimeout(timeoutId) + if (apiResponse.ok) { const response: ApiResponse = await apiResponse.json() for (const item of params) { From 38f2d4240421c72a1f9b6258c36aae6800f77003 Mon Sep 17 00:00:00 2001 From: Shiba <44804845+DeepDoge@users.noreply.github.com> Date: Sat, 6 Aug 2022 18:04:45 +0000 Subject: [PATCH 2/2] removed tabs permission --- manifest.v2.json | 1 - manifest.v3.json | 1 - 2 files changed, 2 deletions(-) diff --git a/manifest.v2.json b/manifest.v2.json index 9489f9c..2258b86 100644 --- a/manifest.v2.json +++ b/manifest.v2.json @@ -18,7 +18,6 @@ "https://odysee.com/", "https://madiator.com/", "https://finder.madiator.com/", - "tabs", "storage" ], "web_accessible_resources": [ diff --git a/manifest.v3.json b/manifest.v3.json index cbb83d7..5e848c5 100644 --- a/manifest.v3.json +++ b/manifest.v3.json @@ -8,7 +8,6 @@ "128": "assets/icons/wol/icon128.png" }, "permissions": [ - "tabs", "storage" ], "host_permissions": [