Revision 185065 of tabbrowser

  • Revision slug: Talk:XUL/tabbrowser
  • Revision title: tabbrowser
  • Revision id: 185065
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment

Revision Content

Dependency On Browser Chrome

If you are building a stand-alone application you will find that the tabbrowser element expects that two menuitems are present, menu_closeWindow (Close Window) and menu_close (Close Tab). This is obviously a dependency on the browser chrome (at least in Firefox up to and including v2.0).

The problem appears on the first invocation of addTab() and results in the following error console message:

Error: document.getElementById("menu_closeWindow") has no properties Source File: chrome://global/content/bindings/tabbrowser.xml Line: 962

Adding menuitems with the required ids fixes the problem.

I have not investigated the reason for the dependancy. tabbrowser does not appear to hook itself into the menuitems in any way, you will have to implement your own code to close the current tab.

See {{template.Bug(327886)}} and {{template.Bug(339964)}}. --Nickolay 22:46, 22 January 2007 (PST)

Revision Source

<h2 name="Dependency_On_Browser_Chrome"> Dependency On Browser Chrome </h2>
<p>If you are building a stand-alone application you will find that the <a href="en/XUL/tabbrowser">tabbrowser</a> element expects that two <a href="en/XUL/menuitem">menuitems</a> are present, <code>menu_closeWindow</code> (Close Window) and <code>menu_close</code> (Close Tab). This is obviously a dependency on the browser chrome (at least in Firefox up to and including v2.0).
</p><p>The problem appears on the first invocation of <a href="en/XUL/tabbrowser#m-addTab">addTab()</a> and results in the following error console message:
</p>
<blockquote>Error: document.getElementById("menu_closeWindow") has no properties
Source File: chrome://global/content/bindings/tabbrowser.xml
Line: 962</blockquote>
<p>Adding <a href="en/XUL/menuitem">menuitems</a> with the required ids fixes the problem.
</p><p>I have not investigated the reason for the dependancy. <a href="en/XUL/tabbrowser">tabbrowser</a> does not appear to hook itself into the <a href="en/XUL/menuitem">menuitems</a> in any way, you will have to implement your own code to close the current tab.
</p>
<dl><dd> See {{template.Bug(327886)}} and {{template.Bug(339964)}}. --<a href="User:Nickolay">Nickolay</a> 22:46, 22 January 2007 (PST)
</dd></dl>
Revert to this revision