-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfirefox-anon
executable file
·31 lines (26 loc) · 931 Bytes
/
firefox-anon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Copyright 2014 haxwithaxe
# License: CC0
# Launch firefox with a new separate profile in "private" mode.
PROFILE_TEMPLATE=$HOME/.local/share/firefox-anon/profile_template
profile_dir=$(mktemp -d /tmp/firefox-anon.XXX)
app_exec="firefox"
# To create a profile comment this line out and ...
cp -r $PROFILE_TEMPLATE/* $profile_dir
# uncomment this one ...
#$app_exec --CreateProfile "$(basename $profile_dir) $profile_dir"
# Then run this script once.
# Make changes to the config.
# Copy the profile directory it created to $PROFILE_TEMPLATE.
# Exit firefox and reverse the changes to this script.
$app_exec --profile $profile_dir \
--new-instance \
--private \
$*
echo "Shredding $profile_dir ..."
# Scrub the temporary profile files
# If this fails the profile directory will still be removed
find "$profile_dir" -type f -exec shred -ux {} \;
# Remove the profile directory
rm -rf "$profile_dir"
echo "Done."