Skip to content

Instantly share code, notes, and snippets.

@incredimike
Last active November 14, 2019 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incredimike/36eea656e33ed7f21cede6cae27ac18f to your computer and use it in GitHub Desktop.
Save incredimike/36eea656e33ed7f21cede6cae27ac18f to your computer and use it in GitHub Desktop.
Small script that will delete the localhost entry in the Firefox SiteSecurityServiceState.txt file, then prompt you to restart your browser using about:restartrequred. Restarting this way should preserve your tabs.
#!/bin/bash
# Path to the Firefox Profiles directory
FF_PROFILE_PATH="$HOME/Library/ApplicationSupport/Firefox/Profiles"
# Get the "Default" path for your profile.
# Alternatively look for '*.dev-edition-default'
FF_PROFILE_DIR=`cd $FF_PROFILE_PATH; find . -maxdepth 1 -name '*.default' | cut -sd / -f 2-`
# Remove the localhost line in the file, and create a backup
sed -i.bak '/localhost/d' $FF_PROFILE_PATH/$FF_PROFILE_DIR/SiteSecurityServiceState.txt
# Prompt to restart Firefox
/Applications/Firefox.app/Contents/MacOS/firefox -new-tab "about:restartrequired"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment