From 4df7f2e40fa75f988a4c3281195313a4a3c84646 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Fri, 17 Mar 2017 15:07:36 -0700 Subject: [PATCH] Reload the custom domain settings when navigating back using the back button. Fixes https://redmine.stoutner.com/issues/100. --- .../privacybrowser/activities/MainWebViewActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. -- 2.45.2