From 815a274380068235a5598f7495dd946605f48685 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Mon, 12 Oct 2020 19:29:37 -0700 Subject: [PATCH] Clear domain settings before opening a file. https://redmine.stoutner.com/issues/554 --- .../privacybrowser/activities/MainWebViewActivity.java | 3 +++ 1 file changed, 3 insertions(+) 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 b54b3d05..9107d5af 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -2992,6 +2992,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Get the file path string. openFilePath = fileNameEditText.getText().toString(); + // Apply the domain settings. This resets the favorite icon and removes any domain settings. + applyDomainSettings(currentWebView, "file://" + openFilePath, true, false); + // Check to see if the storage permission is needed. if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted. // Open the file. -- 2.45.2