WkWebView decidePolicyFor not called when Javascript is enabled

My app is using a web view for rendering some web content. Intercepting navigation events via decidePolicyFor delegate method works great as long as Javascript is not enabled for the WkWebView. As soon as I enabled Javascript, only the first URL request is handled by the delegate. Any future URL requests do not get handled by the delegate.

I have a similar issue. You can start to look further into your problem by attaching to the WebView via Safari on the Mac, and look exactly at what is happening. Add

       if #available(iOS 16.4, *) {
            webView.isInspectable = true
        }

to your debug build to enable inspection

WkWebView decidePolicyFor not called when Javascript is enabled
 
 
Q