Fix problems with audio still playing after a tab is closed. https://redmine.stoutne...
[PrivacyBrowser.git] / app / src / main / java / com / stoutner / privacybrowser / activities / MainWebViewActivity.java
index c49c14caacd5981eb6edc52c9f42c4cd7c440584..cdb2c9fb105b737c6f4931df2091689a020d3948 100644 (file)
@@ -4845,6 +4845,12 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
     }
 
     private void closeCurrentTab() {
+        // Pause the current WebView.
+        currentWebView.onPause();
+
+        // Pause the current WebView JavaScript timers.
+        currentWebView.pauseTimers();
+
         // Get the current tab number.
         int currentTabNumber = tabLayout.getSelectedTabPosition();