Comment 11 for bug 1076350

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Some comments from IRC:

<ChrisCoulson> so, the addon doesn't get pagehide because it disconnects from it the first time anybody navigates away from the first page viewed in a tab
<ChrisCoulson> in case you hadn't figured it out already, it looks like the problem with webapps is that the UnityObject's are keyed by outer window rather than inner window (and outer windows are reused between page navigations). it looks like the webapps addon assumes they are not reused...

When you navigate to a new page in a tab, this returns the same UnityObject (which has since disconnected from "pagehide"):

http://bazaar.launchpad.net/~webapps/unity-firefox-extension/trunk/view/head:/unity-firefox-extension/content/unity-global-property-initializer.js#L486

Then if the new page uses the Unity API, the context isn't destroyed when the tab closes, because the pagehide handler was already disconnected.

New windows are handled from the "content-document-global-created" notification, which is dispatched from the outer window:

http://bazaar.launchpad.net/~webapps/unity-firefox-extension/trunk/view/head:/unity-firefox-extension/content/observer.js#L212