Commit d318f00f authored by intrigeri's avatar intrigeri
Browse files

Delete all search plugins for the chroot'ed browsers (refs: #15708).

I did not manage to prevent the omnibar from allowing search
so let's simply delete the search plugins, which is the same,
from an end-user perspective, as before: we hid the search bar
via userChrome.css.

I'm not removing this one-liner in userChrome.css though, just in case it's
re-enabled by default at some point via Tor Browser prefs or something.
parent f6627223
......@@ -211,6 +211,34 @@ set_chroot_browser_name () {
rm -Rf "${tmp}"
}
delete_chroot_browser_searchplugins() {
local chroot="${1}"
local locale="${2}"
local ext_dir="${chroot}/${TBB_EXT}"
if [ "${locale}" != "en-US" ]; then
pack="${ext_dir}/langpack-${locale}@firefox.mozilla.org.xpi"
top="browser/chrome"
rest="${locale}/locale"
else
pack="${chroot}/${TBB_INSTALL}/browser/omni.ja"
top="chrome"
rest="en-US/locale"
fi
local searchplugins_dir="${top}/${rest}/browser/searchplugins"
local searchplugins_list="${searchplugins_dir}/list.json"
local tmp="$(mktemp -d)"
(
cd "${tmp}"
7z x -tzip "${pack}" "${searchplugins_dir}"
ls "${searchplugins_dir}"/*.xml | xargs 7z d -tzip
echo '{"default": {"visibleDefaultEngines": []}, "experimental-hidden": {"visibleDefaultEngines": []}}' \
> "${searchplugins_list}"
7z u -tzip "${pack}" "${searchplugins_list}"
)
rm -r "${tmp}"
}
configure_chroot_browser () {
local chroot="${1}" ; shift
local browser_user="${1}" ; shift
......@@ -227,6 +255,7 @@ configure_chroot_browser () {
"${best_locale}"
set_chroot_browser_name "${chroot}" "${human_readable_name}" \
"${browser_name}" "${browser_user}" "${best_locale}"
delete_chroot_browser_searchplugins "${chroot}" "${best_locale}"
set_chroot_browser_permissions "${chroot}" "${browser_name}" \
"${browser_user}"
}
......
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