As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 795518 - content api for closing panels
: content api for closing panels
Product: Firefox
Classification: Client Software
Component: SocialAPI (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 18
Assigned To: Mark Hammond [:markh]
: Shane Caraveo (:mixedpuppy)
Depends on:
  Show dependency treegraph
Reported: 2012-09-28 16:51 PDT by Shane Caraveo (:mixedpuppy)
Modified: 2012-10-02 18:22 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Have window.close() close panels and chats (6.15 KB, patch)
2012-10-01 19:14 PDT, Mark Hammond [:markh]
jaws: review+ approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description User image Shane Caraveo (:mixedpuppy) 2012-09-28 16:51:46 PDT
social panels (flyout, status and chat) need an api for closing the panel.  One was implemented for flyouts, it should be updated or verified to work with the panel that is calling the api.
Comment 1 User image Shane Caraveo (:mixedpuppy) 2012-09-28 16:52:14 PDT
This is related to but not dependent on bug 794640
Comment 2 User image Mark Hammond [:markh] 2012-10-01 02:03:15 PDT
On IRC, Jaws suggested we just use window.close.  I've a patch which uses the DOMWindowClose event to implement this (no tests and no support for chat windows yet) - but what d'ya reckon?
Comment 3 User image Shane Caraveo (:mixedpuppy) 2012-10-01 08:46:24 PDT
cool, I would much prefer window.close.  iirc we pass back the window object on any opening api.
Comment 4 User image Mark Hammond [:markh] 2012-10-01 19:14:22 PDT
Created attachment 666805 [details] [diff] [review]
Have window.close() close panels and chats

window.close(), when used on a chatbar window or a panel window will close the chat/panel.
Comment 5 User image Jared Wein [:jaws] (please needinfo? me) 2012-10-01 21:07:40 PDT
Comment on attachment 666805 [details] [diff] [review]
Have window.close() close panels and chats

Review of attachment 666805 [details] [diff] [review]:

::: toolkit/components/social/MozSocialAPI.jsm
@@ +174,4 @@
>      // set a timer which will fire after the unload events have all fired.
>      schedule(function () { port.close(); });
>    });
> +  targetWindow.addEventListener("DOMWindowClose", function(evt) {

Please name this function and remove the event listener.
Comment 6 User image Mark Hammond [:markh] 2012-10-02 00:59:10 PDT
As discussed on IRC, the listener can't be removed as it might fire multiple times.
Comment 7 User image Ed Morley [:emorley] 2012-10-02 08:57:39 PDT
Comment 8 User image :Gavin Sharp [email:] 2012-10-02 18:22:00 PDT

Note You need to log in before you can comment on or make changes to this bug.