From: Soren Stoutner Date: Mon, 8 May 2017 21:07:19 +0000 (-0700) Subject: Allow loading of hosts that are not fQDNs from the URL text box. Fixes https://redmi... X-Git-Tag: v2.3~11 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=6f1b0c12fcf3358c91f7b5889a1dfe083638cb52;p=PrivacyBrowserAndroid.git Allow loading of hosts that are not fQDNs from the URL text box. Fixes https://redmine.stoutner.com/issues/128. --- diff --git a/app/src/main/assets/it/guide_domain_settings.html b/app/src/main/assets/it/guide_domain_settings.html index 15ca0c60..720026f7 100644 --- a/app/src/main/assets/it/guide_domain_settings.html +++ b/app/src/main/assets/it/guide_domain_settings.html @@ -49,7 +49,7 @@

-

When visiting a domain that has domain settings specified, the background of the URL text box is green.

+

Quando si accede a un dominio per cui sono state specificate impostazioni personalizzate la casella di testo dell'indirizzo URL si colora di verde.

diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 0701a162..3c832ae3 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -1866,7 +1866,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation String unformattedUrlString = urlTextBox.getText().toString().trim(); // Check to see if `unformattedUrlString` is a valid URL. Otherwise, convert it into a search. - if ((Patterns.WEB_URL.matcher(unformattedUrlString).matches()) || (unformattedUrlString.contains("localhost"))) { + if ((Patterns.WEB_URL.matcher(unformattedUrlString).matches()) || (unformattedUrlString.startsWith("http://")) || (unformattedUrlString.startsWith("https://"))) { // Add `http://` at the beginning if it is missing. Otherwise the app will segfault. if (!unformattedUrlString.startsWith("http")) { unformattedUrlString = "http://" + unformattedUrlString;