Add Granta Magazine (UK)

merge-requests/16/head
magnolia1234 8 months ago
parent b311ec62a6
commit edcb615cff

@ -426,6 +426,7 @@ Grouped in options:\
[Evening Standard](https://www.standard.co.uk) -
[Financial News](https://www.fnlondon.com) -
[Financial Times](https://www.ft.com) -
[Granta Magazine](https://granta.com) -
[iNews](https://inews.co.uk) -
[Investors' Chronicle](https://www.investorschronicle.co.uk) -
[Irish Independent](https://www.independent.ie) -

@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add Bhaskar (India)
Add Granta Magazine (UK)
Add Interesting Engineering
Fix Media Group Westfalen
Fix Mediahuis Nederland Regional (js)

@ -2626,7 +2626,7 @@ else if (matchDomain('vn.nl')) {
else
csDone = true;
} else if ((window.location.hostname.match(/\.(ie|uk)$/) && !matchDomain(['investmentweek.co.uk'])) || matchDomain(['citywire.com', 'ft.com', 'scotsman.com', 'tes.com'])) {//united kingdom/ireland
} else if ((window.location.hostname.match(/\.(ie|uk)$/) && !matchDomain(['investmentweek.co.uk'])) || matchDomain(['citywire.com', 'ft.com', 'granta.com', 'scotsman.com', 'tes.com'])) {//united kingdom/ireland
if (matchDomain('autocar.co.uk')) {
let url = window.location.href;
@ -2788,6 +2788,32 @@ else if (matchDomain('ft.com')) {
hideDOMElement(...banners);
}
else if (matchDomain('granta.com')) {
let paywall = document.querySelector('div.article-sign-up-container');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
.then(response => {
if (response.ok) {
response.json().then(json => {
let json_text = json.content.rendered;
let content = document.querySelector('div.article-excerpt');
if (json_text && content) {
let parser = new DOMParser();
let doc = parser.parseFromString('<div>' + DOMPurify.sanitize(json_text) + '</div>', 'text/html');
let content_new = doc.querySelector('div');
content.parentNode.replaceChild(content_new, content);
}
});
}
});
}
}
}
else if (matchDomain('independent.co.uk')) {
let url = window.location.href;
if (window.location.search.match(/(\?|&)amp/)) {

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.3.6.5"
"version": "3.3.6.6"
}

@ -289,6 +289,7 @@
"*://*.goodhousekeeping.com/*",
"*://*.gooieneemlander.nl/*",
"*://*.gq.com/*",
"*://*.granta.com/*",
"*://*.groene.nl/*",
"*://*.grubstreet.com/*",
"*://*.haaretz.co.il/*",
@ -800,5 +801,5 @@
"*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.3.6.5"
"version": "3.3.6.6"
}

@ -763,6 +763,11 @@ var defaultSites = {
domain: "globes.co.il",
block_regex: /\.tinypass\.com\//
},
"Granta Magazine": {
domain: "granta.com",
allow_cookies: 1,
cs_dompurify: 1
},
"Groene Amsterdammer": {
domain: "groene.nl",
remove_cookies_select_hold: ["accept-cookies", "popunder-hidden"],

@ -44,6 +44,12 @@
"useragent": "googlebot",
"upd_version": "3.3.5.1"
},
"Granta Magazine": {
"domain": "granta.com",
"allow_cookies": 1,
"ld_json_url": "div.article-sign-up-container|div.article-excerpt",
"upd_version": "3.3.6.6"
},
"Mediahuis Nederland Regional": {
"domain": "###_nl_mediahuis_region",
"group": [

Loading…
Cancel
Save