Window unload event in Jira Clould


We have Jira App in the cloud. We are using ReactJS as a UI framework for our app. As per Jira Cloud architect, all vendor app will be load inside iFrame.

Is it possible to capture “the main window unload event” and stop that unload as we do it in a normal window mode ( without iFrame)? The main use case is if a user fills some data and without saving by mistake they hit the browser back button or some other URL inside Jira data will be lost so we would like to intimate user like… "you have unsaved data. " and for that, I want main parent window unload event…


Hi @umang.savaliya,

I don’t think this is possible, but I thought browsers are generally pretty good at warning the user when they’re likely to lose data in cases like this. It’s been a while since you posted this - did you find a solution?


Yes @dmorrow we find the solution. we used internal react Prompt to capture iFrame URL change event and window unload event for browser Go forward/ Go Back button…

import { Prompt } from "react-router"

Thanks for sharing @umang.savaliya. :slight_smile:

Hello, i think Prompt from react-router can detect changes from the internal iFrame url change from the app, but is there a way we can capture the clicks outside of our app, but inside Jira? Thanks!