Window.controllers

  • Revision slug: Web/API/window.controllers
  • Revision title: window.controllers
  • Revision id: 413249
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

{{DomRef}}

Summary

Returns the XUL controllers of the chrome window.

Syntax

controllers = window.controllers

Specification

XUL-specific. Not part of specification.

By default, a window's controller contains the code that supports the global window commands.

Chrome code can add controllers (to be used in conjunction with the goDoCommand and goUpdateCommand functions in globalOverlay.js).

However, the added controllers must be explicitly removed when the window is unloaded, as this is not done automatically.

Each missing removal can cause

bug 415775:
ASSERTION: XPConnect is being called on a scope without a 'Components' property!

Revision Source

<div>{{DomRef}}</div>


<h2 id="Summary" name="Summary">Summary</h2>

<p>Returns the XUL controllers of the chrome window.</p>


<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<var>controllers</var> = window.controllers
</pre>


<ul>
  <li><code>controllers</code> is an object of type <a href="/en-US/docs/XULControllers"><code>XULControllers</code></a> (<a href="/en-US/docs/XPCOM_Interface_Reference/nsIControllers"><code>nsIControllers</code></a>).</li>
</ul>


<h2 id="Specification" name="Specification">Specification</h2>

<p>XUL-specific. Not part of specification.</p>

<div class="note">
  <p>By default, a window's controller contains the code that supports the global window commands.</p>
  <p>Chrome code can add controllers (to be used in conjunction with the goDoCommand and goUpdateCommand functions in globalOverlay.js).</p>
  <p>However, the added controllers must be explicitly removed when the window is unloaded, as this is not done automatically.</p>
  <p>Each missing removal can cause</p>
  <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=415775">bug 415775</a>:
  <pre class="bz_comment_text" id="comment_text_0">
ASSERTION: XPConnect is being called on a scope without a 'Components' property!</pre>
</div>
Revert to this revision