<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtensionWindow/screenFrame(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKWebExtensionWindow(im)screenFrameForWebExtensionContext:"
  },
  "title" : "screenFrame(for:)"
}
-->

# screenFrame(for:)

Called when the screen frame containing the window is needed.

```
optional func screenFrame(for context: WKWebExtensionContext) -> CGRect
```

## Parameters

`context`

The context associated with the running web extension.

## Discussion

Defaults to <doc://com.apple.documentation/documentation/CoreGraphics/CGRectNull> if not implemented.

---

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)