]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/asynctasks/GetHostIpAddresses.java
Finish tabbed browsing. https://redmine.stoutner.com/issues/22
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / asynctasks / GetHostIpAddresses.java
index 3c7f37cfbb65bf0086e7a017d3a9a9fe9ee01011..050ae1dd502437c302383e2b86c5079c6419751a 100644 (file)
@@ -24,7 +24,6 @@ import android.os.AsyncTask;
 
 import androidx.fragment.app.FragmentManager;
 
-import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 import com.stoutner.privacybrowser.helpers.CheckPinnedMismatchHelper;
 import com.stoutner.privacybrowser.views.NestedScrollWebView;
 
@@ -104,8 +103,8 @@ public class GetHostIpAddresses extends AsyncTask<String, Void, String> {
         // Store the IP addresses.
         nestedScrollWebView.setCurrentIpAddresses(ipAddresses);
 
-        //TODO.  Move `urlIsLoading` to the WebView.
-        if (!MainWebViewActivity.urlIsLoading && !nestedScrollWebView.ignorePinnedDomainInformation() && (nestedScrollWebView.hasPinnedSslCertificate() || nestedScrollWebView.hasPinnedIpAddresses())) {
+        // Checked for pinned mismatches if the WebView is not loading a URL, pinned information is not ignored, and there is pinned information.
+        if ((nestedScrollWebView.getProgress() == 100) && !nestedScrollWebView.ignorePinnedDomainInformation() && (nestedScrollWebView.hasPinnedSslCertificate() || nestedScrollWebView.hasPinnedIpAddresses())) {
             CheckPinnedMismatchHelper.checkPinnedMismatch(fragmentManager, nestedScrollWebView);
         }
     }