[tbb-commits] [tor-browser/tor-browser-52.7.2esr-8.0-1] fix #17 from https://github.com/amoghbl1/tor-browser/issues don't restore tabs by default
gk at torproject.org
gk at torproject.org
Tue Mar 20 11:26:34 UTC 2018
commit e311353ec9e015992ae672834cfa9de796cb0ece
Author: n8fr8 <nathan at freitas.net>
Date: Mon Jul 17 13:33:42 2017 -0400
fix #17 from https://github.com/amoghbl1/tor-browser/issues don't restore tabs by default
fix #11 from https://github.com/amoghbl1/tor-browser/issues
turn off health report by default
search history disabled by default
fixes #12 sets private data to clear by default
disable camera permissions as part of WebRTC disable #15
more work on #15 to remove permissions
disable search history for v11+ as well
work on #15 to disable location permissions
ensure search history is off by default
make sure voice and qr is disabled by default
make sure autoplay is off by default
Signed-off-by: Amogh Pradeep <amoghbl1 at gmail.com>
---
.../android/base/FennecManifest_permissions.xml.in | 12 ++++++++++-
.../java/org/mozilla/gecko/home/BrowserSearch.java | 2 +-
.../org/mozilla/gecko/home/SearchEngineRow.java | 2 +-
.../mozilla/gecko/toolbar/ToolbarEditLayout.java | 4 ++--
mobile/android/base/resources/values/arrays.xml | 24 +++++++++++-----------
.../base/resources/xml-v11/preferences_search.xml | 2 +-
.../base/resources/xml/preferences_advanced.xml | 6 ++++--
.../base/resources/xml/preferences_privacy.xml | 2 +-
.../base/resources/xml/preferences_search.xml | 2 +-
.../android/geckoview/src/main/AndroidManifest.xml | 4 ++++
mobile/android/modules/RuntimePermissions.jsm | 2 +-
.../SearchAndroidManifest_permissions.xml.in | 2 ++
modules/libpref/init/all.js | 2 +-
13 files changed, 42 insertions(+), 24 deletions(-)
diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in
index cf3365582cb3..e711ce6a19de 100644
--- a/mobile/android/base/FennecManifest_permissions.xml.in
+++ b/mobile/android/base/FennecManifest_permissions.xml.in
@@ -17,9 +17,15 @@
(potentially) of the push feature. -->
#include GcmAndroidManifest_permissions.xml.in
+#ifdef MOZ_WIFI_STATE
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+#endif
+
+#ifdef MOZ_LOCATION
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+#endif
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
@@ -34,12 +40,16 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
+
#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
#endif
+#ifdef MOZ_LOCATION
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
+#endif
+
<uses-feature android:name="android.hardware.touchscreen"/>
<!-- Tab Queue -->
@@ -56,10 +66,10 @@
<uses-feature android:name="android.hardware.audio.low_latency" android:required="false"/>
<uses-feature android:name="android.hardware.camera.any" android:required="false"/>
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
-#endif
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
+#endif
<!-- App requires OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
diff --git a/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java b/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java
index 7732932fe3e5..4f029fcc331b 100644
--- a/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java
@@ -275,7 +275,7 @@ public class BrowserSearch extends HomeFragment
super.onResume();
final SharedPreferences prefs = GeckoSharedPrefs.forApp(getContext());
- mSavedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, true);
+ mSavedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, false);
// Fetch engines if we need to.
if (mSearchEngines.isEmpty() || !Locale.getDefault().equals(mLastLocale)) {
diff --git a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
index 5b97a8f5f7e9..39e9bc2865b7 100644
--- a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
@@ -391,7 +391,7 @@ class SearchEngineRow extends AnimatedHeightLayout {
final int recycledSuggestionCount = mSuggestionView.getChildCount();
final SharedPreferences prefs = GeckoSharedPrefs.forApp(getContext());
- final boolean savedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, true);
+ final boolean savedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, false);
// Remove duplicates of search engine suggestions from saved searches.
List<String> searchHistorySuggestions = (rawSearchHistorySuggestions != null) ? rawSearchHistorySuggestions : new ArrayList<String>();
diff --git a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
index c9731a4014d6..c0cee5eeaadd 100644
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
@@ -278,7 +278,7 @@ public class ToolbarEditLayout extends ThemedLinearLayout {
return false;
}
return GeckoSharedPrefs.forApp(context)
- .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, true);
+ .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, false);
}
private void launchVoiceRecognizer() {
@@ -315,7 +315,7 @@ public class ToolbarEditLayout extends ThemedLinearLayout {
return false;
}
return GeckoSharedPrefs.forApp(context)
- .getBoolean(GeckoPreferences.PREFS_QRCODE_ENABLED, true);
+ .getBoolean(GeckoPreferences.PREFS_QRCODE_ENABLED, false);
}
private void launchQRCodeReader() {
diff --git a/mobile/android/base/resources/values/arrays.xml b/mobile/android/base/resources/values/arrays.xml
index d220ca9bb4e0..8369d817da8d 100644
--- a/mobile/android/base/resources/values/arrays.xml
+++ b/mobile/android/base/resources/values/arrays.xml
@@ -70,8 +70,8 @@
<item>@string/history_title</item>
</string-array>
<string-array name="pref_import_android_defaults">
- <item>true</item>
- <item>true</item>
+ <item>false</item>
+ <item>false</item>
</string-array>
<string-array name="pref_import_android_values">
<item>android_import.data.bookmarks</item>
@@ -126,16 +126,16 @@
<item>private.data.passwords</item>
</string-array>
<string-array name="pref_clear_on_exit_defaults">
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
- <item>false</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
+ <item>true</item>
</string-array>
<string-array name="pref_restore_entries">
<item>@string/pref_restore_always</item>
diff --git a/mobile/android/base/resources/xml-v11/preferences_search.xml b/mobile/android/base/resources/xml-v11/preferences_search.xml
index 937b05b617c6..a58bb7cece44 100644
--- a/mobile/android/base/resources/xml-v11/preferences_search.xml
+++ b/mobile/android/base/resources/xml-v11/preferences_search.xml
@@ -27,7 +27,7 @@
<CheckBoxPreference android:key="android.not_a_preference.search.search_history.enabled"
android:title="@string/pref_history_search_suggestions"
- android:defaultValue="true"
+ android:defaultValue="false"
android:persistent="true" />
</PreferenceScreen>
diff --git a/mobile/android/base/resources/xml/preferences_advanced.xml b/mobile/android/base/resources/xml/preferences_advanced.xml
index 32cdf0b915b5..ca8318b83767 100644
--- a/mobile/android/base/resources/xml/preferences_advanced.xml
+++ b/mobile/android/base/resources/xml/preferences_advanced.xml
@@ -27,7 +27,7 @@
<ListPreference android:key="android.not_a_preference.restoreSession3"
android:title="@string/pref_restore"
- android:defaultValue="always"
+ android:defaultValue="quit"
android:entries="@array/pref_restore_entries"
android:entryValues="@array/pref_restore_values"
android:persistent="true" />
@@ -62,7 +62,9 @@
<SwitchPreference android:key="media.autoplay.enabled"
android:title="@string/pref_media_autoplay_enabled"
- android:summary="@string/pref_media_autoplay_enabled_summary" />
+ android:summary="@string/pref_media_autoplay_enabled_summary"
+ android:defaultValue="false"
+ />
</PreferenceCategory>
diff --git a/mobile/android/base/resources/xml/preferences_privacy.xml b/mobile/android/base/resources/xml/preferences_privacy.xml
index 7b3215cb2665..1d4593ec2523 100644
--- a/mobile/android/base/resources/xml/preferences_privacy.xml
+++ b/mobile/android/base/resources/xml/preferences_privacy.xml
@@ -99,7 +99,7 @@
<CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled"
android:title="@string/datareporting_fhr_title"
android:summary="@string/datareporting_fhr_summary2"
- android:defaultValue="true" />
+ android:defaultValue="false" />
<org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.healthreport.link"
android:title="@string/datareporting_abouthr_title"
diff --git a/mobile/android/base/resources/xml/preferences_search.xml b/mobile/android/base/resources/xml/preferences_search.xml
index 440167fe5e2a..fc8c258821e1 100644
--- a/mobile/android/base/resources/xml/preferences_search.xml
+++ b/mobile/android/base/resources/xml/preferences_search.xml
@@ -34,7 +34,7 @@
<CheckBoxPreference android:key="android.not_a_preference.search.search_history.enabled"
android:title="@string/pref_history_search_suggestions"
- android:defaultValue="true"
+ android:defaultValue="false"
android:persistent="true" />
</PreferenceScreen>
diff --git a/mobile/android/geckoview/src/main/AndroidManifest.xml b/mobile/android/geckoview/src/main/AndroidManifest.xml
index 4e2aaf447128..8584018cab39 100644
--- a/mobile/android/geckoview/src/main/AndroidManifest.xml
+++ b/mobile/android/geckoview/src/main/AndroidManifest.xml
@@ -3,7 +3,9 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+#ifdef MOZ_LOCATION
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+#endif
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
@@ -18,8 +20,10 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
+#ifdef MOZ_LOCATION
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
+#endif
<uses-feature android:name="android.hardware.touchscreen"/>
<!--#ifdef MOZ_WEBRTC-->
diff --git a/mobile/android/modules/RuntimePermissions.jsm b/mobile/android/modules/RuntimePermissions.jsm
index 42d8024b1a60..21c6102cafdb 100644
--- a/mobile/android/modules/RuntimePermissions.jsm
+++ b/mobile/android/modules/RuntimePermissions.jsm
@@ -38,4 +38,4 @@ var RuntimePermissions = {
return Messaging.sendRequestForResult(msg);
}
-};
\ No newline at end of file
+};
diff --git a/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in b/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in
index a0abb99faebb..2575e5fe1bc4 100644
--- a/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in
+++ b/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in
@@ -1,3 +1,5 @@
+#ifdef MOZ_LOCATION
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+#endif
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 198028eeb96c..766e665c074a 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -591,7 +591,7 @@ pref("media.encoder.webm.enabled", true);
#endif
// Whether to autostart a media element with an |autoplay| attribute
-pref("media.autoplay.enabled", true);
+pref("media.autoplay.enabled", false);
// The default number of decoded video frames that are enqueued in
// MediaDecoderReader's mVideoQueue.
More information about the tbb-commits
mailing list