Add daily users counter
By counting downloads of empty json-file
This commit is contained in:
parent
e911400671
commit
e527f06b9c
@ -744,3 +744,25 @@ function getParameterByName(name, url) {
|
||||
function stripQueryStringAndHashFromPath(url) {
|
||||
return url.split("?")[0].split("#")[0];
|
||||
}
|
||||
|
||||
// daily users counter
|
||||
function bpc_count_daily_users() {
|
||||
let date = new Date();
|
||||
let dateStr = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().split("T")[0];
|
||||
ext_api.storage.sync.get({
|
||||
daily_users: {},
|
||||
}, function (items) {
|
||||
var daily_users = items.daily_users;
|
||||
if (daily_users.date !== dateStr) {
|
||||
daily_users.date = dateStr;
|
||||
chrome.storage.sync.set({
|
||||
daily_users: daily_users
|
||||
}, function () {
|
||||
true;
|
||||
});
|
||||
let manifest_new = 'https://bitbucket.org/magnolia1234/bpc-chrome-daily-users/downloads/bpc-daily-users-' + dateStr + '.json';
|
||||
fetch(manifest_new);
|
||||
}
|
||||
});
|
||||
}
|
||||
bpc_count_daily_users();
|
||||
|
@ -291,5 +291,5 @@
|
||||
"webRequest",
|
||||
"webRequestBlocking"
|
||||
],
|
||||
"version": "1.8.3.2"
|
||||
"version": "1.8.3.3"
|
||||
}
|
||||
|
@ -21,5 +21,5 @@
|
||||
"page": "options.html"
|
||||
},
|
||||
"permissions": [ "cookies", "<all_urls>", "storage", "webRequest", "webRequestBlocking"],
|
||||
"version": "1.8.3.2"
|
||||
"version": "1.8.3.3"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user