steam-miniprofile
steam-miniprofile copied to clipboard
Ability to know when profile has loaded in iframe
Hi, thanks for the awesome tool. Works great :)
One thing that would be useful when using the iframe is to know when the html changes from the initial loading state to the profile state. As far as I can see there is no easy way of doing this. I think this could be achieved by posting a message to the parent like this:
window.parent.postMessage({
state: 'loaded'
})
Then whenever the iframe is used, the post message can be listened to using:
window.addEventListener('message', (event) => {
if (event.origin !== 'https://gamer2810.github.io') {
return
}
// Do something with message
})