Search code examples
javascriptmootoolsmootools-events

Get opened pages/tabs with mootools


I have a site that need to know if the user have other pages/tabs opened just to make actions in them (like closing them, redirect etc..). I'm not talking about popups, I'm talking about content opened in a new page tab manually by the user.

So basically I need a method to get a list of tabs/windows opened on my domain and be able to access the content in them (as all is the same domain, there should not be any security problems)

Does something like that exist?


Solution

  • I think it might be possible, since you say it's all on the same domain.

    When a page/tab gets loaded, you want to assign it an unique id and send it to the server. When it gets closed you will need to tell the server about it as well, so the server knows what tabs are still open. In each open tab you can then regularly query the server for any actions that you want to happen in this tab, like redirecting or closing it.