Fix-update SeekingAlpha (amp)

This commit is contained in:
magnolia1234 2021-01-10 20:20:53 +01:00
parent 3ba692c432
commit f95a7e85f4
5 changed files with 10 additions and 7 deletions

View File

@ -66,7 +66,7 @@ Visit the [Firefox repository](https://gitlab.com/magnolia1234/bypass-paywalls-f
### Update
For crx-installation: check for updates (in chrome://extensions).\
For zip-installation (load unpacked): unzip files to installation folder or use a Git(Hub)-client to clone the extension (locally).
For zip-installation (load unpacked/developer mode): unzip files to installation folder or use a Git(Hub)-client to clone the extension (locally).
### List of supported websites
@ -518,8 +518,7 @@ Remember to check the [previous requests](https://gitlab.com/magnolia1234/bypass
### Add custom site
Add your own custom site (also for testing).
Check 'Options'-link in popup-menu and go to custom sites.
* 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).
\* 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).\
Make sure the (new) site is checked under Options (or check on/off-button).
By default sites' cookies/local storage are removed after page loads (to bypass article limit).
Also you can enable Googlebot user-agent or disable Javascript for (sub)domain(s)/external sources.

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\/($|(amp\/)?article\/|samw\/)/,
'seekingalpha.com': /.+\/seekingalpha\.com\/($|(amp\/)?(article|news)\/|samw\/)/,
'techinasia.com': /.+\.techinasia\.com\/.+((\w)+(\-)+){3,}.+/,
'wsj.com': /^((?!\/cn\.wsj\.com\/).)*$/
}
@ -779,7 +779,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
let uk_nlr_site = (matchUrlDomain('stripe.com', details.url) && matchUrlDomain('newleftreview.org', header_referer) && isSiteEnabled({url: header_referer}));
let bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && isSiteEnabled({url: header_referer}) &&
matchUrlDomain(['barrons.com', 'belfasttelegraph.co.uk', 'elmundo.es', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'fresnobee.com', 'gelocal.it', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'nationalreview.com', 'sacbee.com', 'seekingalpha', 'sueddeutsche.de', 'telegraph.co.uk'].concat(au_nine_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains), header_referer));
matchUrlDomain(['barrons.com', 'belfasttelegraph.co.uk', 'elmundo.es', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'fresnobee.com', 'gelocal.it', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'nationalreview.com', 'sacbee.com', 'seekingalpha.com', 'sueddeutsche.de', 'telegraph.co.uk'].concat(au_nine_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains), header_referer));
if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !uk_nlr_site && !bpc_amp_site) {
return;

View File

@ -5,6 +5,7 @@ Post-release
Add Curbed (New York Magazine)
Add group TorStar (Canada)
Add New Left Review (United Kingdom)
Fix-update SeekingAlpha (amp)
Fix-update Toronto Star (overlay)
Update options (excluded sites)

View File

@ -1883,9 +1883,12 @@ else if (matchDomain('seekingalpha.com')) {
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"]');
let div_hidden_all = document.querySelectorAll('[amp-access*="premium_access OR"]');
for (let div_hidden of div_hidden_all)
div_hidden.removeAttribute('amp-access-hide');
let paywall = document.querySelector('[class*="paywall-container"]');
if (paywall)
paywall.setAttribute('style', 'display:none;');
let adverts = document.querySelectorAll('.ad-wrap');
removeDOMElement(...adverts);
}

View File

@ -410,5 +410,5 @@
"*://*.stripe.com/*",
"*://*.userzoom.com/*"
],
"version": "2.0.2.5"
"version": "2.0.2.6"
}