I\'m trying to use a shared worker to maintain a list of all the windows/tabs of a web application. Therefore following code is used:
//lives in shared-worker.js
PortCollection
would come in handy but doesn't seem to be implemented in any browser.
It acts as an opaque array of MessagePort objects, thus allowing the objects to be garbage collected when they stop being relevant, while still allowing scripts to iterate over the MessagePort objects.
source; http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#portcollection
Edit; just rised an Issue for Chrome; http://crbug.com/263356