Fix The Athletic (podcast)

merge-requests/2/head
magnolia1234 3 years ago
parent a594d0b03a
commit 3df80cde94

@ -1234,7 +1234,7 @@ if (matchUrlDomain(change_headers, details.url) && (['main_frame', 'sub_frame',
}
if ((!['font', 'stylesheet'].includes(details.type) || matchUrlDomain(cs_limit_except, currentTabUrl)) && !csDone) {
let lib_file = 'lib/empty.js';
if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'gva.be', 'lesechos.fr', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'sudouest.fr', 'techinasia.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains, no_nhst_media_domains), currentTabUrl))
if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'gva.be', 'lesechos.fr', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'sudouest.fr', 'techinasia.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains, no_nhst_media_domains, usa_theathletic_domains), currentTabUrl))
lib_file = 'lib/purify.min.js';
ext_api.tabs.executeScript(tabId, {
file: lib_file,

@ -11,6 +11,7 @@ Fix Commentary Magazine (new domain)
Fix Gestion & El Comercio (Peru)
Fix Grupo Vocento (Spain)
Fix Financial News (London)
Fix The Athletic (podcast)
Update remove cookies (faster)
* v2.3.0.1 (2021-07-26)

@ -1490,6 +1490,15 @@ else if (matchDomain(['theathletic.com', 'theathletic.co.uk'])) {
subscr_section.removeAttribute('subscriptions-section');
let subscr_actions = document.querySelectorAll('[subscriptions-actions]');
removeDOMElement(...subscr_actions);
let podcast = document.querySelector('div[id^="podcast-clip-"]');
if (podcast) {
let podcast_src = podcast.innerHTML.replace(/<amp-/g, '<').replace(/<\/amp-/g, '</');
let parser = new DOMParser();
let doc = parser.parseFromString('<div>' + DOMPurify.sanitize(podcast_src, {ADD_TAGS: ['iframe'], ADD_ATTR: ['layout', 'sandbox']}) + '</div>', 'text/html');
let podcast_new = doc.querySelector('div');
if (podcast_new)
podcast.parentNode.replaceChild(podcast_new, podcast);
}
}
}

Loading…
Cancel
Save