', 'text/html');
let article_new = doc.querySelector('div');
if (article_new) {
article.innerHTML = '';
article.appendChild(article_new);
}
}
}
}
}
}, false);
var overlay = document.querySelector('body.didomi-popup-open');
if (overlay)
overlay.classList.remove('didomi-popup-open');
var ads = document.querySelectorAll('div.OUTBRAIN, div[id^="taboola-"], div.ad, div.ads, div.ad-container, div[class*="-ad-container"], div[class*="_ad-container"]');
hideDOMElement(...ads);
if (!(csDone || csDoneOnce)) {
var msg_once_ses;
if (ext_api.runtime) {
ext_api.runtime.onMessage.addListener(
function (request, sender) {
if (request.msg === 'showExtSrc' && !(msg_once_ses && url_old === window.location.href)) {
msg_once_ses = true;
url_old = window.location.href;
replaceDomElementExtSrc(request.data.url, request.data.url_src, request.data.html, true, false, request.data.selector, request.data.text_fail, request.data.selector_source, request.data.selector_archive);
}
})
}
// Content workarounds/domain
if (matchDomain('medium.com') || matchDomain(medium_custom_domains) || (!matchDomain('webcache.googleusercontent.com') && document.querySelector('head > link[href*=".medium.com/"]'))) {
let url = window.location.href;
let paywall = document.querySelector('article.meteredContent');
if (paywall) {
paywall.removeAttribute('class');
paywall.firstChild.before(freediumLink(url));
paywall.firstChild.before(googleWebcacheLink(url));
}
window.setTimeout(function () {
let banner = pageContains('div > div > p', /author made this story available to/);
if (banner.length)
removeDOMElement(banner[0].parentNode.parentNode);
}, 1000);
}
else if (window.location.hostname.match(/\.(com|net)\.au$/)) {//australia
if (matchDomain('crikey.com.au')) {
let ads = document.querySelectorAll('.advert');
hideDOMElement(...ads);
}
else if (matchDomain('forbes.com.au')) {
if (dompurify_loaded)
getJsonUrl('div[class*="_gate"]', '', 'div.article-page__content-body');
let fade = document.querySelector('div[style*="background-image: linear-gradient"]');
removeDOMElement(fade);
}
else if (matchDomain('macrobusiness.com.au')) {
let paywall = pageContains('div > p', 'The full text of this article is available');
if (paywall[0] && dompurify_loaded) {
let fade = document.querySelector('div.bg-gradient-to-t');
removeDOMElement(paywall[0].parentNode, fade);
let json_script = document.querySelector('script#__NUXT_DATA__');
if (json_script) {
try {
let json = JSON.parse(json_script.text);
let json_text = json.filter(x => typeof x === 'string' && x.match(/(<|\\u003C)p>/))[0];
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html');
let content_new = doc.querySelector('div');
let article = document.querySelector('div.content');
if (article) {
article.innerHTML = '';
article.appendChild(content_new);
}
} catch (err) {
console.log(err);
}
}
}
}
else if (matchDomain('thesaturdaypaper.com.au')) {
let hide_end = document.querySelector('div.hide-end');
if (hide_end) {
refreshCurrentTab_bg();
csDoneOnce = true;
}
let paywall = document.querySelector('div.paywall-hard-always-show');
removeDOMElement(paywall);
}
else if (matchDomain(['brisbanetimes.com.au', 'smh.com.au', 'theage.com.au', 'watoday.com.au'])) {
if (!window.location.hostname.startsWith('amp.')) {
amp_redirect('head > meta[content^="FOR SUBSCRIBERS"], #paywall_prompt');
} else {
amp_unhide_subscr_section();
}
}
else {
// Australian Community Media newspapers
let au_comm_media_domains = ['bendigoadvertiser.com.au', 'bordermail.com.au', 'canberratimes.com.au', 'centralwesterndaily.com.au', 'dailyadvertiser.com.au', 'dailyliberal.com.au', 'examiner.com.au', 'illawarramercury.com.au', 'newcastleherald.com.au', 'northerndailyleader.com.au', 'standard.net.au', 'theadvocate.com.au', 'thecourier.com.au', 'westernadvocate.com.au'];
let au_comm_media_link = document.querySelector('a[href^="https://austcommunitymedia.my.site.com/"]');
if (matchDomain(au_comm_media_domains) || au_comm_media_link) {
let mask = document.querySelector('div[class^="gradient-mask-"]');
if (mask) {
mask.removeAttribute('class');
let div_hidden = document.querySelectorAll('div.flex-col div.hidden');
for (let elem of div_hidden)
elem.classList.remove('hidden');
} else {
let subscribe_truncate = document.querySelector('.subscribe-truncate');
if (subscribe_truncate)
subscribe_truncate.classList.remove('subscribe-truncate');
let subscriber_hiders = document.querySelectorAll('.subscriber-hider');
for (let subscriber_hider of subscriber_hiders)
subscriber_hider.classList.remove('subscriber-hider');
}
let blocker = document.querySelector('div.blocker');
let overlays = document.querySelectorAll('div.transition-all, div[id^="headlessui-dialog"]');
let noscroll = document.querySelectorAll('html[style], body[style]');
for (let elem of noscroll)
elem.removeAttribute('style');
let story_generic_iframe = document.querySelector('.story-generic__iframe');
let ads = document.querySelectorAll('.ad-placeholder, .sticky, [id*="-container"], #hindsight-ads-iframe');
hideDOMElement(story_generic_iframe, blocker, ...overlays, ...ads);
} else if (window.location.hostname.endsWith('.com.au')) {
// Australia News Corp
let au_news_corp_domains = ['adelaidenow.com.au', 'cairnspost.com.au', 'couriermail.com.au', 'dailytelegraph.com.au', 'geelongadvertiser.com.au', 'goldcoastbulletin.com.au', 'heraldsun.com.au', 'ntnews.com.au', 'theaustralian.com.au', 'thechronicle.com.au', 'themercury.com.au', 'townsvillebulletin.com.au', 'weeklytimesnow.com.au'];
if (matchDomain(au_news_corp_domains)) {
if (window.location.search.match(/[&\?]amp/)) {
amp_unhide_subscr_section('amp-ad, amp-embed, [id^="ad-mrec-"]', false);
let figure_stretch = document.querySelectorAll('figure.stretch');
for (let elem of figure_stretch)
elem.classList.remove('stretch');
let comments = document.querySelector('#comments-load, .comments-module');
removeDOMElement(comments);
} else {
let ads = document.querySelectorAll('.header_ads-container, .ad-block');
hideDOMElement(...ads);
}
} else {
// Australian Seven West Media
if (matchDomain('thewest.com.au') || document.querySelector('head > link[href="https://images.thewest.com.au"]')) {
function thewest_main(node) {
let scripts = document.querySelectorAll('script:not([src]):not([type])');
let json_script;
for (let script of scripts) {
if (script.text.includes('window.PAGE_DATA =')) {
json_script = script;
break;
}
}
if (json_script) {
let json_text = json_script.text.split('window.PAGE_DATA =')[1].split(' link[rel="dns-prefetch"][href="//static.ew.mmg.navigacloud.com"]')) { // McPherson Media Group
let paywall = document.querySelector('div#content-Load-message');
if (paywall) {
removeDOMElement(paywall);
let lockable = document.querySelectorAll('div[id^="lockable-"]');
for (let elem of lockable) {
elem.removeAttribute('style');
elem.removeAttribute('id');
}
let gradient = document.querySelector('div.gradienttext');
if (gradient)
gradient.removeAttribute('class');
}
} else
csDone = true;
}
} else
csDone = true;
}
} else if (window.location.hostname.match(/\.(de|at|ch)$/) || matchDomain(['diepresse.com', 'faz.net', 'tt.com', 'wochenblatt.com'])) {//germany/austria/switzerland - ch
if (matchDomain('aerztezeitung.de')) {
let paywall = document.querySelector('div.AZLoginModule');
if (paywall) {
removeDOMElement(paywall);
let json_script = getArticleJsonScript();
if (json_script) {
let json = JSON.parse(json_script.text);
if (json) {
let json_text = json.articleBody;
let content = document.querySelector('p.intro');
if (json_text && content) {
let article_new = document.createElement('p');
article_new.innerText = json_text;
content.after(article_new);
}
}
}
}
}
else if (matchDomain(['arcinfo.ch', 'lacote.ch', 'lenouvelliste.ch'])) {// Groupe ESH Médias
let paywall = document.querySelector('section#paywall-articles');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let url_id = window.location.pathname.match(/\d+$/).pop();
let html = document.documentElement.outerHTML;
let og_url = document.querySelector('head > meta[name="og:url"][content]');
if (og_url && !og_url.content.endsWith(url_id))
refreshCurrentTab();
let json;
if (html.includes('window.__NUXT__='))
json = html.split('window.__NUXT__=')[1].split('')[0].trim().replace(/blocs:\[\{.*?\}\],/g, '');
let article = document.querySelector('div.html-content');
let no_intro = false;
if (!article) {
article = document.querySelector('div.container-mobile-full');
no_intro = true;
}
if (article && json) {
let content = '';
if (json.includes('text_1="'))
content = json.split('text_1="').pop().split('";')[0];
else {
let parts = json.split('html:"');
parts.splice(0, 1);
for (let part of parts)
content += part.split('",has_pre_content')[0];
}
if (content) {
content = content.replace(/\\u003C/g, '<').replace(/\\u003E/g, '>').replace(/\\u002F/g, '/').replace(/\\"/g, '"').replace(/\\r\\n/g, '');
let parser = new DOMParser();
let content_new = parser.parseFromString('
', 'text/html');
let content_new = doc.querySelector('div');
article.parentNode.replaceChild(content_new, article);
} catch (err) {
console.log(err);
}
}
}
}
}
else if (matchDomain('businessinsider.nl')) {
if (dompurify_loaded)
getJsonUrl('div.piano-article__paywall', '', 'div.piano-article__content');
}
else if (matchDomain('doorbraak.be')) {
let paywall_sel = 'div.paywall';
let paywall = document.querySelector(paywall_sel);
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
waitDOMElement(paywall_sel, 'DIV', removeDOMElement, false);
let json_script = document.querySelector('script#__NUXT_DATA__');
if (json_script) {
try {
if (!json_script.text.substr(0, 500).includes(window.location.pathname))
refreshCurrentTab();
let json = JSON.parse(json_script.text);
json = json.filter(x => typeof x === 'string' && x.startsWith('
'));
let json_text = json[0];
if (json_text) {
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html');
let content_new = doc.querySelector('div');
let article = document.querySelector('div > div.prose');
if (article) {
article.appendChild(content_new);
}
}
} catch (err) {
console.log(err);
}
}
}
}
else if (matchDomain('fd.nl')) {
let paywall = document.querySelectorAll('section.upsell, div.upsell-modal-background');
if (paywall.length) {
removeDOMElement(...paywall);
refreshCurrentTab();
}
let header = document.querySelector('div.fd-message[data-slot="Artikel/Header"]');
removeDOMElement(header);
}
else if (matchDomain('ftm.nl')) {
let banners = document.querySelectorAll('div.banner-pp, a.readmore');
removeDOMElement(...banners);
}
else if (matchDomain(be_roularta_domains)) {
if (matchDomain('beleggersbelangen.nl')) {
let paywall = document.querySelector('div.unlimited-access');
if (paywall) {
removeDOMElement(paywall);
let no_account = document.querySelector('div.no-account');
if (no_account)
no_account.classList.remove('no-account');
let content_inner = document.querySelector('div.content-inner[style]');
if (content_inner)
content_inner.removeAttribute('style');
}
} else {
let paywall = document.querySelector('div[id*="wall-modal"]');
if (paywall) {
removeDOMElement(paywall);
let html = document.querySelector('html[class]');
if (html)
html.removeAttribute('class');
function roularta_noscroll(node) {
node.removeAttribute('style');
node.removeAttribute('class');
}
waitDOMAttribute('html', 'html', 'class', roularta_noscroll, true);
let intro = document.querySelectorAll('div.article-body > p, div.article-body > style');
removeDOMElement(...intro);
let locked = document.querySelector('body.locked');
if (locked)
locked.classList.remove('locked');
}
if (!window.navigator.userAgent.toLowerCase().includes('chrome') && !matchDomain(['artsenkrant.com', 'kw.be']) && window.location.href.match(/\/((\w)+(\-)+){3,}/)) {
let lazy_images = document.querySelectorAll('img[src^="data:image/"][data-lazy-src]');
for (let elem of lazy_images) {
elem.src = elem.getAttribute('data-lazy-src');
}
}
}
let ads = document.querySelectorAll('div.rmgAd, div.c-header__ad');
hideDOMElement(...ads);
}
else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('head > link[href*=".ndcmediagroep.nl/"]')) {
let ads = document.querySelectorAll('div.top__ad, div.marketingblock-article');
hideDOMElement(...ads);
}
else if (matchDomain(nl_dpg_adr_domains.concat(['hln.be']))) {
func_post = function () {
let shades = document.querySelectorAll('div[style*="background-color"][style*=";width"]');
for (let elem of shades)
elem.style.width = '85%';
}
let url = window.location.href;
getArchive(url, 'div#remaining-paid-content[data-reduced="true"]', '', 'div.article__body', '', 'div#remaining-paid-content');
}
else if (matchDomain(nl_dpg_media_domains)) {
let banners = document.querySelectorAll('div[data-temptation-position^="PAGE_"], div[class^="ad--"], div[class^="_3iyhos"]');
let paywall = document.querySelectorAll('aside[data-temptation-position^="ARTICLE_"]');
removeDOMElement(...banners, ...paywall);
}
else if (matchDomain('nrc.nl')) {
let banners = document.querySelectorAll('div[id$="modal__overlay"], div.header__subscribe-bar, div.banner');
removeDOMElement(...banners);
}
else if (matchDomain('telegraaf.nl')) {
if (window.location.href.startsWith('https://www.telegraaf.nl/error?ref=/')) {
window.setTimeout(function () {
window.location.href = window.location.href.split('&')[0].replace('error?ref=/', '');
}, 500);
}
let refresh = document.querySelector('div[id="content"] > meta[http-equiv="refresh"]');
if (refresh) {
refreshCurrentTab();
}
let premium = document.querySelector('div[class^="Article__premium"] > p');
let paywall = document.querySelector('data-hydrate[data-name="PaywallHandler"]');
let article = document.querySelector('section > div.DetailArticleImage') || document.querySelector('section > p.Article__intro');
if (paywall && window.location.pathname.startsWith('/video/'))
removeDOMElement(paywall);
if (premium && paywall && article && dompurify_loaded) {
let div_main = document.createElement('div');
div_main.style = 'margin: 20px 0px;';
let div_elem = document.createElement('div');
let par_style = 'font-weight: normal; font-size: 16px; line-height: 1.5;';
function show_text(window_text, div_main) {
window_text = window_text.split('window.telegraaf.')[0].replace(/(^\s?=\s?"|";$|\\")/gm, '').replace(/\\\\u003c/gm, '<');
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(window_text) + '
', 'text/html');
let article_new = doc.querySelector('div');
let pars = article_new.querySelectorAll('p');
for (let par of pars)
par.style = 'margin: 10px 0px;';
let placeholders = article_new.querySelectorAll('div.TeaserImage__placeholder');
for (let elem of placeholders)
elem.removeAttribute('class');
let media = article_new.querySelectorAll('div.NewsletterForm, div.DetailArticleVideo');
removeDOMElement(...media);
let twitter_quotes = article_new.querySelectorAll('blockquote.twitter-tweet > a[href]');
for (let elem of twitter_quotes) {
if (!elem.innerText) {
elem.innerText = elem.href;
elem.target = '_blank';
}
}
div_main.appendChild(article_new);
}
let window_script = document.querySelector('script#scr-tlg-body');
if (window_script && window_script.text.includes('window.telegraaf.articleBodyBlocks')) {
removeDOMElement(paywall);
let window_text = window_script.text.split('window.telegraaf.articleBodyBlocks')[1];
if (window_text)
show_text(window_text, div_main);
} else {
removeDOMElement(paywall);
let url = window.location.href.split(/[#\?]/)[0];
fetch(url)
.then(response => {
if (response.ok) {
response.text().then(html => {
if (html.includes('window.telegraaf.articleBodyBlocks')) {
let window_text = html.split('window.telegraaf.articleBodyBlocks')[1].split('')[0];
if (window_text)
show_text(window_text, div_main);
}
})
}
})
}
article.after(div_main);
}
let banners = document.querySelectorAll('.ArticleBodyBlocks__inlineArticleSpotXBanner, .WebpushOptin');
removeDOMElement(...banners);
}
else if (matchDomain('tijd.be')) {
if (matchDomain('belegger.tijd.be')) {
let noscroll = document.querySelector('body.js-overflow-hidden');
if (noscroll)
noscroll.classList.remove('js-overflow-hidden');
let inert = document.querySelectorAll('[inert]');
for (let elem of inert)
elem.removeAttribute('inert');
let banner = document.querySelector('div[data-id="react-paywall-investor"]');
removeDOMElement(banner);
}
}
else if (matchDomain('vn.nl')) {
if (dompurify_loaded)
getJsonUrl('div.content__message-no-access-container', '', 'div[data-article-content-target]', {art_append: true});
let content_restriction = document.querySelector('div.content__restriction');
removeDOMElement(content_restriction);
let article_content = document.querySelector('section[data-article-content-element]');
if (article_content) {
article_content.style = 'max-height:none !important;';
let body = document.querySelector('body');
if (body)
body.style = 'height:auto !important;';
}
}
else if (document.querySelector('head > link[href="//ppt.promedia.nl"]') || document.querySelector('head > script[src*="/pmgnews/scripts/promedia.js"]')) {
let paywall_sel = 'div.pmgsub';
let paywall = document.querySelector(paywall_sel);
if (paywall) {
let article_sel = 'div.post-body, div.text';
let article = document.querySelector(article_sel);
if (article) {
let pars = article.querySelectorAll('p:first-child');
if (pars.length > 2)
removeDOMElement(paywall);
else {
func_post = function () {
let paywall = document.querySelector(paywall_sel);
removeDOMElement(paywall);
}
let url = window.location.href;
getGoogleWebcache(url, paywall_sel, '', article_sel);
}
}
}
}
else
csDone = true;
} else if ((window.location.hostname.match(/\.(ie|uk)$/) && !matchDomain(['investmentweek.co.uk', 'vogue.co.uk'])) || matchDomain(['apollo-magazine.com', 'autosport.com', 'citywire.com', 'fnlondon.com', 'ft.com', 'granta.com', 'scotsman.com', 'tes.com', 'unherd.com'])) {//united kingdom/ireland
if (matchDomain('apollo-magazine.com')) {
let banner = document.querySelector('#subscribe-ribbon');
removeDOMElement(banner);
}
else if (matchDomain('autocar.co.uk')) {
let url = window.location.href;
getGoogleWebcache(url, 'div.ms-block, div.register-block', '', 'div.content-wrapper');
}
else if (matchDomain('autosport.com')) {
let paywall = document.querySelector('div.ms-piano_article-banner');
if (paywall) {
removeDOMElement(paywall);
header_nofix(document.querySelector('div.ms-article-content > p'));
}
}
else if (matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) {
let flip_pay = document.querySelector('div#flip-pay');
if (flip_pay && flip_pay.hasChildNodes() && dompurify_loaded) {
let content = document.querySelector('script[data-fragment-type="ArticleContent"]');
if (content) {
let fade = document.querySelector('div[class*="_fadetowhite"]');
removeDOMElement(flip_pay, fade);
let intro = document.querySelector('div > div[data-auth-intro="article"]');
if (intro) {
let intro_par = intro.querySelector('p[class]');
let intro_par_class;
if (intro_par)
intro_par_class = intro_par.getAttribute('class');
let content_text = content.innerText;
if (content_text.includes('__PRELOADED_STATE_GRAPH')) {
content_text = content_text.replace(/window\["__PRELOADED_STATE_GRAPH__.+"\]\s=\s/, '');
try {
let json = JSON.parse(content_text);
if (Object.keys(json).length) {
let key = Object.keys(json)[0];
let pars = json[key].data.article.body;
let parser = new DOMParser();
for (let par of pars) {
for (let type in par) {
let item = par[type];
let elem = document.createElement('p');
elem.setAttribute('style', "margin: 10px;");
if (type === 'bullet_list') {
let ul = document.createElement('ul');
for (let sub_item of item) {
let li = document.createElement('li');
li.innerText = sub_item;
ul.appendChild(li);
}
elem.appendChild(ul);
} else if (type === 'image') {
let figure = document.createElement('figure');
let img = document.createElement('img');
img.src = item.url;
if (item.cropped && item.cropped.url)
img.src = item.cropped.url;
figure.appendChild(img);
let caption = document.createElement('figcaption');
caption.innerText = item.caption;
figure.appendChild(caption);
elem.appendChild(figure);
} else if (type === 'related') {
if (item.articles) {
let articles = item.articles;
for (let article of articles) {
let elem_link = document.createElement('a');
elem_link.href = article.webcmsRelativeUrl;
elem_link.innerText = article.title;
elem.appendChild(elem_link);
elem.appendChild(document.createElement('br'));
}
}
} else if (!['ad', 'quote', 'streamone'].includes(type)) {
let html = parser.parseFromString('
', 'text/html');
let content_new = doc.querySelector('div');
if (content_new && content.parentNode)
content.parentNode.replaceChild(content_new, content);
} else
window.location.href = 'https://economictimes.indiatimes.com' + window.location.pathname.replace('amp_prime', 'prime');
let intro = document.querySelector('.art_wrap');
let article_blocker = document.querySelector('.articleBlocker');
removeDOMElement(paywall, intro, article_blocker);
let amp_ads = document.querySelectorAll('amp-ad');
hideDOMElement(...amp_ads);
}
} else {
window.setTimeout(function () {
let paywall = document.querySelector('div#blocker_layer');
let data_prime = document.querySelector('div[data-prime="1"]');
let amphtml = document.querySelector('head > link[rel="amphtml"]');
if (paywall || data_prime) {
removeDOMElement(paywall);
if (data_prime)
data_prime.removeAttribute('data-prime');
if (amphtml)
amp_redirect_not_loop(amphtml);
else if (window.location.pathname.startsWith('/epaper/'))
window.location.href = 'https://economictimes.indiatimes.com' + window.location.pathname;
} else {
let ads = document.querySelectorAll('.adContainer');
hideDOMElement(...ads);
}
}, 500);
}
}
else if (matchDomain('economictimes.indiatimes.com')) {
let paywall = document.querySelector('section.prime_paywall');
if (paywall) {
removeDOMElement(paywall);
let content = document.querySelector('div.content1, div.artText');
let full_text = document.querySelector('div.paywall.p1');
if (content && full_text)
content.innerText = full_text.innerText;
let page_content = document.querySelector('div.pageContent:not([style])');
if (page_content)
page_content.setAttribute('style', 'height: auto !important;');
let article_wrap = document.querySelector('div.article_wrap[style]');
if (article_wrap)
article_wrap.removeAttribute('style');
}
}
else if (matchDomain('economist.com')) {
let paywall = document.querySelector('div.paywall');
if (paywall) {
let noscroll = document.querySelector('svelte-scroller-outer');
let hide_style = document.querySelector('body > style');
removeDOMElement(paywall, noscroll, hide_style);
}
let ads = document.querySelectorAll('div[class*="_advert__"]');
hideDOMElement(...ads);
}
else if (matchDomain('enotes.com')) {
let paywall = document.querySelectorAll('section.c-cta-section');
if (paywall.length) {
removeDOMElement(...paywall);
let blurred = document.querySelectorAll('div[class^="_"]');
for (let elem of blurred)
elem.removeAttribute('class');
let intro = document.querySelectorAll('div.o-rte-text > p:not([class]), div.o-rte-text > h3');
for (let elem of intro)
removeDOMElement(elem);
let section_words = pageContains('p[class="u-align--center"]', /\(The entire section contains/);
let ads = document.querySelectorAll('.ad-hfu');
hideDOMElement(...section_words, ...ads);
}
}
else if (matchDomain('epoch.org.il')) {
if (dompurify_loaded)
getJsonUrl('div.register-login-box', '', 'div.paywall');
}
else if (matchDomain('espn.com')) {
let url = window.location.href;
let paywall = document.querySelector('aside.espn-plus-container-wrapper');
if (paywall) {
removeDOMElement(paywall);
replaceDomElementExt(url, false, false, 'div.article-body');
}
}
else if (matchDomain('euobserver.com')) {
let div_hidden = document.querySelector('div.membership-upsell.show');
if (div_hidden)
div_hidden.classList.remove('show');
}
else if (matchDomain('fastcompany.com')) {
let paywall = document.querySelector('div.paywall');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let scripts = document.querySelectorAll('script:not([src]):not([type])');
let json_script;
for (let script of scripts) {
if (script.text.match(/window\.appState\s=\s/)) {
json_script = script;
break;
}
}
if (json_script) {
try {
let json = JSON.parse(json_script.text.split(/window\.appState\s=\s/)[1].split('};')[0].replace(/:undefined([,}])/g, ':"undefined"$1') + '}');
if (json) {
let pars_array = json.post.data.post.content;
let article = document.querySelector('article');
if (pars_array.length && article) {
article.innerHTML = '';
article.classList.remove('post__article--lock');
let parser = new DOMParser();
for (let par_array of pars_array) {
for (let par of par_array) {
let content_new = parser.parseFromString('
', 'text/html');
let content_new = doc.querySelector('p');
break_pre.parentNode.replaceChild(content_new, break_pre);
removeDOMElement(break_post);
}
}
clear_ads();
}
getGoogleWebcache(url, 'section#subscription-barrier', '', 'div.article-body, article');
clear_ads();
}
else if (matchDomain('newsday.com')) {
if (window.location.pathname.startsWith('/amp/')) {
amp_unhide_access_hide('="AccessLevel = \'Full Content Access\' OR Error = true"', '="Error != true AND UserState != \'Subscribed\'"');
} else {
let nd_lock = document.querySelector('html[class]');
if (nd_lock)
nd_lock.removeAttribute('class');
let ads = document.querySelectorAll('div[class^="ad_full-banner_"]');
hideDOMElement(...ads);
}
}
else if (matchDomain('newsweek.com')) {
let ads = document.querySelectorAll('div#topad, div[id^="dfp-ad-"]');
hideDOMElement(...ads);
}
else if (matchDomain('newsweek.pl')) {
let clear_ads = function () {
window.setTimeout(function () {
let ads = document.querySelectorAll('[class^="pwAds"], .hide-for-paying, div#contentPremiumPlaceholder > span, div.onet-ad');
hideDOMElement(...ads);
}, 2000);
}
func_post = function () {
clear_ads();
}
let url = window.location.href;
getArchive(url, 'div#contentPremiumPlaceholder', '', 'div#article-content-body');
clear_ads();
}
else if (matchDomain(['nola.com', 'theadvocate.com'])) {
if (window.location.pathname.endsWith('.amp.html')) {
let body_hidden = document.querySelector('.site-container');
if (body_hidden)
body_hidden.setAttribute('style', 'display:block;');
}
}
else if (matchDomain('nybooks.com')) {
let paywall_article = document.querySelector('.paywall-article');
if (paywall_article)
paywall_article.classList.remove('paywall-article');
let banners = document.querySelectorAll('div.toast-cta, div.inline-ad');
hideDOMElement(...banners);
}
else if (matchDomain('nytimes.com')) {
waitDOMElement('div#dock-container', 'DIV', removeDOMElement, false);
csDoneOnce = true;
window.setTimeout(function () {
let banners = document.querySelectorAll('div[data-testid="inline-message"], div[id^="ad-"], div.pz-ad-box');
hideDOMElement(...banners);
}, 1000);
}
else if (matchDomain('nzherald.co.nz')) {
// plus code in contentScript_once_var.js (timing)
let premium_toaster = document.querySelector('#premium-toaster');
let ads = document.querySelectorAll('.ad');
hideDOMElement(premium_toaster, ...ads);
}
else if (matchDomain('outlookbusiness.com')) {
let paywall = document.querySelector('div#csc-paywall');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_script = document.querySelector('script#__NEXT_DATA__');
if (json_script) {
let json = JSON.parse(json_script.innerText);
if (json && json.props.initialState.dashboard.ARTICLE_POST_DETAIL_API.data.article_data.description) {
let article_new = json.props.initialState.dashboard.ARTICLE_POST_DETAIL_API.data.article_data.description;
let article = document.querySelector('div.story-content');
if (article) {
article.innerHTML = '';
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(article_new) + '
', 'text/html');
let content_new = doc.querySelector('div');
article.appendChild(content_new);
}
}
}
}
}
else if (matchDomain('outlookindia.com')) {
let paywall = document.querySelector('div.paywall');
if (paywall) {
removeDOMElement(paywall);
let json_script = getArticleJsonScript();
if (json_script) {
let json = JSON.parse(json_script.text);
if (json) {
let json_text = parseHtmlEntities(json.articleBody).replace(/\n/g, "$&\r\n");
let content = document.querySelector('div#articleBody');
if (json_text && content) {
content.innerHTML = '';
let article_new = document.createElement('p');
article_new.innerText = json_text;
content.appendChild(article_new);
}
}
}
}
}
else if (matchDomain('polityka.pl')) {
let paywall = document.querySelector('div.cg-article-salebox');
if (paywall) {
removeDOMElement(paywall);
let elem_hidden = document.querySelectorAll('div.cg_article_meat > [style]');
for (let elem of elem_hidden)
elem.removeAttribute('style');
let fade = document.querySelector('article.article_status-cut');
if (fade)
fade.classList.remove('article_status-cut');
}
}
else if (matchDomain('project-syndicate.org')) {
let url = window.location.href;
let paywall_sel = 'div.paywall--base';
let paywall = document.querySelector(paywall_sel);
if (paywall) {
let article_sel = 'div[data-page-area="article-body"]';
let article = document.querySelector(article_sel);
if (article)
getArchive(url, paywall_sel, '', article_sel);
else {
removeDOMElement(paywall);
let split_top = document.querySelector('div.split-top');
if (split_top)
split_top.after(archiveLink(url));
}
}
}
else if (matchDomain('quora.com')) {
let overlays = document.querySelectorAll('div[class*="_overlay"]');
removeDOMElement(...overlays);
let mask_image = document.querySelector('div.jhqnqh');
if (mask_image)
mask_image.classList.remove('jhqnqh');
let read_more_buttons = document.querySelectorAll('button.puppeteer_test_read_more_button.qu-bg--gray_ultralight');
for (let elem of read_more_buttons)
elem.click();
let overlay_cards = document.querySelectorAll('div[class*="OverlayCard"]');
for (let elem of overlay_cards)
elem.removeAttribute('class');
window.setTimeout(function () {
let answers = document.querySelectorAll('div[class*="dom_annotate_question_answer_item_"]');
for (let answer of answers) {
let wall = answer.querySelector('div.content-monetization-wall');
if (wall) {
wall.classList.remove('content-monetization-wall');
let timestamp_link = answer.querySelector('a.answer_timestamp[href]');
if (timestamp_link) {
let answer_link = document.createElement('a');
answer_link.innerText = 'BPC > open Quora+ answer';
answer_link.href = timestamp_link.href;
wall.appendChild(answer_link);
}
}
}
}, 500);
}
else if (matchDomain('rp.pl')) {
let url = window.location.href;
getGoogleWebcache(url, 'div.paywallComponentWrapper', '', 'div.main--content--body');
}
else if (matchDomain('rugbypass.com')) {
if (window.location.pathname.startsWith('/plus/')) {
let paywall = document.querySelector('.premium-fold-bottom');
if (paywall) {
paywall.classList.remove('premium-fold-bottom');
let offer = document.querySelector('.plus-article-offer');
removeDOMElement(offer);
let fade = document.querySelector('.fade');
if (fade)
fade.classList.remove('fade');
}
} else
csDoneOnce = true;
}
else if (matchDomain('science.org')) {
let paywall = document.querySelector('div.alert-read-limit');
removeDOMElement(paywall);
let overlay = document.querySelector('body.alert-read-limit__overlay');
if (overlay)
overlay.classList.remove('alert-read-limit__overlay');
}
else if (matchDomain('scmp.com')) {
if (window.location.hostname.startsWith('amp.')) {
amp_unhide_subscr_section('amp-ad, div.ad-banner, div.advert-fly-carpet-container, div.inline-advert');
let default_meters = document.querySelectorAll('div[id^="default-meter-page-views"]');
removeDOMElement(...default_meters);
} else {
let section_hidden = document.querySelectorAll('section[data-qa="ContentBody-ContentBodyContainer"][class]');
for (let elem of section_hidden)
elem.removeAttribute('class');
let paywalled = document.querySelector('div.paywalled-content');
if (paywalled)
paywalled.removeAttribute('class');
let ads = document.querySelectorAll('div[data-qa*="AdSlot"], div.adblock-message');
hideDOMElement(...ads);
}
}
else if (matchDomain('seattletimes.com')) {
let ads = document.querySelectorAll('.top-ad-wrapper');
hideDOMElement(...ads);
}
else if (matchDomain('seekingalpha.com')) {
if (!window.location.pathname.startsWith('/amp/')) {
amp_redirect('div[data-test-id="post-locked-banner"]', {rm_attrib: "data-test-id"});
let read_more = document.querySelector('button[id^="continueReadingButton"]');
if (read_more)
read_more.click();
} else {
amp_unhide_access_hide('*="premium_access OR"', '', '.ad-wrap');
let paywall = document.querySelector('[class*="paywall-container"]');
removeDOMElement(paywall);
}
}
else if (matchDomain(sg_sph_media_domains)) {
let url = window.location.href;
getArchive(url, 'div#nocx_paywall_area', '', 'main#content');
let ads = document.querySelectorAll('div[id^="dfp-ad-"], div.cx_paywall_placeholder');
hideDOMElement(...ads);
}
else if (matchDomain('slate.com')) {
let slate_roadblock = document.querySelector('.slate-roadblock');
let ads = document.querySelectorAll('section[class*="-ad"]');
hideDOMElement(slate_roadblock, ...ads);
}
else if (matchDomain('slideshare.net')) {
let limit_overlay = document.querySelector('.limit-overlay');
if (limit_overlay)
limit_overlay.classList.remove('limit-overlay');
}
else if (matchDomain('sltrib.com')) {
let ads = document.querySelectorAll('div.stickyAd, div[class^="sltrib_medrec"]');
hideDOMElement(...ads);
}
else if (matchDomain('sloanreview.mit.edu')) {
let url = window.location.href;
let article_sel = 'div.article-content';
func_post = function () {
let pars = document.querySelectorAll(article_sel + ' > p');
if (pars.length < 5) {
let article = document.querySelector(article_sel);
if (article)
article.firstChild.before(archiveLink(url));
}
}
getGoogleWebcache(url, 'body.is-paywall', {rm_class: 'is-paywall'}, article_sel);
}
else if (matchDomain('sofrep.com')) {
let paywall = document.querySelector('div.paywall');
if (paywall) {
paywall.removeAttribute('class');
let intro = document.querySelector('div.non-paywall');
removeDOMElement(intro);
waitDOMElement('div#paywall_wrap', 'DIV', node => removeDOMElement(node.parentNode));
}
let banners = document.querySelectorAll('#scrollerCTA, #botCta');
removeDOMElement(...banners);
}
else if (matchDomain('spglobal.com')) {
let overlay = document.querySelector('.article__overlay');
removeDOMElement(overlay);
let html_noscroll = document.querySelector('html[class]');
if (html_noscroll)
html_noscroll.removeAttribute('class');
}
else if (matchDomain('sportico.com')) {
if (window.location.pathname.endsWith('/amp/'))
amp_unhide_subscr_section('amp-ad, amp-embed');
}
else if (matchDomain('staradvertiser.com')) {
if (window.location.pathname.endsWith('/amp/')) {
amp_unhide_subscr_section();
} else {
let paywall = document.querySelector('div#hsa-paywall-overlay');
if (paywall) {
removeDOMElement(paywall);
let div_hidden = document.querySelector('div#hsa-paywall-content[style]');
if (div_hidden)
div_hidden.removeAttribute('style');
}
}
}
else if (matchDomain('startribune.com')) {
let noscroll = document.querySelector('body[class]');
if (noscroll)
noscroll.style = 'overflow: auto !important; position: static !important;';
let modal = document.querySelector('div.modal-backdrop');
removeDOMElement(modal);
}
else if (matchDomain('statista.com')) {
if (window.location.pathname.startsWith('/outlook/')) {
let promo = document.querySelector('section#promotionElement');
let chartbox_paywall = document.querySelectorAll('div.xmoChartBoxPaywall');
removeDOMElement(promo, ...chartbox_paywall);
let blurred = document.querySelectorAll('.blurred');
for (let elem of blurred)
elem.removeAttribute('class');
}
}
else if (matchDomain('stereogum.com')) {
let paywall = document.querySelector('div.members-only-overlay-wrapper');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
.then(response => {
if (response.ok) {
response.json().then(json => {
try {
let json_text = json.acf.article_modules[0].copy.replace(/data-src/g, 'src');
let content = document.querySelector('div.article__content div.text-block__inner');
if (json_text && content) {
let parser = new DOMParser();
let doc = parser.parseFromString('
', 'text/html');
let content_new = doc.querySelector('div');
content.innerHTML = '';
content.appendChild(content_new);
}
} catch (err) {
console.log(err);
}
});
}
});
}
}
}
else if (matchDomain('stocknews.com')) {
let hideme = document.querySelector('div#hideme');
removeDOMElement(hideme);
let blurmes = document.querySelectorAll('div[id^="blurme"]');
for (let i = 0; i < blurmes.length; i++)
blurmes[i].setAttribute('id', 'blurmenot' + i);
}
else if (matchDomain('studocu.com')) {
window.setTimeout(function () {
let paywall = document.querySelector('button[data-test-selector^="preview-banner-"]');
if (paywall) {
let paywall_banner = document.querySelector('#document-wrapper > div:not([style])');
let banners = document.querySelectorAll('div.pf > :not(.page-content), div#premium-page-header');
removeDOMElement(paywall_banner, ...banners);
window.setTimeout(function () {
let blurred_pages = document.querySelectorAll('div.page-content[style]');
for (let blurred_page of blurred_pages) {
let page = document.createElement('span');
page.setAttribute('class', 'page-content');
page.appendChild(blurred_page.firstChild);
blurred_page.parentNode.replaceChild(page, blurred_page);
}
}, 2000);
}
}, 1000);
}
else if (matchDomain('study.com')) {
let faded_content = document.querySelector('div.faded-content');
if (faded_content)
faded_content.removeAttribute('class');
let div_hidden = document.querySelector('div.hidden[ng-non-bindable]');
if (div_hidden)
div_hidden.removeAttribute('class');
let banners = document.querySelectorAll('div.article-cutoff-div');
removeDOMElement(...banners);
}
else if (matchDomain('swarajyamag.com')) {
if (!window.location.pathname.startsWith('/amp/')) {
let paywall = pageContains('h2', /Please Sign In To Continue Reading/);
let amphtml = document.querySelector('head > link[rel="amphtml"]');
if (paywall.length) {
removeDOMElement(...paywall);
if (amphtml)
amp_redirect_not_loop(amphtml);
}
}
}
else if (matchDomain('techinasia.com')) {
let paywall = document.querySelector('div.paywall-content');
if (paywall && dompurify_loaded) {
paywall.classList.remove('paywall-content');
let url = window.location.href;
let url_xhr = url.replace('.com/', '.com/wp-json/techinasia/2.0/posts/').replace('/visual-story/', '/');
fetch(url_xhr)
.then(response => {
if (response.ok) {
response.json().then(json => {
let json_text = json.posts[0].content;
json_text = json_text.replace(/width\=\"(\d){3,}\"/g, 'width="100%"').replace(/height\=\"(\d){3,}\"/g, 'height="100%"');
let content = document.querySelector('div.content');
if (json_text && content) {
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html');
let content_new = doc.querySelector('div.content');
content.parentNode.replaceChild(content_new, content);
}
});
}
});
}
let splash_subscribe = document.querySelector('div.splash-subscribe');
let paywall_hard = document.querySelector('div.paywall-hard');
removeDOMElement(splash_subscribe, paywall_hard);
}
else if (matchDomain(['techtarget.com', 'computerweekly.com', 'lemagit.fr'])) {
let paywall = document.querySelector('div.paywall');
if (paywall) {
paywall.classList.remove('paywall');
let banners = document.querySelectorAll('p#firstP, div#inlineRegistrationWrapper');
removeDOMElement(...banners);
}
}
else if (matchDomain('texasmonthly.com')) {
let ads = document.querySelectorAll('div.promo-in-body');
hideDOMElement(...ads);
}
else if (matchDomain('the-american-interest.com')) {
let counter = document.getElementById('article-counter');
removeDOMElement(counter);
}
else if (matchDomain('the-scientist.com')) {
let paywall = document.querySelector('div.paywall');
if (paywall) {
paywall.classList.remove('paywall');
let fader = document.querySelector('div.gated-fader');
let modal = document.querySelector('div#Modal');
removeDOMElement(fader, modal);
}
}
else if (matchDomain('theamericanconservative.com')) {
let paywall_sel = 'section.c-blog-post__body--locked';
let paywall = document.querySelector(paywall_sel);
if (paywall && dompurify_loaded) {
let art_options = {
art_append: true,
func_text: function (json_text) {
if (json_text.includes('
')) {
let split = json_text.split(/(
)/);
json_text = split[1] + split[2];
};
return json_text;
}
};
getJsonUrl(paywall_sel, {rm_class: 'c-blog-post__body--locked'}, 'div.c-blog-post__content', art_options);
} else {
let img_dark = document.querySelector('div.c-hero-article__image-img.o-image');
if (img_dark)
img_dark.removeAttribute('class');
}
let modal = document.querySelector('div#emailsub-modal');
removeDOMElement(modal);
let noscroll = document.querySelector('body.modal-open');
if (noscroll)
noscroll.classList.remove('modal-open');
}
else if (matchDomain('theathletic.com')) {
if (!(window.location.search.match(/(\?|&)amp/) && !document.querySelector('head > link[rel="amphtml"]'))) {
function theathletic_func(node) {
removeDOMElement(node);
let overlays = document.querySelectorAll('div[id*="overlay"], div:empty:not([data-rjs])');
hideDOMElement(...overlays);
let body = document.querySelector('body');
if (body) {
body.style.overflow = 'visible';
body.style.position = 'relative';
}
}
waitDOMElement('div[id^="slideup-"]', 'DIV', theathletic_func);
csDoneOnce = true;
} else {
amp_unhide_subscr_section();
amp_unhide_access_hide('', '*="NOT granted"');
}
let apron = document.querySelector('div#free-apron-cta, div.slideup-free-apron-container');
removeDOMElement(apron);
}
else if (matchDomain('theatlantic.com')) {
let lazy_images = document.querySelectorAll('img[class*="Image_lazy__"]');
for (let elem of lazy_images)
removeClassesByPrefix(elem, 'Image_lazy__');
let videos = document.querySelectorAll('iframe[data-src]:not([src])');
for (let video of videos)
video.src = video.getAttribute('data-src');
let banners = document.querySelectorAll('aside#paywall, div[class^="LostInventoryMessage_"]');
hideDOMElement(...banners);
}
else if (matchDomain('thebulletin.org')) {
if (dompurify_loaded)
getJsonUrl('div.article--cropped', '', 'div#body-copy', {art_append: true});
}
else if (matchDomain('thedailybeast.com')) {
let paywall = document.querySelector('div.Body__paywall-container');
if (paywall) {
removeDOMElement(paywall);
let json_script = document.querySelector('script[displayName="initialState"]');
if (json_script) {
let json_str = json_script.text.substring(json_script.textContent.indexOf('{'));
try {
let json = JSON.parse(json_str);
if (json.body) {
let pars = json.body.sections;
let cards = json.body.cards;
if (pars) {
let mobile_doc = document.querySelector('div.Mobiledoc');
if (mobile_doc) {
let mobile_doc_text = mobile_doc.innerText.replace(/(\r|\n)/g, '');
for (let elem of pars) {
let par_elem = '';
if (elem[0] === 1) {
if (elem[1] === 'p') {
let par = '';
for (let part of elem[2])
par += part[3];
if (par && !mobile_doc_text.includes(par)) {
par_elem = document.createElement('p');
par_elem.innerText = par;
}
}
} else if (elem[0] === 10) {
if (cards && cards[elem[1]]) {
let card = cards[elem[1]];
if (card[0] === 'pt-image') {
par_elem = document.createElement('p');
let par_fig = document.createElement('figure');
let par_img = document.createElement('img');
par_img.src = card[1].url;
par_fig.appendChild(par_img);
par_elem.appendChild(par_fig);
let par_cap = document.createElement('figcaption');
par_cap.innerText = card[1].title + ' ' + card[1].credit;
par_elem.appendChild(par_cap);
} else if (card[0] === 'pt-fancy-links-card') {
par_elem = document.createElement('p');
let par_link = document.createElement('a');
par_link.href = card[1].links;
par_link.innerText = card[1].linksData[0].long_headline;
par_elem.appendChild(par_link);
}
}
}
if (par_elem)
mobile_doc.appendChild(par_elem);
}
}
}
}
csDoneOnce = true;
} catch (err) {
console.log(err);
}
}
}
}
else if (matchDomain('thediplomat.com')) {
if (matchDomain('magazine.thediplomat.com')) {
let preview = document.querySelector('article.dpl-preview');
if (preview)
preview.classList.remove('dpl-preview');
}
}
else if (matchDomain('theglobeandmail.com')) {
let lazy_images = document.querySelectorAll('img[src^="data:image/"][data-src]');
for (let elem of lazy_images)
elem.src = elem.getAttribute('data-src');
let ads = document.querySelectorAll('div.c-ad, div[class^="BaseAd__"]');
hideDOMElement(...ads);
}
else if (matchDomain(['thehindu.com', 'thehindubusinessline.com'])) {
if (!window.location.pathname.endsWith('/amp/')) {
let counter = document.querySelector('#test');
let ads = document.querySelectorAll('.article-ad, .dfp-ad');
hideDOMElement(counter, ...ads);
} else {
let ads = document.querySelectorAll('amp-ad, amp-embed, [class^="height"], [class^="advt"], [id^="piano"]');
hideDOMElement(...ads);
}
function hindu_main() {
if (window) {
window.Adblock = false;
window.isNonSubcribed = false;
}
}
insert_script(hindu_main);
}
else if (matchDomain('theimpression.com')) {
let paywall = document.querySelector('div#modalpostsubscribe');
if (paywall) {
let blureffect = document.querySelectorAll('div.blureffect');
for (let elem of blureffect)
elem.classList.remove('blureffect');
}
}
else if (matchDomain(['thejuggernaut.com', 'jgnt.co'])) {
let paywall = pageContains('div.font-mono', /(Read this article and many more by subscribing today|Join today to read the full story)/);
if (paywall.length) {
removeDOMElement(paywall[0].parentNode);
let json_script = document.querySelector('script#__NEXT_DATA__');
if (json_script) {
try {
let json = JSON.parse(json_script.text);
if (json && json.props.pageProps.post) {
let url_next = json.query.slug;
if (url_next && !window.location.pathname.includes(url_next))
refreshCurrentTab();
let pars = json.props.pageProps.post.fields.textEssay.fields.body.content;
window.setTimeout(function () {
let article = document.querySelector('div[class*="opacity-"]');
if (article) {
article.innerHTML = '';
article.removeAttribute('class');
let fade = document.querySelectorAll('div.bg-gradient-to-b');
for (let elem of fade)
elem.removeAttribute('class');
let modal = document.querySelector('div#headlessui-portal-root');
removeDOMElement(modal);
let par_first = true;
function attach_text(sub_item, elem) {
if (sub_item.value) {
let sub_elem = document.createElement('span');
sub_elem.innerText = sub_item.value;
if (sub_item.marks && sub_item.marks.length) {
let style = '';
for (let mark of sub_item.marks) {
if (mark.type === 'bold')
style += 'font-weight: bold;';
else if (mark.type === 'italic')
style += 'font-style: italic;';
else if (mark.type === 'underline')
style += 'text-decoration: underline;';
}
sub_elem.style = style;
}
elem.appendChild(sub_elem);
}
}
function attach_hyperlink(sub_item, elem) {
if (sub_item.content && sub_item.content[0] && sub_item.content[0].value && sub_item.data && sub_item.data.uri) {
let sub_elem = document.createElement('a');
sub_elem.href = sub_item.data.uri;
sub_elem.innerText = sub_item.content[0].value;
if (!matchUrlDomain(['thejuggernaut.com', 'jgnt.co'], sub_item.data.uri))
sub_elem.target = '_blank';
sub_elem.style = 'text-decoration: underline;';
elem.appendChild(sub_elem);
}
}
function attach_paragraph(par, elem) {
if (par.content && par.content.length) {
let span_elem = document.createElement('span');
for (let item of par.content) {
if (item.nodeType === 'text') {
attach_text(item, span_elem);
} else if (item.nodeType === 'hyperlink') {
attach_hyperlink(item, span_elem);
} else
console.log(item);
}
elem.appendChild(span_elem);
}
}
for (let par of pars) {
let elem = document.createElement('p');
if (par.nodeType.match(/^(paragraph|heading-\d)$/)) {
attach_paragraph(par, elem);
} else if (['blockquote'].includes(par.nodeType)) {
if (par.content && par.content.length) {
for (let item of par.content) {
if (item.nodeType === 'paragraph') {
elem.style = 'margin: 0px 20px; font-style: italic;';
attach_paragraph(item, elem);
} else
console.log(item);
}
}
} else if (par.nodeType === 'hr') {
elem.appendChild(document.createElement('hr'));
} else if (par.nodeType === 'embedded-asset-block') {
if (!par_first) {
if (par.data && par.data.target && par.data.target.fields) {
if (par.data.target.fields.file && par.data.target.fields.file.url) {
let figure = document.createElement('figure');
let img = document.createElement('img');
img.src = par.data.target.fields.file.url;
figure.appendChild(img);
if (par.data.target.fields.description) {
let caption = document.createElement('figcaption');
caption.innerText = par.data.target.fields.description;
figure.appendChild(caption);
}
elem.appendChild(figure);
}
}
} else
par_first = false;
} else if (par.nodeType === 'unordered-list') {
if (par.content && par.content.length) {
let ul = document.createElement('ul');
for (let item of par.content) {
if (item.nodeType === 'list-item') {
if (item.content) {
for (let sub_item_par of item.content) {
if (sub_item_par.nodeType === 'paragraph') {
let li = document.createElement('li');
attach_paragraph(sub_item_par, li);
ul.appendChild(li);
}
}
}
} else
console.log(item);
}
elem.appendChild(ul);
}
} else {
console.log(par);
}
if (elem.hasChildNodes()) {
article.appendChild(document.createElement('br'));
article.appendChild(elem);
}
}
}
}, 1000);
} else
refreshCurrentTab();
} catch (err) {
console.log(err);
}
}
}
}
else if (matchDomain('thelampmagazine.com')) {
let paywall = document.querySelector('div.paywall-gradient');
if (paywall) {
paywall.removeAttribute('class');
let banner = document.querySelector('section.p-8');
removeDOMElement(banner);
}
let login = document.querySelectorAll('a.js-login-modal-trigger');
for (let elem of login) {
elem.removeAttribute('class');
let url_search = '/search?q=' + elem.innerText.replace(/\s/g, '+');
elem.href = url_search;
elem.onclick = x => window.location.href = url_search;
}
}
else if (matchDomain('thelawyersdaily.ca')) {
if (window.location.pathname.startsWith('/amp/')) {
ampToHtml();
} else {
let modal = document.querySelectorAll('#NewsletterModal, .modal-backdrop');
removeDOMElement(...modal);
}
}
else if (matchDomain('thenewatlantis.com')) {
let article_gated = document.querySelector('.article-gated');
if (article_gated)
article_gated.classList.remove('article-gated');
}
else if (matchDomain('thenewsminute.com')) {
let paywall = document.querySelector('div#paywall-banner');
if (paywall) {
removeDOMElement(paywall);
let fade = document.querySelector('div[class^="paywall-story-styles-"]');
if (fade)
fade.removeAttribute('class');
let json_script = getArticleJsonScript();
if (json_script) {
let json = JSON.parse(json_script.text);
if (json) {
let json_text = breakText(parseHtmlEntities(json.articleBody.replace(/\.\./g, '.\r\n\r\n')));
let article = document.querySelector('div.arr--story-page-card-wrapper');
if (json_text && article) {
article.innerHTML = '';
let article_new = document.createElement('p');
article_new.innerText = json_text;
article.appendChild(article_new);
}
}
}
}
}
else if (matchDomain('thepointmag.com')) {
let overlay = document.querySelectorAll('div.overlay, div#tpopup-');
removeDOMElement(...overlay);
}
else if (matchDomain('thequint.com')) {
let paywall = document.querySelector('div#paywall-widget');
if (paywall) {
removeDOMElement(paywall);
let json_script = getArticleJsonScript();
if (json_script) {
let json = JSON.parse(json_script.text);
if (json) {
let json_text = breakText(parseHtmlEntities(json.articleBody));
let article = document.querySelector('div.story-element');
if (json_text && article) {
let article_new = document.createElement('p');
article_new.innerText = json_text;
article.innerHTML = '';
article.appendChild(article_new);
}
}
} else
refreshCurrentTab();
let body_hidden = document.querySelector('div#story-body-wrapper');
if (body_hidden) {
body_hidden.removeAttribute('class');
body_hidden.removeAttribute('style');
}
function thequint_unhide(node) {
node.removeAttribute('style');
}
waitDOMAttribute('div#story-body-wrapper', 'DIV', 'style', thequint_unhide, true);
}
}
else if (matchDomain('theverge.com')) {
let paywall = document.querySelector('div.bg-paywall-fade');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_script = document.querySelector('script#__NEXT_DATA__');
if (json_script) {
try {
let json = JSON.parse(json_script.text);
let article = document.querySelector('div.duet--article--article-body-component-container');
if (json && article) {
let json_pars = json.props.pageProps.hydration.responses[0].data.entryRevision.body.components;
article.innerHTML = '';
let parser = new DOMParser();
for (let par of json_pars) {
let elem = document.createElement('p');
elem.style = 'margin: 20px 0px;';
let type = par.__typename;
if (['EntryBodyParagraph', 'EntryBodyHeading'].includes(type)) {
if (par.contents && par.contents.html) {
if (type === 'EntryBodyHeading')
elem.style = 'font-weight: bold;';
let doc = parser.parseFromString('
' + DOMPurify.sanitize(par.contents.html) + '
', 'text/html');
elem.appendChild(doc.querySelector('div'));
}
} else if (type === 'EntryBodyHorizontalRule') {
elem.appendChild(document.createElement('hr'));
} else if (type === 'EntryBodyImage') {
if (par.image && par.image.url) {
let figure = document.createElement('figure');
if (par.image.asset && par.image.asset.title)
figure.appendChild(document.createTextNode(par.image.asset.title));
let img = document.createElement('img');
img.src = par.image.url;
figure.appendChild(img);
if (par.image.caption && par.image.caption.html) {
let caption = document.createElement('figcaption');
caption.innerText = par.image.caption.html;
if (par.image.credit && par.image.credit.html)
caption.innerText += ' - ' + par.image.credit.html;
figure.appendChild(caption);
}
elem.appendChild(figure);
}
} else if (type === 'EntryBodyPullquote') {
if (par.quote && par.quote.html) {
let doc = parser.parseFromString('
' + DOMPurify.sanitize(par.quote.html) + '
', 'text/html');
elem.appendChild(doc.querySelector('div'));
}
} else if (type === 'EntryBodyBlockquote') {
if (par.paragraphs) {
for (let quote_par of par.paragraphs) {
if (quote_par.contents && quote_par.contents.html) {
let doc = parser.parseFromString('
', 'text/html');
elem.appendChild(doc.querySelector('div'));
}
}
}
} else if (type === 'EntryBodyList') {
if (par.items) {
let ul = document.createElement('ul');
for (let item of par.items) {
if (item.line && item.line.html) {
let li = document.createElement('li');
let doc = parser.parseFromString('
' + DOMPurify.sanitize(item.line.html) + '
', 'text/html');
li.appendChild(doc.querySelector('div'));
ul.appendChild(li);
}
}
elem.appendChild(ul);
}
} else
console.log(par);
if (elem.hasChildNodes())
article.appendChild(elem);
}
}
} catch (err) {
console.log(err);
}
}
}
}
else if (matchDomain('theweek.com')) {
let paywall = document.querySelector('div.kiosq-main-layer');
removeDOMElement(paywall);
let locker = document.querySelector('div.paywall-locker');
if (locker)
locker.classList.remove('paywall-locker');
}
else if (matchDomain('thewrap.com')) {
if (dompurify_loaded)
getJsonUrl('div#zephr-payment-form-root', '', 'div.entry-content', {art_append: true});
let fade = document.querySelector('div.content-area div[style*="background-image: linear-gradient"]');
removeDOMElement(fade);
}
else if (matchDomain('timeshighereducation.com')) {
let paywall_cta = document.querySelector('div.paywall-cta');
if (paywall_cta) {
paywall_cta.removeAttribute('style');
let hidden_divs = document.querySelectorAll('div[style="display: none;"]');
for (let hidden_div of hidden_divs)
hidden_div.removeAttribute('style');
let paywall_fade = document.querySelector('div.paywall-fade');
if (paywall_fade)
paywall_fade.classList.remove('paywall-fade');
}
let hidden_images = document.querySelectorAll('img.b-lazy[src^="data:image/"][data-src]');
for (let hidden_image of hidden_images) {
hidden_image.setAttribute('src', hidden_image.getAttribute('data-src'));
hidden_image.classList.remove('b-lazy');
hidden_image.parentElement.classList.remove('media--loading');
}
let ads = document.querySelectorAll('div[id^="div-gpt-in-article-ad-"], div[class^="the-dfp__in-article-ATD"]');
hideDOMElement(...ads);
}
else if (matchDomain(timesofindia_domains)) {
if (matchDomain('epaper.indiatimes.com')) {
let blocker = document.querySelector('div.epaperBlockerWrap');
removeDOMElement(blocker);
if (window.location.pathname.startsWith('/english-news-paper-today-toi-print-edition/')) {
let paywall = document.querySelector('section#blocker');
if (paywall) {
let fq = document.querySelector('section#fq');
removeDOMElement(paywall, fq);
let json_script = getArticleJsonScript();
if (json_script) {
let json = JSON.parse(json_script.text);
if (json) {
let json_text = json.articleBody;
let content = document.querySelector('section[type="synopsis"]');
if (json_text && content) {
let article_new = document.createElement('p');
article_new.innerText = breakText(json_text);
content.innerHTML = '';
let sheet = document.createElement('style');
sheet.innerText = '[type="synopsis"]::after {background: none !important;}';
document.head.appendChild(sheet);
content.appendChild(article_new);
}
}
}
}
}
} else {
let url = window.location.href;
let region_block = document.querySelector('div.plan-popup.active');
if (region_block) {
removeDOMElement(region_block);
let overflow = document.querySelector('html[style]');
if (overflow)
overflow.removeAttribute('style');
}
if (!window.location.pathname.includes('/amp_')) {
amp_redirect('div[id^="story-blocker"]', '', url.replace('/articleshow/', '/amp_articleshow/'));
} else {
let amp_images = document.querySelectorAll('div.inline-image > div.inline-imgecontent > amp-img[src]');
for (let amp_image of amp_images) {
amp_image.parentNode.removeAttribute('class');
amp_image.parentNode.parentNode.removeAttribute('class');
let elem = document.createElement('img');
Object.assign(elem, {
src: amp_image.getAttribute('src'),
alt: amp_image.getAttribute('alt')
});
amp_image.parentNode.replaceChild(elem, amp_image);
}
}
}
}
else if (matchDomain(no_nhst_media_domains)) {
let url = window.location.href;
if (url.includes('.tradewindsnews.com/markets/')) {
let paywall = document.querySelector('iframe[src]');
removeDOMElement(paywall);
let overflow = document.querySelector('body[style]');
if (overflow)
overflow.removeAttribute('style');
let blurred = document.querySelector('body > div[style]');
if (blurred)
blurred.removeAttribute('style');
} else if (matchDomain('upstreamonline.com')) {
window.setTimeout(function () {
let paywall = document.querySelector('div.dn-paywall > div#sub-paywall-container');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall.parentNode);
let article = document.querySelector('div#dn-content');
let json_script = document.querySelector('script#__NUXT_DATA__');
if (json_script) {
try {
let pars = JSON.parse(json_script.text);
let article_id_index = pars.indexOf('global-article') + 1;
if (article_id_index) {
let article_id = pars[article_id_index];
if (article_id && !window.location.pathname.endsWith(article_id)) {
refreshCurrentTab();
return;
}
}
article.innerHTML = '';
article.classList.remove('shadow');
let img_first = true;
let parser = new DOMParser();
for (let par of pars) {
let elem;
if (par.type) {
let type = pars[par.type];
if (['text', 'subhead'].includes(type)) {
if (par.html || par.value) {
let index = par.html || par.value;
let json_text = pars[index];
let content_new = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html');
elem = content_new.querySelector('p');
if (par.value)
elem.style = 'font-weight: bold;';
}
} else if (type === 'picture') {
if (img_first)
img_first = false;
else {
elem = document.createElement('figure');
elem.className = 'dn-image';
let img = document.createElement('img');
img.src = pars[par.src];
elem.appendChild(img);
if (par.caption) {
let caption = document.createElement('p');
caption.innerText = pars[par.caption];
if (par.credit)
caption.innerText += ' (' + pars[par.credit] + ')';
elem.appendChild(caption);
}
}
} else if (type === 'news' && par.title && par.url) {
elem = document.createElement('a');
elem.href = pars[par.url];
elem.innerText = 'Related: ' + pars[par.title];
elem.style = 'font-weight: bold;';
} else if (!['ad', 'author', 'break', 'Location', 'news', 'Organisation', 'promobox', 'Person', 'Region', 'Regions', 'related', 'Sectors'].includes(type)) {
for (let item in par) {
console.log(item);
console.log(pars[par[item]]);
}
}
if (elem)
article.appendChild(elem);
}
}
} catch (err) {
console.log(err);
}
}
}
}, 1000);
} else {
let fade = document.querySelector('div[style*="background-image: linear-gradient"]');
if (fade) {
removeDOMElement(fade);
let header = document.querySelector('div.article-body > div');
header_nofix(header);
}
}
}
else if (matchDomain(uk_incisive_media_domains)) {
let url = window.location.href;
let paywall_sel = 'div#d-wrapper';
let paywall = document.querySelector(paywall_sel);
if (paywall) {
let live_blog = document.querySelector('head > meta[name="description"][content^="In this live blog"]');
let article_sel = 'div.article-content';
let article = document.querySelector(article_sel);
if (article) {
if (live_blog) {
removeDOMElement(paywall);
article.firstChild.before(googleWebcacheLink(url));
} else {
getGoogleWebcache(url, 'div#d-wrapper', '', article_sel);
}
}
}
}
else if (matchDomain(usa_conde_nast_domains)) {
let banners = document.querySelectorAll('aside.paywall-bar, div[class^="MessageBannerWrapper-"], div.ad-stickyhero');
removeDOMElement(...banners);
}
else if (matchDomain(usa_craincomm_domains)) {
if (matchDomain('european-rubber-journal.com')) {
let paywall = document.querySelector('div.article-overlay');
if (paywall) {
let fade = document.querySelector('div.gradient');
removeDOMElement(paywall, fade);
let truncated = document.querySelector('div.truncated');
if (truncated)
truncated.classList.remove('truncated');
}
} else {
let body_hidden = document.querySelector('body[class]');
if (body_hidden)
body_hidden.removeAttribute('class');
let lazy_images = document.querySelectorAll('img.lazy[data-src]');
for (let lazy_image of lazy_images) {
lazy_image.src = lazy_image.getAttribute('data-src');
lazy_image.removeAttribute('class');
}
let lazy_sources = document.querySelectorAll('source[srcset^="data:image"]');
removeDOMElement(...lazy_sources);
let sponsored_article = document.querySelector('div.sponsored-article');
if (sponsored_article)
sponsored_article.classList.remove('sponsored-article');
}
let banners = document.querySelectorAll('div.footer__ads-footer');
hideDOMElement(...banners);
}
else if (matchDomain(usa_nymag_domains)) {
let ads = document.querySelectorAll('div.m-ad');
hideDOMElement(...ads);
}
else if (matchDomain(usa_outside_mag_domains)) {
let ads = document.querySelectorAll('div.js-ad');
hideDOMElement(...ads);
}
else if (matchDomain(usa_tribune_domains)) {
let overlay = document.querySelector('div#zephr-overlay');
removeDOMElement(overlay);
}
else if (matchDomain('usatoday.com')) {
if (window.location.hostname.startsWith('amp.')) {
amp_unhide_access_hide('="gup.hasAssetAccess"', '', 'div[class*="ad-"]');
} else {
let roadblock = document.querySelector('.roadblock-container');
if (roadblock) {
removeDOMElement(roadblock);
article_next = document.querySelector('article.next-in-depth-story > div.article-inner');
if (article_next) {
let url = article_next.getAttribute('data-url');
let weblink = document.createElement('a');
weblink.href = url;
weblink.innerText = 'open next in-depth story';
article_next.appendChild(weblink);
}
}
}
}
else if (matchDomain('vikatan.com')) {
window.setTimeout(function () {
let paywall = document.querySelector('div#paywallDisplay');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_script = getArticleJsonScript();
if (json_script) {
let json = JSON.parse(json_script.text);
if (json) {
let json_text = parseHtmlEntities(json.articleBody);
let content = document.querySelector('div.story-element > div');
if (json_text && content) {
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(json_text) + '
', 'text/html');
let content_new = doc.querySelector('div');
content.parentNode.replaceChild(content_new, content);
}
}
}
}
let story_hidden = document.querySelector('div[class^="styles-m__story-card-wrapper_"]');
if (story_hidden)
story_hidden.removeAttribute('class');
}, 500);
}
else if (matchDomain('voguebusiness.com')) {
let article_sel = 'div[data-testid="ArticlePageChunks"]';
let article = document.querySelector(article_sel);
if (article) {
let pars = article.querySelectorAll('p');
if (pars.length < 5) {
let url = window.location.href;
let url_archive = 'https://' + archiveRandomDomain() + '/' + url.split(/[#\?]/)[0];
csDoneOnce = true;
replaceDomElementExt(url_archive, true, false, article_sel);
}
}
}
else if (matchDomain('washingtonpost.com')) {
let leaderboard = document.querySelector('#leaderboard-wrapper');
let ads = document.querySelectorAll('div[data-qa$="-ad"]');
hideDOMElement(leaderboard, ...ads);
}
else if (matchDomain('winnipegfreepress.com')) {
let ads = document.querySelectorAll('.billboard-ad-space, .article-ad, .fixed-sky');
hideDOMElement(...ads);
}
else if (matchDomain('wsj.com')) {
if (matchDomain('www.wsj.com'))
blockJsReferrer();
if (window.location.pathname.startsWith('/livecoverage/')) {
window.setTimeout(function () {
let paywall = document.querySelector('div#cx-lc-snippet');
let amphtml = document.querySelector('head > link[rel="amphtml"]');
if (paywall) {
removeDOMElement(paywall);
if (amphtml) {
amp_redirect_not_loop(amphtml);
} else {
let fade = document.querySelectorAll('div[class*="-CardWrapper"]');
for (let elem of fade)
elem.removeAttribute('class');
}
}
}, 1000);
} else {
let url_article = window.location.pathname.includes('/articles/');
let path_article = window.location.pathname.match(/((\w)+(\-)+){3,}\w+/);
if (url_article || path_article) {
if (window.location.pathname.startsWith('/amp/')) {
amp_unhide_subscr_section();
let masthead_link = document.querySelector('div.masthead > a[href*="-"]');
if (masthead_link)
masthead_link.href = 'https://www.wsj.com';
} else {
let paywall_sel = '.snippet-promotion, div#cx-snippet-overlay';
let paywall = document.querySelector(paywall_sel);
if (paywall) {
if (!matchDomain('www.wsj.com')) {
removeDOMElement(paywall);
if (url_article)
window.location.href = window.location.href.replace('wsj.com', 'wsj.com/amp');
else
window.location.href = '/amp/articles/' + path_article[0];
} else if (dompurify_loaded) {
let url = window.location.href;
let article_sel = 'article section';
let wsj_pro = paywall.querySelector('a[href^="https://wsjpro.com/"]');
if (wsj_pro)
article_sel = 'article';
getArchive(url, paywall_sel, '', article_sel);
}
}
}
}
}
let ads = document.querySelectorAll('div.wsj-ad, div.adWrapper, div.css-xgokil-Box');
hideDOMElement(...ads);
}
else if (matchDomain('zerohedge.com')) {
window.setTimeout(function () {
let paywall = document.querySelector('div[class^="PremiumOverlay_container__"]');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_script = document.querySelector('script#__NEXT_DATA__');
if (json_script) {
try {
let json = JSON.parse(json_script.innerText);
if (json && json.props.pageProps.node.body) {
let article_new = parseHtmlEntities(decode_utf8(atob(json.props.pageProps.node.body.substring(21))));
let article = document.querySelector('div[class^="NodeContent_mainContent__"');
if (article) {
article.innerHTML = '';
let parser = new DOMParser();
let doc = parser.parseFromString('
' + DOMPurify.sanitize(article_new) + '
', 'text/html');
let content_new = doc.querySelector('div');
article.appendChild(content_new);
}
}
} catch (err) {
console.log(err);
}
}
}
}, 1000);
}
else if (matchDomain(usa_gannett_domains) || document.querySelector('head > link[href*=".gannettdigital.com/"], head > link[href*=".gannett-cdn.com/"]')) {
if (window.location.pathname.endsWith('/restricted/') && window.location.search.startsWith('?return='))
window.location.href = decodeURIComponent(window.location.href.split('?return=')[1]);
}
else if (matchDomain(usa_hearst_comm_domains) || document.querySelector('head > script[src*="/treg.hearstnp.com/"]')) {
let overlay = document.querySelector('div > div#modalOuter');
if (overlay) {
hideDOMElement(overlay.parentNode);
let noscroll = document.querySelector('body[style]');
if (noscroll)
noscroll.removeAttribute('style');
}
let ads = pageContains('div > div > p', 'Article continues below this ad');
for (let elem of ads)
hideDOMElement(elem.parentNode.parentNode);
}
else if ((domain = matchDomain(usa_lee_ent_domains)) || matchDomain(ca_torstar_domains.concat(['abqjournal.com'])) || document.querySelector('head > meta[name="tncms-access-version"]')) {
if (window.location.pathname.endsWith('.amp.html')) {
amp_unhide_access_hide('="hasAccess"', '="NOT hasAccess"', 'amp-ad, amp-embed, .amp-ads-container');
let elem_hidden = document.querySelectorAll('html[class], body[class]');
for (let elem of elem_hidden)
elem.removeAttribute('class');
let amp_images = document.querySelectorAll('div.main-content amp-img[src^="https://"]');
for (let amp_image of amp_images) {
let elem = document.createElement('img');
Object.assign(elem, {
src: amp_image.getAttribute('src'),
alt: amp_image.getAttribute('alt'),
height: '400'
});
amp_image.parentNode.replaceChild(elem, amp_image);
}
} else {
if (!domain) {
function unscramble(t) {
for (var n = "", i = 0, r = t.length; i < r; i++) {
var s = t.charCodeAt(i);
if (s >= 33 && s <= 126) {
var sTmp = String.fromCharCode(33 + (s - 33 + 47) % 94);
n += sTmp;
} else
n += t.charAt(i);
}
return n;
}
let paywall = document.querySelector('div.subscriber-offers');
removeDOMElement(paywall);
let subscriber_only = document.querySelectorAll('div.subscriber-only');
for (let elem of subscriber_only) {
if (elem.classList.contains('encrypted-content') && dompurify_loaded) {
let parser = new DOMParser();
let doc = parser.parseFromString('