Add Welt.de

This commit is contained in:
magnolia1234 2022-08-06 07:49:29 +02:00
parent 9bfbfa69ef
commit 1c2842b6e8
6 changed files with 42 additions and 11 deletions

View file

@ -486,6 +486,7 @@ Grouped in options:\
[Der Spiegel](https://www.spiegel.de) -
[Der Tagesspiegel](https://www.tagesspiegel.de) -
[Die Rheinpfalz](https://www.rheinpfalz.de) -
[Die Welt](https://www.welt.de) -
[Die Zeit](https://www.zeit.de) -
[Frankfurter Allgemeine Zeitung](https://www.faz.net) -
[Freie Presse](https://www.freiepresse.de) -

View file

@ -6,7 +6,7 @@ var ext_name = manifestData.name;
var ext_version = manifestData.version;
const cs_limit_except = ['elespanol.com', 'faz.net', 'nation.africa', 'nationalgeographic.com', 'thetimes.co.uk'].concat(de_westfalen_medien_domains);
const dompurify_sites = ['asiatimes.com', 'bloomberg.com', 'cicero.de', 'economictimes.com', 'golem.de', 'hs.fi', 'ilmanifesto.it', 'iltalehti.fi', 'iltirreno.it', 'ipolitics.ca', 'italiaoggi.it', 'lanuovasardegna.it', 'lesechos.fr', 'limburger.nl', 'marianne.net', 'newleftreview.org', 'nzherald.co.nz', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'spiegel.de', 'stratfor.com', 'tagesspiegel.de', 'techinasia.com', 'thetimes.co.uk', 'timesofindia.com', 'vn.nl'].concat(be_mediahuis_domains, nl_mediahuis_region_domains, no_nhst_media_domains);
const dompurify_sites = ['asiatimes.com', 'bloomberg.com', 'cicero.de', 'economictimes.com', 'golem.de', 'hs.fi', 'ilmanifesto.it', 'iltalehti.fi', 'iltirreno.it', 'ipolitics.ca', 'italiaoggi.it', 'lanuovasardegna.it', 'lesechos.fr', 'limburger.nl', 'marianne.net', 'newleftreview.org', 'nzherald.co.nz', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'spiegel.de', 'stratfor.com', 'tagesspiegel.de', 'techinasia.com', 'thetimes.co.uk', 'timesofindia.com', 'vn.nl', 'welt.de'].concat(be_mediahuis_domains, nl_mediahuis_region_domains, no_nhst_media_domains);
var currentTabUrl = '';
var csDone = false;
var optin_setcookie = false;
@ -24,7 +24,6 @@ var restrictions = {
'faz.net': /^((?!\.faz\.net\/aktuell\/(\?switchfaznet)?$).)*$/,
'globo.com': /^((?!\/valor\.globo\.com\/).)*$/,
'lastampa.it': /^((?!\/video\.lastampa\.it\/).)*$/,
'theatlantic.com': /^((?!\/newsletters\.theatlantic\.com\/).)*$/,
'nytimes.com': /^((?!\/timesmachine\.nytimes\.com\/).)*$/,
'science.org': /^((?!\.science\.org\/doi\/).)*$/,
'standaard.be': /^((?!\.standaard\.be\/plus\/).)*$/,
@ -34,6 +33,7 @@ var restrictions = {
'seekingalpha.com': /\/seekingalpha\.com($|\/($|(amp\/)?(article|news)\/|samw\/))/,
'statista.com': /^((?!\.statista\.com\/(outlook|study)\/).)*$/,
'techinasia.com': /\.techinasia\.com\/.+/,
'theatlantic.com': /^((?!\/newsletters\.theatlantic\.com\/).)*$/,
'timeshighereducation.com': /\.timeshighereducation\.com\/((features|news|people)\/|.+((\w)+(\-)+){3,}.+|sites\/default\/files\/)/
}

View file

@ -5,6 +5,7 @@ Post-release
Add Limburger.nl
Add Standaard.be
Add SuomenSotilas.fi
Add Welt.de
Fix Australian Community Media (css)
Fix Spiegel.de (Google webcache)
Add Tagesspiegel.de

View file

@ -720,12 +720,12 @@ else if (matchDomain('spiegel.de')) {
csDoneOnce = true;
let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('?')[0];
replaceDomElementExt(url_cache, true, false, 'div[data-area="body"]');
window.setTimeout(function () {
let lazy_images = document.querySelectorAll('img.lazyload[src^="data:image/"][data-src]');
for (let elem of lazy_images) {
elem.src = elem.getAttribute('data-src');
}
}, 1000);
window.setTimeout(function () {
let lazy_images = document.querySelectorAll('img.lazyload[src^="data:image/"][data-src]');
for (let elem of lazy_images) {
elem.src = elem.getAttribute('data-src');
}
}, 1000);
}
}
@ -740,6 +740,30 @@ else if (matchDomain('tagesspiegel.de')) {
}
}
else if (matchDomain('welt.de')) {
let url = window.location.href;
let paywall = document.querySelector('div[data-premium-content-loader-id^="spinner-article-"]');
if (paywall) {
removeDOMElement(paywall);
csDoneOnce = true;
let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('?')[0];
replaceDomElementExt(url_cache, true, false, 'div[itemprop="articleBody"]');
window.setTimeout(function () {
let lazy_images = document.querySelectorAll('img[src*="/lazy-picture-placeholder-"][data-src]');
for (let elem of lazy_images) {
let source = elem.parentNode.querySelector('source[data-breakpoint="Large"][data-src-template]');
if (source)
elem.src = source.getAttribute('data-src-template');
else
elem.src = elem.getAttribute('data-src');
}
let teaser = document.querySelector('div[data-qa="Article.PremiumContent"] > div.c-article-text');
let ads = document.querySelectorAll('div[data-component="Outbrain"], div[data-component="OEmbedComponent"]');
removeDOMElement(teaser, ...ads);
}, 1500);
}
}
else if (matchDomain(de_westfalen_medien_domains)) {
let url = window.location.href;
if (url.includes('/amp/')) {
@ -4238,7 +4262,7 @@ function replaceDomElementExtSrc(url, html, proxy, base64, selector, text_fail =
}
let parser = new DOMParser();
window.setTimeout(function () {
let doc = parser.parseFromString(DOMPurify.sanitize(html, {ADD_ATTR: ['layout'], ADD_TAGS: ['amp-img']}), 'text/html');
let doc = parser.parseFromString(DOMPurify.sanitize(html, {ADD_ATTR: ['layout', 'itemprop'], ADD_TAGS: ['amp-img']}), 'text/html');
//console.log(DOMPurify.removed);
let article_new = doc.querySelector(selector_source);
if (article_new) {

View file

@ -639,6 +639,7 @@
"*://*.waz.de/*",
"*://*.weeklytimesnow.com.au/*",
"*://*.wellandtribune.ca/*",
"*://*.welt.de/*",
"*://*.westernadvocate.com.au/*",
"*://*.westfalen-blatt.de/*",
"*://*.winnipegfreepress.com/*",
@ -700,5 +701,5 @@
"*://gcm.omerlocdn.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "2.7.8.6"
"version": "2.7.8.7"
}

View file

@ -355,6 +355,10 @@ var defaultSites = {
allow_cookies: 1,
useragent: "googlebot"
},
"Die Welt": {
domain: "welt.de",
allow_cookies: 1
},
"Die Zeit": {
domain: "zeit.de",
allow_cookies: 1,
@ -2160,4 +2164,4 @@ var no_nhst_media_domains = grouped_sites['###_no_nhst_media'];
// sites with no fix (background)
var nl_dpg_media_nofix_domains = ['ad.nl', 'bd.nl', 'bndestem.nl', 'destentor.nl', 'ed.nl', 'gelderlander.nl', 'hln.be', 'pzc.nl', 'tubantia.nl'];
var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'gazzetta.it', 'handelsblatt.com', 'hln.be', 'ilmanifesto.it', 'ilsole24ore.com', 'jacobinmag.com', 'jeunesafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'liberation.fr', 'mediapart.fr', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nieuwsblad.be', 'nknews.org', 'ouest-france.fr', 'politiken.dk', 'publico.pt', 'republic.ru', 'rp-online.de', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'wiwo.de', 'ynet.co.il'].concat(nl_dpg_media_nofix_domains);
var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'gazzetta.it', 'handelsblatt.com', 'hln.be', 'ilmanifesto.it', 'ilsole24ore.com', 'jacobinmag.com', 'jeunesafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'liberation.fr', 'mediapart.fr', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nieuwsblad.be', 'nknews.org', 'ouest-france.fr', 'politiken.dk', 'publico.pt', 'republic.ru', 'rp-online.de', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'wiwo.de', 'ynet.co.il'].concat(nl_dpg_media_nofix_domains);