Skip to main content

Iframe integration

In a link to a game, you can pass the home parameter with several values:

1. home = 'closePopup'

In this case, when you start on the home button, the iframe in the game will generate an event for its parent

window.parent.postMessage({ cmd: 'closeGamePopup' }, '*');

In the parent iframe it will be possible to catch it and perform the actions that our partner needs. Example:

window.addEventListener("message", function(event) {
if(event?.data?.cmd == "closeGamePopup") {
// CLOSE THE IFRAME AND DO SOMETHING ELSE
}
}, false); 2. home = 'some url'

2. home = 'some url':

In this case, when you click on the home button, the iframe with the game will contact its parent (if it exists) and follow the link passed in the home parameter. If for some reason the parent was not found, the link will open in the iframe of the game itself