mozilla

Revision 119005 of Mozmill Base Object Interfaces

  • Revision slug: Mozmill/Mozmill_Base_Object_Interfaces
  • Revision title: Mozmill Base Object Interfaces
  • Revision id: 119005
  • Created:
  • Creator: Ctalbert
  • Is current revision? No
  • Comment 2244 words added, 156 words removed

Revision Content

<h1>Mozmill Base Object Interfaces</h1>
<p>At the top of many Mozmill tests you will see a line that contains a setupModule function with something that looks like the following code in it: controller = mozmill.getBrowserController();  This creates a "controller" object for the test to use.  The <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> is the heart of all Mozmill interfaces in that it allows you to completely control the application under test.  However, this makes use of a global object called mozmill to instantiate the controller.  The mozmill object API provides many convenience methods to help you get started testing specific applications.</p>
<h2>Method overview</h2>
<table class="standard-table">
    <tbody>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#getBrowserController.28.29">getBrowserController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#newBrowserController.28.29">newBrowserController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#getDownloadsController.28.29">getDownloadsController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#getAddrbkController.28.29">getAddrbkController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#newAddrbkController.28.29">newAddrbkController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#getMail3PaneController.28.29">getMail3PaneController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#newMail3PaneController.28.29">newMail3PaneController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#getAddonsController.28.29">getAddonsController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#getPreferencesController.28.29">getPreferencesController</a>();</code></td>
        </tr>
        <tr>
             <td><code><a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller</a> <a href="#controller.MozmillController.28.29">controller.MozmillController</a>();</code></td>
        </tr>
    </tbody>
</table>

<h2>Attributes</h2>
<table class="standard-table">
    <thead>
        <tr>
            <th scope="col">Attribute</th>
            <th scope="col">Type</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><code>platform</code></td>
            <td>object</td>
            <td>The name of the platform according to the Gecko subsystem, i.e. Mac == Darwin, Windows == winnt, linux == linux.  For more specifc testing use the "is" attributes below.</a></td>
        </tr>
        <tr>
            <td><code>isWindows</code></td>
            <td>boolean</td>
            <td>True if the current platform is a Windows operating system</td>
        </tr>
        <tr>
            <td><code>isLinux</code></td>
            <td>boolean</td>
            <td>True if the current platform is a Linux operating system</td>
        </tr>
        <tr>
            <td><code>isMac</code></td>
            <td>boolean</td>
            <td>True if the current platform is a Mac OS X operating system</td>
        </tr>
        <tr>
            <td><code>wm</code></td>
            <td>{{ interface(nsIWindowsMediator) }}nsIWindowsMediator</td>
            <td>Shortcut to the nsIWindowsMediator service, for an example of use see controller.MozMillController below</td>
        </tr>
        <tr>
            <td><code>appInfo</code></td>
            <td>{{ interface(nsIXULAppInfo) }}nsIXULAppInfo</td>
            <td>Shortcut to the nsIXULAppInfo service.</td>
        </tr>
    </tbody>
</table>

<h2>Browser Methods</h2>
<h3 name="getBrowserController.28.29">getBrowserController()</h3>
<p>Gets a new browser controller for the currently open browser window.  If no window is open, it opens a new window and returns a controller for that.  Supported in Firefox and Seamonkey.</p>
<pre>
controller getBrowserController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.getBrowserController();
</pre>

<h3 name="newBrowserController.28.29">newBrowserController()</h3>
<p>Forces creation of a new browser window and returns a controller for it, regardless of how many other browser windows are open.  Supported in Firefox and Seamonkey.</p>
<pre>
controller newBrowserController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.newBrowserController();
</pre>

<h3 name="getDownlaodsController.28.29">getDownloadsController()</h3>
<p>Instantiates the Downloads window and returns a controller for that or returns a controller to an already opened Downloads window.  Supported in Firefox and Seamonkey.</p>
<pre>
controller getDownloadsController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.getDownloadsController();
</pre>

<h2>Mail Methods</h2>
<h3 name="getAddrbkController.28.29">getAddrbkController()</h3>
<p>Gets a controller for the current Thunderbird Addressbook window.  If one is not open, it opens a window and returns a controller for that.  Supported in Thunderbird.</p>
<pre>
controller getAddrbkController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.getAddrbkController();
</pre>

<h3 name="newAddrbkController.28.29">newAddrbkController()</h3>
<p>Forces the system to create a new addressbook window and returns a controller for that.  Supported in Thunderbird.</p>
<pre>
controller newAddrbkController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.newAddrbkController();
</pre>

<h3 name="getMail3PaneController.28.29">getAddrbkController()</h3>
<p>Gets a controller for the current Thunderbird window.  If one is not open, it opens a window and returns a controller for that.  Supported in Thunderbird.</p>
<pre>
controller getMail3PaneController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.getMail3PaneController();
</pre>

<h3 name="newAddrbkController.28.29">newMail3PaneController()</h3>
<p>Forces the system to create a new main Thunderbird window and returns a controller for that.  Supported in Thunderbird.</p>
<pre>
controller newMail3PaneController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.newMail3PaneController();
</pre>

<h2>General Methods</h2>
<h3 name="getAddonsController.28.29">getAddonsController()</h3>
<p>Creates a controller for the currently open Add-Ons window, if one is not open, it opens one and returns the controller for that.  Supported in all applications that use the toolkit Extension Manager to manage addons.</p>
<pre>
controller getAddonsController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.getAddonsController();
</pre>

<h3 name="getPreferencesController.28.29">getPreferencesController()</h3>
<p>Creates a controller for the currently open Preferences window, if one is not open, it opens one and returns the controller for that.  Supported in all applications.</p>
<pre>
controller getPreferencesController();
</pre>
<h6>Parameters</h6>
<p>None</p>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
controller = mozmill.getPreferencesController();
</pre>

<h3 name="controller.MozMillController.28.29">controller.MozMillController()</h3>
<p>Creates a controller for the given window.  This works on all supported applications and allows you to create controllers for windows that do not have a convenience method above.  Supported in all applications.</p>
<pre>
controller controller.MozMillController(in {{ interface(nsIDOMWindow) }} window);
</pre>
<h6>Parameters</h6>
<dl>
    <dt><code>window</code></dt>
    <dd>The DOM Window you wish to wrap into a controller object</dd>
</dl>
<h6>Return value</h6>
<p><code>controller</code> Returns a <a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object">controller object</a> for the window.</p>
<h6>Example</h6>
<pre function="syntax.JavaScript" class="deki-transform">
// Creates a controller for the browser's page information dialog.
// It assumes that you've already clicked on the proper icons to launch the dialog.
let window = mozmill.wm.getMostRecentWindow('Browser:page-info');
let pageInfoController = new mozmill.controller.MozMillController(window);
</pre>

Revision Source

<p>&lt;h1&gt;Mozmill Base Object Interfaces&lt;/h1&gt;<br>
&lt;p&gt;At the top of many Mozmill tests you will see a line that contains a setupModule function with something that looks like the following code in it: controller = mozmill.getBrowserController();  This creates a "controller" object for the test to use.  The &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; is the heart of all Mozmill interfaces in that it allows you to completely control the application under test.  However, this makes use of a global object called mozmill to instantiate the controller.  The mozmill object API provides many convenience methods to help you get started testing specific applications.&lt;/p&gt;<br>
&lt;h2&gt;Method overview&lt;/h2&gt;<br>
&lt;table class="standard-table"&gt;<br>
    &lt;tbody&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#getBrowserController.28.29"&gt;getBrowserController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#newBrowserController.28.29"&gt;newBrowserController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#getDownloadsController.28.29"&gt;getDownloadsController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#getAddrbkController.28.29"&gt;getAddrbkController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#newAddrbkController.28.29"&gt;newAddrbkController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#getMail3PaneController.28.29"&gt;getMail3PaneController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#newMail3PaneController.28.29"&gt;newMail3PaneController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#getAddonsController.28.29"&gt;getAddonsController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#getPreferencesController.28.29"&gt;getPreferencesController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
             &lt;td&gt;&lt;code&gt;&lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller&lt;/a&gt; &lt;a href="#controller.MozmillController.28.29"&gt;controller.MozmillController&lt;/a&gt;();&lt;/code&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
    &lt;/tbody&gt;<br>
&lt;/table&gt;<br>
<br>
&lt;h2&gt;Attributes&lt;/h2&gt;<br>
&lt;table class="standard-table"&gt;<br>
    &lt;thead&gt;<br>
        &lt;tr&gt;<br>
            &lt;th scope="col"&gt;Attribute&lt;/th&gt;<br>
            &lt;th scope="col"&gt;Type&lt;/th&gt;<br>
            &lt;th scope="col"&gt;Description&lt;/th&gt;<br>
        &lt;/tr&gt;<br>
    &lt;/thead&gt;<br>
    &lt;tbody&gt;<br>
        &lt;tr&gt;<br>
            &lt;td&gt;&lt;code&gt;platform&lt;/code&gt;&lt;/td&gt;<br>
            &lt;td&gt;object&lt;/td&gt;<br>
            &lt;td&gt;The name of the platform according to the Gecko subsystem, i.e. Mac == Darwin, Windows == winnt, linux == linux.  For more specifc testing use the "is" attributes below.&lt;/a&gt;&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
            &lt;td&gt;&lt;code&gt;isWindows&lt;/code&gt;&lt;/td&gt;<br>
            &lt;td&gt;boolean&lt;/td&gt;<br>
            &lt;td&gt;True if the current platform is a Windows operating system&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
            &lt;td&gt;&lt;code&gt;isLinux&lt;/code&gt;&lt;/td&gt;<br>
            &lt;td&gt;boolean&lt;/td&gt;<br>
            &lt;td&gt;True if the current platform is a Linux operating system&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
            &lt;td&gt;&lt;code&gt;isMac&lt;/code&gt;&lt;/td&gt;<br>
            &lt;td&gt;boolean&lt;/td&gt;<br>
            &lt;td&gt;True if the current platform is a Mac OS X operating system&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
            &lt;td&gt;&lt;code&gt;wm&lt;/code&gt;&lt;/td&gt;<br>
            &lt;td&gt;{{ interface(nsIWindowsMediator) }}nsIWindowsMediator&lt;/td&gt;<br>
            &lt;td&gt;Shortcut to the nsIWindowsMediator service, for an example of use see controller.MozMillController below&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
        &lt;tr&gt;<br>
            &lt;td&gt;&lt;code&gt;appInfo&lt;/code&gt;&lt;/td&gt;<br>
            &lt;td&gt;{{ interface(nsIXULAppInfo) }}nsIXULAppInfo&lt;/td&gt;<br>
            &lt;td&gt;Shortcut to the nsIXULAppInfo service.&lt;/td&gt;<br>
        &lt;/tr&gt;<br>
    &lt;/tbody&gt;<br>
&lt;/table&gt;<br>
<br>
&lt;h2&gt;Browser Methods&lt;/h2&gt;<br>
&lt;h3 name="getBrowserController.28.29"&gt;getBrowserController()&lt;/h3&gt;<br>
&lt;p&gt;Gets a new browser controller for the currently open browser window.  If no window is open, it opens a new window and returns a controller for that.  Supported in Firefox and Seamonkey.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller getBrowserController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.getBrowserController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="newBrowserController.28.29"&gt;newBrowserController()&lt;/h3&gt;<br>
&lt;p&gt;Forces creation of a new browser window and returns a controller for it, regardless of how many other browser windows are open.  Supported in Firefox and Seamonkey.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller newBrowserController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.newBrowserController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="getDownlaodsController.28.29"&gt;getDownloadsController()&lt;/h3&gt;<br>
&lt;p&gt;Instantiates the Downloads window and returns a controller for that or returns a controller to an already opened Downloads window.  Supported in Firefox and Seamonkey.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller getDownloadsController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.getDownloadsController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h2&gt;Mail Methods&lt;/h2&gt;<br>
&lt;h3 name="getAddrbkController.28.29"&gt;getAddrbkController()&lt;/h3&gt;<br>
&lt;p&gt;Gets a controller for the current Thunderbird Addressbook window.  If one is not open, it opens a window and returns a controller for that.  Supported in Thunderbird.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller getAddrbkController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.getAddrbkController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="newAddrbkController.28.29"&gt;newAddrbkController()&lt;/h3&gt;<br>
&lt;p&gt;Forces the system to create a new addressbook window and returns a controller for that.  Supported in Thunderbird.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller newAddrbkController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.newAddrbkController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="getMail3PaneController.28.29"&gt;getAddrbkController()&lt;/h3&gt;<br>
&lt;p&gt;Gets a controller for the current Thunderbird window.  If one is not open, it opens a window and returns a controller for that.  Supported in Thunderbird.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller getMail3PaneController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.getMail3PaneController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="newAddrbkController.28.29"&gt;newMail3PaneController()&lt;/h3&gt;<br>
&lt;p&gt;Forces the system to create a new main Thunderbird window and returns a controller for that.  Supported in Thunderbird.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller newMail3PaneController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.newMail3PaneController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h2&gt;General Methods&lt;/h2&gt;<br>
&lt;h3 name="getAddonsController.28.29"&gt;getAddonsController()&lt;/h3&gt;<br>
&lt;p&gt;Creates a controller for the currently open Add-Ons window, if one is not open, it opens one and returns the controller for that.  Supported in all applications that use the toolkit Extension Manager to manage addons.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller getAddonsController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.getAddonsController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="getPreferencesController.28.29"&gt;getPreferencesController()&lt;/h3&gt;<br>
&lt;p&gt;Creates a controller for the currently open Preferences window, if one is not open, it opens one and returns the controller for that.  Supported in all applications.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller getPreferencesController(); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;p&gt;None&lt;/p&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
controller = mozmill.getPreferencesController();<br>
&lt;/pre&gt;<br>
<br>
&lt;h3 name="controller.MozMillController.28.29"&gt;controller.MozMillController()&lt;/h3&gt;<br>
&lt;p&gt;Creates a controller for the given window.  This works on all supported applications and allows you to create controllers for windows that do not have a convenience method above.  Supported in all applications.&lt;/p&gt;<br>
&lt;pre&gt;<br>
controller controller.MozMillController(in {{ interface(nsIDOMWindow) }} window); <br>
&lt;/pre&gt;<br>
&lt;h6&gt;Parameters&lt;/h6&gt;<br>
&lt;dl&gt;<br>
    &lt;dt&gt;&lt;code&gt;window&lt;/code&gt;&lt;/dt&gt;<br>
    &lt;dd&gt;The DOM Window you wish to wrap into a controller object&lt;/dd&gt;<br>
&lt;/dl&gt;<br>
&lt;h6&gt;Return value&lt;/h6&gt;<br>
&lt;p&gt;&lt;code&gt;controller&lt;/code&gt; Returns a &lt;a href="https://developer.mozilla.org/en/Mozmill_Tests/Mozmill_Controller_Object"&gt;controller object&lt;/a&gt; for the window.&lt;/p&gt;<br>
&lt;h6&gt;Example&lt;/h6&gt;<br>
&lt;pre function="syntax.JavaScript" class="deki-transform"&gt;<br>
// Creates a controller for the browser's page information dialog.<br>
// It assumes that you've already clicked on the proper icons to launch the dialog.<br>
let window = mozmill.wm.getMostRecentWindow('Browser:page-info');<br>
let pageInfoController = new mozmill.controller.MozMillController(window);<br>
&lt;/pre&gt;<br>
<br>
</p>
Revert to this revision