packages(ublock-origin): Document attempt at changing settings

This seemed to work to an extent but resulted in some weirdness with the
uBlock Origin from LibreWolf and the uBlock Origin from this package.

The actual setting didn't change even though it was disabled in the
interface. Re-enabling the checkbox and toggling it didn't change
anything either.
This commit is contained in:
Donovan Glover 2024-08-30 23:58:34 -04:00
parent 42ea4eef27
commit c2bc18d696
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -2,6 +2,8 @@
lib,
stdenvNoCC,
fetchurl,
unzip,
zip,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
@ -15,10 +17,27 @@ stdenvNoCC.mkDerivation (finalAttrs: {
dontUnpack = true;
nativeBuildInputs = [
unzip
zip
];
postPatch = ''
unzip "$src"
substituteInPlace ./js/vapi-background-ext.js \
--replace-fail "browser.dns instanceof Object" "false"
substituteInPlace ./js/background.js \
--replace-fail "cnameUncloakEnabled: true" "cnameUncloakEnabled: false"
zip -x env-vars -r ublock-origin.xpi *
'';
installPhase = ''
runHook preInstall
install -Dm644 "$src" "$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/uBlock0@raymondhill.net.xpi"
install -Dm644 ublock-origin.xpi "$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/uBlock0@raymondhill.net.xpi"
runHook postInstall
'';