Reputation: 11140
We are using to display custom notifications for a Firefox addon. All is good, except that we also need to do some custom cleanup activity when the user presses the red [x] button (in Windows) on the right side of our notification bar to close it (or technically "hide" it).
That said, what would be the best way to detect or get an indication that the user has pressed the red [x] button to close/hide the notification?
There is this event AlertClose as the document say but how to handle it?
i tried this but no effect..
notificationobj.addEventListener('AlertClose',function() { alert('closed'); },false)
Upvotes: 1
Views: 210
Reputation: 966
The bad news is the "AlertClose" is only fired in Firefox Mobile. We should move the event to the toolkit so all apps get the support. I don't have any good ideas, except using a DOM mutation event to watch for "DOMNodeRemoved".
Upvotes: 1