summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh')
-rw-r--r--config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh32
1 files changed, 23 insertions, 9 deletions
diff --git a/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh b/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
index 93fe389..ee3c0cf 100644
--- a/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
+++ b/config/chroot_local-includes/usr/local/lib/tails-shell-library/tor-browser.sh
@@ -11,20 +11,34 @@ exec_firefox() {
exec "${TBB_INSTALL}"/firefox "${@}"
}
+exec_unconfined_firefox() {
+ LD_LIBRARY_PATH="${TBB_INSTALL}"
+ export LD_LIBRARY_PATH
+ exec "${TBB_INSTALL}"/firefox-unconfined "${@}"
+}
+
guess_best_tor_browser_locale() {
- local long_locale short_locale
+ local long_locale short_locale similar_locale
long_locale="$(echo ${LANG} | sed -e 's/\..*$//' -e 's/_/-/')"
short_locale="$(echo ${long_locale} | cut -d"-" -f1)"
if [ -e "${TBB_EXT}/langpack-${long_locale}@firefox.mozilla.org.xpi" ]; then
- echo ${long_locale}
- elif ls -1 "${TBB_EXT}" | grep -q "^langpack-${short_locale}\(-[A-Z]\+\)\?@firefox.mozilla.org.xpi$"; then
- # If we use locale xx-YY and there is no langpack for xx nor
- # xx-YY but there is one for xx-ZZ, then Firefox is smart
- # enough to use the xx-ZZ langpack if we set the locale to xx.
- echo ${short_locale}
- else
- echo en-US
+ echo "${long_locale}"
+ return
+ elif [ -e "${TBB_EXT}/langpack-${short_locale}@firefox.mozilla.org.xpi" ]; then
+ echo "${short_locale}"
+ return
fi
+ # If we use locale xx-YY and there is no langpack for xx-YY nor xx
+ # there may be a similar locale xx-ZZ that we should use instead.
+ similar_locale="$(ls -1 "${TBB_EXT}" | \
+ sed -n "s,^langpack-\(${short_locale}-[A-Z]\+\)@firefox.mozilla.org.xpi$,\1,p" | \
+ head -n 1)" || :
+ if [ -n "${similar_locale}" ]; then
+ echo "${similar_locale}"
+ return
+ fi
+
+ echo 'en-US'
}
guess_best_tor_launcher_locale() {