Can WKWebView automatically adjust its width and height based on the loaded content?

Hi Team,

We're trying to load an Image Ad inside WKWebView and we're wondering if we can adjust its width and height based on the loaded content.

Currently, we're using evaluateJavaScript("document.body.scrollHeight") query to fetch the height of the content but often times we get incorrect value from it.

We looked at the WKWebView documentation but couldn't find anything related to our use case.

Could someone from the team guide us through the next step?

Thanks

Can WKWebView automatically adjust its width and height based on the loaded content?
 
 
Q