OpenSecurity/vm/usr/local/bin/ff
author om
Mon, 02 Dec 2013 16:02:00 +0100
changeset 5 166c38b8b6ed
child 6 088f4b20dbbc
permissions -rwxr-xr-x
added multiple session firefox script
     1 #!/bin/bash
     2 
     3 # create a disposable firefox session
     4 #
     5 # Remark:   this script expects the firefox sessions
     6 #           to be stored in ~/.mozilla/fireofx
     7 #
     8 
     9 # pick the next profile number
    10 PROFILE_NUMBER=$(new_firefox_profile_id.py)
    11 PROFILE_PATH=$(basename $(mktemp -d ~/.mozilla/firefox/XXXXXXXX.os_user_${PROFILE_NUMBER}))
    12 PROFILE_TIMESTAMP="$(date +%s)000"
    13 PROFILE_NAME=$(echo ${PROFILE_PATH} | awk -F '.' '{ print $NF; }')
    14 
    15 # create a fake times.json
    16 cat > ${PROFILE_PATH}/times.json << __EO_TIMES_JSON__
    17 {
    18 "created": ${PROFILE_TIMESTAMP}
    19 }
    20 __EO_TIMES_JSON__
    21 
    22 # add out new "profile" to firefox
    23 cat >> ~/.mozilla/firefox/profiles.ini << __EO_PROFILES_INI__
    24 [Profile${PROFILE_NUMBER}]
    25 Name=${PROFILE_NAME}
    26 IsRelative=1
    27 Path=${PROFILE_PATH}
    28 
    29 __EO_PROFILES_INI__
    30 
    31 
    32 # launch firefox
    33 firefox -P ${PROFILE_NAME} -no-remote $@