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