Update custom flex sites (identify main domain)

merge-requests/10/head
magnolia1234 1 year ago
parent 7b960c8194
commit 57fcfa7f0e

@ -533,7 +533,7 @@ ext_api.storage.onChanged.addListener(function (changes, namespace) {
}
// Refresh the current tab
refreshCurrentTab();
ext_api.tabs.reload({bypassCache: true});
}
});
@ -1302,6 +1302,7 @@ function clear_cookies() {
custom_flex_domains.push(custom_domain);
if (!enabledSites.includes(custom_domain))
enabledSites.push(custom_domain);
ext_api.tabs.reload({bypassCache: true});
}
var chrome_scheme = 'light';
@ -1366,7 +1367,7 @@ ext_api.runtime.onMessage.addListener(function (message, sender) {
});
}
if (message.request === 'refreshCurrentTab') {
refreshCurrentTab();
ext_api.tabs.reload({bypassCache: true});
}
if (message.request === 'getExtSrc' && message.data) {
fetch(message.data.url)
@ -1509,19 +1510,3 @@ function randomIP(range_low = 0, range_high = 223) {
}
return rndmIP.join('.');
}
// Refresh the current tab
function refreshCurrentTab() {
ext_api.tabs.query({
active: true,
currentWindow: true
}, function (tabs) {
if (tabs && tabs[0] && /^http/.test(tabs[0].url)) {
if (ext_api.runtime.lastError)
return;
ext_api.tabs.update(tabs[0].id, {
url: tabs[0].url
});
}
});
}

@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox
Post-release
Fix MIT Sloan Management Review
Update block general paywall script (TownNews & fix Pigeon)
Update custom flex sites (identify main domain)
* v2.9.7.0 (2022-12-11)
Add Handelsblatt

@ -40,10 +40,10 @@ else {
window.setTimeout(function () {
let hostname = window.location.hostname;
let custom_domain = prepHostname(hostname);
let custom_domain = getCookieDomain(hostname);
let group;
if (hostname) {
if (document.querySelector('script[src*=".medium.com/"]'))
if (document.querySelector('script[src*=".medium.com/"]') || matchDomain(['plainenglish.io']))
group = '###_medium_custom';
else if (document.querySelector('script[src*="/leaky-paywall/"], script[src*="/leaky-paywall-"]'))
group = '###_wp_leaky_paywall';
@ -123,8 +123,17 @@ function matchDomain(domains, hostname) {
return matched_domain;
}
function prepHostname(hostname) {
return hostname.replace(/^(www|m|account|amp(\d)?|edition|eu|mobil|wap)\./, '');
function getCookieDomain(hostname) {
let domain = hostname;
let n = 0;
let parts = hostname.split('.');
let str = '_gd' + (new Date()).getTime();
while (n < (parts.length - 1) && document.cookie.indexOf(str + '=' + str) == -1) {
domain = parts.slice(-1 - (++n)).join('.');
document.cookie = str + "=" + str + ";domain=" + domain + ";";
}
document.cookie = str + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=" + domain + ";";
return domain;
}
function insert_script(func, insertAfterDom) {

@ -78,6 +78,11 @@
"domain": "fnweb.de",
"useragent": "googlebot"
},
"Freitag.de": {
"allow_cookies": 1,
"domain": "freitag.de",
"ld_json": "div.qa-paywall|div#x-article-text"
},
"Frieze.com": {
"allow_cookies": 1,
"block_regex": "js\\.pelcro\\.com\\/",
@ -194,6 +199,11 @@
"block_regex": "my\\.odt\\.co\\.nz\\/bwtw\\/api\\/TheWall\\/",
"domain": "odt.co.nz"
},
"Oz-online.de": {
"allow_cookies": 1,
"domain": "oz-online.de",
"ld_json": "div.paywall|div.pointer-events-none"
},
"Physicsworld.com": {
"domain": "physicsworld.com"
},

@ -713,5 +713,5 @@
"*://*.wallkit.net/*",
"*://webcache.googleusercontent.com/*"
],
"version": "2.9.7.4"
"version": "2.9.7.5"
}

@ -1255,12 +1255,12 @@ var defaultSites = {
allow_cookies: 1,
block_regex: /(\.blueconic\.net\/|\.tinypass\.com\/|\/loader-wp\/.+\/loader\.min\.js|cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js)/
},
"Medium (free articles only)": {
"Medium": {
domain: "medium.com",
allow_cookies: 1,
remove_cookies: 1
},
"Medium custom domains (free articles only; opt-in to custom sites)": {
"Medium custom domains (opt-in to custom sites)": {
domain: "###_medium_custom",
"group": [
"betterprogramming.pub",

@ -1,13 +1,4 @@
{
"Groupe Centre France": {
"domain": "###_fr_gcf",
"group": [
"lamontagne.fr"
],
"allow_cookies": 1,
"block_regex": "\\.poool\\.fr\\/",
"ld_json": "div#poool-widget|div.entry-content"
},
"Neue Osnabrücker Zeitung": {
"domain": "noz.de",
"allow_cookies": 1,
@ -19,10 +10,6 @@
"block_regex": "cdn\\.theatlantic\\.com\\/_next\\/static\\/chunks\\/[567].+\\.js",
"remove_cookies_select_drop": ["articleViews"]
},
"The Spectator (UK)": {
"domain": "spectator.co.uk",
"useragent": "googlebot"
},
"The Washington Post": {
"domain": "washingtonpost.com",
"allow_cookies": 1,

Loading…
Cancel
Save