From: Soren Stoutner Date: Tue, 13 Oct 2020 02:29:37 +0000 (-0700) Subject: Clear domain settings before opening a file. https://redmine.stoutner.com/issues/554 X-Git-Tag: v3.6~9 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=815a274380068235a5598f7495dd946605f48685;p=PrivacyBrowserAndroid.git Clear domain settings before opening a file. https://redmine.stoutner.com/issues/554 --- 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.