Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 693115 of addon-page

  • Revision slug: Mozilla/Add-ons/SDK/High-Level_APIs/addon-page
  • Revision title: addon-page
  • Revision id: 693115
  • Created:
  • Creator: wbamberg
  • Is current revision? No
  • Comment

Revision Content

Deprecated

This module will be removed in Firefox 35.

Create a page that does not contain navigational elements.

Usage

With the Add-on SDK you can present information to the user, such as a guide to using your add-on, in a browser tab. You can supply the content in an HTML file in your add-on's "data" directory.

This module has no effect on Fennec.

For pages like this, navigational elements such as the Awesome Bar, Search Bar, or Bookmarks Toolbar are not usually relevant and distract from the content you are presenting. The addon-page module provides a simple way to have a page which excludes these elements.

To use the module import it using require(). After this, the page loaded from "data/index.html" will not contain navigational elements:

var addontab = require("sdk/addon-page");
var data = require("sdk/self").data;
 
require("sdk/tabs").open(data.url("index.html"));

This only affects the page at "data/index.html": all other pages are displayed normally.

Revision Source

<div class="note">
 <p>Deprecated</p>
 <p>This module will be removed in Firefox 35.</p>
</div>
<p><span class="seoSummary">Create a page that does not contain navigational elements.</span></p>
<h2 id="Usage">Usage</h2>
<p>With the Add-on SDK you can present information to the user, such as a guide to using your add-on, in a browser tab. You can supply the content in an HTML file in your add-on's "data" directory.</p>
<div class="note">
 <p>This module has no effect on Fennec.</p>
</div>
<p>For pages like this, navigational elements such as the <a href="https://support.mozilla.org/en-US/kb/Location%20bar%20autocomplete">Awesome Bar</a>, <a href="https://support.mozilla.org/en-US/kb/Search%20bar">Search Bar</a>, or <a href="https://support.mozilla.org/en-US/kb/Bookmarks%20Toolbar">Bookmarks Toolbar</a> are not usually relevant and distract from the content you are presenting. The <code>addon-page</code> module provides a simple way to have a page which excludes these elements.</p>
<p>To use the module import it using <code>require()</code>. After this, the page loaded from "data/index.html" will not contain navigational elements:</p>
<pre class="brush: js">
var addontab = require("sdk/addon-page");
var data = require("sdk/self").data;
 
require("sdk/tabs").open(data.url("index.html"));
</pre>
<p><img alt="" src="https://mdn.mozillademos.org/files/6503/addon-page.png" style="width: 666px; height: 722px; display: block; margin-left: auto; margin-right: auto;" /></p>
<p>This only affects the page at "data/index.html": all other pages are displayed normally.</p>
Revert to this revision