Display warning message within Confluence macro pop up window

Hi Team ,

We’re having a requirement to show a warning banner message while opening “File and images” macro on confluence edit page. We need to show the warning message in macro pop up window.

I tried this by using Javascript and put that JS in to customHTML window of confluence but I’m not able to identify the event which tells that “File and images” is opened on confluence edit page window.

Can anyone help me on this or provide any pointer how can we implement this ?

Thanks
Nishat