Part of Bug 976109 Manually handle cookies
Bug TBD Work around for uri.host being undefined in webrtc prompts
Bug 1007190 Separate out handleWindowClose from MozSocialAPI so that it can be used by Loop.
Bug 1007190 Use the new exported function for handling panel and chatbox closes