mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-20 04:57:03 +00:00
Check for parentUrl when deciding whether a SPA specific url parameter should be ignored (#2881)
This commit is contained in:
@@ -97,7 +97,11 @@ describe("UrlParams", () => {
|
||||
});
|
||||
|
||||
it("respected in widget mode", () => {
|
||||
expect(getUrlParams("?preload=true&widgetId=12345").preload).toBe(true);
|
||||
expect(
|
||||
getUrlParams(
|
||||
"?preload=true&widgetId=12345&parentUrl=https%3A%2F%2Flocalhost%2Ffoo",
|
||||
).preload,
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -212,11 +212,12 @@ export const getUrlParams = (
|
||||
const fontScale = parseFloat(parser.getParam("fontScale") ?? "");
|
||||
|
||||
const widgetId = parser.getParam("widgetId");
|
||||
const isWidget = !!widgetId;
|
||||
const parentUrl = parser.getParam("parentUrl");
|
||||
const isWidget = !!widgetId && !!parentUrl;
|
||||
|
||||
return {
|
||||
widgetId,
|
||||
parentUrl: parser.getParam("parentUrl"),
|
||||
parentUrl,
|
||||
|
||||
// NB. we don't validate roomId here as we do in getRoomIdentifierFromUrl:
|
||||
// what would we do if it were invalid? If the widget API says that's what
|
||||
|
||||
Reference in New Issue
Block a user