X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=e06531c6174780d655f9aad96a06996d612c72c1;hp=08aa9eb21f074639b376f62f7e9e00694e0273f1;hb=fc5f976c4e6535abe6c088155d23a67bd4596fd6;hpb=086d810836a7d34f3e536b8b2622fa9ce07f1d88 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 08aa9eb2..e06531c6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -1874,12 +1874,15 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation boolean hostHasDomainSettings = false; String domainNameInDatabase = null; - // Check all the subdomains of `hostname` against the list of domains in `domainCursor`. + // Check the hostname. + if (domainSettingsSet.contains(hostname)) { + hostHasDomainSettings = true; + domainNameInDatabase = hostname; + } + + // Check all the subdomains of `hostname` against wildcard domains in `domainCursor`. while (hostname.contains(".") && !hostHasDomainSettings) { // Stop checking if we run out of `.` or if we already know that `hostHasDomainSettings` is `true`. - if (domainSettingsSet.contains(hostname)) { // Check the host name. - hostHasDomainSettings = true; - domainNameInDatabase = hostname; - } else if (domainSettingsSet.contains("*." + hostname)) { // Check the host name prepended by `*.`. + if (domainSettingsSet.contains("*." + hostname)) { // Check the host name prepended by `*.`. hostHasDomainSettings = true; domainNameInDatabase = "*." + hostname; }