[tor-commits] [tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Add mobile-override of 000-tor-browser prefs
gk at torproject.org
gk at torproject.org
Fri Jul 27 08:37:27 UTC 2018
commit b5a6b33814d32a25a41b0d21f02447e1b630ec4f
Author: Matthew Finkel <Matthew.Finkel at gmail.com>
Date: Fri Jan 19 23:49:11 2018 +0000
Bug 25741 - TBA: Add mobile-override of 000-tor-browser prefs
---
.eslintignore | 3 ++
mobile/android/app/000-tor-browser-android.js | 58 +++++++++++++++++++++++++++
mobile/android/app/mobile.js | 4 ++
mobile/android/app/moz.build | 1 +
mobile/android/installer/package-manifest.in | 1 +
5 files changed, 67 insertions(+)
diff --git a/.eslintignore b/.eslintignore
index 3fcc46db7ded..69f27d2366ec 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -326,6 +326,9 @@ media/webrtc/trunk/**
# mobile/android/ exclusions
mobile/android/tests/browser/chrome/tp5/**
+# uses `#include`
+mobile/android/app/000-tor-browser-android.js
+
# Uses `#filter substitution`
mobile/android/app/mobile.js
mobile/android/app/geckoview-prefs.js
diff --git a/mobile/android/app/000-tor-browser-android.js b/mobile/android/app/000-tor-browser-android.js
new file mode 100644
index 000000000000..399c6f07718b
--- /dev/null
+++ b/mobile/android/app/000-tor-browser-android.js
@@ -0,0 +1,58 @@
+// Import all prefs from the canonical file
+// We override mobile-specific prefs below
+// Tor Browser for Android
+// Do not edit this file.
+
+#include ../../../browser/app/profile/000-tor-browser.js
+
+
+// Disable Presentation API
+pref("dom.presentation.controller.enabled", false);
+pref("dom.presentation.enabled", false);
+pref("dom.presentation.discoverable", false);
+pref("dom.presentation.discoverable.encrypted", false);
+pref("dom.presentation.discovery.enabled", false);
+pref("dom.presentation.receiver.enabled", false);
+
+pref("dom.audiochannel.audioCompeting", false);
+pref("dom.audiochannel.mediaControl", false);
+
+// Space separated list of URLs that are allowed to send objects (instead of
+// only strings) through webchannels. This list is duplicated in browser/app/profile/firefox.js
+pref("webchannel.allowObject.urlWhitelist", "");
+
+// Disable browser auto updaters
+pref("app.update.auto", false);
+pref("app.update.enabled", false);
+pref("browser.startup.homepage_override.mstone", "ignore");
+
+// Clear data on quit
+pref("privacy.clearOnShutdown.cache", true);
+pref("privacy.clearOnShutdown.cookies",true);
+pref("privacy.clearOnShutdown.downloads",true);
+pref("privacy.clearOnShutdown.formdata",true);
+pref("privacy.clearOnShutdown.history",true);
+pref("privacy.clearOnShutdown.offlineApps",true);
+pref("privacy.clearOnShutdown.passwords",true);
+pref("privacy.clearOnShutdown.sessions",true);
+pref("privacy.clearOnShutdown.siteSettings",true);
+
+// Disable Control media casting & mirroring features
+pref("browser.casting.enabled", false);
+pref("browser.mirroring.enabled", false);
+
+// Disable autoplay
+pref("media.autoplay.enabled", false);
+
+// controls if we want camera support
+pref("device.camera.enabled", false);
+pref("media.realtime_decoder.enabled", false);
+
+// Do not fetch updated per-site user-agent strings from Mozilla
+// See ua-update.json.in for the packaged UA override list
+// See https://bugzilla.mozilla.org/show_bug.cgi?id=897221
+pref("general.useragent.updates.enabled", false);
+pref("general.useragent.updates.url", "");
+
+// Override this because Orbot uses 9050 as the default
+pref("network.proxy.socks_port", 9050);
diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js
index a11e1b033396..052ebdec5948 100644
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -504,7 +504,11 @@ pref("app.update.timerMinimumDelay", 30); // seconds
// used by update service to decide whether or not to
// automatically download an update
pref("app.update.autodownload", "wifi");
+#ifdef TOR_BROWSER_VERSION
+pref("app.update.url.android", "");
+#else
pref("app.update.url.android", "https://aus5.mozilla.org/update/4/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%MOZ_VERSION%/update.xml");
+#endif
#ifdef MOZ_UPDATER
/* prefs used specifically for updating the app */
diff --git a/mobile/android/app/moz.build b/mobile/android/app/moz.build
index 8ff152f3b369..773c1a3979a8 100644
--- a/mobile/android/app/moz.build
+++ b/mobile/android/app/moz.build
@@ -49,6 +49,7 @@ if CONFIG['MOZ_PKG_SPECIAL']:
DEFINES['MOZ_PKG_SPECIAL'] = CONFIG['MOZ_PKG_SPECIAL']
JS_PREFERENCE_PP_FILES += [
+ '000-tor-browser-android.js',
'geckoview-prefs.js',
'mobile.js',
]
diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in
index 6f6a02082bec..8a2a356c151c 100644
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -431,6 +431,7 @@
#ifdef MOZ_GECKOVIEW_JAR
@BINPATH@/@PREF_DIR@/geckoview-prefs.js
#else
+ at BINPATH@/@PREF_DIR@/000-tor-browser-android.js
@BINPATH@/@PREF_DIR@/mobile.js
#endif
@BINPATH@/@PREF_DIR@/channel-prefs.js
More information about the tor-commits
mailing list