X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=c49c14caacd5981eb6edc52c9f42c4cd7c440584;hp=78629e559f4b2a4c487097ef91f6eebabd24d042;hb=cff65a4f64cf00066246e4208dbf2bd4fa535e0f;hpb=f99c5299aced4335017a59423fb491b84c9a6970 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 78629e55..c49c14ca 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -6291,7 +6291,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } } - // Clear the cache and history if Incognito Mode is enabled. + // Clear the cache, history, and logcat if Incognito Mode is enabled. if (incognitoModeEnabled) { // Clear the cache. `true` includes disk files. nestedScrollWebView.clearCache(true); @@ -6311,9 +6311,17 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Delete the secondary `Service Worker` cache directory. // A `String[]` must be used because the directory contains a space and `Runtime.exec` will not escape the string correctly otherwise. Runtime.getRuntime().exec(new String[]{"rm", "-rf", privateDataDirectoryString + "/app_webview/Service Worker/"}); - } catch (IOException e) { + } catch (IOException exception) { // Do nothing if an error is thrown. } + + // Clear the logcat. + try { + // Clear the logcat. `-c` clears the logcat. `-b all` clears all the buffers (instead of just crash, main, and system). + Runtime.getRuntime().exec("logcat -b all -c"); + } catch (IOException exception) { + // Do nothing. + } } // Get the current page position.