On Dec 21, 3:55*pm, "Ed West" wrote:
> Hello,
>
> I have some code that is used to open the sidebar on a button press and
> update the sidebar's document:
>
> toggleSidebar('my-sidebar', true);
>
> if (document.getElementById('my-sidebar').hasAttribute('checked')) {
> * * var doc = document.getElementById('sidebar').contentDocument ;
> // Manipulate doc
>
> Where "my-sidebar" is the id of a broadcaster:
>
> * * * * * > * * * * * * sidebartitle="My extension"
> * * * * * * autoCheck="false"
> * * * * * * type="checkbox"
> * * * * * * group="sidebar"
> * * * * * * sidebarurl="chrome://myextension/content/sidebar.xul" />
> * *

>
> However, the sidebar doesn't always update when it's opened. *I tried
> wrapping the code that updates the sidebar document in a call to setTimeout,
> but that fails occasionally as well.
>
> Is there an event that can be listened to that will be fired when the
> sidebar is open and its contentDocument is available?


why not place the code to update the sidebar document inside the
sidebar? I mean, using the 'onload' event of the sidebar document