work around profile creation issues in a recent Firefox versions with an ugly hack
This commit is contained in:
parent
2e97d33757
commit
e738e875bb
|
|
@ -3,13 +3,6 @@ set -e
|
||||||
COMMAND="$1"
|
COMMAND="$1"
|
||||||
echo "$COMMAND"
|
echo "$COMMAND"
|
||||||
|
|
||||||
# If no profile ...
|
|
||||||
if [ ! -d "$HOME/.mozilla" ]; then
|
|
||||||
# create the default Firefox profile and put some settings there
|
|
||||||
firefox -CreateProfile default
|
|
||||||
mv $HOME/user.js `find $HOME/.mozilla/firefox -type d | grep .default`
|
|
||||||
fi
|
|
||||||
|
|
||||||
OPENVPN_CONF='/etc/openvpn/openvpn.conf'
|
OPENVPN_CONF='/etc/openvpn/openvpn.conf'
|
||||||
if [ -f "$OPENVPN_CONF" ]; then
|
if [ -f "$OPENVPN_CONF" ]; then
|
||||||
"$HOME/start-openvpn-blocking.sh" "$OPENVPN_CONF"
|
"$HOME/start-openvpn-blocking.sh" "$OPENVPN_CONF"
|
||||||
|
|
@ -31,5 +24,24 @@ if [ ! -z ${ASSERT_COUNTRY+x} ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start firefox
|
# If no profile ...
|
||||||
|
if [ $COMMAND == "firefox" ]; then
|
||||||
|
# create the default Firefox profile and put some settings there
|
||||||
|
firefox &
|
||||||
|
FIREFOX_PID=$!
|
||||||
|
# Since some recent Firefox version, calling CreateProfile and copying
|
||||||
|
# user.js stopped working on the first use for reasons I could not find on
|
||||||
|
# Google and do not frankly care about. This is the workaround
|
||||||
|
set +e
|
||||||
|
while [ `find $HOME/.mozilla/firefox -type f | grep prefs.js | wc -l` == "0" ];
|
||||||
|
do
|
||||||
|
echo "... waiting for Firefox to start the first time"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
set -e
|
||||||
|
echo "killing Firefox and copying settings"
|
||||||
|
kill $FIREFOX_PID
|
||||||
|
mv $HOME/user.js `find $HOME/.mozilla/firefox -maxdepth 1 -type d | grep .default-release`
|
||||||
|
fi
|
||||||
|
|
||||||
$COMMAND
|
$COMMAND
|
||||||
|
|
|
||||||
1
run.sh
1
run.sh
|
|
@ -6,6 +6,7 @@ docker run -ti --rm -e DISPLAY \
|
||||||
-v `pwd`/openvpn:/etc/openvpn \
|
-v `pwd`/openvpn:/etc/openvpn \
|
||||||
-v `pwd`/shared:/home/user/Downloads \
|
-v `pwd`/shared:/home/user/Downloads \
|
||||||
-e ASSERT_COUNTRY \
|
-e ASSERT_COUNTRY \
|
||||||
|
--name docker-vpn-browser-container \
|
||||||
--dns 1.1.1.1 \
|
--dns 1.1.1.1 \
|
||||||
docker-vpn-browser \
|
docker-vpn-browser \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue