' + item + '
', 'text/html'); + elem = html.querySelector('p'); + let error_iframes = elem.querySelectorAll('iframe[allow*="fullscreen"][allowfullscreen]'); + for (let iframe of error_iframes) + iframe.removeAttribute('allowfullscreen'); + if (!['p', 'subhead', 'legacy-ml'].includes(type)) { + console.log(type); + console.log(item); + } + } + window.setTimeout(function () { + if (elem) + intro.parentNode.appendChild(elem); + }, 500); + } + } + } + } catch (err) { + console.log(err); + } + } + } + } + } + let ads = 'div.ad'; + hideDOMStyle(ads); +} + +else if (matchDomain('businesspost.ie')) { + function bpie_main() { + if ($) { + let article_id_dom = document.querySelector('article[id]'); + let article_id; + if (article_id_dom) + article_id = article_id_dom.id; + if (article_id) { + let bp_ajaxurl = 'https://www.businesspost.ie/wp-admin/admin-ajax.php'; + let data_ajax = { + action: 'fetch_article_content', + type: 'POST', + data: { + id: article_id + }, + dataType: 'json', + contentType: 'application/json' + }; + $.ajax({ + type: 'POST', + url: bp_ajaxurl, + data: data_ajax, + success: function (data) { + $('main article .article-body-section').html(data); + } + }); + } + } else + refreshCurrentTab(); + } + window.setTimeout(function () { + let paywall = document.querySelector('div#bp_paywall_content'); + let article_id_dom = document.querySelector('article[id]'); + let article_id; + if (article_id_dom) + article_id = article_id_dom.id; + if (paywall || article_id) { + removeDOMElement(paywall); + insert_script(bpie_main); + } + }, 500); +} + +else if (matchDomain('decanter.com')) { + let paywall = document.querySelector('div[id^="react_subscriber_content_"]'); + if (paywall) { + removeDOMElement(paywall); + let data = document.querySelector('div[data-dom-id^="react_subscriber_content_"][data-props]'); + if (data) { + try { + let json = JSON.parse(data.getAttribute('data-props')); + if (json && json.content) { + let content = decode_utf8(atob(json.content)); + let parser = new DOMParser(); + let doc = parser.parseFromString('' + par.content + '
', 'text/html'); + par_new = doc.querySelector('p'); + } + } else if (par.image_type) { + if (par.url) { + let caption_text = par.caption; + if (par.credits && par.credits.by && par.credits.by[0] && par.credits.by[0].byline) + caption_text += ' - ' + par.credits.by[0].byline; + par_new = makeFigure(par.url, caption_text, {alt: par.alt_text}, {'class': 'article__image-caption'}); + par_new.className = 'article__image'; + par_new.style = 'width: 75%; margin-left: auto; margin-right: auto;'; + } + } else if (par.type === 'custom_embed') { + if (par.subtype === 'custom-image' && par.embed && par.embed.config) { + let config = par.embed.config; + if (config.image_src) { + let caption_text = config.image_caption; + if (config.image_credit) + caption_text += ' ' + config.image_credit; + par_new = makeFigure(config.image_src, caption_text, {}, {'class': 'article__image-caption'}); + par_new.className = 'article__image'; + } + } + } else if (par.raw_oembed) { + if (par.raw_oembed.html) { + let doc = parser.parseFromString('' + par.raw_oembed.html + '
', 'text/html'); + par_new = doc.querySelector('p'); + } + } else if (par.type === 'list') { + if (par.items) { + par_new = document.createElement('ul'); + for (let item of par.items) { + let li = document.createElement('li'); + let doc = parser.parseFromString('' + item.content + '', 'text/html'); + let span = doc.querySelector('span'); + li.appendChild(span); + par_new.appendChild(li); + } + } + } else if (!['quote', 'raw_html'].includes(par.type)) { + console.log(par); + } + if (par_new) + article.appendChild(par_new); + } + } + } catch (err) { + console.log(err); + } + } + let fusion_script = document.querySelector('script#fusion-metadata'); + if (fusion_script) { + paywall.classList.remove('paywall'); + if (fusion_script.text.includes('Fusion.globalContent=')) { + fusionGetContent(fusion_script.text); + } else { + let url = window.location.href.split(/[#\?]/)[0]; + fetch(url) + .then(response => { + if (response.ok) { + response.text().then(html => { + if (html.includes('Fusion.globalContent=')) + fusionGetContent(html); + }); + } + }); + } + } else + amp_redirect(paywall_sel, '', window.location.pathname + '?outputType=amp'); + } + } +} + +else if (matchDomain('adweek.com')) { + setCookie('blaize_session', '', '.www.adweek.com', '/', 0); + let paywall = document.querySelector('div#paywall-subscribe'); + if (paywall) { + let fade = document.querySelector('div[style*="linear-gradient"]'); + removeDOMElement(paywall, fade); + let json_script = getArticleJsonScript(); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.sharedContent.articleBody; + let content = document.querySelector('div.aw-article-content'); + if (json_text && content) { + let url = window.location.href; + content.before(archiveLink(url)); + content.innerHTML = ''; + let article_new = document.createElement('p'); + article_new.innerText = json_text; + content.appendChild(article_new); + } + } + } catch (err) { + console.log(err); + } + } + } +} + +else if (matchDomain('ajc.com')) { + let paygate = document.querySelector('div.story-paygate_placeholder'); + if (paygate) + paygate.removeAttribute('class'); + let video_blocker = document.querySelector('div.video-blocker'); + removeDOMElement(video_blocker); +} + +else if (matchDomain('americanbanker.com') || matchDomain(usa_arizent_custom_domains)) { + let inline_gate = document.querySelector('.inline-gate'); + if (inline_gate) { + inline_gate.classList.remove('inline-gate'); + let inline_gated = document.querySelectorAll('.inline-gated'); + for (let elem of inline_gated) + elem.classList.remove('inline-gated'); + } +} + +else if (matchDomain('artnet.com')) { + if (window.location.pathname.endsWith('/amp-page')) { + amp_unhide_subscr_section(); + } else { + let body_hidden = document.querySelector('.article-body'); + if (body_hidden) + body_hidden.style = 'display:block;'; + let banner = document.querySelector('div[id^="issuem-leaky-paywall-"]'); + removeDOMElement(banner); + } +} + +else if (matchDomain('asia.nikkei.com')) { + let paywall = document.querySelector('div#paywall-offer'); + if (paywall) { + removeDOMElement(paywall); + let article = document.querySelector('div#article-body-preview > div'); + if (article) { + let json_script = document.querySelector('script#__NEXT_DATA__'); + if (json_script) { + try { + let json = JSON.parse(json_script.text); + if (json && json.props.pageProps.data.body) { + let json_text = json.props.pageProps.data.body; + if (!json_text.includes('missing photo: ' + p1 + '
'; + if (contributorId) + result = '')) { + 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('theamericanscholar.org')) {
+ getJsonUrl('div.ssagk-form', '', 'div.post_summary');
+}
+
+else if (matchDomain('theatlantic.com')) {
+ setCookie('articleViews', '', 'theatlantic.com', '/', 0);
+ 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 = 'aside#paywall, div[class^="LostInventoryMessage_"]';
+ hideDOMStyle(banners);
+}
+
+else if (matchDomain('thebulletin.org')) {
+ 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 = makeFigure(card[1].url, card[1].title + ' ' + card[1].credit);
+ par_elem.appendChild(par_fig);
+ } 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);
+ }
+ }
+ }
+ }
+ } catch (err) {
+ console.log(err);
+ }
+ }
+ }
+ let ads = 'aside.AdSlot, div.FooterAd';
+ hideDOMStyle(ads);
+}
+
+else if (matchDomain('thediplomat.com')) {
+ if (matchDomain('magazine.thediplomat.com')) {
+ let article = document.querySelector('article > section.h-96');
+ if (article)
+ article.classList.remove('h-96');
+ let fade = 'aside.bg-gradient-to-b';
+ hideDOMStyle(fade, 2);
+ }
+ let ads = 'aside.td-ad-container--labeled, div[data-actirise]';
+ hideDOMStyle(ads);
+}
+
+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 = 'div.c-ad--base';
+ hideDOMStyle(ads);
+}
+
+else if (matchDomain(['thehindu.com', 'thehindubusinessline.com'])) {
+ if (!window.location.pathname.endsWith('/amp/')) {
+ let counter = '#test';
+ let ads = 'div.ad, div.article-ad, div.dfp-ad, div#paywallbox, div[id^="piano-art-"]';
+ hideDOMStyle(counter + ', ' + ads);
+ } else {
+ let ads = 'amp-ad, amp-embed, [class^="height"], [class^="advt"], [id^="piano"]';
+ hideDOMStyle(ads);
+ }
+ function hindu_main() {
+ if (window) {
+ window.Adblock = false;
+ window.isNonSubcribed = false;
+ }
+ }
+ insert_script(hindu_main);
+}
+
+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.fields) {
+ let url_next = json.query.slug;
+ if (url_next && !window.location.pathname.includes(url_next))
+ refreshCurrentTab();
+ let fields = json.props.pageProps.post.fields;
+ let pars = fields.fullText ? fields.fullText.content : 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 = makeFigure(par.data.target.fields.file.url, par.data.target.fields.description);
+ 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('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')) {
+ setCookie('monthly_history', '', 'thepointmag.com', '/', 0);
+ let overlay = document.querySelectorAll('div.overlay, div#tpopup-');
+ removeDOMElement(...overlay);
+}
+
+else if (matchDomain('thequint.com')) {
+ window.setTimeout(function () {
+ let lock = document.querySelector('div > img[alt^="lock"]');
+ if (lock) {
+ lock.removeAttribute('alt');
+ let paywall = document.querySelector('div#paywall-widget');
+ if (paywall) {
+ removeDOMElement(paywall);
+ let article = document.querySelector('div.story-element');
+ if (article) {
+ let article_new = getArticleQuintype();
+ if (article_new && article.parentNode)
+ article.parentNode.replaceChild(article_new, article);
+ }
+ }
+ 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);
+ }
+ }, 4000);
+}
+
+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')) {
+ setCookie('blaize_session', '', 'thewrap.com', '/', 0);
+ 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 = document.querySelector('div.paywall-active');
+ if (paywall) {
+ removeDOMElement(paywall);
+ let fade = document.querySelectorAll('div.paywall-fade');
+ for (let elem of fade)
+ elem.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 = 'div[data-ad-page], section.block-the-dfp';
+ hideDOMStyle(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 = '';
+ addStyle('[type="synopsis"]::after {background: none !important;}');
+ 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_')) {
+ let paywall = document.querySelector('div[id^="story-blocker"]');
+ if (paywall) {
+ removeDOMElement(paywall);
+ let json_script = getArticleJsonScript();
+ if (json_script) {
+ try {
+ let json = JSON.parse(json_script.text);
+ if (json) {
+ let json_text = json.articleBody;
+ let article = document.querySelector('div.paywall');
+ if (json_text && article) {
+ if (!json_text.match(/\s(src|href)=/))
+ json_text = breakText(json_text).replace(/\n\n/g, '
');
+ window.setTimeout(function () {
+ let parser = new DOMParser();
+ let doc = parser.parseFromString('
' + 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 { + let caption_text = pars[par.caption]; + if (par.credit) + caption_text += ' (' + pars[par.credit] + ')'; + elem = makeFigure(pars[par.src], caption_text); + elem.className = 'dn-image'; + } + } else if (type === 'factbox') { + elem = document.createElement('p'); + if (par.title) + elem.innerText = pars[par.title]; + if (par.html) { + let content_new = parser.parseFromString('' + par.content + '
', 'text/html'); + elem = doc.querySelector('p'); + if (par.type === 'header') + elem.style = 'font-weight: bold;'; + } else if (par.type === 'image') { + if (par.url && !par_first) { + elem = document.createElement('p'); + elem.className = par_class; + let sub_elem = document.createElement('figure'); + let img = document.createElement('img'); + img.src = 'https://www.washingtonpost.com/wp-apps/imrs.php?src=' + par.url + '&w=1200'; + img.style = 'width:100%'; + sub_elem.appendChild(img); + if (par.credits_caption_display) { + let caption = document.createElement('p'); + caption.innerText = par.credits_caption_display; + sub_elem.appendChild(caption); + } + elem.appendChild(sub_elem); + } + } else if (par.type === 'custom_embed' && par.subtype) { + if (!['magnet'].includes(par.subtype) && par.embed && par.embed.url) { + elem = document.createElement('iframe'); + elem.src = par.embed.url; + elem.style = 'height: 400px; width: 100%'; + } + } else if (!['divider'].includes(par.type)) + console.log(par); + if (elem) + article.appendChild(elem); + if (par_first) + par_first = false; + } + window.scrollTo(0, 0); + } + } catch (err) { + console.log(err); + } + } + } + } + let leaderboard = '#leaderboard-wrapper'; + let ads = 'div[data-qa$="-ad"]'; + hideDOMStyle(leaderboard + ', ' + ads); +} + +else if (matchDomain('winnipegfreepress.com')) { + let ads = '.billboard-ad-space, .ad, .article-ad, .fixed-sky'; + hideDOMStyle(ads); +} + +else if (matchDomain('wsj.com')) { + 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 (true) { + let paywall_sel = '.snippet-promotion, div[id^="cx-snippet-overlay"]'; + let paywall = document.querySelector(paywall_sel); + if (paywall) { + if (!matchDomain('cn.wsj.com')) { + 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'; + let video_sel = 'div[data-type="video"]'; + let video = document.querySelector(video_sel); + let schema_script = document.querySelector('script#articleschema'); + func_post = function () { + if (video) { + let video_new = document.querySelector(video_sel); + if (video_new && video_new.parentNode) + video_new.parentNode.replaceChild(video, video_new); + } + let inline_videos = document.querySelectorAll('div[id^="video"]'); + for (let inline_video of inline_videos) { + let video_id = inline_video.id.replace('video', ''); + if (video_id && schema_script) { + try { + let video_data = JSON.parse(schema_script.text).find(x => x['@type'] === 'VideoObject' && x.embedUrl.includes(video_id)); + if (video_data && inline_video.parentNode) { + let elem = document.createElement('iframe'); + elem.src = video_data.embedUrl; + elem.style = 'width: ' + inline_video.offsetWidth + 'px; height: ' + inline_video.offsetWidth * 3 / 4 + 'px;'; + inline_video.parentNode.replaceChild(elem, inline_video); + } + } catch (err) { + console.log(err); + } + } + } + if (mobile) { + let inline_images = document.querySelectorAll('div[style] > figure > picture > img'); + for (let elem of inline_images) { + elem.style = 'width: 100%;'; + elem.removeAttribute('height'); + elem.removeAttribute('width'); + elem.parentNode.removeAttribute('style'); + elem.parentNode.parentNode.parentNode.removeAttribute('style'); + } + let inline_data = document.querySelectorAll('div[data-layout="inline"][style]'); + for (let elem of inline_data) + elem.removeAttribute('style'); + } + let read_next = document.querySelector('div#cx-what-to-read-next'); + removeDOMElement(read_next); + let inline_wrappers = document.querySelectorAll('div[style*="background-position"] > div[id^="wrapper-INLINEIMM_"]'); + for (let elem of inline_wrappers) + removeDOMElement(elem.parentNode); + } + getArchive(url, paywall_sel, '', article_sel); + } else { + removeDOMElement(paywall); + window.location.href = window.location.href.split(/[\?#]/)[0].replace('https://cn.', 'https://www.'); + } + } + } + } + } + let ads = 'div.wsj-ad, div.adWrapper, div.css-xgokil-Box, div#cx-article-cover-overlay'; + hideDOMStyle(ads); +} + +else if (matchDomain('zerohedge.com')) { + let paywall = document.querySelector('div[class^="PremiumOverlay_container__"]'); + if (paywall) { + 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('