- // Set the new search URL as the summary text for the JavaScript-disabled search preference. The default is "https://duckduckgo.com/html/?q=".
- javaScriptDisabledSearchPreference.setSummary(sharedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q="));
+ if (sharedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q=").equals("Custom URL")) {
+ // Set the summary text to R.string.custom_url, which will be translated.
+ javaScriptDisabledSearchPreference.setSummary(R.string.custom_url);
+
+ // Update the javaScriptDisabledSearchURL variable. The default is "".
+ MainWebViewActivity.javaScriptDisabledSearchURL = sharedPreferences.getString("javascript_disabled_search_custom_url", "");
+ } else { // javascript_disabled_search is not set to Custom.
+ // Set the new search URL as the summary text for the JavaScript-disabled search preference. The default is "https://duckduckgo.com/html/?q=".
+ javaScriptDisabledSearchPreference.setSummary(sharedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q="));
+
+ // Update the javaScriptDisabledSearchURL variable. The default is "https://duckduckgo.com/html/?q=".
+ MainWebViewActivity.javaScriptDisabledSearchURL = sharedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q=");
+ }