From 042ccadcf3de82d25d89f144be20800aad296ffe Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 13 Feb 2023 12:40:06 +0100 Subject: [PATCH] Add custom version --- README.md | 8 ++++-- custom/manifest.json | 55 +++++++++++++++++++++++++++++++++++++++++ options/optin/opt-in.js | 2 +- options/popup.js | 2 +- updates_custom.json | 10 ++++++++ 5 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 custom/manifest.json create mode 100644 updates_custom.json diff --git a/README.md b/README.md index f0194a8..df3ecef 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Weekly updates are released for fixes and new sites. You can install the add-on from [GitLab releases](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases)\ Download the xpi-file (from latest release), go to downloads and install the add-on.\ Or go to Tools > Add-ons (about:addons) > Extensions > Cogwheel/Settings - Install Add-on from File\ +Custom xpi-file has host permissions for all sites.\ Minumum browser requirement: Firefox 86+. If you want to install the latest [master ZIP-file from GitLab](https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/archive/master/bypass-paywalls-firefox-clean-master.zip) use a Firefox browser which allows using unsigned add-ons like Firefox Developer Portable (go to about:config and set xpinstall.signatures.required to false) or LibreWolf (for both no automatic updates of add-on).\ @@ -34,9 +35,12 @@ You can also check for update of site rules at startup (opt-in); only available For new sites you also have to opt-in to custom sites/request permissions for new domains (or wait for new release). #### Android -Add-on was removed by Mozilla from add-on store. +Add-on was removed by Mozilla from add-on store.\ +Current installations will stay active, but with no more updates. -You can switch to Kiwi browser (Chromium) or use the [adblocker filter/userscripts](https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters) +At the moment only the experimental GeckoView-based browser [SmartCookieWeb-Preview](https://github.com/CookieJarApps/SmartCookieWeb-Preview/releases) can install/sideload a xpi-file by url. + +You can also switch to [Kiwi browser (Chromium)](https://play.google.com/store/apps/details?id=com.kiwibrowser.browser) or use the [adblocker filter/userscripts](https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters) #### Chrome/Chromium Visit the [Chrome repository](https://gitlab.com/magnolia1234/bypass-paywalls-chrome-clean) of Bypass Paywall Clean. diff --git a/custom/manifest.json b/custom/manifest.json new file mode 100644 index 0000000..54fd801 --- /dev/null +++ b/custom/manifest.json @@ -0,0 +1,55 @@ +{ + "background": { + "scripts": ["sites.js", "bpc_count_daily_users.js", "background.js"] + }, + "content_security_policy": "script-src 'self'; object-src 'self'", + "browser_specific_settings": { + "gecko": { + "id": "magnolia_limited_permissions@12.34", + "update_url": "https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/raw/master/updates_custom.json", + "strict_min_version": "86.0" + } + }, + "browser_action": { + "default_popup": "options/popup.html", + "default_icon": { + "128": "bypass.png" + }, + "theme_icons": [{ + "light": "bypass-dark.png", + "dark": "bypass.png", + "size": 128 + } + ] + }, + "description": "Bypass Paywalls of news sites", + "homepage_url": "https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean", + "icons": { + "128": "bypass.png" + }, + "manifest_version": 2, + "name": "Bypass Paywalls Clean (c)", + "short_name": "Bypass Paywall", + "options_ui": { + "browser_style": true, + "open_in_tab": true, + "page": "options/options.html" + }, + "content_scripts": [{ + "matches": [ + "*://*.gitlab.com/magnolia1234" + ], + "run_at": "document_start", + "js": ["contentScript_once.js"] + } + ], + "permissions": [ + "cookies", + "storage", + "activeTab", + "webRequest", + "webRequestBlocking", + "*://*/*" + ], + "version": "3.0.5.0" +} diff --git a/options/optin/opt-in.js b/options/optin/opt-in.js index 4dbd42b..c1027b0 100644 --- a/options/optin/opt-in.js +++ b/options/optin/opt-in.js @@ -3,7 +3,7 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var manifestData = ext_api.runtime.getManifest(); var navigator_ua = navigator.userAgent; var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile'); -var custom_switch = manifestData.optional_permissions && manifestData.optional_permissions.length;// && !navigator_ua_mobile; +var custom_switch = manifestData.optional_permissions && manifestData.optional_permissions.length && !navigator_ua_mobile; window.addEventListener("load", function () { document.getElementById("button-close").addEventListener("click", function () { diff --git a/options/popup.js b/options/popup.js index c69e39e..0f2966f 100644 --- a/options/popup.js +++ b/options/popup.js @@ -2,7 +2,7 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var manifestData = ext_api.runtime.getManifest(); var navigator_ua = navigator.userAgent; var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile'); -var custom_switch = manifestData.optional_permissions && manifestData.optional_permissions.length;// && !navigator_ua_mobile; +var custom_switch = manifestData.optional_permissions && manifestData.optional_permissions.length && !navigator_ua_mobile; function popup_show_toggle(domain, enabled) { if (domain) { diff --git a/updates_custom.json b/updates_custom.json new file mode 100644 index 0000000..336818b --- /dev/null +++ b/updates_custom.json @@ -0,0 +1,10 @@ +{ + "addons": { + "magnolia_limited_permissions@12.34": { + "updates": [ + { "version": "3.0.5.0", + "update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.0.5.0-custom.xpi" } + ] + } + } +}