// Set the current user-agent as the summary text for the "user_agent" preference when the preference screen is loaded.
final Preference userAgentPreference = findPreference("user_agent");
- switch (savedPreferences.getString("user_agent", "Default user agent")) {
+ switch (savedPreferences.getString("user_agent", "PrivacyBrowser/1.0")) {
case "Default user agent":
// Get the user agent text from the webview (which changes based on the version of Android and WebView installed).
userAgentPreference.setSummary(bareWebView.getSettings().getUserAgentString());
default:
// Display the user agent from the preference as the summary text.
- userAgentPreference.setSummary(savedPreferences.getString("user_agent", "Default user agent"));
+ userAgentPreference.setSummary(savedPreferences.getString("user_agent", "PrivacyBrowser/1.0"));
break;
}
// Set the JavaScript-disabled search URL as the summary text for the JavaScript-disabled search preference when the preference screen is loaded.
- // The default is "https://duckduckgo.com/html/?q=".
+ // The default is `https://duckduckgo.com/html/?q=`.
final Preference javaScriptDisabledSearchPreference = findPreference("javascript_disabled_search");
String javaScriptDisabledSearchString = savedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q=");
if (javaScriptDisabledSearchString.equals("Custom URL")) {
javaScriptDisabledSearchPreference.setSummary(javaScriptDisabledSearchString);
}
- // Set the summary text for "javascript_disabled_search_custom_url" (the default is "") and enable it if "javascript_disabled_search" is set to "Custom URL".
+ // Set the summary text for `javascript_disabled_search_custom_url` (the default is `""`) and enable it if `javascript_disabled_search` is set to `Custom URL`.
final Preference javaScriptDisabledSearchCustomURLPreference = findPreference("javascript_disabled_search_custom_url");
javaScriptDisabledSearchCustomURLPreference.setSummary(savedPreferences.getString("javascript_disabled_search_custom_url", ""));
javaScriptDisabledSearchCustomURLPreference.setEnabled(javaScriptDisabledSearchString.equals("Custom URL"));
// Set the JavaScript-enabled searchURL as the summary text for the JavaScript-enabled search preference when the preference screen is loaded.
- // The default is "https://duckduckgo.com/?q=".
+ // The default is `https://duckduckgo.com/?q=`.
final Preference javaScriptEnabledSearchPreference = findPreference("javascript_enabled_search");
String javaScriptEnabledSearchString = savedPreferences.getString("javascript_enabled_search", "https://duckduckgo.com/?q=");
if (javaScriptEnabledSearchString.equals("Custom URL")) {
javaScriptEnabledSearchPreference.setSummary(javaScriptEnabledSearchString);
}
- // Set the summary text for "javascript_enabled_search_custom_url" (the default is "") and enable it if "javascript_enabled_search" is set to "Custom URL".
+ // Set the summary text for `javascript_enabled_search_custom_url` (the default is `""`) and enable it if `javascript_enabled_search` is set to `Custom URL`.
final Preference javaScriptEnabledSearchCustomURLPreference = findPreference("javascript_enabled_search_custom_url");
javaScriptEnabledSearchCustomURLPreference.setSummary(savedPreferences.getString("javascript_enabled_search_custom_url", ""));
javaScriptEnabledSearchCustomURLPreference.setEnabled(javaScriptEnabledSearchString.equals("Custom URL"));
break;
case "user_agent":
- String userAgentString = sharedPreferences.getString("user_agent", "Default user agent");
+ String userAgentString = sharedPreferences.getString("user_agent", "PrivacyBrowser/1.0");
switch (userAgentString) {
case "Default user agent":
default:
// Display the user agent as the summary text for userAgentPreference, and disable customUserAgent.
- userAgentPreference.setSummary(sharedPreferences.getString("user_agent", "Default user agent"));
+ userAgentPreference.setSummary(sharedPreferences.getString("user_agent", "PrivacyBrowser/1.0"));
customUserAgent.setEnabled(false);
break;
}
break;
case "custom_user_agent":
- // Set the new custom user agent as the summary text for "custom_user_agent". The default is "PrivacyBrowser/1.0".
+ // Set the new custom user agent as the summary text for `custom_user_agent`. The default is `PrivacyBrowser/1.0`.
customUserAgent.setSummary(sharedPreferences.getString("custom_user_agent", "PrivacyBrowser/1.0"));
break;
<string name="save_form_data_preference_summary">Saved form data can auto-populate fields on websites.</string>
<string name="user_agent">User agent</string>
<string-array name="user_agent_entries">
- <item>WebView Default</item>
<item>Privacy Browser 1.0</item>
+ <item>WebView Default</item>
<item>Firefox 48 on Android 6.0.1</item>
<item>Chrome 52 on Android 6.0.1</item>
<item>Safari on iOS 10</item>
<item>Custom</item>
</string-array>
<string-array name="user_agent_entry_values" translatable="false"> <!-- None of the items in this `string-array` should be translated. -->
- <item>Default user agent</item> <!-- This item must not be translated into other languages because it is referenced in code. It is never displayed on the screen. -->
<item>PrivacyBrowser/1.0</item>
+ <item>Default user agent</item> <!-- This item must not be translated into other languages because it is referenced in code. It is never displayed on the screen. -->
<item>Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0</item>
<item>Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MTC20F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36</item>
<item>Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A5345a Safari/602.1</item>