Sep-0007 protocol utilities.
The methods listed in the documentation are browser-only.
Methods
(static) isWebHandlerSupported() → {Boolean}
Returns whether or not the browser can register a SEP-0007 web handler.
- Source:
Returns:
- Type:
-
Boolean
Example
if (cosmicLib.sep7Utils.isWebHandlerSupported()) {
registerSep7HandlerButton.show()
}
(static) registerWebHandler(handler, description)
Proposes the user to register handler as her default SEP-0007 link
handler. SEP-0007 requests will hit {handler}?sep7={sep7Request}
.
Note that this makes use of a non-standard feature. Compatibility can be
checked using sep7Utils.isWebHandlerSupported()
.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
handler |
String
|
URL of the SEP-0007 web handler. |
description |
String
|
A brief description of the service. |
Example
cosmicLib.sep7Utils.registerWebHandler(
"https://cosmic.link/",
"Cosmic.link"
)