From a544317df893118a45ed9f36051faba375643e48 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 10 Mar 2024 14:14:37 +0100 Subject: [PATCH] Fix The Globe and Mail (js only) --- background.js | 2 +- changelog.txt | 1 + contentScript.js | 18 ++---------------- contentScript_once_var.js | 13 ------------- custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 4 ++-- 7 files changed, 8 insertions(+), 34 deletions(-) diff --git a/background.js b/background.js index c48e22b..dcccf09 100644 --- a/background.js +++ b/background.js @@ -964,7 +964,7 @@ if (typeof browser !== 'object') { } } - var set_var_sites = ['dagsavisen.no', 'journaldemontreal.com', 'journaldequebec.com', 'nzherald.co.nz', 'theglobeandmail.com'].concat(de_madsack_domains); + var set_var_sites = ['dagsavisen.no', 'journaldemontreal.com', 'journaldequebec.com', 'nzherald.co.nz'].concat(de_madsack_domains); function runOnTab_once_var(tab) { let tabId = tab.id; let url = tab.url; diff --git a/changelog.txt b/changelog.txt index d03bbec..9e933fd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ Fix ElMundo.es (colegios - no amp-fix) Fix Hearst newspapers (anti-adblocker) Fix Il Sole 24 Ore (24+ only) Fix Motor Presse Stuttgart (xhr) +Fix The Globe and Mail (js only) Fix The Quint (css) * v3.5.8.0 (2024-03-03) diff --git a/contentScript.js b/contentScript.js index 589590b..923d7a8 100644 --- a/contentScript.js +++ b/contentScript.js @@ -5301,25 +5301,11 @@ else if (matchDomain('thediplomat.com')) { } else if (matchDomain('theglobeandmail.com')) { - if (!window.location.search.startsWith('?rel=premium')) { - let paywall = document.querySelector('div.c-paywall'); - if (paywall) { - removeDOMElement(paywall); - window.location.href = window.location.pathname + '?rel=premium'; - } - } else { - let html_nojs = document.querySelector('html.no-js'); - if (html_nojs) - html_nojs.classList.remove('no-js'); - let header_hidden = document.querySelectorAll('div.o-primary-header, div.c-article-meta'); - for (let elem of header_hidden) - elem.setAttribute('style', 'display: block !important;'); - } let lazy_images = document.querySelectorAll('img[src^="data:image/"][data-src]'); for (let elem of lazy_images) elem.src = elem.getAttribute('data-src'); - let banners = document.querySelectorAll('div.c-ad, div#subscription-pencil-area, div.marketing-container-wrapper, div[class^="BaseAd__"]'); - hideDOMElement(...banners); + let ads = document.querySelectorAll('div.c-ad, div[class^="BaseAd__"], div.ad-container'); + hideDOMElement(...ads); } else if (matchDomain(['thehindu.com', 'thehindubusinessline.com'])) { diff --git a/contentScript_once_var.js b/contentScript_once_var.js index b41bb82..2f22389 100644 --- a/contentScript_once_var.js +++ b/contentScript_once_var.js @@ -57,19 +57,6 @@ else if (matchDomain('nzherald.co.nz')) { insert_script(nzherald_main); } -else if (matchDomain('theglobeandmail.com')) { - function tgam_main() { - for (let n = 0; n < 10; n++) { - window.setTimeout(function () { - if (window.Fusion) { - window.Fusion.globalContent._id = ''; - } - }, n * 50); - } - } - insert_script(tgam_main); -} - function matchDomain(domains, hostname) { var matched_domain = false; if (!hostname) diff --git a/custom/manifest.json b/custom/manifest.json index 73ab28e..ceb9daa 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.5.8.6" + "version": "3.5.8.7" } diff --git a/manifest.json b/manifest.json index 83de107..696bba0 100644 --- a/manifest.json +++ b/manifest.json @@ -853,5 +853,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.5.8.6" + "version": "3.5.8.7" } diff --git a/sites.js b/sites.js index c8d80a8..7982725 100644 --- a/sites.js +++ b/sites.js @@ -2415,8 +2415,8 @@ var defaultSites = { }, "The Globe and Mail": { domain: "theglobeandmail.com", - block_js_inline: /\.theglobeandmail\.com\/.+\/article-.+\?rel=premium/, - block_regex: /(smartwall\.theglobeandmail\.com\/|\.sophi\.io\/|\.zephr\.com\/zephr-browser\/)/ + allow_cookies: 1, + block_regex: /(\.sophi\.io\/|\.zephr\.com\/zephr-browser\/)/ }, "The Hill": { domain: "thehill.com",