From: Soren Stoutner Date: Fri, 17 Mar 2017 22:07:36 +0000 (-0700) Subject: Reload the custom domain settings when navigating back using the back button. Fixes... X-Git-Tag: v2.0.1~4 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=4df7f2e40fa75f988a4c3281195313a4a3c84646;p=PrivacyBrowserAndroid.git Reload the custom domain settings when navigating back using the back button. Fixes https://redmine.stoutner.com/issues/100. --- 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 a5713ae1..89fb9e0a 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -135,7 +135,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // `orbotStatus` is public static so it can be accessed from `OrbotProxyHelper`. It is also used in `onCreate()`. public static String orbotStatus; - // `webViewTitle` is public static so it can be accessed from `CreateHomeScreenShorcutDialog`. It is also used in `onCreate()`. + // `webViewTitle` is public static so it can be accessed from `CreateBookmarkDialog` and `CreateHomeScreenShortcutDialog`. It is also used in `onCreate()`. public static String webViewTitle; @@ -1716,6 +1716,10 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } else { // Load the previous URL if available. if (mainWebView.canGoBack()) { + // Set `navigatingHistory` so that the domain settings are applied when the new URL is loaded. + navigatingHistory = true; + + // Go back. mainWebView.goBack(); } else { // Pass `onBackPressed()` to the system.