<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebPolicyDelegate/webView(_:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebPolicyDelegate(im)webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:"
  },
  "title" : "webView(_:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:)"
}
-->

# webView(_:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:)

Decides whether to allow a targeted navigation event, such as opening a link in a new window.

```
optional func webView(_ webView: WebView!, decidePolicyForNewWindowAction actionInformation: [AnyHashable : Any]!, request: URLRequest!, newFrameName frameName: String!, decisionListener listener: (any WebPolicyDecisionListener)!)
```

## Parameters

`webView`

The `WebView` object for which this object is the policy delegate.

`actionInformation`

A description of the action that triggered the navigation request. The possible key-value pairs in this dictionary are defined in `Making content decisions`.

`request`

The request for which the new window action is performed.

`frameName`

The name of the new frame that contains the content returned from the request.

`listener`

The `WebPolicyDecisionListener` object that receives the policy decision.

## Discussion

This method is invoked when a targeted navigation decision needs to be made. A targeted navigation typically opens a new window to display content.  The receiver implements a policy decision by sending one of the [`WebPolicyDecisionListener`](/documentation/WebKit/WebPolicyDecisionListener) protocol messages to `listener`. This method allows delegates to modify the behavior of targeted links which normally open a new window. Delegates might do something else, such as download or present the content in a special way. If this method sends [`use()`](/documentation/WebKit/WebPolicyDecisionListener/use()) to `listener` then the new window will be opened, and [`webView(_:decidePolicyForNavigationAction:request:frame:decisionListener:)`](/documentation/WebKit/WebPolicyDelegate/webView(_:decidePolicyForNavigationAction:request:frame:decisionListener:)) will be invoked with a [`WebNavigationType.other`](/documentation/WebKit/WebNavigationType/other) as the value for the [`WebActionNavigationTypeKey`](/documentation/WebKit/WebActionNavigationTypeKey) key in the action dictionary.

The default behavior sends [`use()`](/documentation/WebKit/WebPolicyDecisionListener/use()) to `listener`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)