For the code to observe when a tab is no longer visible, see the vibrator code in Navigator.cpp.
To observe when a window goes into / out of bfcache (or otherwise just closes) I think you want pagehide / pageshow, but I'm not sure.
For the code to observe when a tab is no longer visible, see the vibrator code in Navigator.cpp.
To observe when a window goes into / out of bfcache (or otherwise just closes) I think you want pagehide / pageshow, but I'm not sure.