Compare commits

...

1 Commits

Author SHA1 Message Date
Timo K
acc4cc9fc7 make wildcard (*) a possible parentUrl
Signed-off-by: Timo K <toger5@hotmail.de>
2023-08-31 12:46:00 +02:00

View File

@@ -75,7 +75,9 @@ export const widget: WidgetHelpers | null = (() => {
const parentUrl = query.get("parentUrl");
if (widgetId && parentUrl) {
const parentOrigin = new URL(parentUrl).origin;
// Allow * (wildcard) as the parentOrigin. This is needed if the widget does
// not run in an IFrame and instead needs to send the messages to the webview itself.
const parentOrigin = parentUrl === "*" ? "*" : new URL(parentUrl).origin;
logger.info("Widget API is available");
const api = new WidgetApi(widgetId, parentOrigin);
api.requestCapability(MatrixCapabilities.AlwaysOnScreen);