From 154d1b9c225188c1a3dc3d759d40ed01e5524c89 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 19 Jul 2021 17:54:59 +0200 Subject: [PATCH] Add Southern Weekly (China) --- README.md | 1 + background.js | 13 +++++++++++++ changelog.txt | 1 + contentScript.js | 12 ++++++++++++ manifest.json | 3 ++- sites.js | 1 + 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cde2690..bf5621e 100644 --- a/README.md +++ b/README.md @@ -530,6 +530,7 @@ Grupo Vocento (ABC) regional sites like [Nikkei Asian Review](https://asia.nikkei.com) - [NK News](https://www.nknews.org)* - [South China Morning Post](https://www.scmp.com) - +[Southern Weekly](https://www.infzm.com) - [Tech in Asia](https://www.techinasia.com) - [The Diplomat](https://www.thediplomat.com) - [The Japan Times](https://www.japantimes.co.jp) diff --git a/background.js b/background.js index b588e36..60a51a7 100644 --- a/background.js +++ b/background.js @@ -89,6 +89,7 @@ var allow_cookies_default = [ 'ilgiorno.it', 'ilrestodelcarlino.it', 'independent.ie', + 'infzm.com', 'intelligentinvestor.com.au', 'jpost.com', 'knack.be', @@ -910,6 +911,18 @@ ext_api.webRequest.onBeforeRequest.addListener(function (details) { ["blocking"] ); +// infzm.com redirect to wap (mobile) +ext_api.webRequest.onBeforeRequest.addListener(function (details) { + if (!isSiteEnabled(details)) { + return; + } + var updatedUrl = details.url.replace('.com/contents/', '.com/wap/#/content/'); + return { redirectUrl: updatedUrl }; +}, +{urls:["*://www.infzm.com/contents/*"], types:["main_frame"]}, +["blocking"] +); + // fix nytimes x-frame-options (hidden iframe content) ext_api.webRequest.onHeadersReceived.addListener(function (details) { if (!isSiteEnabled(details)) { diff --git a/changelog.txt b/changelog.txt index 0a88927..6fe3a3c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Add Southern Weekly (China) Fix The Daily Telegraph (au) * v2.2.9.0 (2021-07-11) diff --git a/contentScript.js b/contentScript.js index f6284f6..f71ca98 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1961,6 +1961,18 @@ else if (matchDomain(['houstonchronicle.com', 'sfchronicle.com'])) { removeDOMElement(wrapper); } +else if (matchDomain('infzm.com')) { + let url = window.location.href; + if (url.includes('/wap/#/')) { + let container = document.querySelector('section.container'); + if (container) + container.classList.remove('container'); + let overlay = document.querySelector('div.article-content[style]'); + if (overlay) + overlay.removeAttribute('style'); + } +} + else if (matchDomain('inkl.com')) { document.addEventListener('DOMContentLoaded', () => { let menu_btn = document.querySelector('div.left-buttons-container button.menu-btn'); diff --git a/manifest.json b/manifest.json index e96a991..cd34707 100644 --- a/manifest.json +++ b/manifest.json @@ -231,6 +231,7 @@ "*://*.ilsecoloxix.it/*", "*://*.inc.com/*", "*://*.independent.ie/*", + "*://*.infzm.com/*", "*://*.inkl.com/*", "*://*.inquirer.com/*", "*://*.intelligentinvestor.com.au/*", @@ -534,5 +535,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.2.9.1" + "version": "2.2.9.2" } \ No newline at end of file diff --git a/sites.js b/sites.js index 4e061af..3c77a0c 100644 --- a/sites.js +++ b/sites.js @@ -225,6 +225,7 @@ var defaultSites = "Slate": "slate.com", "SOFREP": "sofrep.com", "South China Morning Post": "scmp.com", + "Southern Weekly": "infzm.com", "Sports Illustrated": "si.com", "Star Tribune": "startribune.com", "Statista": "statista.com",