---
title: "windowState(for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensionwindow/windowstate(for:)"
---

# windowState(for:)

Called when the state of the window is needed.

## Declaration

```swift
optional func windowState(for context: WKWebExtensionContext) -> WKWebExtension.WindowState
```

## Parameters

- `context`: The context in which the web extension is running.

## Discussion

Discussion Defaults toWKWebExtension.WindowState.normal if not implemented.
