Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion extension/js/common/core/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ export class Url {
* todo - the camelCase or snake_case functionality can now be removed
*/
public static parse = (expectedKeys: string[], parseThisUrl?: string) => {
const url = parseThisUrl || window.location.search.replace('?', '');
const replacedLocation = typeof window !== 'undefined' ? window.location.search.replace('?', '') : 'https://service-worker.context'; // Placeholder URL when running in a service‐worker context

const url = parseThisUrl ?? replacedLocation;

const valuePairs = url.split('?').pop()?.split('&') ?? []; // str.split('?') string[].length will always be >= 1
const rawParams = new Map<string, string>();
Expand Down
1 change: 1 addition & 0 deletions extension/js/service_worker/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ console.info('background.js service worker starting');
let db: IDBDatabase;
let storage: GlobalStoreDict;
const inMemoryStore = new ExpirationCache<string>('in_memory_store', 4 * 60 * 60 * 1000); // 4 hours
await chrome.alarms.clearAll();
await BrowserMsg.createIntervalAlarm('delete_expired', 1); // each minute

try {
Expand Down
Loading