<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtensionContext/hasInjectedContent(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionContext(im)hasInjectedContentForURL:"
  },
  "title" : "hasInjectedContent(for:)"
}
-->

# hasInjectedContent(for:)

Checks if the extension has script or stylesheet content that can be injected into the specified URL.

```
func hasInjectedContent(for url: URL) -> Bool
```

## Parameters

`url`

The webpage URL to check.

## Return Value

Returns `YES` if the extension has content that can be injected by matching the URL against the extension’s requested match patterns.

## Discussion

The extension context will still need to be loaded and have granted website permissions for its content to actually be injected.

---

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)