forked from Stigmatoz/web-activity-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.ts
More file actions
23 lines (19 loc) · 781 Bytes
/
background.ts
File metadata and controls
23 lines (19 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Browser from 'webextension-polyfill';
import { initTracker } from './tracker';
import { logger } from './compositions/logger';
import { scheduleJobs } from './jobs/sheduler';
import { Settings } from './compositions/settings';
import { StorageParams } from './storage/storage-params';
logger.log('Start background script');
Browser.runtime.onInstalled.addListener(details => {
logger.log('Extension installed:', details);
});
Browser.storage.onChanged.addListener((changes, namespace) => {
for (var key in changes) {
if (Object.values(StorageParams).includes(key as StorageParams))
Settings.getInstance().reloadSetting(key as StorageParams);
}
});
Browser.runtime.setUninstallURL('https://webtracker.online/goodbye.html');
scheduleJobs();
initTracker();