Last Comment Bug 660069 - Provide an "id" for the sidebar close button XUL element
: Provide an "id" for the sidebar close button XUL element
Status: NEW
[bugday-2011-05-27]
:
Product: Firefox
Classification: Client Software
Component: Toolbars and Customization (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-26 13:14 PDT by Marc-Aurèle DARCHE
Modified: 2011-05-27 12:47 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Marc-Aurèle DARCHE 2011-05-26 13:14:25 PDT
User-Agent:       Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

In the context of extension development it is often needed to listen to the closing of the Firefox sidebar. An easy way to do so is to listen on events on the sidebar close button. Alas this button has no "id", thus one has to use a query selector to get this XUL element.

Reproducible: Always


Actual Results:  
var sidebar_closebutton = top.document.querySelector('#sidebar-box toolbarbutton');
sidebar_closebutton.addEventListener('command', reactToClosing, false);


Expected Results:  
If the sidebar close button XUL element could have an ID such as "sidebar-closebutton" extension developers could add listeners to it in a much more robust manner without relying on somehow implementation details like that:
var sidebar_closebutton = top.document.getElementById('sidebar-closebutton');
sidebar_closebutton.addEventListener('command', reactToClosing, false);


As you see this is just a suggestion of a small addition that is fully compatible with both past and future.

Thanks a lot if this little id attribute could be added!

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