Commit dd0e21f8 authored by intrigeri's avatar intrigeri
Browse files

Merge branch 'feature/12635-tor-browser-7.0' into testing

parents 415c4457 da659888
......@@ -135,13 +135,12 @@ apply_extension_code_signing_hacks () {
diff -Naur a/chrome/toolkit/content/mozapps/extensions/extensions.js b/chrome/toolkit/content/mozapps/extensions/extensions.js
--- a/chrome/toolkit/content/mozapps/extensions/extensions.js 2000-01-01 00:00:00.000000000 +0000
+++ b/chrome/toolkit/content/mozapps/extensions/extensions.js 2000-01-01 00:00:00.000000000 +0000
@@ -282,7 +282,9 @@
@@ -282,7 +282,8 @@
// they aren't the correct type for signing.
if (aAddon.id == "torbutton@torproject.org" ||
aAddon.id == "tor-launcher@torproject.org" ||
- aAddon.id == "https-everywhere-eff@eff.org") {
+ aAddon.id == "https-everywhere-eff@eff.org" ||
+ aAddon.id == "branding@amnesia.boum.org" ||
+ aAddon.id == "uBlock0@raymondhill.net") {
return true;
}
......@@ -149,13 +148,12 @@ diff -Naur a/chrome/toolkit/content/mozapps/extensions/extensions.js b/chrome/to
diff -Naur a/modules/addons/XPIProvider.jsm b/modules/addons/XPIProvider.jsm
--- a/modules/addons/XPIProvider.jsm 2000-01-01 00:00:00.000000000 +0000
+++ b/modules/addons/XPIProvider.jsm 2000-01-01 00:00:00.000000000 +0000
@@ -749,7 +749,9 @@
@@ -749,7 +749,8 @@
if (aAddon.id == "torbutton@torproject.org" ||
aAddon.id == "tor-launcher@torproject.org" ||
aAddon.id == "https-everywhere-eff@eff.org" ||
- aAddon.id == "meek-http-helper@bamsoftware.com") {
+ aAddon.id == "meek-http-helper@bamsoftware.com" ||
+ aAddon.id == "branding@amnesia.boum.org" ||
+ aAddon.id == "uBlock0@raymondhill.net") {
return true;
}
......@@ -172,13 +170,12 @@ EOF
diff -Naur x/components/nsBrowserGlue.js y/components/nsBrowserGlue.js
--- a/components/nsBrowserGlue.js 2000-01-01 00:00:00.000000000 +0000
+++ b/components/nsBrowserGlue.js 2000-01-01 00:00:00.000000000 +0000
@@ -1122,7 +1122,9 @@
@@ -1122,7 +1122,8 @@
if ((addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) &&
!(addon.id == "torbutton@torproject.org" ||
addon.id == "tor-launcher@torproject.org" ||
- addon.id == "https-everywhere-eff@eff.org")) {
+ addon.id == "https-everywhere-eff@eff.org" ||
+ addon.id == "branding@amnesia.boum.org" ||
+ addon.id == "uBlock0@raymondhill.net")) {
this._notifyUnsignedAddonsDisabled();
break;
......@@ -202,6 +199,36 @@ EOF
)
}
# Modern Firefox doesn't apply browser.search.defaultenginename on
# start, and the other ways to get it to work (e.g. pre-generating
# search.json.mozlz4) seems rather complex. Instead, let's just make
# browser.search.defaultenginename work again by employing some
# Enterprise features to run arbitrary JavaScript with acces to the
# Firefox internals. For the details of this feature, see:
# https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment
apply_default_searchengine_hacks () {
local destination
destination="${1}"
cat > "${destination}/defaults/pref/autoconfig.js" <<EOF
// This file must start with a comment
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);
EOF
cat > "${destination}/mozilla.cfg" <<EOF
// This file must start with a comment
var searchService = Components.classes["@mozilla.org/browser/search-service;1"].getService(Components.interfaces.nsIBrowserSearchService);
var engineName = getPref("browser.search.defaultenginename");
if (engineName) {
var engine = searchService.getEngineByName(engineName);
if (engine) {
searchService.currentEngine = engine;
}
}
EOF
}
install_langpacks_from_bundles() {
local bundles_dir destination
bundles_dir="${1}"
......@@ -280,6 +307,7 @@ download_and_verify_files "${TBB_TARBALLS_BASE_URL}" "${TBB_TARBALLS}" "${TMP}"
install_tor_browser "${TMP}/${MAIN_TARBALL}" "${TBB_INSTALL}"
apply_extension_code_signing_hacks "${TBB_INSTALL}"
apply_default_searchengine_hacks "${TBB_INSTALL}"
mkdir -p "${TBB_EXT}"
if [ "${NIGHTLY_BUILD}" != yes ]; then
......
......@@ -8,9 +8,6 @@ echo "Localize each supported browser locale"
# supported_tor_browser_locales()
. /usr/local/lib/tails-shell-library/tor-browser.sh
# Import set_simple_config_key()
. /usr/local/lib/tails-shell-library/common.sh
# Import language_code_from_locale()
. /usr/local/lib/tails-shell-library/localization.sh
......@@ -23,8 +20,7 @@ echo "Localize each supported browser locale"
TBB_LOCALIZED_SEARCHPLUGINS_DIR="${TBB_INSTALL}/distribution/searchplugins/locale/"
BROWSER_LOCALIZATION_DIR="/usr/share/tails/browser-localization"
DESCRIPTIONS_FILE="${BROWSER_LOCALIZATION_DIR}/descriptions"
BRANDING_TEMPLATE_FILE="${BROWSER_LOCALIZATION_DIR}/amnesia.properties-template"
BRANDING_DIR="/usr/local/share/tor-browser-extensions/branding@amnesia.boum.org/"
LOCALE_PROFILES_DIR="/etc/tor-browser/locale-profiles/"
NO_SPELLCHECKER_LOCALES="ja ko nl pl tr zh"
# Sanity check that each supported Tor Browser locale has a
......@@ -114,13 +110,10 @@ while IFS=: read MOZILLA_LOCALE LOCATION LOCALIZED_LANG STARTPAGE_LANG STARTPAGE
rm "${LOCALIZED_WIKIPEDIA_ICON_PATH}" \
"${WIKIPEDIA_SEARCH_ICON_BASE64_PATH}"
# We use the branding@amnesia.org extension to set some per-locale
# default prefs that set the appropriate localization options.
TARGET_BRANDING_DIR="${BRANDING_DIR}/chrome/locale/${MOZILLA_LOCALE}"
echo "locale amnesiabranding ${MOZILLA_LOCALE} chrome/locale/${MOZILLA_LOCALE}/" >> "${BRANDING_DIR}/chrome.manifest"
mkdir -p "${TARGET_BRANDING_DIR}"
TARGET_BRANDING_FILE="${TARGET_BRANDING_DIR}/amnesia.properties"
cp "${BRANDING_TEMPLATE_FILE}" "${TARGET_BRANDING_FILE}"
# Our Tor Browser wrapper script will make use of the following
# per-locale profiles to set localized defaults for various prefs.
mkdir -p "${LOCALE_PROFILES_DIR}"
LOCALE_PROFILE_FILE="${LOCALE_PROFILES_DIR}/${MOZILLA_LOCALE}.js"
for KEY in browser.search.defaultenginename \
browser.search.selectedEngine; do
PLUGIN="DuckDuckGo - ${LOCALIZED_LANG}"
......@@ -128,7 +121,7 @@ while IFS=: read MOZILLA_LOCALE LOCATION LOCALIZED_LANG STARTPAGE_LANG STARTPAGE
echo "Trying to make search plugin '${PLUGIN}' the default for ${MOZILLA_LOCALE} but it unexpectedly wasn't the one we generated earlier" >&2
exit 1
fi
set_simple_config_key "${TARGET_BRANDING_FILE}" "${KEY}" "${PLUGIN}"
set_mozilla_pref "${LOCALE_PROFILE_FILE}" "${KEY}" "\"${PLUGIN}\""
done
TBB_DICTIONARIES_DIR="${TBB_INSTALL}/dictionaries"
unset SPELLCHECKER_LOCALE
......@@ -145,15 +138,15 @@ while IFS=: read MOZILLA_LOCALE LOCATION LOCALIZED_LANG STARTPAGE_LANG STARTPAGE
exit 1
fi
fi
set_simple_config_key "${TARGET_BRANDING_FILE}" \
set_mozilla_pref "${LOCALE_PROFILE_FILE}" \
"spellchecker.dictionary" \
"${SPELLCHECKER_LOCALE}"
"\"${SPELLCHECKER_LOCALE}\""
HOMEPAGE="https://tails.boum.org/home/"
if echo "${TAILS_WIKI_SUPPORTED_LANGUAGES}" | grep -qw "${LANG_CODE}"; then
HOMEPAGE="${HOMEPAGE}index.${LANG_CODE}.html"
fi
set_simple_config_key "${TARGET_BRANDING_FILE}" \
"browser.startup.homepage" "${HOMEPAGE}"
set_mozilla_pref "${LOCALE_PROFILE_FILE}" \
"browser.startup.homepage" "\"${HOMEPAGE}\"" "user_pref"
done < "${DESCRIPTIONS_FILE}"
# This directory is not needed after build time.
......@@ -201,5 +194,5 @@ done
# All generated and modified files must remain world-readable.
chmod -R a+rX "${TBB_LOCALIZED_SEARCHPLUGINS_DIR}" \
"${BRANDING_DIR}" \
"${LOCALE_PROFILES_DIR}" \
"${TBB_EXT}"
#!/bin/sh
set -e
echo "Overriding TBB branding with our own"
# Import the TBB_PROFILE variable.
. /usr/local/lib/tails-shell-library/tor-browser.sh
install --owner root --group root --mode 0755 --directory /etc/xul-ext
install --owner root --group root --mode 0644 \
"${TBB_PROFILE}"/extensions/branding@amnesia.boum.org/defaults/preferences/prefs.js \
/etc/xul-ext/torbutton.js
......@@ -77,8 +77,8 @@ pref("browser.newtabpage.directory.ping", "");
pref("browser.newtabpage.introShown", true);
// Don't use geographically specific search prefs, like
// browser.search.*.US for US locales. Our generated amnesia branding
// add-on localizes search-engines in an incompatible but equivalent
// browser.search.*.US for US locales. Our generated localization
// profiles localizes search-engines in an incompatible but equivalent
// way.
pref("browser.search.geoSpecificDefaults", false);
......@@ -90,7 +90,3 @@ pref("browser.download.panel.shown", true);
// open external applications, so let's not offer the option to the user,
// and instead only propose them to save downloaded files.
pref("browser.download.forbid_open_with", true);
// Web pages does not render when e10s is enabled, so we have to
// disable it. Note that the "user_"-prefix is required.
user_pref("browser.tabs.remote.autostart.2", false);
......@@ -15,7 +15,7 @@ set_mozilla_pref() {
value="${3}"
# Sometimes we might want to do e.g. user_pref
prefix="${4:-pref}"
sed -i "/^${prefix}(\"${name}\",/d" "${file}"
[ -e "${file}" ] && sed -i "/^${prefix}(\"${name}\",/d" "${file}"
echo "${prefix}(\"${name}\", ${value});" >> "${file}"
}
......@@ -93,7 +93,12 @@ configure_xulrunner_app_locale() {
}
configure_best_tor_browser_locale() {
configure_xulrunner_app_locale "${1}" "$(guess_best_tor_browser_locale)"
local profile best_locale
profile="${1}"
best_locale="$(guess_best_tor_browser_locale)"
configure_xulrunner_app_locale "${profile}" "${best_locale}"
cat "/etc/tor-browser/locale-profiles/${best_locale}.js" \
>> "${profile}/preferences/0000locale.js"
}
configure_best_tor_launcher_locale() {
......
pref("browser.search.defaultenginename", "chrome://amnesiabranding/locale/amnesia.properties");
pref("browser.search.selectedEngine", "chrome://amnesiabranding/locale/amnesia.properties");
pref("browser.startup.homepage", "chrome://amnesiabranding/locale/amnesia.properties");
pref("spellchecker.dictionary", "chrome://amnesiabranding/locale/amnesia.properties");
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>branding@amnesia.boum.org</em:id>
<em:name>amnesia branding</em:name>
<em:version>0.2</em:version>
<em:creator>amnesia</em:creator>
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>10.0.999</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
http://torbrowser-archive.tails.boum.org/7.0a4/
http://torbrowser-archive.tails.boum.org/7.0-build1/
296b52125efc67e4fc77b7ef90ec97d155314134b26ea18a355d83a2a79359dc tor-browser-linux64-7.0a4_ar.tar.xz
bccf48a8ad0c0ea83538313d635bf2f425610725604fe7bb05a2586b9455243b tor-browser-linux64-7.0a4_de.tar.xz
615547c4230ac398bbd829a9df98d8303668ac2c5207a6c9277cf12b9fe39d58 tor-browser-linux64-7.0a4_en-US.tar.xz
7d6be9584fc782e8606f2f1c2b66795829bce99d7cab6671d97aae8d5923aa3f tor-browser-linux64-7.0a4_es-ES.tar.xz
92effc01fa8385c494495c39727b0b0c6706386e8556a084c22680e8e29003d9 tor-browser-linux64-7.0a4_fa.tar.xz
66679a4456777f092b8ac33c63a2e2d1b35e286023e89436d2867f3f919a0844 tor-browser-linux64-7.0a4_fr.tar.xz
868080def32dd904fd52395ccdce0a14cf225e09edcae07efae3f2567faa4f52 tor-browser-linux64-7.0a4_it.tar.xz
df056bd086a85272c6180c833c3e859c8ed87fffc891d47c382b7df5b0715889 tor-browser-linux64-7.0a4_ja.tar.xz
690d392b9bd4828cef8191956a5bf40e9cf7daf10ce1cb9eb1f47eda3a119a00 tor-browser-linux64-7.0a4_ko.tar.xz
043c1ab5892ee51205156766817b042273b4aa5e70e8c0afbe27424592fbe4e1 tor-browser-linux64-7.0a4_nl.tar.xz
19d47c0a1d03bb79b7883717c9eee8d023cff04eb4f8d003e73f5dbf7f71df6f tor-browser-linux64-7.0a4_pl.tar.xz
fda1204abc9caca7cee8ee52b383887a15410d7cd77179c43b4df2b2dd02b3ee tor-browser-linux64-7.0a4_pt-BR.tar.xz
6d32a08d5901ceaeae4684d3baab47e6ead6d70d6129abeeae5d757007e358b4 tor-browser-linux64-7.0a4_ru.tar.xz
651c194b85b2b5addbb1846859caeda100baca8f833bf97dfd54da493a9befe2 tor-browser-linux64-7.0a4_tr.tar.xz
a18b5e88500d04e4632436896831c75a26b6d874b525361312fe1ae14881d6d1 tor-browser-linux64-7.0a4_vi.tar.xz
333349c27959c94053ec375aa66fd902a6e30426d383ae4105a3a7b1f23eb489 tor-browser-linux64-7.0a4_zh-CN.tar.xz
06779c24f98ff238181440ba9baab820f7c41fed0c9a1e0fe622e0dcb6bfb32e tor-browser-linux64-7.0_ar.tar.xz
be7792d20ac44a2c38fbdda85b4d554466481309023348c5a6ad0259d1cfa426 tor-browser-linux64-7.0_de.tar.xz
3cc3d5ab5856d47e4f3c609d945c2deb1ca9a676c6ff0e7c3b6689fc1f9b537a tor-browser-linux64-7.0_en-US.tar.xz
b3da0a75a07d4314814ad431bbabe4b3d6b9c1abea06be95d57f9a1a490a090e tor-browser-linux64-7.0_es-ES.tar.xz
3c559bb299b41775b50a4482570733b38a67cf90714a28ab002ecca1e801287d tor-browser-linux64-7.0_fa.tar.xz
edf065549146f6d099ac3822e511ca506d6b135be0b0cd1e826b46f31d358b16 tor-browser-linux64-7.0_fr.tar.xz
be0fc9f64516e0a6df7640c28a1ef6911165209f60cd5fd9f7c1a60989fb4287 tor-browser-linux64-7.0_it.tar.xz
3e7e7a5028e3c81d82e85c2ae4188826245c072dccf291926b63c9effc465457 tor-browser-linux64-7.0_ja.tar.xz
74ffd47a910f74c5c96fd07cf92ae694bb79002adb5bc5b8e099564a077ac41b tor-browser-linux64-7.0_ko.tar.xz
ea6bca88583cbebeddee075bf8f5352bb4c31d8353c4d1b9a13471b73634712f tor-browser-linux64-7.0_nl.tar.xz
61fb36c61704eb755f8221997a2fdb530004477d24dfeb2efc2c76b8aa3a792c tor-browser-linux64-7.0_pl.tar.xz
0e70dccc0f7fd09cdd9df42aa77fcb15ad28cf27daf14ea621c2b50ed0f7415f tor-browser-linux64-7.0_pt-BR.tar.xz
f1e1e1c88333d5eb33849482b6ac4442be6a396b5976a0ddfcd401d73f6a15d2 tor-browser-linux64-7.0_ru.tar.xz
4552c2b914623310e54366fed4d71f8b457fae9fd9ddc1da12fb7f4d85dcf0ff tor-browser-linux64-7.0_tr.tar.xz
001a9b45413744b4728aa8a8aedef0a72c59d5bce249dd6edc5b6e875455edc6 tor-browser-linux64-7.0_vi.tar.xz
d98e0b559fac5b8c2ca8c5e06eeb65e83a08c28f67ba646cc6d9b1c9c00ee07f tor-browser-linux64-7.0_zh-CN.tar.xz
......@@ -102,7 +102,7 @@
/etc/mailcap r,
/etc/mime.types r,
@@ -83,6 +92,30 @@
@@ -83,6 +92,34 @@
/sys/devices/pci[0-9]*/**/uevent r,
owner /{dev,run}/shm/shmfd-* rw,
......@@ -115,6 +115,10 @@
+
+ /usr/local/lib/tor-browser/firefox Pix,
+
+ # Required for e10s
+ /usr/local/lib/tor-browser/plugin-container Pix,
+ owner /dev/shm/org.chromium.* rw,
+
+ # Grant access to assistive technologies
+ # (otherwise, Firefox crashes when Orca is enabled:
+ # https://labs.riseup.net/code/issues/9261)
......
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