Fix Nautilus

This commit is contained in:
magnolia1234 2022-06-24 20:57:28 +02:00
parent 5e94f70bff
commit 342527b124
6 changed files with 32 additions and 2 deletions

View file

@ -617,11 +617,12 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) {
['blocking', 'responseHeaders']); ['blocking', 'responseHeaders']);
// block inline script // 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) if (block_js_inline.length)
ext_api.webRequest.onHeadersReceived.addListener(function (details) { ext_api.webRequest.onHeadersReceived.addListener(function (details) {
let url_path = details.url.split('?')[0]; let url_path = details.url.split('?')[0];
let excluded = (matchUrlDomain('elpais.com', details.url) && (url_path.includes('/elpais.com') || !url_path.includes('.html'))) 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'))); || (matchUrlDomain('theglobeandmail.com', details.url) && (!enabledSites.includes('#options_optin_tgam_premium') || !details.url.includes('?rel=premium')));
if (!isSiteEnabled(details) || excluded) if (!isSiteEnabled(details) || excluded)
return; return;

View file

@ -7,6 +7,7 @@ Fix Business Standard
Fix Helsingin Sanomat (dynamic-json) Fix Helsingin Sanomat (dynamic-json)
Fix Koelner Stadt-Anzeiger & Koelnische Rundschau Fix Koelner Stadt-Anzeiger & Koelnische Rundschau
Fix LesEchos.fr Fix LesEchos.fr
Fix Nautilus
Fix Repubblica.it & LaStampa.it (videos-gtm) Fix Repubblica.it & LaStampa.it (videos-gtm)
* v2.7.2.0 (2022-06-06) * v2.7.2.0 (2022-06-06)

View file

@ -3190,6 +3190,23 @@ else if (matchDomain('nationalreview.com')) {
removeDOMElement(...adverts); 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')) { else if (matchDomain('newleftreview.org')) {
window.setTimeout(function () { window.setTimeout(function () {
let url = window.location.href; let url = window.location.href;

View file

@ -53,6 +53,15 @@ else if (matchDomain('nationalgeographic.com')) {
waitDOMElement('div[id^="fittPortal"]', 'DIV', natgeo_func, false); 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')) { else if (matchDomain('nyteknik.se')) {
window.setTimeout(function () { window.setTimeout(function () {
let hidden_images = document.querySelectorAll('img[src=""][data-proxy-image]'); let hidden_images = document.querySelectorAll('img[src=""][data-proxy-image]');

View file

@ -41,6 +41,7 @@
"matches": [ "matches": [
"*://*.inkl.com/*", "*://*.inkl.com/*",
"*://*.nationalgeographic.com/*", "*://*.nationalgeographic.com/*",
"*://*.nautil.us/*",
"*://*.nyteknik.se/*", "*://*.nyteknik.se/*",
"*://*.nzherald.co.nz/*", "*://*.nzherald.co.nz/*",
"*://*.gitlab.com/magnolia1234" "*://*.gitlab.com/magnolia1234"

View file

@ -1228,7 +1228,8 @@ var defaultSites = {
useragent: "googlebot" useragent: "googlebot"
}, },
"Nautilus": { "Nautilus": {
domain: "nautil.us" domain: "nautil.us",
allow_cookies: 1
}, },
"Neue Osnabrücker Zeitung": { "Neue Osnabrücker Zeitung": {
domain: "noz.de", domain: "noz.de",