From df4c6b59cddb243ed5c847c24768ed70d553f4f9 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Fri, 21 Mar 2025 10:42:58 -0300 Subject: [PATCH] Enable DOM storage and enable error messaging for PayPal user actions. --- .../donate/paypal/PayPalConfirmationDialogFragment.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/subscription/donate/paypal/PayPalConfirmationDialogFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/subscription/donate/paypal/PayPalConfirmationDialogFragment.kt index e494eac9fd..2a9ab1f51e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/subscription/donate/paypal/PayPalConfirmationDialogFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/subscription/donate/paypal/PayPalConfirmationDialogFragment.kt @@ -55,6 +55,7 @@ class PayPalConfirmationDialogFragment : DialogFragment(R.layout.donation_webvie viewLifecycleOwner.lifecycle.addObserver(client) binding.webView.webViewClient = client binding.webView.settings.javaScriptEnabled = true + binding.webView.settings.domStorageEnabled = true binding.webView.settings.cacheMode = WebSettings.LOAD_NO_CACHE binding.webView.loadUrl(args.uri.toString()) @@ -82,6 +83,16 @@ class PayPalConfirmationDialogFragment : DialogFragment(R.layout.donation_webvie isDestroyed = true } + /** + * Requires API23 for non-deprecated version. + */ + @Suppress("OVERRIDE_DEPRECATION", "DEPRECATION") + override fun onReceivedError(view: WebView?, errorCode: Int, description: String?, failingUrl: String?) { + Log.d(TAG, "onReceivedError $errorCode: $description") + + super.onReceivedError(view, errorCode, description, failingUrl) + } + override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { if (!isDestroyed) { binding.progress.visible = true