---
title: uniqueIdentifier
framework: webkit
role: symbol
role_heading: Instance Property
path: webkit/wkwebextensioncontext/uniqueidentifier
---

# uniqueIdentifier

A unique identifier used to distinguish the extension from other extensions and target it for messages.

## Declaration

```swift
var uniqueIdentifier: String { get set }
```

## Discussion

Discussion The default value is a unique value that matches the host in the default base URL. The identifier can be any value that is unique. Setting is only allowed when the context is not loaded. This value is accessible by the extension via browser.runtime.id and is used for messaging the extension via browser.runtime.sendMessage().
