diff --git a/background.js b/background.js index 93e4417..2fb766c 100644 --- a/background.js +++ b/background.js @@ -25,7 +25,6 @@ var restrictions = { 'faz.net': /^((?!\.faz\.net\/aktuell\/(\?switchfaznet)?$).)*$/, 'foreignaffairs.com': /\.foreignaffairs\.com\/((articles|fa-caching|interviews|reviews|sites)\/)/, 'lastampa.it': /^((?!\/video\.lastampa\.it\/).)*$/, - 'medianama.com': /\.medianama\.com\/((\d){4}\/(\d){2}|wp-content)\//, 'science.org': /^((?!\.science\.org\/doi\/).)*$/, 'timesofindia.com': /\.timesofindia\.com($|\/($|toi-plus(\/.+)?|.+\.cms))/, 'nknews.org': /^((?!nknews\.org\/pro\/).)*$/, @@ -173,7 +172,7 @@ function set_rules(sites, sites_updated, sites_custom) { for (let domain of domains) { let custom_in_group = false; if (rule_default.hasOwnProperty('exception')) { - let exception_rule = rule_default.exception.filter(x => domain === x.domain); + let exception_rule = rule_default.exception.filter(x => domain === x.domain || (typeof x.domain !== 'string' && x.domain.includes(domain))); if (exception_rule.length > 0) rule = exception_rule[0]; else @@ -602,9 +601,9 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) { ['blocking', 'responseHeaders']); // block inline script -var block_js_inline = ["*://*.medianama.com/*"]; +var block_js_inline = []; ext_api.webRequest.onHeadersReceived.addListener(function (details) { - if (!isSiteEnabled(details)) { + if (block_js_inline.length === 0 || !isSiteEnabled(details)) { return; } var headers = details.responseHeaders; diff --git a/changelog.txt b/changelog.txt index a6cb343..6cee0ee 100644 --- a/changelog.txt +++ b/changelog.txt @@ -9,6 +9,7 @@ Fix Cairns Post, Code Sports & The Advertiser Fix Challenges.fr Fix Clarin Fix El Pais (menu subdomains) +Fix MediaNama (menu) Fix MIT Sloan Management Review (refresh) Fix The New Yorker (update) diff --git a/contentScript.js b/contentScript.js index a7a3288..9998ca6 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2565,6 +2565,11 @@ else if (matchDomain('medianama.com')) { let modal = document.querySelector('div.modal'); removeDOMElement(modal); }, 500); // Delay (in milliseconds) + function medianama_height(node) { + node.removeAttribute('style'); + } + waitDOMAttribute('div.zox-post-body', 'DIV', 'style', medianama_height, true); + csDoneOnce = true; } else if (matchDomain('mexiconewsdaily.com')) { diff --git a/manifest.json b/manifest.json index 165b4f0..9de8365 100644 --- a/manifest.json +++ b/manifest.json @@ -603,5 +603,5 @@ "*://*.wsj.net/*", "*://*.zephr.com/*" ], - "version": "2.5.2.7" + "version": "2.5.2.8" } diff --git a/sites.js b/sites.js index 9ab1dfa..47f70de 100644 --- a/sites.js +++ b/sites.js @@ -128,15 +128,11 @@ var defaultSites = { ], allow_cookies: 1, useragent: "googlebot", - block_regex: /(\.com\.au\/remote\/identity\/rampart\/latest\/rampart\.js|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/, + block_regex: /(\.com\.au\/remote\/identity\/rampart\/latest\/rampart\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/, exception: [{ - domain: "adelaidenow.com.au", + domain: ["adelaidenow.com.au", "cairnspost.com.au"], allow_cookies: 1, - block_regex: /(\.com\.au\/remote\/identity\/rampart\/latest\/rampart\.js|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/ - }, { - domain: "cairnspost.com.au", - allow_cookies: 1, - block_regex: /(\.com\.au\/remote\/identity\/rampart\/latest\/rampart\.js|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/ + block_regex: /(\.com\.au\/remote\/identity\/rampart\/latest\/rampart\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/ } ] },