Revert "librewolf: Remove unnecessary ublock-origin package"

It turns out that DNS leaks were occurring from a new feature in Firefox
v129+ that uses the system's DNS in favor of the browser's DNS.

See: https://bugzilla.mozilla.org/show_bug.cgi?id=1910593
This commit is contained in:
Donovan Glover 2024-08-31 02:00:29 -04:00
parent 70c8d3f27a
commit f52c98bab6
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 53 additions and 0 deletions

View File

@ -20,6 +20,7 @@ in
profiles.default = { profiles.default = {
extensions = with nix-config.packages.${pkgs.system}; [ extensions = with nix-config.packages.${pkgs.system}; [
ublock-origin
yomitan yomitan
redlib redlib
new-tab-identity new-tab-identity

View File

@ -0,0 +1,52 @@
{
lib,
stdenvNoCC,
fetchurl,
unzip,
zip,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "ublock-origin";
version = "1.59.0";
src = fetchurl {
url = "https://addons.mozilla.org/firefox/downloads/file/4328681/ublock_origin-${finalAttrs.version}.xpi";
hash = "sha256-HbnGdqB9FB+NNtu8JPnj1kpswjQNv8bISLxDlfls+xQ=";
};
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 ublock-origin.xpi "$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/uBlock0@raymondhill.net.xpi"
runHook postInstall
'';
meta = {
homepage = "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/";
description = "Efficient wide-spectrum content blocker";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ donovanglover ];
platforms = lib.platforms.all;
};
})