Popup hidden event

4 views
Skip to first unread message

Ralfas

unread,
Jan 24, 2011, 7:43:49 PM1/24/11
to Chromium-extensions
Is there an event for the popup being hidden/closed?

I've looked in the Docs but couldn't find anything relevant.


Many thanks,
Ralfas

Abraham Williams

unread,
Jan 25, 2011, 6:01:58 PM1/25/11
to Ralfas, Chromium-extensions
You should be able to do something like the following in the popup.

addEventListener('unload', function () {
  // Code to execute.
  }, false);

Abraham
-------------
Abraham Williams | Hacker Advocate | abrah.am
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.




--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Arne Roomann-Kurrik

unread,
Jan 25, 2011, 6:52:07 PM1/25/11
to Abraham Williams, Ralfas, Chromium-extensions
Unfortunately not: http://code.google.com/p/chromium/issues/detail?id=31262

Antony's suggestion in that issue seems serviceable:

Another idea for a workaround occurred to me today - create a message port between the 
popup and the background page, and then have the background page add a listener to the 
onDisconnect event of the Port.
~Arne

PhistucK

unread,
Jan 27, 2011, 1:46:26 PM1/27/11
to kur...@chromium.org, Chromium-extensions
Can you ask around whether my idea is acceptable?


PhistucK
Reply all
Reply to author
Forward
0 new messages