diff --git a/README.md b/README.md index d92369d..e1865c1 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The experimental Mozac/GeckoView-based browser [SmartCookieWeb-Preview](https:// There is still an elaborate workaround for regular Firefox (or Beta/fork) though: * install an old version of Firefox (like v68.11.0 from [archive.mozilla.org](https://archive.mozilla.org/pub/mobile/releases/68.11.0/) or [apkmirror.com](https://www.apkmirror.com/apk/mozilla/firefox/firefox-68-11-0-release)); first you have to remove your current Firefox app.\ Specifically for the add-on you can also use Firefox Beta or a Firefox-fork like [Fennec F-Droid](https://f-droid.org/packages/org.mozilla.fennec_fdroid) where you can [set a custom add-on collection](https://blog.mozilla.org/addons/2020/09/29/expanded-extension-support-in-firefox-for-android-nightly) (for amo-listed add-ons); again first install an old version of [Firefox Beta v68.7](https://www.apkmirror.com/apk/mozilla/firefox-beta/firefox-beta-68-7-release) or [Fennec F-droid v68.11.0](https://www.apkmirror.com/apk/mozilla/fennec-f-droid/fennec-f-droid-68-11-0-release) -* download add-on's xpi-file (custom version if you want to use custom sites) from [releases](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases) and install/open in Firefox (from downloads) +* download add-on's xpi-file (custom version has by default host permissions for all sites) from [releases](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases) and install/open in Firefox (from downloads) * now you can update Firefox to the latest version * add-on will stay active & automatically updates to the latest version diff --git a/changelog.txt b/changelog.txt index 09b1900..2982cb5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Post-release Fix Automobilwoche.de (js) Fix Harvard Business Review (script) Fix National Review (cookies) +Enable optional host permissions on Android (Firefox 120+) * v3.4.7.0 (2023-12-14) Add Die Presse (at) diff --git a/options/optin/opt-in.js b/options/optin/opt-in.js index ae41cbb..5a1a944 100644 --- a/options/optin/opt-in.js +++ b/options/optin/opt-in.js @@ -1,11 +1,10 @@ -"use strict"; var ext_api = (typeof browser === 'object') ? browser : chrome; var url_loc = (typeof browser === 'object') ? 'firefox' : 'chrome'; var manifestData = ext_api.runtime.getManifest(); var navigator_ua = navigator.userAgent; var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile'); var yandex_browser = navigator_ua_mobile && (url_loc === 'chrome') && navigator_ua.toLowerCase().includes('yabrowser'); -var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && !yandex_browser); +var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && (url_loc === 'chrome') && !yandex_browser); window.addEventListener("load", function () { document.getElementById("button-close").addEventListener("click", function () { diff --git a/options/options_custom.js b/options/options_custom.js index e039e11..7aad968 100644 --- a/options/options_custom.js +++ b/options/options_custom.js @@ -1,10 +1,10 @@ -var ext_api = chrome || browser; +var ext_api = (typeof browser === 'object') ? browser : chrome; var url_loc = (typeof browser === 'object') ? 'firefox' : 'chrome'; var manifestData = ext_api.runtime.getManifest(); var navigator_ua = navigator.userAgent; var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile'); var yandex_browser = navigator_ua_mobile && (url_loc === 'chrome') && navigator_ua.toLowerCase().includes('yabrowser'); -var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && !yandex_browser); +var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && (url_loc === 'chrome') && !yandex_browser); var useragent_options = ['', 'googlebot', 'bingbot', 'facebookbot']; var referer_options = ['', 'facebook', 'google', 'twitter']; diff --git a/options/popup.js b/options/popup.js index 1d77125..2c5d8d3 100644 --- a/options/popup.js +++ b/options/popup.js @@ -4,7 +4,7 @@ var manifestData = ext_api.runtime.getManifest(); var navigator_ua = navigator.userAgent; var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile'); var yandex_browser = navigator_ua_mobile && (url_loc === 'chrome') && navigator_ua.toLowerCase().includes('yabrowser'); -var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && !yandex_browser); +var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !(navigator_ua_mobile && (url_loc === 'chrome') && !yandex_browser); function popup_show_toggle(domain, enabled) { if (domain && !matchDomain(['webcache.googleusercontent.com'], domain)) {