Fix The Globe and Mail (sections)

merge-requests/4/head
magnolia1234 2 years ago
parent 9f56d0cd04
commit 3fc50103a6

@ -279,6 +279,8 @@ function set_rules(sites, sites_updated, sites_custom) {
}
}
}
if (enabledSites.includes('#options_optin_tgam_media'))
blockedRegexes['theglobeandmail.com'] = /(\.theglobeandmail\.com\/pf\/dist\/engine\/react\.js|smartwall\.theglobeandmail\.com\/)/;
use_random_ip = Object.keys(random_ip);
change_headers = use_google_bot.concat(use_bing_bot, use_facebook_referer, use_google_referer, use_twitter_referer, use_random_ip);
disableJavascriptOnListedSites();
@ -617,12 +619,12 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) {
['blocking', 'responseHeaders']);
// block inline script
var block_js_inline = [];
var block_js_inline = ["*://*.theglobeandmail.com/*"];
if (block_js_inline.length)
ext_api.webRequest.onHeadersReceived.addListener(function (details) {
if (!isSiteEnabled(details)) {
let excluded = matchUrlDomain('theglobeandmail.com', details.url) && (enabledSites.includes('#options_optin_tgam_media') || !details.url.includes('?rel=premium'));
if (!isSiteEnabled(details) || excluded)
return;
}
var headers = details.responseHeaders;
headers.push({
'name': 'Content-Security-Policy',

@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox
Post-release
Add El Periodico Extremadura
Remove Algemeen Dagblad Regional (fix obsolete)
Fix The Globe and Mail (sections)
Fix The Hill Times (text)
Fix (custom) group-sites (limit identify on image)

@ -3402,9 +3402,18 @@ else if (matchDomain('thediplomat.com')) {
}
else if (matchDomain('theglobeandmail.com')) {
let article_body_subscribed = document.querySelector('.c-article-body--subscribed');
if (article_body_subscribed)
article_body_subscribed.removeAttribute('class');
let paywall = document.querySelector('div.c-paywall');
if (paywall) {
removeDOMElement(paywall);
let url = window.location.href.split('?')[0];
window.location.href = url + '?rel=premium';
} else {
let article_body_subscribed = document.querySelector('.c-article-body--subscribed');
if (article_body_subscribed)
article_body_subscribed.removeAttribute('class');
}
let banners = document.querySelectorAll('div.c-ad, div#subscription-pencil-area');
removeDOMElement(...banners);
}
else if (matchDomain(['thehindu.com', 'thehindubusinessline.com'])) {

@ -663,5 +663,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.6.3.2"
"version": "2.6.3.3"
}

@ -1588,7 +1588,7 @@ var defaultSites = {
},
"The Globe and Mail": {
domain: "theglobeandmail.com",
block_regex: /(\.theglobeandmail\.com\/pf\/dist\/engine\/react\.js|smartwall\.theglobeandmail\.com\/)/
block_regex: /smartwall\.theglobeandmail\.com\//
},
"The Hill Times": {
domain: "hilltimes.com",
@ -1802,7 +1802,7 @@ var defaultSites = {
"sun-sentinel.com"
],
allow_cookies: 1,
block_regex: /(\.tribdss\.com\/|\.zephr\.com\/zephr-browser\/.+\/zephr-browser\.umd\.js)/
block_regex: /(\.tribdss\.com\/|js\.matheranalytics\.com\/|\.zephr\.com\/zephr-browser\/.+\/zephr-browser\.umd\.js)/
},
"Trouw": {
domain: "trouw.nl",
@ -1977,7 +1977,10 @@ var defaultSites = {
},
"The Wall Street Journal - no Googlebot (http error 500)": {
domain: "#options_disable_gb_wsj"
}
},
"The Globe and Mail premium-media (empty sections)": {
domain: "#options_optin_tgam_media"
},
}
if (typeof browser === 'object') {

Loading…
Cancel
Save