How to get notification when window closes in Firefox extension?
I am making toolbar for Mozilla Firefox. On the click of a button on my toolbar, I am opening a new window which navigates to my HTML Page created by me. On this HTML Page on the click of a button I am doing some work and closing the window.
That's all done, now 开发者_StackOverflowI need my original or parent window's toolbar to get notified when this window is closed. I guess adding event listeners won't work as its all done in new window. Please suggest.
Any help is appreciated
You can use "window.onbeforeunload" event.
Here is the reference page: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
I guess adding event listeners won't work as its all done in new window.
Why not if you add the event listener to the window you've opened (the one returned from your window.open call)?
精彩评论