Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 48 lines (40 sloc) 1.27 KB
#!/bin/bash
help() {
echo 'usage: bromium [--enable-cookies] [URL]'
echo ' bromium --help'
echo
echo ' Run chromium with an empty temporary profile.'
echo
echo ' By default bromium will run in "incognito"'
echo ' mode. If you want to allow cookies then'
echo ' use --enable-cookies'
echo
echo ' If you are using bromium as a privacy tool'
echo ' then you may want to consider changing your'
echo ' default search provider. See'
echo ' https://stackoverflow.com/a/50888866'
echo
exit 1
}
[ "$1" == "--help" ] && help
tmp_user_dir=$( mktemp -d /tmp/bromium.XXXX )
# see http://peter.sh/experiments/chromium-command-line-switches/ for options
if [ "$1" == "--enable-cookies" ]; then
incognito=""
shift
else
incognito="--incognito"
fi
if [ "$1" ]; then
chromium --user-data-dir="$tmp_user_dir" --temp-profile --password-store=basic --disable-notifications $incognito "$@"
else
chromium --user-data-dir="$tmp_user_dir" --temp-profile --password-store=basic --disable-notifications $incognito "about:blank"
fi
# be really sure that "$tmp_user_dir" contains a correct tmpdir
# before rm -rf /* or such
#
if [[ "$tmp_user_dir" =~ /tmp/bromium ]]; then
rm -r "$tmp_user_dir"
else
echo "hae? $tmp_user_dir"
fi
You can’t perform that action at this time.