Fix Fortune (amp)

This commit is contained in:
magnolia1234 2021-12-10 18:16:56 +01:00
parent 3adcc0e4fd
commit 33df454957
5 changed files with 53 additions and 22 deletions

View file

@ -605,7 +605,23 @@ ext_api.webRequest.onHeadersReceived.addListener(function (details) {
}, },
['blocking', 'responseHeaders']); ['blocking', 'responseHeaders']);
var block_js = ["*://cdn.tinypass.com/*", "*://*.piano.io/*", "*://*.poool.fr/*", "*://cdn.ampproject.org/v*/amp-access-*.js", "*://cdn.ampproject.org/v*/amp-subscriptions-*.js", "*://loader-cdn.azureedge.net/prod/*/loader.min.js*", "*://*.blueconic.net/*", "*://*.cxense.com/*", "*://*.evolok.net/*", "*://js.matheranalytics.com/*", "*://*.newsmemory.com/*", "*://*.onecount.net/*", "*://js.pelcro.com/*", "*://*.qiota.com/*", "*://*.tribdss.com/*"]; var block_js = [
"*://*.blueconic.net/*",
"*://*.cxense.com/*",
"*://*.evolok.net/*",
"*://*.newsmemory.com/*",
"*://*.onecount.net/*",
"*://*.piano.io/*",
"*://*.poool.fr/*",
"*://*.qiota.com/*",
"*://*.tribdss.com/*",
"*://cdn.ampproject.org/v*/amp-access-*.*js",
"*://cdn.ampproject.org/v*/amp-subscriptions-*.*js",
"*://cdn.tinypass.com/*",
"*://js.matheranalytics.com/*",
"*://js.pelcro.com/*",
"*://loader-cdn.azureedge.net/prod/*/loader.min.js*",
];
// Disable javascript for these sites/general paywall-scripts // Disable javascript for these sites/general paywall-scripts
function disableJavascriptOnListedSites() { function disableJavascriptOnListedSites() {

View file

@ -5,6 +5,7 @@ Post-release
Add Koelner Stadt-Anzeiger & Koelnische Rundschau Add Koelner Stadt-Anzeiger & Koelnische Rundschau
Add The (New Orleans) Advocate Add The (New Orleans) Advocate
Fix ABC.es (amp) Fix ABC.es (amp)
Fix Fortune (amp)
Fix Funke Mediengruppe (amp) Fix Funke Mediengruppe (amp)
Fix Lecho.be (separate from Groupe Rossel) Fix Lecho.be (separate from Groupe Rossel)
Fix Repubblica sites (no amp) Fix Repubblica sites (no amp)

View file

@ -26,7 +26,7 @@ var usa_mng_domains = ['denverpost.com', 'eastbaytimes.com', 'mercurynews.com'
var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com'];
// clean local storage of sites (with an exemption for hold-list) // clean local storage of sites (with an exemption for hold-list)
var arr_localstorage_hold = ['augsburger-allgemeine.de', 'businessoffashion.com', 'charliehebdo.fr', 'cmjornal.pt', 'houstonchronicle.com', 'inc42.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk'].concat(de_funke_media_domains, es_grupo_vocento_domains, es_unidad_domains, no_nhst_media_domains); var arr_localstorage_hold = ['augsburger-allgemeine.de', 'businessoffashion.com', 'charliehebdo.fr', 'cmjornal.pt', 'fortune.com', 'houstonchronicle.com', 'inc42.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk'].concat(de_funke_media_domains, es_grupo_vocento_domains, es_unidad_domains, no_nhst_media_domains);
if (!matchDomain(arr_localstorage_hold)) { if (!matchDomain(arr_localstorage_hold)) {
window.localStorage.clear(); window.localStorage.clear();
} }
@ -53,7 +53,7 @@ function amp_iframes_replace(weblink = false) {
src: amp_iframe.getAttribute('src'), src: amp_iframe.getAttribute('src'),
sandbox: amp_iframe.getAttribute('sandbox'), sandbox: amp_iframe.getAttribute('sandbox'),
height: amp_iframe.getAttribute('height'), height: amp_iframe.getAttribute('height'),
width: amp_iframe.getAttribute('width'), width: 'auto',
style: 'border: 0px;' style: 'border: 0px;'
}); });
} else { } else {
@ -1936,6 +1936,14 @@ else if (matchDomain('foreignpolicy.com')) {
content_gated.classList.remove('content-gated'); content_gated.classList.remove('content-gated');
} }
else if (matchDomain('fortune.com')) {
if (window.location.pathname.endsWith('/amp/')) {
amp_unhide_access_hide('="NOT p.showRegWall AND NOT p.showPayWall"', '', '[class^="amp-ad"]');
let paywall = document.querySelector('.paywall');
removeDOMElement(paywall);
}
}
else if (matchDomain('ft.com')) { else if (matchDomain('ft.com')) {
if (window.location.hostname.startsWith('amp.')) { if (window.location.hostname.startsWith('amp.')) {
amp_unhide_subscr_section('.ad-container, amp-ad'); amp_unhide_subscr_section('.ad-container, amp-ad');

View file

@ -587,5 +587,5 @@
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.4.6.4" "version": "2.4.6.5"
} }

View file

@ -454,7 +454,7 @@ var defaultSites = {
"Forbes": { "Forbes": {
domain: "forbes.com", domain: "forbes.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /\.tinypass\.com\// block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js)/
}, },
"Foreign Affairs": { "Foreign Affairs": {
domain: "foreignaffairs.com", domain: "foreignaffairs.com",
@ -467,7 +467,7 @@ var defaultSites = {
"Fortune": { "Fortune": {
domain: "fortune.com", domain: "fortune.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /\.tinypass\.com\// block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Frankfurter Allgemeine Zeitung": { "Frankfurter Allgemeine Zeitung": {
domain: "faz.net", domain: "faz.net",
@ -675,7 +675,7 @@ var defaultSites = {
}, },
"Houston Chronicle": { "Houston Chronicle": {
domain: "houstonchronicle.com", domain: "houstonchronicle.com",
block_regex: /\.blueconic\.net\// block_regex: /(\.blueconic\.net\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Humo.be": { "Humo.be": {
domain: "humo.be", domain: "humo.be",
@ -802,6 +802,7 @@ var defaultSites = {
"La Nouvelle République du Centre-Ouest": { "La Nouvelle République du Centre-Ouest": {
domain: "lanouvellerepublique.fr", domain: "lanouvellerepublique.fr",
allow_cookies: 1, allow_cookies: 1,
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/,
useragent: "googlebot" useragent: "googlebot"
}, },
"La Nuova Sardegna": { "La Nuova Sardegna": {
@ -1009,7 +1010,7 @@ var defaultSites = {
}, },
"MIT Technology Review": { "MIT Technology Review": {
domain: "technologyreview.com", domain: "technologyreview.com",
block_regex: /\.blueconic\.net\// block_regex: /(\.blueconic\.net\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.mjs)/
}, },
"Mitteldeutsche Zeitung": { "Mitteldeutsche Zeitung": {
domain: "mz.de", domain: "mz.de",
@ -1046,6 +1047,7 @@ var defaultSites = {
"Neue Zürcher Zeitung": { "Neue Zürcher Zeitung": {
domain: "nzz.ch", domain: "nzz.ch",
allow_cookies: 1, allow_cookies: 1,
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js/,
useragent: "googlebot" useragent: "googlebot"
}, },
"New Left Review": { "New Left Review": {
@ -1076,7 +1078,7 @@ var defaultSites = {
}, },
"Newsweek": { "Newsweek": {
domain: "newsweek.com", domain: "newsweek.com",
block_regex: /js\.pelcro\.com\// block_regex: /(js\.pelcro\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|subscriptions)-.+\.js)/
}, },
"NHST Media Group": { "NHST Media Group": {
domain: "###_no_nhst_media", domain: "###_no_nhst_media",
@ -1196,7 +1198,7 @@ var defaultSites = {
"Rolling Stone": { "Rolling Stone": {
domain: "rollingstone.com", domain: "rollingstone.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /cdn\.cxense\.com\// block_regex: /(cdn\.cxense\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Ruhr Nachrichten": { "Ruhr Nachrichten": {
domain: "ruhrnachrichten.de", domain: "ruhrnachrichten.de",
@ -1210,7 +1212,7 @@ var defaultSites = {
}, },
"San Francisco Chronicle": { "San Francisco Chronicle": {
domain: "sfchronicle.com", domain: "sfchronicle.com",
block_regex: /\.blueconic\.net\// block_regex: /(\.blueconic\.net\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Sanoma Media Finland (+ regional/opt-in to custom sites)": { "Sanoma Media Finland (+ regional/opt-in to custom sites)": {
domain: "###_fi_sanoma", domain: "###_fi_sanoma",
@ -1237,7 +1239,7 @@ var defaultSites = {
}, },
"Sciences et Avenir": { "Sciences et Avenir": {
domain: "sciencesetavenir.fr", domain: "sciencesetavenir.fr",
block_regex: /\.poool\.fr\// block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/
}, },
"Scientific American (free articles only)": { "Scientific American (free articles only)": {
domain: "scientificamerican.com", domain: "scientificamerican.com",
@ -1256,10 +1258,11 @@ var defaultSites = {
}, },
"Slate": { "Slate": {
domain: "slate.com", domain: "slate.com",
block_regex: /(cdn\.cxense\.com\/|\.tinypass\.com\/)/ block_regex: /(cdn\.cxense\.com\/|\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/
}, },
"SOFREP": { "SOFREP": {
domain: "sofrep.com" domain: "sofrep.com",
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js/
}, },
"South China Morning Post": { "South China Morning Post": {
domain: "scmp.com", domain: "scmp.com",
@ -1302,7 +1305,7 @@ var defaultSites = {
"Tampa Bay Times": { "Tampa Bay Times": {
domain: "tampabay.com", domain: "tampabay.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /(loader-cdn\.azureedge\.net\/|js\.matheranalytics\.com\/)/ block_regex: /(loader-cdn\.azureedge\.net\/|js\.matheranalytics\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/
}, },
"Tech in Asia": { "Tech in Asia": {
domain: "techinasia.com", domain: "techinasia.com",
@ -1351,10 +1354,11 @@ var defaultSites = {
"The Atlanta Journal-Constitution": { "The Atlanta Journal-Constitution": {
domain: "ajc.com", domain: "ajc.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /loader-cdn\.azureedge\.net\// block_regex: /(loader-cdn\.azureedge\.net\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/
}, },
"The Atlantic": { "The Atlantic": {
domain: "theatlantic.com", domain: "theatlantic.com",
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|subscriptions)-.+\.js/,
remove_cookies_select_drop: ["articleViews"] remove_cookies_select_drop: ["articleViews"]
}, },
"The Australian Financial Review": { "The Australian Financial Review": {
@ -1421,7 +1425,7 @@ var defaultSites = {
"The Hindu BusinessLine": { "The Hindu BusinessLine": {
domain: "thehindubusinessline.com", domain: "thehindubusinessline.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /(cdn\.cxense\.com\/|\.tinypass\.com\/)/ block_regex: /(cdn\.cxense\.com\/|\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad(s)?)-.+\.js)/
}, },
"The Intercept": { "The Intercept": {
domain: "theintercept.com", domain: "theintercept.com",
@ -1448,11 +1452,12 @@ var defaultSites = {
"The Market.ch": { "The Market.ch": {
domain: "themarket.ch", domain: "themarket.ch",
allow_cookies: 1, allow_cookies: 1,
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js/,
useragent: "googlebot" useragent: "googlebot"
}, },
"The Nation": { "The Nation": {
domain: "thenation.com", domain: "thenation.com",
block_regex: /\.tinypass\.com\// block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/
}, },
"The New Atlantis": { "The New Atlantis": {
domain: "thenewatlantis.com", domain: "thenewatlantis.com",
@ -1495,6 +1500,7 @@ var defaultSites = {
}, },
"The Seattle Times": { "The Seattle Times": {
domain: "seattletimes.com", domain: "seattletimes.com",
block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js/,
remove_cookies_select_hold: ["st_newsletter_splash_seen"] remove_cookies_select_hold: ["st_newsletter_splash_seen"]
}, },
"The Spectator (UK)": { "The Spectator (UK)": {
@ -1537,11 +1543,11 @@ var defaultSites = {
"wellandtribune.ca" "wellandtribune.ca"
], ],
allow_cookies: 1, allow_cookies: 1,
block_regex: /\.(ca|com)\/api\/overlaydata/ block_regex: /(\.(ca|com)\/api\/overlaydata|cdn\.ampproject\.org\/v\d\/amp-(access|ad|subscriptions)-.+\.js)/
}, },
"The Wall Street Journal": { "The Wall Street Journal": {
domain: "wsj.com", domain: "wsj.com",
block_regex: /(cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent|subscriptions)-.+\.js|cdn\.cxense\.com\/)/, block_regex: /(cdn\.cxense\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent|subscriptions)-.+\.js)/,
remove_cookies_select_hold: ["wsjregion", "ResponsiveConditional_initialBreakpoint"], remove_cookies_select_hold: ["wsjregion", "ResponsiveConditional_initialBreakpoint"],
useragent: "googlebot" useragent: "googlebot"
}, },
@ -1562,7 +1568,7 @@ var defaultSites = {
"Time Magazine": { "Time Magazine": {
domain: "time.com", domain: "time.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /\/time\.com\/dist\/meter-wall-client-js\..+\.js/ block_regex: /(\/time\.com\/dist\/meter-wall-client-js\..+\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"Times Higher Education": { "Times Higher Education": {
domain: "timeshighereducation.com", domain: "timeshighereducation.com",
@ -1627,7 +1633,7 @@ var defaultSites = {
"Variety": { "Variety": {
domain: "variety.com", domain: "variety.com",
allow_cookies: 1, allow_cookies: 1,
block_regex: /cdn\.cxense\.com\// block_regex: /(cdn\.cxense\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad)-.+\.js)/
}, },
"VeloNews": { "VeloNews": {
domain: "velonews.com", domain: "velonews.com",