Skip to content

MOBILEWEBVIEW-57: Add shouldOverrideUrlLoading for webviewclient#32

Merged
enotniy merged 1 commit into
developfrom
feature/MOBILEWEBVIEW-57
Feb 26, 2026
Merged

MOBILEWEBVIEW-57: Add shouldOverrideUrlLoading for webviewclient#32
enotniy merged 1 commit into
developfrom
feature/MOBILEWEBVIEW-57

Conversation

@enotniy
Copy link
Copy Markdown
Collaborator

@enotniy enotniy commented Feb 25, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the shouldOverrideUrlLoading callback to the WebView implementation, allowing consumers to intercept and handle URL loading events in the WebView. The change introduces a new interface method in WebViewEventListener with a default implementation that returns false, and implements the corresponding Android WebView callbacks.

Changes:

  • Added onShouldOverrideUrlLoading method to WebViewEventListener interface with a default implementation returning false
  • Implemented both modern and deprecated shouldOverrideUrlLoading callbacks in Android WebViewClient
  • Added cache mode setting to LOAD_NO_CACHE in setUserAgentSuffix method (though this appears redundant)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
mindbox-common/src/commonMain/kotlin/cloud/mindbox/mobile_sdk/inapp/webview/WebViewInterfaces.kt Adds new onShouldOverrideUrlLoading method to WebViewEventListener interface with default implementation
mindbox-common/src/androidMain/kotlin/cloud/mindbox/mobile_sdk/inapp/webview/WebViewAndroid.kt Implements shouldOverrideUrlLoading callbacks in WebViewClient and adds duplicate cache mode setting
Comments suppressed due to low confidence (1)

mindbox-common/src/androidMain/kotlin/cloud/mindbox/mobile_sdk/inapp/webview/WebViewAndroid.kt:62

  • Setting cacheMode to LOAD_NO_CACHE here is redundant. The cache mode is already set to LOAD_NO_CACHE in the configureWebView method at line 106. This duplicate setting should be removed to avoid confusion and maintain consistency with the initialization pattern used for other WebView settings.
            webView.settings.cacheMode = WebSettings.LOAD_NO_CACHE

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@enotniy enotniy merged commit d5fd83b into develop Feb 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants