From 3a63d4d3076e92bb0e91b7109bce311aa9d84d83 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 21 Jul 2024 11:25:51 -0400 Subject: [PATCH] Fix firefox fingerprint protection. --- ansible/roles/firefox/defaults/main.yaml | 2 +- ansible/roles/firefox/tasks/peruser.yaml | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ansible/roles/firefox/defaults/main.yaml b/ansible/roles/firefox/defaults/main.yaml index 6e384d7..e3fbe4a 100644 --- a/ansible/roles/firefox/defaults/main.yaml +++ b/ansible/roles/firefox/defaults/main.yaml @@ -33,7 +33,7 @@ firefox_config: browser.urlbar.speculativeConnect.enabled: false # Do not resist fingerprinting because that tells websites to use light mode. # https://bugzilla.mozilla.org/show_bug.cgi?id=1732114 - privacy.resistFingerprinting: true + privacy.resistFingerprinting: null # (default false) # Instead, enable fingerprinting protection, which allows configuring an override. privacy.fingerprintingProtection: true # Allow sending dark mode preference to websites. diff --git a/ansible/roles/firefox/tasks/peruser.yaml b/ansible/roles/firefox/tasks/peruser.yaml index cb3b69a..7e2530f 100644 --- a/ansible/roles/firefox/tasks/peruser.yaml +++ b/ansible/roles/firefox/tasks/peruser.yaml @@ -10,12 +10,21 @@ register: firefox_about_config - name: Configure Firefox about:config + when: item[1].value != None lineinfile: path: "{{ item[0].path }}" regexp: '"{{ item[1].key }}", [^")\n]*\)' line: 'user_pref("{{ item[1].key }}", {{ item[1].value | to_json }});' loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}" +- name: Configure Firefox about:config + when: item[1].value == None + lineinfile: + path: "{{ item[0].path }}" + regexp: '"{{ item[1].key }}", [^")\n]*\)' + state: absent + loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}" + - import_tasks: tasks/peruser_freebsd.yaml when: 'os_flavor == "freebsd"'