From fae02c6b117413bf804a4a5d57a2f3d1806a1496 Mon Sep 17 00:00:00 2001 From: Luca Scalzotto Date: Tue, 18 Jun 2024 15:23:45 +0200 Subject: [PATCH] Fix URLs and host permissions --- manifest.json | 3 +-- src/TimeChimpApi.ts | 2 +- src/background/timechimp.ts | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index 8b50c8c..ba70117 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "webRequest" ], "host_permissions": [ - "*://app.timechimp.com/*" + "*://*.timechimp.com/*" ], "content_scripts": [ { @@ -35,4 +35,3 @@ } } } - diff --git a/src/TimeChimpApi.ts b/src/TimeChimpApi.ts index 8a42488..5586a70 100644 --- a/src/TimeChimpApi.ts +++ b/src/TimeChimpApi.ts @@ -1,6 +1,6 @@ export class TimeChimpApi { private async doFetch(path: string): Promise { - const url = `https://app.timechimp.com${path}`; + const url = `https://web.timechimp.com${path}`; const response = await fetch(url); const body = await response.text(); diff --git a/src/background/timechimp.ts b/src/background/timechimp.ts index f328619..c278745 100644 --- a/src/background/timechimp.ts +++ b/src/background/timechimp.ts @@ -20,7 +20,7 @@ chrome.webRequest.onCompleted.addListener( }, { // Limit to requests that indicate a week change - urls: ['https://app.timechimp.com/api/time/week/*'], + urls: ['https://web.timechimp.com/api/time/week/*'], }, ); @@ -31,9 +31,9 @@ chrome.webRequest.onCompleted.addListener( (request) => sendMessage(request.tabId, { type: 'refresh' }), { urls: [ - 'https://app.timechimp.com/api/time', - 'https://app.timechimp.com/api/time/put', - 'https://app.timechimp.com/api/time/delete?*', + 'https://web.timechimp.com/api/time', + 'https://web.timechimp.com/api/time/put', + 'https://web.timechimp.com/api/time/delete?*', ], }, );