* Remove stale max-len disablements * Remove stale camelCase & naming-convention disablements * Remove stale ban-ts-comment disablements * Remove stale no-var disablements * Remove stale no-empty-property disablements * Remove stale react rule disablements * Remove stale no-constant-condition disablements * Remove stale no-unused-vars disablements * Remove stale disablements for disabled rules * fixup camelcase * Remove dead code * Tidy code * Tweak oxlint config * Use oxlint to apply jsx/tsx extension consistently * Fix import * Fix imports * Rename affected snapshots * Update more imports * Enable restriction ruleset * Make code comply with new rules * Make code comply with react/button-has-type * Make code comply with typescript/non-nullable-type-assertion-style * Comply with node/no-process-env * Comply with unicorn/prefer-node-protocol * Comply with unicorn/import-style * Comply with unicorn/no-process-exit * Comply with no-proto * Comply with node/handle-callback-err * Comply with import/no-commonjs * Comply with node/no-path-concat * Comply with unicorn/no-length-as-slice-end * Comply with unicorn/no-document-cookie * Comply with unicorn/prefer-module * Comply with typescript/prefer-literal-enum-member * Comply with jsx-a11y/anchor-ambiguous-text * Tweak oxlint config * Fix resolves * Iterate * Iterate * Iterate * Iterate * Iterate * Iterate * Iterate
@element-hq/element-web-module-widget-lifecycle
Widget lifecycle module for Element Web.
Supports the following configuration options under the configuration key io.element.element-web-modules.widget-lifecycle:
| Key | Type | Description |
|---|---|---|
| widget_permissions | object | Map of widget URL patterns to approval settings. |
Each widget configuration can use the following options:
preload_approved- if true, the preload dialog is not displayed for this widget.identity_approved- if true, requests for an identity token are automatically accepted.capabilities_approved- a list of capabilities that should be approved for this widget.
The widget URL and capability strings can use a trailing * to match multiple widgets or capabilities.
This is useful when widgets have multiple routes or capabilities include variable state keys.
Matching and precedence
- Patterns ending in
*are matched by prefix; other patterns must match exactly. - If multiple rules match, the most specific match wins per field.
- The capabilities allow-list is not merged across rules; the most specific rule that defines it wins.
Example configuration (exact match)
{
"io.element.element-web-modules.widget-lifecycle": {
"widget_permissions": {
"https://widget.example.com/": {
"preload_approved": true,
"identity_approved": true,
"capabilities_approved": [
"org.matrix.msc2931.navigate",
"org.matrix.msc2762.receive.state_event:m.room.power_levels"
]
}
}
}
}
Example configuration (wildcards)
{
"io.element.element-web-modules.widget-lifecycle": {
"widget_permissions": {
"https://widget.example.com/*": {
"preload_approved": true,
"identity_approved": true,
"capabilities_approved": [
"org.matrix.msc2931.navigate",
"org.matrix.msc2762.receive.state_event:m.room.power_levels",
"org.matrix.msc2762.send.state_event:net.custom_event#*"
]
}
}
}
}