Add Sud Ouest (France)

This commit is contained in:
magnolia1234 2021-01-16 10:58:06 +01:00
parent 3fbfb5a396
commit e52fa22f18
6 changed files with 31 additions and 5 deletions

View file

@ -203,6 +203,7 @@ Alma Talent sites (grouped in options) like
[Paris Match](https://www.parismatch.com) -
[Science & Vie](https://www.science-et-vie.com) -
[Sciences et Avenir](https://www.sciencesetavenir.fr) -
[Sud Ouest](https://www.sudouest.fr) -
[Valeurs Actuelles](https://www.valeursactuelles.com)\
Grouped in options:\
Groupe EBRA sites like

View file

@ -101,6 +101,7 @@ var allow_cookies_default = [
'slader.com',
'startribune.com',
'stocknews.com',
'sudouest.fr',
'sueddeutsche.de',
'svz.de',
'techinasia.com',
@ -160,6 +161,7 @@ var use_google_bot_default = [
'intelligentinvestor.com.au',
'mexiconewsdaily.com',
'miamiherald.com',
'newleftreview.org',
'nouvelobs.com',
'nzz.ch',
'piqd.de',

View file

@ -7,6 +7,7 @@ Add Il Secolo XIX (Italy)
Add L'Usine Nouvelle (France)
Add La Nuova Sardegna (Italy)
Add Schweriner Volkszeitung (Germany)
Add Sud Ouest (France)
Fix-update Discover Magazine
Fix-update Faz.net (Zeitung subdomain)
Update set user-agent/referer (limit)

View file

@ -1463,7 +1463,8 @@ else if (matchDomain("thelogic.co")) {
else if (matchDomain("foreignaffairs.com")) {
let paywall = document.querySelector('.paywall');
let loading_indicator = document.querySelector('.loading-indicator');
removeDOMElement(paywall, loading_indicator);
let msg_bottom = document.querySelector('.messages--container--bottom');
removeDOMElement(paywall, loading_indicator, msg_bottom);
let article_dropcap = document.querySelectorAll('.article-dropcap');
for (let elem of article_dropcap)
elem.classList.add('loaded');
@ -1910,7 +1911,7 @@ else if (matchDomain('cicero.de')) {
let paywall = document.querySelector('.plenigo-paywall');
if (paywall) {
let url_amp = url + '?amp';
replaceDomElementExt(url_amp, false, '.field-name-field-cc-body');
replaceDomElementExt(url_amp, false, false, '.field-name-field-cc-body');
removeDOMElement(paywall);
}
} else {
@ -1931,7 +1932,7 @@ else if (matchDomain('newleftreview.org')) {
let paywall = document.querySelector('div.promo-wrapper');
if (paywall) {
let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('//')[1];
replaceDomElementExt(url_cache, true, 'div.article-page', 'Article not yet in Google webcache ...');
replaceDomElementExt(url_cache, true, false, 'div.article-page', 'Article not yet in Google webcache ...');
removeDOMElement(paywall);
}
}
@ -1959,6 +1960,21 @@ else if (matchDomain('svz.de')) {
removeDOMElement(...amp_ads);
}
else if (matchDomain('sudouest.fr')) {
let url = window.location.href;
let paywall = document.querySelector('.article-premium-footer');
if (paywall) {
let premium = document.querySelector('meta[name="gsoi:premium-content"]');
if (premium) {
if (premium.content) {
let url_premium = window.location.origin + premium.content;
replaceDomElementExt(url_premium, false, true, 'div.full-content');
}
}
removeDOMElement(paywall);
}
}
else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie']))
csDone = true;
@ -1983,13 +1999,17 @@ function matchDomain(domains, hostname) {
return matched_domain;
}
function replaceDomElementExt(url, proxy, selector, text_fail) {
function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') {
let proxyurl = proxy ? 'https://cors-anywhere.herokuapp.com/' : '';
fetch(proxyurl + url, { headers: {"Content-Type": "text/plain", "X-Requested-With": "XMLHttpRequest" } })
.then(response => {
let article = document.querySelector(selector);
if (response.ok) {
response.text().then(html => {
if (base64) {
html = atob(html);
selector = 'body';
}
let parser = new DOMParser();
let doc = parser.parseFromString(html, 'text/html');
let article_new = doc.querySelector(selector);

View file

@ -330,6 +330,7 @@
"*://*.stcatharinesstandard.ca/*",
"*://*.stocknews.com/*",
"*://*.sudinfo.be/*",
"*://*.sudouest.fr/*",
"*://*.sueddeutsche.de/*",
"*://*.sun-sentinel.com/*",
"*://*.sunshinecoastdaily.com.au/*",
@ -429,5 +430,5 @@
"*://*.stripe.com/*",
"*://*.userzoom.com/*"
],
"version": "2.0.3.5"
"version": "2.0.3.6"
}

View file

@ -180,6 +180,7 @@ var defaultSites =
"Star Tribune": "startribune.com",
"Statista": "statista.com",
"Stock News": "stocknews.com",
"Sud Ouest": "sudouest.fr",
"Süddeutsche Zeitung": "sueddeutsche.de",
"SunSentinel": "sun-sentinel.com",
"Tech in Asia": "techinasia.com",