Fix Artnet, ET Prime, Lee Enterprises Group & LiveMint (amp)

This commit is contained in:
magnolia1234 2021-12-12 09:38:17 +01:00
parent 7f907d6312
commit 5c98b8f55c
3 changed files with 69 additions and 35 deletions

View file

@ -6,13 +6,17 @@ Add Koelner Stadt-Anzeiger & Koelnische Rundschau
Add The (New Orleans) Advocate Add The (New Orleans) Advocate
Remove Caixin Global (obsolete) Remove Caixin Global (obsolete)
Fix ABC.es (amp) Fix ABC.es (amp)
Fix Artnet (amp)
Fix Billboard (amp) Fix Billboard (amp)
Fix Digiday (amp) Fix Digiday (amp)
Fix ET Prime (amp)
Fix Fortune (amp) Fix Fortune (amp)
Fix Bloomberg Quint (bq blue) Fix Bloomberg Quint (bq blue)
Fix Funke Mediengruppe (amp) Fix Funke Mediengruppe (amp)
Fix Inkl (images) Fix Inkl (images)
Fix Lecho.be (separate from Groupe Rossel) Fix Lecho.be (separate from Groupe Rossel)
Fix Lee Enterprises Group (amp)
Fix LiveMint (amp)
Fix Los Angeles Times & San Diego Union-Tribune (amp) Fix Los Angeles Times & San Diego Union-Tribune (amp)
Fix Newsday (amp) Fix Newsday (amp)
Fix Repubblica sites (no amp) Fix Repubblica sites (no amp)

View file

@ -21,6 +21,7 @@ var no_nhst_media_domains = ['intrafish.com', 'rechargenews.com', 'tradewindsnew
var timesofindia_domains = ['timesofindia.com', 'timesofindia.indiatimes.com']; var timesofindia_domains = ['timesofindia.com', 'timesofindia.indiatimes.com'];
var usa_adv_local_domains = ['al.com', 'cleveland.com', 'lehighvalleylive.com', 'masslive.com', 'mlive.com', 'nj.com', 'oregonlive.com', 'pennlive.com', 'silive.com', 'syracuse.com']; var usa_adv_local_domains = ['al.com', 'cleveland.com', 'lehighvalleylive.com', 'masslive.com', 'mlive.com', 'nj.com', 'oregonlive.com', 'pennlive.com', 'silive.com', 'syracuse.com'];
var usa_craincomm_domains = ['adage.com', 'autonews.com', 'chicagobusiness.com', 'crainscleveland.com', 'crainsdetroit.com', 'crainsnewyork.com', 'modernhealthcare.com']; var usa_craincomm_domains = ['adage.com', 'autonews.com', 'chicagobusiness.com', 'crainscleveland.com', 'crainsdetroit.com', 'crainsnewyork.com', 'modernhealthcare.com'];
var usa_lee_ent_domains = ['buffalonews.com', 'richmond.com', 'tucson.com', 'tulsaworld.com'];
var usa_mcc_domains = ['bnd.com', 'charlotteobserver.com', 'fresnobee.com', 'kansas.com', 'kansascity.com', 'kentucky.com', 'miamiherald.com', 'newsobserver.com', 'sacbee.com', 'star-telegram.com', 'thestate.com', 'tri-cityherald.com']; var usa_mcc_domains = ['bnd.com', 'charlotteobserver.com', 'fresnobee.com', 'kansas.com', 'kansascity.com', 'kentucky.com', 'miamiherald.com', 'newsobserver.com', 'sacbee.com', 'star-telegram.com', 'thestate.com', 'tri-cityherald.com'];
var usa_mng_domains = ['denverpost.com', 'eastbaytimes.com', 'mercurynews.com', 'ocregister.com', 'pe.com', 'twincities.com']; var usa_mng_domains = ['denverpost.com', 'eastbaytimes.com', 'mercurynews.com', 'ocregister.com', 'pe.com', 'twincities.com'];
var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com'];
@ -1593,10 +1594,14 @@ else if (matchDomain('americanaffairsjournal.org')) {
} }
else if (matchDomain('artnet.com')) { else if (matchDomain('artnet.com')) {
if (window.location.pathname.endsWith('/amp-page')) {
amp_unhide_subscr_section();
} else {
let body_hidden = document.querySelector('.article-body'); let body_hidden = document.querySelector('.article-body');
if (body_hidden) if (body_hidden)
body_hidden.style = 'display:block;'; body_hidden.style = 'display:block;';
} }
}
else if (matchDomain('asia.nikkei.com')) { else if (matchDomain('asia.nikkei.com')) {
let popup = document.querySelector('#pianoj_ribbon'); let popup = document.querySelector('#pianoj_ribbon');
@ -1807,6 +1812,18 @@ else if (matchDomain('discovermagazine.com')) {
} }
else if (matchDomain('economictimes.com')) { else if (matchDomain('economictimes.com')) {
if (window.location.pathname.includes('/amp_')) {
let paywall = document.querySelector('.paywall_wrap');
if (paywall) {
let content = document.querySelector('.paywall[style="display:none;"]');
if (content)
content.setAttribute('style', 'display:block;');
let intro = document.querySelector('.art_wrap');
let article_blocker = document.querySelector('.articleBlocker');
let amp_ads = document.querySelectorAll('amp-ad');
removeDOMElement(paywall, intro, article_blocker, ...amp_ads);
}
} else {
window.setTimeout(function () { window.setTimeout(function () {
let paywall = document.querySelector('div#blocker_layer'); let paywall = document.querySelector('div#blocker_layer');
let data_prime = document.querySelector('div[data-prime="1"]'); let data_prime = document.querySelector('div[data-prime="1"]');
@ -1823,7 +1840,7 @@ else if (matchDomain('economictimes.com')) {
if (content && full_text) { if (content && full_text) {
content.innerText = ''; content.innerText = '';
let parser = new DOMParser(); let parser = new DOMParser();
html = parser.parseFromString('<div>' + DOMPurify.sanitize(full_text.innerHTML, {ADD_ATTR: ['frameborder'], ADD_TAGS: ['iframe']}) + '</div>', 'text/html'); let html = parser.parseFromString('<div>' + DOMPurify.sanitize(full_text.innerHTML, {ADD_ATTR: ['frameborder'], ADD_TAGS: ['iframe']}) + '</div>', 'text/html');
let article = html.querySelector('div'); let article = html.querySelector('div');
content.appendChild(article); content.appendChild(article);
removeDOMElement(full_text); removeDOMElement(full_text);
@ -1836,6 +1853,7 @@ else if (matchDomain('economictimes.com')) {
} }
}, 500); // Delay (in milliseconds) }, 500); // Delay (in milliseconds)
} }
}
else if (matchDomain('economictimes.indiatimes.com')) { else if (matchDomain('economictimes.indiatimes.com')) {
let paywall = document.querySelector('section.prime_paywall'); let paywall = document.querySelector('section.prime_paywall');
@ -2119,6 +2137,13 @@ else if (matchDomain('livelaw.in')) {
} }
} }
else if (matchDomain('livemint.com')) {
if (window.location.pathname.includes('/amp-')) {
let paywall = document.querySelectorAll('[amp-access="NOT subscribed"]');
removeDOMElement(...paywall);
}
}
else if (matchDomain('magazine.atavist.com')) { else if (matchDomain('magazine.atavist.com')) {
let bottom_notification = document.querySelector('div.bottom-notification'); let bottom_notification = document.querySelector('div.bottom-notification');
let overlay = document.querySelector('div.notification-overlay'); let overlay = document.querySelector('div.notification-overlay');
@ -2227,7 +2252,6 @@ else if (matchDomain('newrepublic.com')) {
else if (matchDomain('newsday.com')) { else if (matchDomain('newsday.com')) {
if (window.location.pathname.startsWith('/amp/')) { if (window.location.pathname.startsWith('/amp/')) {
console.log('newsday');
amp_unhide_access_hide('="AccessLevel = \'Full Content Access\' OR Error = true"', '="AccessLevel = \'Page View Limit\'"'); amp_unhide_access_hide('="AccessLevel = \'Full Content Access\' OR Error = true"', '="AccessLevel = \'Page View Limit\'"');
} }
} }
@ -2858,6 +2882,11 @@ else if (matchDomain('wsj.com')) {
} }
} }
else if (matchDomain(usa_lee_ent_domains)) {
if (window.location.pathname.endsWith('.amp.html'))
amp_unhide_access_hide('="hasAccess"', '="NOT hasAccess"');
}
else if ((domain = matchDomain(usa_mcc_domains)) || document.querySelector('script[src^="https://media.mcclatchyinteractive.com/"]') || (window.location.href.match(/\/\/amp\..+\.com\/(.+\/)?article(\d){8,}\.html/) && document.querySelector('a[href^="https://classifieds.mcclatchy.com/"]'))) { else if ((domain = matchDomain(usa_mcc_domains)) || document.querySelector('script[src^="https://media.mcclatchyinteractive.com/"]') || (window.location.href.match(/\/\/amp\..+\.com\/(.+\/)?article(\d){8,}\.html/) && document.querySelector('a[href^="https://classifieds.mcclatchy.com/"]'))) {
if (!domain) if (!domain)
domain = document.domain.replace(/(account|amp)\./, ''); domain = document.domain.replace(/(account|amp)\./, '');

View file

@ -93,7 +93,7 @@ var defaultSites = {
"Artnet": { "Artnet": {
domain: "artnet.com", domain: "artnet.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /\.artnet\.com\/paywall-ajax\.php/ block_regex: /(\.artnet\.com\/paywall-ajax\.php|cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js)/
}, },
"Asia Times": { "Asia Times": {
domain: "asiatimes.com", domain: "asiatimes.com",
@ -415,6 +415,7 @@ var defaultSites = {
}, },
"Financial News (London)": { "Financial News (London)": {
domain: "fnlondon.com", domain: "fnlondon.com",
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js/,
useragent: "googlebot" useragent: "googlebot"
}, },
"Financial Post": { "Financial Post": {
@ -875,7 +876,7 @@ var defaultSites = {
"tulsaworld.com" "tulsaworld.com"
], ],
allow_cookies: 1, allow_cookies: 1,
block_regex: /api\.bntech\.io\/js\// block_regex: /(api\.bntech\.io\/js\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Leeuwarder Courant": { "Leeuwarder Courant": {
domain: "lc.nl", domain: "lc.nl",
@ -897,7 +898,7 @@ var defaultSites = {
}, },
"LiveMint": { "LiveMint": {
domain: "livemint.com", domain: "livemint.com",
block_regex: /(\.livemint\.com\/js\/localWorker\.js|analytics\.htmedia\.in\/analytics-js\/.+\.js)/ block_regex: /(\.livemint\.com\/js\/localWorker\.js|analytics\.htmedia\.in\/analytics-js\/.+\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Loeb Classical Library": { "Loeb Classical Library": {
domain: "loebclassics.com" domain: "loebclassics.com"