Skip to content

Commit

Permalink
Put background script api url in var
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScorpion committed Jun 28, 2024
1 parent 9895845 commit 3453a4f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/background/timechimp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Message } from '../message';

const API_URL = 'https://web.timechimp.com';

/**
* The time registration form is an iframe in the webpage,
* so we need to wait for that to load, and store the frame id per tab.
Expand Down Expand Up @@ -35,7 +37,7 @@ chrome.webRequest.onCompleted.addListener(
},
{
// Limit to requests that indicate a week change
urls: ['https://web.timechimp.com/api/time/week/*'],
urls: [`${API_URL}/api/time/week/*`],
},
);

Expand All @@ -46,9 +48,9 @@ chrome.webRequest.onCompleted.addListener(
(request) => sendMessage(request.tabId, { type: 'refresh' }),
{
urls: [
'https://web.timechimp.com/api/time',
'https://web.timechimp.com/api/time/put',
'https://web.timechimp.com/api/time/delete?*',
`${API_URL}/api/time`,
`${API_URL}/api/time/put`,
`${API_URL}/api/time/delete?*`,
],
},
);
Expand Down

0 comments on commit 3453a4f

Please sign in to comment.