forked from Stigmatoz/web-activity-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblock.js
More file actions
18 lines (16 loc) · 714 Bytes
/
block.js
File metadata and controls
18 lines (16 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var storage = new LocalStorage();
var restrictionList = [];
document.addEventListener('DOMContentLoaded', function () {
var url = new URL(document.URL);
var blockSiteUrl = url.searchParams.get("url");
document.getElementById('site').innerText = blockSiteUrl;
storage.getSettings(STORAGE_RESTRICTION_LIST, function (items) {
restrictionList = items;
if (restrictionList === undefined)
restrictionList = [];
var currentItem = restrictionList.find(x => isDomainEquals(x.domain, blockSiteUrl));
if (currentItem !== undefined){
document.getElementById('limit').innerText = convertShortSummaryTimeToString(currentItem.time);
}
});
});