puter.ui.parentApp()
GUIObtain a connection to the app that launched this app.
puter.ui.parentApp()
puter.ui.parentApp()
does not accept any parameters.
An AppConnection
to the parent, or null if there is no parent app.
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
const parent = puter.ui.parentApp();
if (!parent) {
alert('This app was launched directly');
} else {
alert('This app was launched by another app');
parent.postMessage("Hello, parent!");
}
</script>
</body>
</html>