Allow the embedded games platform to ask for opening external urls

Don't show in changelog
This commit is contained in:
Florian Rival
2025-02-26 15:26:26 +01:00
parent c62ea9e10a
commit 812153ffb3

View File

@@ -365,6 +365,16 @@ const GamesPlatformFrameStateProvider = ({
console.error('Error while sending GGM command:', error);
}
}
if (event.data.id === 'openExternalUrl') {
if (typeof event.data.url !== 'string') {
console.warn(
'Received an invalid URL to open from the games platform:',
event.data
);
return;
}
Window.openExternalURL(event.data.url);
}
},
[
openUserPublicProfile,