From b6c8b1948b82aa5ebb7a4d0fbd23f36ac458be0b Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 5 Oct 2023 19:02:02 +0000 Subject: [PATCH] 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? --- .../0001-dont-show-options.patch | 26 ++++++++++++------- .../bypass-paywalls-clean/default.nix | 11 +++++++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/pkgs/additional/firefox-extensions/bypass-paywalls-clean/0001-dont-show-options.patch b/pkgs/additional/firefox-extensions/bypass-paywalls-clean/0001-dont-show-options.patch index 7094eb4f..9deb2f95 100644 --- a/pkgs/additional/firefox-extensions/bypass-paywalls-clean/0001-dont-show-options.patch +++ b/pkgs/additional/firefox-extensions/bypass-paywalls-clean/0001-dont-show-options.patch @@ -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": [ + "" + ], diff --git a/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix b/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix index 992e1480..01b9e375 100644 --- a/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix +++ b/pkgs/additional/firefox-extensions/bypass-paywalls-clean/default.nix @@ -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 ];