My website is being ran in a mobile app within an iFrame. This app has a "back" button implemented, above the iFrame. Whenever this button is clicked, the API of the app will send my website an event, and I perform window.history.back()
so the user goes back one page on my website, inside the iFrame.
The problem occurs when the user clicked the back button at the point where there is no page back anymore, in this case, instead of using the window.history.back() I want to send an event to the API to close the iFrame.
How do I know when "this is the last page"?
Thanks