mirror of
https://github.com/iamadamdev/bypass-paywalls-chrome
synced 2025-05-07 03:44:26 +02:00
Fix dailytelegraph.com.au
This commit is contained in:
parent
6e78f24f74
commit
b57c72d41b
@ -75,7 +75,8 @@ const allowCookies = [
|
|||||||
'elmundo.es',
|
'elmundo.es',
|
||||||
'time.com',
|
'time.com',
|
||||||
'zeit.de',
|
'zeit.de',
|
||||||
'expansion.com'
|
'expansion.com',
|
||||||
|
'dailytelegraph.com.au'
|
||||||
];
|
];
|
||||||
|
|
||||||
// Removes cookies after page load
|
// Removes cookies after page load
|
||||||
@ -158,7 +159,6 @@ const useGoogleBotSites = [
|
|||||||
'adelaidenow.com.au',
|
'adelaidenow.com.au',
|
||||||
'barrons.com',
|
'barrons.com',
|
||||||
'couriermail.com.au',
|
'couriermail.com.au',
|
||||||
'dailytelegraph.com.au',
|
|
||||||
'fd.nl',
|
'fd.nl',
|
||||||
'genomeweb.com',
|
'genomeweb.com',
|
||||||
'heraldsun.com.au',
|
'heraldsun.com.au',
|
||||||
@ -243,7 +243,8 @@ const blockedRegexes = {
|
|||||||
'thestar.com': /\.com\/api\/overlaydata/,
|
'thestar.com': /\.com\/api\/overlaydata/,
|
||||||
'elpais.com': /(\.epimg\.net\/js\/.+\/(noticia|user)\.min\.js|\/elpais\.com\/arc\/subs\/p\.min\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|consent)-.+\.js)/,
|
'elpais.com': /(\.epimg\.net\/js\/.+\/(noticia|user)\.min\.js|\/elpais\.com\/arc\/subs\/p\.min\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|consent)-.+\.js)/,
|
||||||
'expansion.com': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/,
|
'expansion.com': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/,
|
||||||
'chicagobusiness.com': /(\.tinypass\.com\/|\.chicagobusiness\.com\/.+\/js\/js_.+\.js)/
|
'chicagobusiness.com': /(\.tinypass\.com\/|\.chicagobusiness\.com\/.+\/js\/js_.+\.js)/,
|
||||||
|
'dailytelegraph.com.au': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/
|
||||||
};
|
};
|
||||||
|
|
||||||
const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
|
const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
|
||||||
@ -306,6 +307,18 @@ function getBadgeText (currentUrl) {
|
|||||||
return currentUrl && isSiteEnabled({ url: currentUrl }) ? 'ON' : '';
|
return currentUrl && isSiteEnabled({ url: currentUrl }) ? 'ON' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AMP redirect for dailytelegraph.com.au
|
||||||
|
extensionApi.webRequest.onBeforeRequest.addListener(function (details) {
|
||||||
|
if (!isSiteEnabled(details)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const updatedUrl = decodeURIComponent(details.url.split('&dest=')[1].split('&')[0]).replace('www.', 'amp.');
|
||||||
|
return { redirectUrl: updatedUrl };
|
||||||
|
},
|
||||||
|
{ urls: ['*://www.dailytelegraph.com.au/subscribe/*'], types: ['main_frame'] },
|
||||||
|
['blocking']
|
||||||
|
);
|
||||||
|
|
||||||
// Disable javascript for these sites
|
// Disable javascript for these sites
|
||||||
extensionApi.webRequest.onBeforeRequest.addListener(function (details) {
|
extensionApi.webRequest.onBeforeRequest.addListener(function (details) {
|
||||||
if (!isSiteEnabled(details) && !enabledSites.includes('generalpaywallbypass')) {
|
if (!isSiteEnabled(details) && !enabledSites.includes('generalpaywallbypass')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user