Skip to content

Instantly share code, notes, and snippets.

@incredimike
Last active November 14, 2019 22:27
Show Gist options
  • Select an option

  • Save incredimike/36eea656e33ed7f21cede6cae27ac18f to your computer and use it in GitHub Desktop.

Select an option

Save incredimike/36eea656e33ed7f21cede6cae27ac18f to your computer and use it in GitHub Desktop.

Revisions

  1. incredimike revised this gist Nov 14, 2019. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions hsts-localhost-fix-firefox.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,14 @@
    #!/bin/bash

    FIND_NAME_PATTERN="'*.default'"
    # FIND_NAME_PATTERN="'*.dev-edition-default'"

    # 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-`

    echo $FF_PROFILE_DIR;

    # 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"
  2. incredimike created this gist Nov 14, 2019.
    16 changes: 16 additions & 0 deletions hsts-localhost-fix-firefox.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/bash

    FIND_NAME_PATTERN="'*.default'"
    # FIND_NAME_PATTERN="'*.dev-edition-default'"

    # Path to the Firefox Profiles directory
    FF_PROFILE_PATH="$HOME/Library/ApplicationSupport/Firefox/Profiles"

    # Get the "Default" path for your profile.
    FF_PROFILE_DIR=`cd $FF_PROFILE_PATH; find . -maxdepth 1 -name '*.default' | cut -sd / -f 2-`

    echo $FF_PROFILE_DIR;

    sed -i.bak '/localhost/d' $FF_PROFILE_PATH/$FF_PROFILE_DIR/SiteSecurityServiceState.txt

    /Applications/Firefox.app/Contents/MacOS/firefox -new-tab "about:restartrequired"