Fix Medium (identify member-only)

merge-requests/15/head
magnolia1234 11 months ago
parent ce5848602b
commit 333a9427fc

@ -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);

@ -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)

@ -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);
}

@ -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');

Loading…
Cancel
Save