diff --git a/background.js b/background.js index 970324b9..e0c38e64 100644 --- a/background.js +++ b/background.js @@ -1131,7 +1131,7 @@ ext_api.tabs.onUpdated.addListener(function (tabId, info, tab) { updateBadge(tab ext_api.tabs.onActivated.addListener(function (activeInfo) { if (activeInfo.tabId) ext_api.tabs.get(activeInfo.tabId, updateBadge); }); function updateBadge(activeTab) { - if (ext_api.runtime.lastError || !activeTab || (activeTab.url && activeTab.url.split('?')[0].includes('/archive.'))) + if (ext_api.runtime.lastError || !activeTab || (activeTab.url && urlHost(activeTab.url).match(/^archive\.[a-z]{2}$/))) return; let badgeText = ''; let color = 'red'; @@ -1150,6 +1150,8 @@ function updateBadge(activeTab) { badgeText = 'X'; color = 'silver'; } + if (matchUrlDomain('webcache.googleusercontent.com', currentUrl)) + badgeText = ''; if (ext_version_new) badgeText = '^' + badgeText; let isDefaultSite = matchUrlDomain(defaultSites_domains, currentUrl); diff --git a/changelog.txt b/changelog.txt index a2fdb240..6a60813c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Fix Medium (identify member-only) Maintenance request host permission (disable for mobile) * v3.2.5.0 (2023-07-16) diff --git a/contentScript.js b/contentScript.js index a1b34469..28a55947 100644 --- a/contentScript.js +++ b/contentScript.js @@ -300,14 +300,17 @@ if (ext_api.runtime) { if (matchDomain('medium.com') || matchDomain(medium_custom_domains) || document.querySelector('script[src*=".medium.com/"]')) { let url = window.location.href; + let paywall = document.querySelector('section button[aria-label="Member-only story"]'); + if (paywall) { + paywall.removeAttribute('aria-label'); + let article = document.querySelector('article'); + if (article) + article.firstChild.before(googleWebcacheLink(url)); + } window.setTimeout(function () { - let paywall = pageContains('div > h2 > div, div > div > h2', /Read (the full story with|this story from)/); - if (paywall.length) { - removeDOMElement(paywall[0].parentNode.parentNode); - let article = document.querySelector('article'); - if (article) - article.firstChild.before(googleWebcacheLink(url)); - } + let banner = pageContains('div > h2 > div, div > div > h2', /(Read (the full story with|this story from)|Get unlimited access to stories)/); + if (banner.length) + removeDOMElement(banner[0].parentNode.parentNode); }, 1000); } diff --git a/options/popup.js b/options/popup.js index 6be59f2b..04bb0a09 100644 --- a/options/popup.js +++ b/options/popup.js @@ -7,7 +7,7 @@ var yandex_browser = navigator_ua_mobile && (url_loc === 'chrome') && navigator_ var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && !yandex_browser); function popup_show_toggle(domain, enabled) { - if (domain) { + if (domain && !matchDomain(['webcache.googleusercontent.com'], domain)) { var site_switch_span = document.getElementById('site_switch_span'); let labelEl = document.createElement('label'); labelEl.setAttribute('class', 'switch');