Skip to content

Commit 665b15b

Browse files
committed
chore: Updated protocol-activation doc to reflect standard-protocols on WASM
1 parent b3af291 commit 665b15b

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

doc/articles/features/protocol-activation.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,53 @@ If your target framework is Android 12, you must also add `Exported = true` to t
4646

4747
### WASM
4848

49-
WASM implementation uses the [`Navigator.registerProtocolHandler` API](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler). This has several limitations for the custom scheme:
49+
WASM implementation uses the [`Navigator.registerProtocolHandler` API](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler).
50+
51+
This has several limitations when using a custom scheme:
5052

5153
- The custom scheme's name must begin with `web+`
5254
- The custom scheme's name must include at least 1 letter after the `web+` prefix
5355
- The custom scheme must have only lowercase ASCII letters in its name.
5456

57+
You can also use one of the following supported schemes instead:
58+
59+
- `bitcoin`
60+
- `ftp`
61+
- `ftps`
62+
- `geo`
63+
- `im`
64+
- `irc`
65+
- `ircs`
66+
- `magnet`
67+
- `mailto`
68+
- `matrix`
69+
- `mms`
70+
- `news`
71+
- `nntp`
72+
- `openpgp4fpr`
73+
- `sftp`
74+
- `sip`
75+
- `sms`
76+
- `smsto`
77+
- `ssh`
78+
- `tel`
79+
- `urn`
80+
- `webcal`
81+
- `wtai`
82+
- `xmpp`
83+
5584
To register the custom theme, call the WASM-specific `Uno.Helpers.ProtocolActivation` API when appropriate to let the user confirm URI handler association:
5685

5786
```csharp
5887
#if __WASM__
5988
Uno.Helpers.ProtocolActivation.RegisterCustomScheme(
60-
"web+myscheme",
89+
"web+myscheme",
6190
new System.Uri("http://localhost:55838/"),
6291
"Can we handle web+myscheme links?");
6392
#endif
6493
```
6594

66-
The first argument is the scheme name, the second is the base URL of your application (it must match the current domain to be registered successfully), and the third is a text prompt, which will be displayed to the user to ask for permission.
95+
The first argument is the scheme name, the second is the base URL of your application (it must match the current domain to be registered successfully), and the third is a text prompt, which will be displayed to the user to ask for permission (this does not work on all browsers e.g. edge).
6796

6897
When a link with the custom scheme gets executed, the browser will navigate to a your URL with additional `unoprotocolactivation` query string key, which will contain the custom URI. Uno internally recognizes this query string key and executes `OnActivated` appropriately.
6998

0 commit comments

Comments
 (0)