mirror of
https://github.com/iamadamdev/bypass-paywalls-chrome
synced 2025-04-30 05:24:26 +02:00
Add AMP redirect for barrons.com
This commit is contained in:
parent
596d85fcea
commit
58b60f03f0
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
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}\/.+/,
|
||||||
'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/
|
'seekingalpha.com': /.+seekingalpha\.com\/article\/.+/
|
||||||
};
|
};
|
||||||
@ -180,7 +180,8 @@ const blockedRegexes = {
|
|||||||
'thenation.com': /thenation\.com\/.+\/paywall-script\.php/,
|
'thenation.com': /thenation\.com\/.+\/paywall-script\.php/,
|
||||||
'thewrap.com': /thewrap\.com\/.+\/wallkit\.js/,
|
'thewrap.com': /thewrap\.com\/.+\/wallkit\.js/,
|
||||||
'wsj.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/,
|
'wsj.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/,
|
||||||
'historyextra.com': /.+\.evolok\.net\/.+\/authorize\/.+/
|
'historyextra.com': /.+\.evolok\.net\/.+\/authorize\/.+/,
|
||||||
|
'barrons.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/
|
||||||
};
|
};
|
||||||
|
|
||||||
// Allowed external scripts
|
// Allowed external scripts
|
||||||
|
@ -306,6 +306,27 @@ if (matchDomain('rep.repubblica.it')) {
|
|||||||
window.location.href = window.location.href + '/amp';
|
window.location.href = window.location.href + '/amp';
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
} else if (matchDomain('barrons.com')) {
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const bodyContinuous = document.querySelector('body.is-continuous');
|
||||||
|
const snippet = document.querySelector('meta[content="snippet"]');
|
||||||
|
if (bodyContinuous && snippet) {
|
||||||
|
window.location.href = window.location.href.replace('barrons.com', 'barrons.com/amp');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!window.location.href.includes('barrons.com/amp/')) {
|
||||||
|
let href = '';
|
||||||
|
const signinLinks = document.querySelectorAll('a.primary-button--link');
|
||||||
|
for (const signinLink of signinLinks) {
|
||||||
|
href = signinLink.href;
|
||||||
|
if (href.includes('target=')) {
|
||||||
|
href = href.split('target')[1].split('%3F')[0];
|
||||||
|
href = href.replace('=', '').replace('%3A', ':').replace(/%2F/g, '/');
|
||||||
|
signinLink.href = href;
|
||||||
|
signinLink.text = 'Click';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function matchDomain (domains) {
|
function matchDomain (domains) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user