<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebPreferences/javaScriptCanOpenWindowsAutomatically",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebPreferences(py)javaScriptCanOpenWindowsAutomatically"
  },
  "title" : "javaScriptCanOpenWindowsAutomatically"
}
-->

# javaScriptCanOpenWindowsAutomatically

A Boolean that indicates whether or not the web view allows JavaScript to open windows automatically.

```
var javaScriptCanOpenWindowsAutomatically: Bool { get set }
```

## Discussion

Set to <doc://com.apple.documentation/documentation/Swift/true> if the web view should allow JavaScript to open windows automatically, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

Explicit calls to a JavaScript window opener that are activated by user action (such as a button click) are not affected by this setting.

---

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)