Top
WebView Support
  • 20 Nov 2024
  • 1 Minute To Read
  • Dark
    Light
  • PDF

WebView Support

  • Dark
    Light
  • PDF

Article summary

your title goes here

Chrome tabs are not supported as it doesn't support JavaScript injection.

If you want Whatfix Mobile to run in the Activity/Fragment which contains WebView then you add the following code:

your title goes here

Ensure that you call the following code before WebView loadUrl() method.

Leap.enableWeb(yourWebViewInstance);

WebView Scaling Support

If you have scaling enabled in your WebView, make sure you send the new scale to Whatfix Mobile SDK. You can get the new scale value of the WebView by overriding onScaleChanged() method in your WebViewClient.
Use the following code to get the new scale of the WebView:

Java

webViewInstance.setWebViewClient(new WebViewClient() {
    @Override
    public void onScaleChanged(WebView view, float oldScale, float newScale) {
        super.onScaleChanged(view, oldScale, newScale);
        //Required in LeapCreator to create the exp. in scaled WebView
        LeapCreator.updateWebViewScale(newScale);
        //Required in Leap to show the exp. in scaled WebView
        Leap.updateWebViewScale(newScale);
    }
});

Kotlin

webViewInstance.webViewClient = object : WebViewClient() {
    override fun onScaleChanged(view: WebView, oldScale: Float, newScale: Float) {
          super.onScaleChanged(view, oldScale, newScale)
          //Required in LeapCreator to create the exp. in scaled WebView
          LeapCreator.updateWebViewScale(newScale)
          //Required in Leap to show the exp. in scaled WebView
          Leap.updateWebViewScale(newScale)
     }
}


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.