Fix-update SeekingAlpha (amp)

This commit is contained in:
magnolia1234 2020-12-29 16:34:05 +01:00
parent a65e9bf4c6
commit 4df9846262
5 changed files with 28 additions and 7 deletions

View file

@ -10,9 +10,12 @@
* [License](#license)
### Installation
You can install the add-on from Mozilla add-ons (AMO): [Bypass Paywalls Clean](https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean)
Or download and install the latest xpi-version from [GitLab](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases)
By default BPC has limited permissions, but you can opt-in to enable custom sites (and also clear cookies/block general paywall-scripts for non-listed sites).
You can install the add-on from Mozilla add-ons (AMO): [Bypass Paywalls Clean](https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean)\
Or download and install the latest xpi-version from [GitLab](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases)\
By default BPC has limited permissions, but you can opt-in to enable custom sites (and also clear cookies/block general paywall-scripts for non-listed sites).
### Update
Check for updates (in about:addons) and allow permissions for newly supported sites (else no update will be installed).
#### Android
On Android this add-on only works with Firefox 68 (Fennec); Firefox 79+ (Fenix) only supports 9 'recommended' add-ons (for now).\

View file

@ -23,7 +23,7 @@ const restrictions = {
'hs.fi': /^((?!\/.+\.hs\.fi\/paivanlehti\/).)*$/,
'globo.com': /^((?!\/valor\.globo\.com\/).)*$/,
'quora.com': /^((?!quora\.com\/search\?q=).)*$/,
'seekingalpha.com': /.+\/seekingalpha\.com\/article\/.+/,
'seekingalpha.com': /.+\/seekingalpha\.com\/($|(amp\/)?article\/|samw\/)/,
'techinasia.com': /.+\.techinasia\.com\/.+((\w)+(\-)+){3,}.+/,
'wsj.com': /^((?!\/cn\.wsj\.com\/).)*$/
}
@ -268,7 +268,7 @@ var blockedRegexes = {
'science-et-vie.com': /.+\.qiota\.com\/.+/,
'sciencesetavenir.fr': /.+\.poool\.fr\/.+/,
'scmp.com': /cdn\.tinypass\.com\/.+/,
'seekingalpha.com': /cdn\.tinypass\.com\/.+/,
'seekingalpha.com': /(cdn\.tinypass\.com\/|cdn\.ampproject\.org(\/.+)?\/v\d\/amp-(access|ad|loader)-.+\.js)/,
'sfchronicle.com': /.+\.blueconic\.net\/.+/,
'slate.com': /(cdn\.cxense\.com\/.+|cdn\.tinypass\.com\/.+)/,
'sloanreview.mit.edu': /(cdn\.tinypass\.com\/.+|.+\/sloanreview\.mit\.edu\/.+\/welcome-ad\.js)/,
@ -743,10 +743,11 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
let fr_groupe_ebra_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(fr_groupe_ebra_domains, header_referer) && isSiteEnabled({url: header_referer}));
let fr_groupe_la_depeche_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(fr_groupe_la_depeche_domains, header_referer) && isSiteEnabled({url: header_referer}));
let fr_lacroix_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('la-croix.com', header_referer) && isSiteEnabled({url: header_referer}));
let seekingalpha_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('seekingalpha', header_referer) && isSiteEnabled({url: header_referer}));
let sz_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('sueddeutsche.de', header_referer) && isSiteEnabled({url: header_referer}));
let uk_telegraph_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('telegraph.co.uk', header_referer) && isSiteEnabled({url: header_referer}));
if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !es_grupo_vocento_site && !fr_groupe_ebra_site && !fr_groupe_la_depeche_site && !fr_lacroix_amp_site && !sz_amp_site && !uk_telegraph_amp_site) {
if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !es_grupo_vocento_site && !fr_groupe_ebra_site && !fr_groupe_la_depeche_site && !fr_lacroix_amp_site && !seekingalpha_amp_site && !sz_amp_site && !uk_telegraph_amp_site) {
return;
}

View file

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox
Post-release
Fix-update SeekingAlpha (amp)
* v2.0.1.0 (2020-12-27)
Add Expansion (Spain)

View file

@ -1909,6 +1909,22 @@ else if (matchDomain('freiepresse.de')) {
}
}
else if (matchDomain('seekingalpha.com')) {
let url = window.location.href;
let locked = document.querySelector('div[data-test-id="post-locked-banner"]');
if (locked && !url.includes('/amp/')) {
window.setTimeout(function () {
window.location.href = url.replace('seekingalpha.com/', 'seekingalpha.com/amp/');
}, 500); // Delay (in milliseconds)
} else if (url.includes('/amp/')) {
let div_hidden_all = document.querySelectorAll('div[amp-access="premium OR proplus"]');
for (let div_hidden of div_hidden_all)
div_hidden.removeAttribute('amp-access-hide');
let adverts = document.querySelectorAll('.ad-wrap');
removeDOMElement(...adverts);
}
}
else
csDone = true;

View file

@ -414,5 +414,5 @@
"*://*.repstatic.it/*",
"*://*.userzoom.com/*"
],
"version": "2.0.1.0"
"version": "2.0.1.1"
}