> I'd like to be able to detect when a page is let in Nitrogen. Is this
> possible?
It's a bit kludgy but if you take Tom's comet fork of nitrogen and set
up comet on the page (It doesn't actually have to do anything.) you can
reliably (as far as my testing goes) detect when the page is
abandoned/replaced/network partition/...
If you check back in the archives for one of my comet posts there's a
clause in my listener that goes like:
listener( Agent, Ref, #state {header = ControlID,
locus_id = Locus_id}=State ) ->
receive
{'DOWN', Ref, process, Agent, _Info} ->
%% user has left the page.
exit( done );
...
That message is a result of a 'monitor' on the comet agent. It dies
within 30 seconds or so (I've forgotten) of the page being left.
Sometimes I use this for cleanup like you want.
I've not stumbled across any other method
- paul