On Wed, Nov 4, 2009 at 11:15 AM, Jean-Lou Dupont <jeanlou.dup...@gmail.com>wrote:
> > > You're in luck! The onDisconnect event is on the Port object that is > passed > > to onConnect and returned from connect(). Seehttp:// > code.google.com/chrome/extensions/extension.html#type-Portfor some > > admittedly sparse documentation. > > I see... thanks. So if I want to maintain a list of "listeners", I > can use the "name" field of a "port" object to serve as "unique id" ? The 'name' field is whatever you passed to chrome.extension.connect() in the second param. I think it would be difficult to guarantee that is unique. A better identifier might be the ID of the tab that sent the message (assuming you're connecting from a content script to a background page), which is available on port.sender.tab.id. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to chromium-extensions@googlegroups.com To unsubscribe from this group, send email to chromium-extensions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en -~----------~----~----~----~------~----~------~--~---