<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtension/init(resourceBaseURL:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "s:So14WKWebExtensionC6WebKitE15resourceBaseURLAB10Foundation0G0V_tYaKcfc"
  },
  "title" : "init(resourceBaseURL:)"
}
-->

# init(resourceBaseURL:)

Creates a web extension initialized with a specified resource base URL, which can point to either a directory or a ZIP archive.

```
@MainActor @preconcurrency convenience init(resourceBaseURL: URL) async throws
```

## Parameters

`resourceBaseURL`

The file URL to use for the new web extension.

## Discussion

The URL must be a file URL that points to either a directory with a `manifest.json` file or a ZIP archive containing a `manifest.json` file.
If the manifest is invalid or missing, or the URL points to an unsupported format or invalid archive, an error will be returned.

> Throws: An error if the manifest is invalid or missing, or the URL points to an unsupported format or invalid archive.

---

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)