[tbb-commits] [tor-browser/tor-browser-68.1.0esr-9.0-1] Bug 25741 - TBA: Add mobile-override of 000-tor-browser prefs

gk at torproject.org gk at torproject.org
Sat Aug 31 19:46:16 UTC 2019


commit f0c4f9219012e04982d99f92c2808716bc8b9cc4
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 | 61 +++++++++++++++++++++++++++
 mobile/android/app/mobile.js                  |  4 ++
 mobile/android/app/moz.build                  |  1 +
 mobile/android/installer/package-manifest.in  |  1 +
 5 files changed, 70 insertions(+)

diff --git a/.eslintignore b/.eslintignore
index 2fc0d61fabe5..e8dbe3a037a3 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -227,6 +227,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..02e3ef00c1b3
--- /dev/null
+++ b/mobile/android/app/000-tor-browser-android.js
@@ -0,0 +1,61 @@
+// 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", "");
+
+// Enable touch events on Android (highlighting text, etc)
+pref("dom.w3c_touch_events.enabled", 2);
+
+// Inherit locale from the OS, used for multi-locale builds
+pref("intl.locale.requested", "");
diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js
index 9d4f331e968f..1d69f082da27 100644
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -483,7 +483,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 3d014cbc6e67..2002a894fc51 100644
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -168,6 +168,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 tbb-commits mailing list