Fix-update Australia News Corp (amp/video-link)

This commit is contained in:
magnolia1234 2020-12-05 18:12:05 +01:00
parent 129a881913
commit cc55cf9968
3 changed files with 18 additions and 13 deletions

View file

@ -276,6 +276,7 @@ var blockedRegexes = {
'thehindubusinessline.com': /(cdn\.cxense\.com\/.+|cdn\.tinypass\.com\/.+)/,
'thenation.com': /cdn\.tinypass\.com\/.+/,
'thestar.com': /emeter-nam\.mppglobal\.com\/probes\/JSONP\?/,
'timeshighereducation.com': /\.timeshighereducation\.com\/sites\/default\/files\/js\/js_bbCGL.+\.js/,
'valeursactuelles.com': /.+\.qiota\.com\/.+/,
'variety.com': /cdn\.cxense\.com\/.+/,
'washingtonpost.com': /.+\.washingtonpost\.com\/.+\/pwapi-proxy\.min\.js/,
@ -353,7 +354,7 @@ function add_grouped_sites(init_rules) {
for (let domain of au_news_corp_domains) {
allow_cookies.push(domain);
use_google_bot.push(domain);
blockedRegexes[domain] = /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/;
blockedRegexes[domain] = /cdn\.ampproject\.org\/v\d\/amp-(access|iframe)-.+\.js/;
}
for (let domain of au_prov_news_domains) {
allow_cookies.push(domain);

View file

@ -8,7 +8,7 @@ Add La Voix du Nord (France)
Add The Spectator USA
Remove Aftonbladet.se (obsolete)
Remove NK News (obsolete)
Fix-update Australia News Corp (amp/no video)
Fix-update Australia News Corp (amp/video-link)
Fix-update CharlieHebdo.fr (captcha)
Fix-update Discover Magazine
Fix-update El Mercurio & La Segunda (mobile)

View file

@ -85,17 +85,21 @@ else if (window.location.hostname.endsWith(".com.au") || window.location.hostnam
for (let div_hidden of div_hidden_all)
div_hidden.removeAttribute('amp-access-hide');
} else if (window.location.href.includes('?amp')) {
window.setTimeout(function () {
//window.setTimeout(function () {
let div_hidden = document.querySelector('div[amp-access="subscriber AND status=\'logged-in\'"]');
if (div_hidden)
div_hidden.removeAttribute('amp-access-hide');
let placeholders = document.querySelectorAll('amp-img.amp-hidden');
for (let placeholder of placeholders) {
placeholder.classList.remove('amp-hidden');
if (placeholder.src && placeholder.src.includes('blank-square.svg'))
removeDOMElement(placeholder);
//}, 500); // Delay (in milliseconds)
}
}, 500); // Delay (in milliseconds)
let amp_iframes = document.querySelectorAll('amp-iframe');
let elem;
for (let amp_iframe of amp_iframes) {
elem = document.createElement('a');
elem.innerText = 'Video-link';
elem.setAttribute('href', amp_iframe.getAttribute('src'));
elem.setAttribute('target', '_blank');
amp_iframe.parentElement.insertBefore(elem, amp_iframe);
removeDOMElement(amp_iframe);
}
} else {
// Australian Seven West Media