summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks/12-install_browser_searchplugins
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-hooks/12-install_browser_searchplugins')
-rwxr-xr-xconfig/chroot_local-hooks/12-install_browser_searchplugins25
1 files changed, 25 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/12-install_browser_searchplugins b/config/chroot_local-hooks/12-install_browser_searchplugins
new file mode 100755
index 0000000..7884572
--- /dev/null
+++ b/config/chroot_local-hooks/12-install_browser_searchplugins
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+echo "Install extra browser search plugins"
+
+# Import the TBB_EXT variable
+. /usr/local/lib/tails-shell-library/tor-browser.sh
+
+LOCALIZED_PLUGINS_DIR=/usr/share/amnesia/browser/searchplugins/locale
+
+for langpack in "${TBB_EXT}"/langpack-*@firefox.mozilla.org.xpi; do
+ locale="$(basename "${langpack}" | sed 's,^langpack-\([^@]\+\)@.*$,\1,')"
+ pkg=iceweasel-l10n-"$(echo ${locale} | tr 'A-Z' 'a-z')"
+ tmp="$(mktemp -d)"
+ cd "${tmp}"
+ apt-get download "${pkg}"
+ ar x "${pkg}"*.deb
+ path_to_searchplugins=etc/iceweasel/searchplugins/locale/"${locale}"
+ tar xf data.tar.* --wildcards ./"${path_to_searchplugins}"/wikipedia-'*'.xml
+ mkdir -p "${LOCALIZED_PLUGINS_DIR}"/"${locale}"
+ cp "${path_to_searchplugins}"/* "${LOCALIZED_PLUGINS_DIR}"/"${locale}"
+ cd /
+ rm -r "${tmp}"
+done