mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 06:47:47 +01:00
Fix-update Globe and Mail (postfix premium links)
This commit is contained in:
parent
7e6bb84c05
commit
772e4acdf6
1 changed files with 22 additions and 11 deletions
|
@ -378,13 +378,22 @@ else if (matchDomain("afr.com")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain("theglobeandmail.com")) {
|
else if (matchDomain("theglobeandmail.com")) {
|
||||||
let paywall = document.querySelector('div.c-article-body__teaser-enabled');
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
if (paywall) {
|
let subscribed = document.querySelector('html.story-subscribed');
|
||||||
window.setTimeout(function () {
|
if (subscribed && !window.location.href.includes('?ref=premium')) {
|
||||||
if (!window.location.href.includes('?ref=premium'))
|
window.setTimeout(function () {
|
||||||
window.location.href = new URL(window.location.href).pathname + '?ref=premium';
|
window.location.href = new URL(window.location.href).pathname + '?ref=premium';
|
||||||
}, 500);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
let c_cards = document.querySelectorAll('div.c-card');
|
||||||
|
for (c_card of c_cards) {
|
||||||
|
var a_link = c_card.querySelector('a');
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain("sofrep.com")) {
|
else if (matchDomain("sofrep.com")) {
|
||||||
|
@ -708,13 +717,15 @@ else if (matchDomain('inkl.com')) {
|
||||||
gradient_container.setAttribute("style", "height:auto;");
|
gradient_container.setAttribute("style", "height:auto;");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let dismiss_button = document.querySelector('div.dismiss-button-container button.btn');
|
let dismiss_button = document.querySelector('div.dismiss-button-container button.btn');
|
||||||
if (dismiss_button)
|
if (dismiss_button)
|
||||||
dismiss_button.click();
|
dismiss_button.click();
|
||||||
|
let shared_banner = document.querySelector('div.shared-article-inline-banner');
|
||||||
|
removeDOMElement(shared_banner);
|
||||||
let dive_deeper_summary_bodies = document.querySelectorAll('div.dive-deeper-container div.summary-body');
|
let dive_deeper_summary_bodies = document.querySelectorAll('div.dive-deeper-container div.summary-body');
|
||||||
if (dive_deeper_summary_bodies) {
|
if (dive_deeper_summary_bodies) {
|
||||||
for (summary_body of dive_deeper_summary_bodies) {
|
for (summary_body of dive_deeper_summary_bodies) {
|
||||||
if (!summary_body.outerHTML.includes('<a href=')) {
|
if (!summary_body.querySelector('a')) {
|
||||||
var ng_click = summary_body.getAttribute('ng-click').replace("showArticle('", '').replace("')", '');
|
var ng_click = summary_body.getAttribute('ng-click').replace("showArticle('", '').replace("')", '');
|
||||||
var weblink = document.createElement('a');
|
var weblink = document.createElement('a');
|
||||||
weblink.text = 'open';
|
weblink.text = 'open';
|
||||||
|
|
Loading…
Reference in a new issue