Skip to content

Commit 1679316

Browse files
Snap dialogs do not support metamask:: urls (#1970)
1 parent 35e17eb commit 1679316

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

snaps/features/custom-ui/dialogs.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ There are four types of dialogs: [alerts](#display-an-alert-dialog),
1313
[confirmations](#display-a-confirmation-dialog), [prompts](#display-a-prompt-dialog), and
1414
[custom dialogs](#display-a-custom-dialog).
1515

16-
:::caution
17-
Dialogs do not work when MetaMask is locked.
18-
To check if MetaMask is locked, use
19-
[`snap_getClientStatus`](../../reference/snaps-api.md#snap_getclientstatus).
16+
:::warning
17+
- Dialogs do not work when MetaMask is locked.
18+
To check if MetaMask is locked, use
19+
[`snap_getClientStatus`](../../reference/snaps-api.md#snap_getclientstatus).
20+
- [`metamask:` URLs](index.md#about-metamask-urls) are not supported in dialogs.
2021
:::
2122

2223
## Request permission to display dialogs

snaps/features/custom-ui/index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,9 @@ A Snap can link to the following screens using the `metamask:` scheme:
999999
Snap IDs for local testing and production.
10001000

10011001
:::warning
1002-
MetaMask will throw an error if the URL is not valid or if the URL leads to a Snap that is not
1003-
installed.
1002+
- MetaMask will throw an error if the URL is not valid or if the URL leads to a Snap that is not
1003+
installed.
1004+
- `metamask:` URLs are not supported in [dialogs](dialogs.md).
10041005
:::
10051006

10061007
#### Example

snaps/features/notifications.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Each Snap can trigger up to:
6666
## Expanded view
6767

6868
In-app notifications can include an optional expanded view that displays when selected.
69-
The expanded view includes a title, content, and an optional footer link.
69+
The expanded view includes a title, [custom UI](custom-ui/index.md) content, and an optional footer link.
7070

7171
The following example displays a notification in MetaMask, with the message "Hello, world!"
7272
When the user selects the notification, the expanded view displays a page with a title, a paragraph, and a link to the MetaMask Snaps directory:

snaps/features/signature-insights.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ Your Snap should use `signatureMethod` as the source of truth to identify the si
107107
providing insights for.
108108

109109
Once you've identified the signature object, your Snap can run any logic, including calling APIs.
110-
Then, your Snap must either return `null` if it has no insights to provide, or an object with a
111-
`content` property and an optional `severity` property as specified in the
110+
Then, your Snap must either return `null` if it has no insights to provide, or an object with
111+
[custom UI](custom-ui/index.md) content and an optional `severity` property as specified in the
112112
[`onSignature`](../reference/entry-points.md#onsignature) entry point.
113113

114114
The following is an example implementation of `onSignature`:

snaps/features/transaction-insights.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ permission object, and set it to `true`:
4040
### 2. Implement the `onTransaction` entry point
4141

4242
Expose an [`onTransaction`](../reference/entry-points.md#ontransaction) entry point, which receives
43-
a raw unsigned transaction payload, the chain ID, and the optional transaction origin.
43+
a raw unsigned transaction payload, the chain ID, and the optional transaction origin,
44+
and returns [custom UI](custom-ui/index.md) content.
4445
When a user submits a transaction using the MetaMask extension, MetaMask calls the `onTransaction`
4546
handler method.
4647

0 commit comments

Comments
 (0)