mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-16 06:13:16 +00:00
Add daily users counter
By counting downloads of empty json-file
This commit is contained in:
parent
b181833ccf
commit
9dc45634a0
@ -744,3 +744,25 @@ function getParameterByName(name, url) {
|
|||||||
function stripQueryStringAndHashFromPath(url) {
|
function stripQueryStringAndHashFromPath(url) {
|
||||||
return url.split("?")[0].split("#")[0];
|
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-firefox-daily-users/downloads/bpc-daily-users-' + dateStr + '.json';
|
||||||
|
fetch(manifest_new);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
bpc_count_daily_users();
|
||||||
|
@ -304,5 +304,5 @@
|
|||||||
"webRequest",
|
"webRequest",
|
||||||
"webRequestBlocking"
|
"webRequestBlocking"
|
||||||
],
|
],
|
||||||
"version": "1.8.3.2"
|
"version": "1.8.3.3"
|
||||||
}
|
}
|
@ -40,5 +40,5 @@
|
|||||||
"webRequest",
|
"webRequest",
|
||||||
"webRequestBlocking"
|
"webRequestBlocking"
|
||||||
],
|
],
|
||||||
"version": "1.8.3.2"
|
"version": "1.8.3.3"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user