tabex
tabex copied to clipboard
No way to cleanup the tabex.
There is a situation, where tab should be 'disconnected' pragmatically, while page is still loaded. In such case tab shouldn't become a master tab. In this case it'd cool to have some cleanup method: client.disconnect() or so.
Currently, it's possible to workaround with __router__.__destroy__() method, but __router__ has intervals as well, so it still will try to achieve master tab.
Sorry for silence. Could you clarify and split things by priority?
- router does not clear timers in
.__destroy__()- seems easy to fix
Client.destroy()with local router.__destroy__()after no clients left- can be postponed
Currently, it's not a blocker for me, so the prioritization is up to you.
I worked around it with the following code:
cleanupMutex: function() {
if (this.mutex.__router__.__iframe__) {
return this.mutex.__router__.__iframe__.remove();
}
this.mutex.__router__.__check_master__ = function() {};
this.mutex.__router__.__destroy__();
return this.mutex = null;
}
this.mutex is an instance of tabex's Client.
I found a bug in my workaround. If you destroyed the router once, you can reestablish it, because of caching here https://github.com/nodeca/tabex/blob/master/lib/index.js#L38. It will pick the destroyed router instead of creating new one