Disable outdated Firefox First-Party Isolation (FPI)
Overview
This script improves your privacy on Linux.
These changes use Linux system commands to update your settings.
First-party isolation (FPI) helps in preventing third parties from tracking users across multiple websites 1 2. This is sometimes referred to as "double keying" (double-keying) 1 or supercookies 1 2.
This script disables FPI in favor of a newer technology called dynamic First-Party Isolation (dFPI) for the following reasons:
- FPI and dFPI conflict with each other, and they cannot function simultaneously 3 4. Additionally, Mozilla doesn't plan to make them compatible 5.
- FPI has been marked as deprecated and is expected to be phased out 3, with dFPI set to become the standard in the future 6.
- dFPI, when combined with network partitioning, offers broader and more effective privacy coverage than FPI, being essentially a superset of FPI 3 7.
This script uses Bash (Shell script) scripting language.
This script is only recommended if you understand its implications. Some non-critical or features may no longer function correctly after running this script.
Implementation Details
-
Language: bash
-
Required Privileges: Root/sudo access
-
Compatibility: Linux only
-
Reversibility: Can be undone using provided revert script
Explore Categories
- Enable Firefox state partitioning (Total Cookie Protection)
- Harden Firefox privacy
- Configure Firefox
- Configure programs
This action belongs to Enable Firefox state partitioning (Total Cookie Protection) category. Web browsers, including Firefox, save various data types such as cookies, cache, and site-specific details. While this data helps in providing a faster and personalized browsing experience, it can be exploited by websites to track your activities across the internet, potentially compromising... Read more on category page ▶
This action belongs to Harden Firefox privacy category. The following are privacy-focused tweaks to prevent browser fingerprinting and tracking. See also: What is browser fingerprinting? | AmIUnique.org Read more on category page ▶
This action belongs to Configure Firefox category. Mozilla Firefox, colloquially known as Firefox, is a free and open-source web browser created by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. By default, Firefox collects telemetry data and has other features that gather information about your downloaded files and browsed... Read more on category page ▶
This action belongs to Configure programs category. These scripts configure third-party applications installed on Linux distributions to harden their security and privacy to protect your data. They scripts differ from OS level configurations as they configure applications that are not typically native to Linux distributions, i.e., not included in... Read more on category page ▶
Apply now
Choose one of three ways to apply:
- Automatically via privacy.sexy: The easiest and safest option.
- Manually by downloading: Requires downloading a file.
- Manually by copying: Advanced flexibility.
Alternative 1. Apply with Privacy.sexy
privacy.sexy is free and open-source application that lets securely apply this action easily.
You can fully restore this action (revert back to the original behavior) using the application.
privacy.sexy instructions
- Open or download the desktop application
- Search for the script name:
Disable outdated Firefox First-Party Isolation (FPI)
. - Check the script by clicking on the checkbox.
- Click on Run button at the bottom of the page.
Alternative 2. Download
This script is irreversible, meaning there is no straightforward method to restore changes once applied. Exercise caution before running, restoring it may not be possible.
-
Download the script file by clicking on the button below:
-
Run the script file by clicking on it.
Download revert script
This file restores your system to its original state, before this script is applied.
Alternative 3. Copy
This is for advanced users. Consider automatically applying or downloading the script for simpler way.
-
Open Terminal
-
Copy the following code:
pref_name='privacy.firstparty.isolate'
pref_value='false'
echo "Setting preference \"$pref_name\" to \"$pref_value\"."
declare -a profile_paths=(
~/.mozilla/firefox/*/
~/.var/app/org.mozilla.firefox/.mozilla/firefox/*/
~/snap/firefox/common/.mozilla/firefox/*/
)
declare -i total_profiles_found=0
for profile_dir in "${profile_paths[@]}"; do
if [ ! -d "$profile_dir" ]; then
continue
fi
if [[ ! "$(basename "$profile_dir")" =~ ^[a-z0-9]{8}\..+ ]]; then
continue # Not a profile folder
fi
((total_profiles_found++))
user_js_file="${profile_dir}user.js"
echo "$user_js_file:"
if [ ! -f "$user_js_file" ]; then
touch "$user_js_file"
echo $'\t''Created new user.js file'
fi
pref_start="user_pref(\"$pref_name\","
pref_line="user_pref(\"$pref_name\", $pref_value);"
if ! grep --quiet "^$pref_start" "${user_js_file}"; then
echo -n $'\n'"$pref_line" >> "$user_js_file"
echo $'\t'"Successfully added a new preference in $user_js_file."
elif grep --quiet "^$pref_line$" "$user_js_file"; then
echo $'\t'"Skipping, preference is already set as expected in $user_js_file."
else
sed --in-place "/^$pref_start/c\\$pref_line" "$user_js_file"
echo $'\t'"Successfully replaced the existing incorrect preference in $user_js_file."
fi
done
if [ "$total_profiles_found" -eq 0 ]; then
echo 'No profile folders are found, no changes are made.'
else
echo "Successfully verified preferences in $total_profiles_found profiles."
fi
- Paste the code into terminal.
- Press Enter to apply the code.
Some scripts requires restarting your computer to take affect.
Copy restore code
Copy and run the following code to restore changes:
pref_name='privacy.firstparty.isolate'
pref_value='false'
echo "Reverting preference: \"$pref_name\" to its default."
if command -v 'ps' &> /dev/null && ps aux | grep -i "[f]irefox" > /dev/null; then
>&2 echo -e "\e[33mWarning: Firefox is currently running. Please close Firefox before executing the revert script to ensure changes are applied effectively.\e[0m"
fi
declare -a files_to_modify=('prefs.js' 'user.js')
declare -a profile_paths=(
~/.mozilla/firefox/*/
~/.var/app/org.mozilla.firefox/.mozilla/firefox/*/
~/snap/firefox/common/.mozilla/firefox/*/
)
declare -i total_profiles_found=0
for profile_dir in "${profile_paths[@]}"; do
if [ ! -d "$profile_dir" ]; then
continue
fi
if [[ ! "$(basename "$profile_dir")" =~ ^[a-z0-9]{8}\..+ ]]; then
continue # Not a profile folder
fi
((total_profiles_found++))
for file_to_modify in "${files_to_modify[@]}"; do
config_file_path="${profile_dir}${file_to_modify}"
if [ ! -f "$config_file_path" ]; then
continue
fi
echo "$config_file_path:"
pref_start="user_pref(\"$pref_name\","
pref_line="user_pref(\"$pref_name\", $pref_value);"
if ! grep --quiet "^$pref_start" "${config_file_path}"; then
echo $'\t''Skipping, preference was not configured before.'
elif grep --quiet "^$pref_line$" "${config_file_path}"; then
sed --in-place "/^$pref_line/d" "$config_file_path"
echo $'\t''Successfully reverted preference to default.'
if ! grep --quiet '[^[:space:]]' "$config_file_path"; then
rm "$config_file_path"
echo $'\t'"Removed the file as it became empty."
fi
else
echo $'\t''Skipping, the preference has value that is not configured by privacy.sexy.'
fi
done
done
if [ "$total_profiles_found" -eq 0 ]; then
echo 'No reversion was necessary.'
else
echo "Successfully verified preferences in $total_profiles_found profiles."
fi
Support
This website relies on your support.
Your donation helps keep the project alive and improves its content ❤️.
Share this page: