Commit ed0a3862 authored by Tails developers's avatar Tails developers
Browse files

Modify a fresh Iceweasel profile instead of the system one.

If we're in camouflage mode we want it to be applied to the Unsafe
Browser as well. However, the camouflage activation script modifies
the *user's* own profile, not the system one, so it must be present at
this point, and then it's easier to also make all the other changes to
the user's profile since any changes to the system profile will not be
copied back in.
parent 7b7eae82
......@@ -152,14 +152,19 @@ configure_chroot () {
dpkg -l 'xul-ext-*' | /bin/grep '^ii' | awk '{print $2}' | \
xargs chroot ${CHROOT} dpkg --remove
# Create a fresh Iceweasel profile for the clearnet user
cp -a ${CHROOT}/etc/skel/.mozilla/ ${CHROOT}/home/clearnet/
chown -R clearnet:clearnet ${CHROOT}/home/clearnet/.mozilla/
CLEARNET_PROFILE=${CHROOT}/home/clearnet/.mozilla/firefox/default
# Disable proxying in the chroot
sed -r -i '/^(user_|)pref\("network\.proxy\..*",/d' \
${CHROOT}/etc/iceweasel/*/*.js
${CLEARNET_PROFILE}/*.js
echo 'user_pref("network.proxy.type", 0);' >> \
${CHROOT}/etc/iceweasel/profile/user.js
${CLEARNET_PROFILE}/user.js
echo 'user_pref("network.proxy.socks_remote_dns", false);' >> \
${CHROOT}/etc/iceweasel/profile/user.js
rm -rf ${CHROOT}/etc/iceweasel/profile/extensions
${CLEARNET_PROFILE}/user.js
rm -rf ${CLEARNET_PROFILE}/extensions
# Set a scary theme (except if we're using Windows camouflage)
if [ -z "${CAMOUFLAGE}" ]; then
......@@ -178,30 +183,30 @@ EOF
# Set start page to something that explains what's going on
echo 'user_pref("browser.startup.homepage", "'${START_PAGE}'");' >> \
${CHROOT}/etc/iceweasel/profile/user.js
${CLEARNET_PROFILE}/user.js
# Remove all bookmarks
rm -f ${CHROOT}/etc/iceweasel/profile/bookmarks.html
rm -f ${CLEARNET_PROFILE}/bookmarks.html
rm -f ${CLEARNET_PROFILE}/places.sqlite
# Make the English wikipedia the only available and default search
# engine (this is a documented cue for identifying the Unsafe Browser,
# which is extra important in camouflage mode when the scary coloured
# theme is disabled.)
find ${CHROOT}/etc/iceweasel/profile/searchplugins/ \
${CHROOT}/etc/iceweasel/searchplugins -name "*.xml" | \
find ${CLEARNET_PROFILE}/searchplugins -name "*.xml" | \
while read searchengine; do
if basename "$searchengine" | grep -qvi wikipedia; then
rm "${searchengine}"
fi
done
sed -i '/^user_pref("browser.search.defaultenginename",/d' \
${CHROOT}/etc/iceweasel/profile/user.js
${CLEARNET_PROFILE}/user.js
echo 'user_pref("browser.search.defaultenginename", "Wikipedia (en)");' >> \
${CHROOT}/etc/iceweasel/profile/user.js
${CLEARNET_PROFILE}/user.js
sed -i '/^user_pref("browser.search.selectedEngine",/d' \
${CHROOT}/etc/iceweasel/profile/user.js
${CLEARNET_PROFILE}/user.js
echo 'user_pref("browser.search.selectedEngine", "Wikipedia (en)");' >> \
${CHROOT}/etc/iceweasel/profile/user.js
${CLEARNET_PROFILE}/user.js
}
run_browser_in_chroot () {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment