diff --git a/background.js b/background.js index 85b1e0e..44fafe9 100644 --- a/background.js +++ b/background.js @@ -617,11 +617,12 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) { ['blocking', 'responseHeaders']); // block inline script -var block_js_inline = ["*://*.elpais.com/*", "*://*.theglobeandmail.com/*"]; +var block_js_inline = ["*://*.elpais.com/*", "*://*.nautil.us/*", "*://*.theglobeandmail.com/*"]; if (block_js_inline.length) ext_api.webRequest.onHeadersReceived.addListener(function (details) { let url_path = details.url.split('?')[0]; let excluded = (matchUrlDomain('elpais.com', details.url) && (url_path.includes('/elpais.com') || !url_path.includes('.html'))) + || (matchUrlDomain('nautil.us', details.url) && !details.url.match(/((\w)+(\-)+){3,}/)) || (matchUrlDomain('theglobeandmail.com', details.url) && (!enabledSites.includes('#options_optin_tgam_premium') || !details.url.includes('?rel=premium'))); if (!isSiteEnabled(details) || excluded) return; diff --git a/changelog.txt b/changelog.txt index 3a93b2a..0089a1a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,7 @@ Fix Business Standard Fix Helsingin Sanomat (dynamic-json) Fix Koelner Stadt-Anzeiger & Koelnische Rundschau Fix LesEchos.fr +Fix Nautilus Fix Repubblica.it & LaStampa.it (videos-gtm) * v2.7.2.0 (2022-06-06) diff --git a/contentScript.js b/contentScript.js index 1f6336a..e4ee47c 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3190,6 +3190,23 @@ else if (matchDomain('nationalreview.com')) { removeDOMElement(...adverts); } +else if (matchDomain('nautil.us')) { + // plus code in contentScript_once.js + let hidden_images = document.querySelectorAll('img[src^="data:image"][data-src]'); + for (let hidden_image of hidden_images) + hidden_image.src = hidden_image.getAttribute('data-src'); + let empty_video_iframes = document.querySelectorAll('iframe[src="about:blank"][data-litespeed-src]'); + for (let empty_video_iframe of empty_video_iframes) + empty_video_iframe.src = empty_video_iframe.getAttribute('data-litespeed-src'); + window.setTimeout(function () { + let banners = document.querySelectorAll('div[class^="a__sc-np"], div.subscibe-bar'); + removeDOMElement(...banners); + let overflows = document.querySelectorAll('html[style], body[style]'); + for (let overflow of overflows) + overflow.removeAttribute('style'); + }, 1000); +} + else if (matchDomain('newleftreview.org')) { window.setTimeout(function () { let url = window.location.href; diff --git a/contentScript_once.js b/contentScript_once.js index 9c2e3f4..f7c6243 100644 --- a/contentScript_once.js +++ b/contentScript_once.js @@ -53,6 +53,15 @@ else if (matchDomain('nationalgeographic.com')) { waitDOMElement('div[id^="fittPortal"]', 'DIV', natgeo_func, false); } +else if (matchDomain('nautil.us')) { + let hidden_images = document.querySelectorAll('img[src^="data:image"][data-src]'); + for (let hidden_image of hidden_images) + hidden_image.src = hidden_image.getAttribute('data-src'); + let empty_video_iframes = document.querySelectorAll('iframe[src="about:blank"][data-litespeed-src]'); + for (let empty_video_iframe of empty_video_iframes) + empty_video_iframe.src = empty_video_iframe.getAttribute('data-litespeed-src'); +} + else if (matchDomain('nyteknik.se')) { window.setTimeout(function () { let hidden_images = document.querySelectorAll('img[src=""][data-proxy-image]'); diff --git a/manifest.json b/manifest.json index dd6de09..cfdddc9 100644 --- a/manifest.json +++ b/manifest.json @@ -41,6 +41,7 @@ "matches": [ "*://*.inkl.com/*", "*://*.nationalgeographic.com/*", + "*://*.nautil.us/*", "*://*.nyteknik.se/*", "*://*.nzherald.co.nz/*", "*://*.gitlab.com/magnolia1234" diff --git a/sites.js b/sites.js index e74c4d6..a43454e 100644 --- a/sites.js +++ b/sites.js @@ -1228,7 +1228,8 @@ var defaultSites = { useragent: "googlebot" }, "Nautilus": { - domain: "nautil.us" + domain: "nautil.us", + allow_cookies: 1 }, "Neue Osnabrücker Zeitung": { domain: "noz.de",