mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-09-20 03:41:06 +02:00
Fix-update Globe and Mail
Premium articles have no video and photo gallery
This commit is contained in:
parent
2082e40cd1
commit
a2ae7b6edd
2 changed files with 25 additions and 6 deletions
|
@ -217,6 +217,7 @@ var blockedRegexes = {
|
|||
'telegraph.co.uk': /.+\.tinypass\.com\/.+/,
|
||||
'theage.com.au': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/,
|
||||
'thedailybeast.com': /.+\.tinypass\.com\/.+/,
|
||||
'theglobeandmail.com': /theglobeandmail\.com\/pb\/resources\/scripts\/build\/chunk-common-vendor.+\.js/,
|
||||
'thehindu.com': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/.+\/cloudflare-static\/rocket-loader\.min\.js/,
|
||||
'thenation.com': /.+\.tinypass\.com\/.+/,
|
||||
'valeursactuelles.com': /.+\.qiota\.com\/.+/,
|
||||
|
@ -517,8 +518,12 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|||
// check for blocked regular expression: domain enabled, match regex, block on an internal or external regex
|
||||
var blockedDomains = Object.keys(blockedRegexes);
|
||||
var domain = matchUrlDomain(blockedDomains, header_referer);
|
||||
var block_regex = true;
|
||||
if (domain && details.url.match(blockedRegexes[domain]) && isSiteEnabled({url: header_referer})) {
|
||||
return { cancel: true };
|
||||
if (domain === 'theglobeandmail.com' && !(header_referer.includes('?ref=premium')))
|
||||
block_regex = false;
|
||||
if (block_regex)
|
||||
return { cancel: true };
|
||||
}
|
||||
|
||||
let inkl_site = (matchUrlDomain('cdn.jsdelivr.net', details.url) && matchUrlDomain('inkl.com', header_referer) && isSiteEnabled({url: header_referer}));
|
||||
|
|
|
@ -430,18 +430,32 @@ else if (matchDomain("afr.com")) {
|
|||
}
|
||||
|
||||
else if (matchDomain("theglobeandmail.com")) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let subscribed = document.querySelector('html.story-subscribed');
|
||||
if (subscribed && !window.location.href.includes('?ref=premium')) {
|
||||
window.setTimeout(function () {
|
||||
window.location.href = new URL(window.location.href).pathname + '?ref=premium';
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
let lazy_images = document.querySelectorAll('.js-lazyimage');
|
||||
for (let lazy_image of lazy_images) {
|
||||
lazy_image.classList.remove('js-lazyimage');
|
||||
}
|
||||
let hidden_images = document.querySelectorAll('img');
|
||||
for (let hidden_image of hidden_images) {
|
||||
var src = hidden_image.src;
|
||||
if (src.includes("data:image/gif")) {
|
||||
var data_src = hidden_image.getAttribute("data-src");
|
||||
if (data_src)
|
||||
hidden_image.setAttribute('src', data_src);
|
||||
var data_bg = hidden_image.getAttribute("data-bg");
|
||||
if (data_bg)
|
||||
hidden_image.setAttribute('src', data_bg);
|
||||
}
|
||||
}
|
||||
let c_cards = document.querySelectorAll('div.c-card');
|
||||
for (c_card of c_cards) {
|
||||
for (let c_card of c_cards) {
|
||||
var a_link = c_card.querySelector('a');
|
||||
var subscr_key = c_card.querySelector('span.c-indicator-icon--key');
|
||||
var subscr_key = c_card.querySelector('span.c-indicator-icon--key');
|
||||
if (subscr_key && a_link && !a_link.href.includes('?ref=premium')) {
|
||||
a_link.href = a_link.href + '?ref=premium';
|
||||
}
|
||||
|
@ -827,7 +841,7 @@ else if (matchDomain('ilfattoquotidiano.it')) {
|
|||
else if (matchDomain('qz.com')) {
|
||||
window.setTimeout(function () {
|
||||
if (pageContains('._33dc2 h2', 'Become a member, and we promise').length)
|
||||
document.location.reload(true);
|
||||
window.location.reload(true);
|
||||
}, 500); // Delay (in milliseconds)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue