diff --git a/README.md b/README.md index c9b381f3..0c16ae95 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Weekly updates are released for fixes and new sites. ### Installation You can install the add-on from Mozilla add-ons (AMO): [Bypass Paywalls Clean](https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean)\ +Latest add-on versions (2.4.8.0+) require a browser based on Firefox 86+ (else use the non-amo version below).\ Or download and install the latest xpi-version from [GitLab](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases)\ 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). diff --git a/background.js b/background.js index 25e947c2..74471d6d 100644 --- a/background.js +++ b/background.js @@ -34,6 +34,7 @@ const restrictions = { 'seekingalpha.com': /.+\/seekingalpha\.com\/($|(amp\/)?(article|news)\/|samw\/)/, 'statista.com': /^((?!\.statista\.com\/(outlook|study)\/).)*$/, 'techinasia.com': /\.techinasia\.com\/.+/, + 'theaustralian.com.au': /^((?!todayspaper\.theaustralian\.com\.au\/).)*$/, 'theglobeandmail.com': /\.theglobeandmail\.com\/.+\//, 'timeshighereducation.com': /.+\.timeshighereducation\.com\/((features|news|people)\/|.+((\w)+(\-)+){3,}.+|sites\/default\/files\/)/ } @@ -795,7 +796,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { ext_api.tabs.executeScript({ file: 'options/toggleIcon.js', runAt: 'document_start' @@ -972,7 +973,7 @@ if (matchUrlDomain(change_headers, details.url) && !['font', 'image', 'styleshee active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { if (isSiteEnabled({url: tabs[0].url})) { ext_api.tabs.executeScript({ file: 'contentScript.js', @@ -1033,7 +1034,8 @@ function updateBadge(activeTab) { ext_api.browserAction.setBadgeBackgroundColor({color: color}); ext_api.browserAction.setBadgeText({text: badgeText}); } - } + } else + ext_api.browserAction.setBadgeText({text: badgeText}); } var ext_version_new; @@ -1066,7 +1068,7 @@ function site_switch() { active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { let currentUrl = tabs[0].url; let isDefaultSite = matchUrlDomain(defaultSites_grouped_domains, currentUrl); if (!isDefaultSite) { @@ -1119,7 +1121,7 @@ function remove_cookies_fn(domainVar, exclusions = false) { active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { if (ext_api.runtime.lastError) return; let tabId = tabs[0].id; @@ -1187,7 +1189,7 @@ function clear_cookies() { active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { ext_api.tabs.executeScript({ file: 'options/clearCookies.js', runAt: 'document_start' @@ -1223,7 +1225,7 @@ ext_api.runtime.onMessage.addListener(function (message, sender) { active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { let currentUrl = tabs[0].url; let domain; let isExcludedSite = matchUrlDomain(excludedSites, currentUrl); @@ -1371,7 +1373,7 @@ function refreshCurrentTab() { active: true, currentWindow: true }, function (tabs) { - if (tabs && tabs[0] && tabs[0].url.startsWith('http')) { + if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) { if (ext_api.runtime.lastError) return; ext_api.tabs.update(tabs[0].id, { diff --git a/changelog.txt b/changelog.txt index b3f98989..b10cf672 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Post-release Add LaLibre.be Add LeVif.be Fix Bloomberg (permission block js) +Remove tabs-permission (amo - Firefox 86+) * v2.4.7.0 (2021-12-12) Add Koelner Stadt-Anzeiger & Koelnische Rundschau diff --git a/manifest.json b/manifest.json index 44b69f2a..e2f94a3e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "scripts": ["sites.js", "bpc_count_daily_users.js", "background.js"] }, "content_security_policy": "script-src 'self'; object-src 'self'", - "applications": { + "browser_specific_settings": { "gecko": { "id": "magnolia@12.34", "update_url": "https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/raw/master/updates.json" @@ -589,5 +589,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.7.2" + "version": "2.4.7.3" } diff --git a/options/options.html b/options/options.html index b1158912..642cc995 100644 --- a/options/options.html +++ b/options/options.html @@ -33,6 +33,7 @@ +