Once every other while it's useful to have a browser that's not connected to the normal browsing profile (I know. Don't say it. I've been here a while).
These are two shell scripts that create a new profile for Firefox and Chrome in a temporary directory, start the browser using that profile and remove the directory afterwards.
Chrome
#!/bin/bash
trap cleanup EXIT
die() {
echo $@
exit 1
}
cleanup() {
[ -d ${CHROMETMP} ] && rm -rf ${CHROMETMP}
}
CHROMETMP=$(mktemp -d)
[ -d ${CHROMETMP} ] || die "Could not create temp dir"
chromium-browser --user-data-dir="${CHROMETMP}"
Firefox
#!/bin/bash
trap cleanup EXIT
die() {
echo $@
exit 1
}
cleanup() {
[ -d ${FIREFOXTMP} ] && rm -rf ${FIREFOXTMP}
}
FIREFOXTMP=$(mktemp -d)
[ -d ${FIREFOXTMP} ] || die "Could not create temp dir"
export HOME=${FIREFOXTMP}
firefox -no-remote -CreateProfile 'throwaway' || die "Could not create profile"
firefox -no-remote -P 'throwaway'