Fix-update The New Yorker
This commit is contained in:
parent
e527f06b9c
commit
5ff22b4f41
@ -197,6 +197,7 @@ var blockedRegexes = {
|
||||
'nationalreview.com': /.+\.blueconic\.net\/.+/,
|
||||
'newrepublic.com': /.+\.onecount\.net\/js\/.+/,
|
||||
'newsweek.com': /.+\.googletagmanager\.com\/gtm\.js/,
|
||||
'newyorker.com': /.+\.newyorker\.com\/verso\/static\/presenter-articles.+\.js/,
|
||||
'nytimes.com': /(.+meter-svc\.nytimes\.com\/meter\.js.+|.+mwcm\.nyt\.com\/.+\.js)/,
|
||||
'nzherald.co.nz': /nzherald\.co\.nz\/.+\/headjs\/.+\.js/,
|
||||
'repubblica.it': /scripts\.repubblica\.it\/pw\/pw\.js.+/,
|
||||
@ -745,24 +746,3 @@ 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();
|
||||
|
23
bpc_count_daily_users.js
Normal file
23
bpc_count_daily_users.js
Normal file
@ -0,0 +1,23 @@
|
||||
var ext_api = (typeof browser === 'object') ? browser : chrome;
|
||||
|
||||
// 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 count_json = 'https://bitbucket.org/magnolia1234/bpc-chrome-daily-users/downloads/bpc-daily-users-' + dateStr + '.json';
|
||||
fetch(count_json);
|
||||
}
|
||||
});
|
||||
}
|
||||
bpc_count_daily_users();
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"background": {
|
||||
"scripts": ["sites.js", "background.js"]
|
||||
"scripts": ["sites.js", "background.js", "bpc_count_daily_users.js"]
|
||||
},
|
||||
"content_security_policy": "script-src 'self'; object-src 'self'",
|
||||
"browser_action": {
|
||||
@ -291,5 +291,5 @@
|
||||
"webRequest",
|
||||
"webRequestBlocking"
|
||||
],
|
||||
"version": "1.8.3.3"
|
||||
"version": "1.8.3.4"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"background": {
|
||||
"scripts": ["sites.js", "background.js"]
|
||||
"scripts": ["sites.js", "background.js", "bpc_count_daily_users.js"]
|
||||
},
|
||||
"content_security_policy": "script-src 'self'; object-src 'self'",
|
||||
"browser_action": {
|
||||
@ -21,5 +21,5 @@
|
||||
"page": "options.html"
|
||||
},
|
||||
"permissions": [ "cookies", "<all_urls>", "storage", "webRequest", "webRequestBlocking"],
|
||||
"version": "1.8.3.3"
|
||||
"version": "1.8.3.4"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user