]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Allow loading of hosts that are not fQDNs from the URL text box. Fixes https://redmi...
authorSoren Stoutner <soren@stoutner.com>
Mon, 8 May 2017 21:07:19 +0000 (14:07 -0700)
committerSoren Stoutner <soren@stoutner.com>
Mon, 8 May 2017 21:07:19 +0000 (14:07 -0700)
app/src/main/assets/it/guide_domain_settings.html
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java

index 15ca0c6084ff34b89741f7119a7e05a0d072872d..720026f756af34837955dd571076f05b199fc3b5 100644 (file)
@@ -49,7 +49,7 @@
 
         <p><img class="center" src="images/domain_settings.png"></p>
 
-        <p>When visiting a domain that has domain settings specified, the background of the URL text box is green.</p>
+        <p>Quando si accede a un dominio per cui sono state specificate impostazioni personalizzate la casella di testo dell'indirizzo URL si colora di verde.</p>
 
         <p><img class="center" src="../en/images/green_url_bar.png"></p>
     </body>
index 0701a162a0fa9aecf83d7c719f0f3ad51ba1e712..3c832ae3ed2ec5806ac596f6dfa6f9a0f467d80e 100644 (file)
@@ -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;