mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 07:17:47 +01:00
Fix-update Barron's (amp for snippet)
This commit is contained in:
parent
710ac16453
commit
8b11df84be
2 changed files with 20 additions and 10 deletions
|
@ -8,7 +8,7 @@ var ext_api = (typeof browser === 'object') ? browser : chrome;
|
||||||
// var defaultSites = {};
|
// var defaultSites = {};
|
||||||
|
|
||||||
const restrictions = {
|
const restrictions = {
|
||||||
'barrons.com': /.+barrons\.com\/articles\/.+/,
|
'barrons.com': /.+barrons\.com\/(amp\/)?article(s)?\/.+/,
|
||||||
'economist.com': /.+economist\.com\/.+\/\d{1,4}\/\d{1,2}\/\d{2}\/.+/,
|
'economist.com': /.+economist\.com\/.+\/\d{1,4}\/\d{1,2}\/\d{2}\/.+/,
|
||||||
'elcomercio.pe': /.+\/elcomercio.pe\/.+((\w)+(\-)+){3,}.+/,
|
'elcomercio.pe': /.+\/elcomercio.pe\/.+((\w)+(\-)+){3,}.+/,
|
||||||
'gestion.pe': /.+\/gestion.pe\/.+((\w)+(\-)+){3,}.+/,
|
'gestion.pe': /.+\/gestion.pe\/.+((\w)+(\-)+){3,}.+/,
|
||||||
|
@ -145,6 +145,7 @@ var blockedRegexes = {
|
||||||
'adweek.com': /.+\.lightboxcdn\.com\/.+/,
|
'adweek.com': /.+\.lightboxcdn\.com\/.+/,
|
||||||
'afr.com': /afr\.com\/assets\/vendorsReactRedux_client.+\.js/,
|
'afr.com': /afr\.com\/assets\/vendorsReactRedux_client.+\.js/,
|
||||||
'americanbanker.com': /.+\.tinypass\.com\/.+/,
|
'americanbanker.com': /.+\.tinypass\.com\/.+/,
|
||||||
|
'barrons.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/,
|
||||||
'bloomberg.com': /.+\.tinypass\.com\/.+/,
|
'bloomberg.com': /.+\.tinypass\.com\/.+/,
|
||||||
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/,
|
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/,
|
||||||
'businessinsider.com': /(.+\.tinypass\.com\/.+|cdn\.onesignal\.com\/sdks\/.+\.js)/,
|
'businessinsider.com': /(.+\.tinypass\.com\/.+|cdn\.onesignal\.com\/sdks\/.+\.js)/,
|
||||||
|
|
|
@ -509,15 +509,24 @@ else if (matchDomain('challenges.fr')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('barrons.com')) {
|
else if (matchDomain('barrons.com')) {
|
||||||
var href = '';
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const signin_links = document.querySelectorAll('a.primary-button--link');
|
let body_continuous = document.querySelector('body.is-continuous');
|
||||||
for (let i = 0; i < signin_links.length; i++) {
|
let snippet = document.querySelector('meta[content="snippet"]');
|
||||||
href = signin_links[i].href;
|
if (body_continuous && snippet) {
|
||||||
if (href.includes('target=')) {
|
window.location.href = window.location.href.replace('barrons.com', 'barrons.com/amp');
|
||||||
href = href.split('target')[1].split('%3F')[0];
|
}
|
||||||
href = href.replace('=', '').replace('%3A', ':').replace(/%2F/g, '/');
|
});
|
||||||
signin_links[i].href = href;
|
if (!window.location.href.includes('barrons.com/amp/')) {
|
||||||
signin_links[i].text = 'Click';
|
var href = '';
|
||||||
|
let signin_links = document.querySelectorAll('a.primary-button--link');
|
||||||
|
for (let signin_link of signin_links) {
|
||||||
|
href = signin_link.href;
|
||||||
|
if (href.includes('target=')) {
|
||||||
|
href = href.split('target')[1].split('%3F')[0];
|
||||||
|
href = href.replace('=', '').replace('%3A', ':').replace(/%2F/g, '/');
|
||||||
|
signin_link.href = href;
|
||||||
|
signin_link.text = 'Click';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue