johnjbarton / crx2app

use https://github.com/google/crx2app instead
12 stars 1 forks source link

Clean up state when debugger closes #1

Open johnjbarton opened 12 years ago

johnjbarton commented 12 years ago

WindowsAdapter is by origin, not by tab. So how can we know when the debugger is closed?

  1. record tabId. No multiple tabs from the origin can be debuggers
  2. search all tabs for a matching origin. No we are only interested in debuggers from the origin.
  3. track all tabIds that are debuggers for the origin, Ok.

    4. Duh, use port onDisconnected event http://code.google.com/chrome/extensions/extension.html#type-Port

WindowsAdapter created in adapterFactory call from crxEnd add onDisconnect. Undocumented argument is 'port'. _disconnect windowsAdapter refactor add _connect() for better doc delete it

add _connect (call in ctor) _disconnect to TabsAdapter

johnjbarton commented 12 years ago

As of https://github.com/johnjbarton/crx2app/commit/981279a60801ad27b7f5584e490abd79f9770d83 one issue remains, the chrome.experimental.infobar does not get removed.

http://code.google.com/p/chromium/issues/detail?id=107458

Could be worked around by signalling the bar to close itself.