Enable DOM storage and enable error messaging for PayPal user actions.

This commit is contained in:
Alex Hart
2025-03-21 10:42:58 -03:00
parent e5bb3f02f8
commit df4c6b59cd

View File

@@ -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