Fix The Economist (interactive)

This commit is contained in:
magnolia1234 2023-08-04 19:14:55 +02:00
parent 8ee8ada8a7
commit e78e21c1df
8 changed files with 27 additions and 22 deletions

View File

@ -8,6 +8,7 @@ Add Crikey.com.au
Fix EUobserver (css)
Fix Grupo Vocento (limit amp-redirect)
Fix The Economic Times (update mobile redirect)
Fix The Economist (interactive)
Update custom sites (add_ext_link: Google webcache)
* v3.2.7.0 (2023-07-30)

View File

@ -1149,6 +1149,8 @@ else if (document.querySelector('script[src^="https://assets.static-chmedia.ch/"
let infobox_body = document.querySelector('div.infobox__body');
if (infobox_body)
infobox_body.removeAttribute('class');
let paywall = document.querySelector('div.dynamic-regwall');
removeDOMElement(paywall);
}
else
@ -3522,23 +3524,14 @@ else if (matchDomain('economictimes.indiatimes.com')) {
}
else if (matchDomain('economist.com')) {
let subscribe = document.querySelector('.subscription-proposition');
let wrapper = document.getElementById('bottom-page-wrapper');
let adverts = document.querySelectorAll('div.advert');
removeDOMElement(subscribe, wrapper, ...adverts);
let p_articles = document.querySelectorAll('p.article__body-text');
let href;
for (let p_article of p_articles) {
let e_anchors = document.querySelectorAll('a');
href = '';
for (let e_anchor of e_anchors) {
if (e_anchor.href) {
href = e_anchor.href;
} else {
e_anchor.href = href;
}
}
let paywall = document.querySelector('div.paywall');
if (paywall) {
let noscroll = document.querySelector('svelte-scroller-outer');
let hide_style = document.querySelector('body > style');
removeDOMElement(paywall, noscroll, hide_style);
}
let ads = document.querySelectorAll('div[class*="_advert__"]');
hideDOMElement(...ads);
}
else if (matchDomain('enotes.com')) {

View File

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.2.7.5"
"version": "3.2.7.6"
}

View File

@ -249,8 +249,8 @@
"block_regex": "\\.irishexaminer\\.com\\/pu_examiner\\/scripts\\/engage",
"domain": "irishexaminer.com"
},
"Irishnews.com (not premium)": {
"block_regex": "\\.irishnews\\.com\\/.+\\/js\\/mpppaywall\\.js",
"Irishnews.com": {
"block_regex": "\\.irishnews\\.com\\/.+\\/js\\/(bundle|mpppaywall)\\.js",
"domain": "irishnews.com"
},
"Kapital.no": {

View File

@ -773,5 +773,5 @@
"*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.2.7.5"
"version": "3.2.7.6"
}

View File

@ -88,8 +88,12 @@ function import_json(result) {
}, function (items) {
var sites_custom = items.sites_custom;
var sites_custom_new = JSON.parse(result);
for (let site in sites_custom_new)
for (let site in sites_custom_new) {
let customSite_diff = Object.keys(sites_custom).find(key => sites_custom[key].domain === sites_custom_new[site].domain && key !== site);
if (customSite_diff)
delete sites_custom[customSite_diff];
sites_custom[site] = sites_custom_new[site];
}
sites_custom = filterObject(sites_custom, function (val, key) {
return !(val.add_ext_link && (!val.add_ext_link_type || val.add_ext_link_type === 'google_search_tool'))
});

View File

@ -2056,7 +2056,7 @@ var defaultSites = {
"The Economist": {
domain: "economist.com",
allow_cookies: 1,
block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/
block_regex: /\.tinypass\.com\//
},
"The Financial Express": {
domain: "financialexpress.com",

View File

@ -157,6 +157,13 @@
"block_regex": "cdn\\.cxense\\.com\\/cx\\.js",
"upd_version": "3.2.6.6"
},
"The Economist": {
"domain": "economist.com",
"allow_cookies": 1,
"block_regex": "\\.tinypass\\.com",
"cs_code": "[{\"cond\":\"div.paywall\", \"rm_elem\": 1, \"elems\":[{\"cond\":\"svelte-scroller-outer\", \"rm_elem\": 1}, {\"cond\":\"body > style\", \"rm_elem\": 1}]}]",
"upd_version": "3.2.7.6"
},
"The Japan Times (recent/last 2 months articles only; do not block Piano.io-script externally)": {
"domain": "japantimes.co.jp",
"block_regex": "cdn\\.cxense\\.com",