SwiftUI WebView: Is action.target == nil a Reliable Way to Handle New Window Requests?

In WKWebView, there is the WKUIDelegate method:

func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {}

This delegate method provides a callback when a new window (for example, target="_blank") is requested in the web view.

However, in native SwiftUI (iOS 26), WebView / WebPage APIs do not provide an equivalent delegate method to handle new window requests. As a workaround, I am using the following method:

public func decidePolicy(for action: WebPage.NavigationAction, preferences: inout WebPage.NavigationPreferences) async -> WKNavigationActionPolicy {}

In this method, when action.target == nil, I treat it as a new window request.

My question:

Is relying on action.target == nil in decidePolicy a reliable and future-safe way to detect new window requests in SwiftUI’s WebView, or is there a better or more recommended approach for handling target="_blank" / new window navigation in the SwiftUI WebView APIs?

Code:

public func decidePolicy(for action: WebPage.NavigationAction, preferences: inout WebPage.NavigationPreferences) async -> WKNavigationActionPolicy {

            guard let webPage = webPage else { return .cancel }

            // Handle case where target frame is nil (e.g., target="_blank" or window.open)
            // This indicates a new window request
            if action.target == nil {
                print("Target frame is nil - new window requested")
                // WORKAROUND: Until iOS 26 WebPage UI protocol is available, we handle new windows here
                // Try to create a new WebPage through UI plugins
                if handleCreateWebPage(for: webPage, navigationAction: action) != nil {
                    // Note: The new WebPage has been created and published to the view
                    return .allow
                }
            }
            return .allow
        }
SwiftUI WebView: Is action.target == nil a Reliable Way to Handle New Window Requests?
 
 
Q