bypass-paywalls-clean: don't show options on first launch

this is apparently a thing firefox does when it sees the `options_ui`
key in manifest.json?
This commit is contained in:
Colin 2023-10-05 19:02:02 +00:00
parent 3a71d26638
commit b6c8b1948b
2 changed files with 27 additions and 10 deletions

View File

@ -8,15 +8,7 @@ diff --git a/background.js b/background.js
index e0c38e6..5d4acf4 100644
--- a/background.js
+++ b/background.js
@@ -148,7 +148,6 @@ function setDefaultOptions() {
return [key, val.domain]
})
}, function () {
- ext_api.runtime.openOptionsPage();
});
}
@@ -1453,18 +1452,6 @@ ext_api.runtime.onMessage.addListener(function (message, sender) {
@@ -1486,18 +1485,6 @@ ext_api.runtime.onMessage.addListener(function (message, sender) {
}
});
@ -35,3 +27,19 @@ index e0c38e6..5d4acf4 100644
function filterObject(obj, filterFn, mapFn = function (val, key) {
return [key, val];
diff --git a/manifest.json b/manifest.json
index 5af8d8f..3fb7be7 100644
--- a/manifest.json
+++ b/manifest.json
@@ -30,11 +30,6 @@
"manifest_version": 2,
"name": "Bypass Paywalls Clean",
"short_name": "Bypass Paywall",
- "options_ui": {
- "browser_style": true,
- "open_in_tab": true,
- "page": "options/options.html"
- },
"optional_permissions": [
"<all_urls>"
],

View File

@ -17,9 +17,18 @@ stdenv.mkDerivation rec {
patches = [
./0001-dont-show-options.patch
./0002-disable-auto-update.patch
# ./0002-disable-auto-update.patch
./0003-disable-metrics.patch
];
# N.B.: disabling all `fetch` breaks the manual "check for updates" button,
# but that's not necessary because `nix run '.#update.pkgs.firefox-extensions'` is so trivial.
# still, re-enable the 'disable-auto-update' patch above for a higher-maintenance solution
# which avoids breaking manual updates
postPatch = ''
substituteAllInPlace background.js \
--replace 'ext_api.runtime.openOptionsPage()' 'true' \
--replace ' fetch(' ' false && fetch('
'';
nativeBuildInputs = [ zip ];