Updating extensions for Firefox 3.6

  • Revision slug: Updating_extensions_for_Firefox_3.6
  • Revision title: Updating extensions for Firefox 3.6
  • Revision id: 126082
  • Created:
  • Creator: Fcp
  • Is current revision? No
  • Comment 33 words added

Revision Content

{{ fx_minversion_header("3") }}

This article provides helpful information to extension developers trying to update their extensions to work properly in Firefox 3.6.

User interface changes

Right-clicking on elements (including links and images) no longer offers a "Properties" menu item. The properties dialog box was not useful for most users and has been removed. If your extension interacts with that menu item in any way, you'll need to revise your code to add it yourself, or contribute your own context menu entry directly.

Add-on package changes

In order to allow add-ons' icons to be displayed even when they're disabled, Gecko 1.9.2 added support for automatically detecting and using an icon named icon.png, located in the add-on's root directory. This is used if the add-on is disabled, or if the manifest is missing an iconURL entry.

HTML 5 compliance improvements

The DOM Level 2 views to HTML and XHTML documents are now unified per HTML 5.

  • The localName DOM property now returns the name of HTML element nodes in lower case. Previously, in HTML documents, it returned it in upper case. (DOM Level 1 tagName continues to return in upper case in HTML documents.)
  • The namespaceURI DOM property now returns "http://www.w3.org/1999/xhtml" on HTML element nodes. Previously, in HTML documents, it returned null.
  • document.createElementNS(null, "FOO") no longer creates an HTML element node in HTML documents. document.createElement("FOO") or document.createElementNS("http://www.w3.org/1999/xhtml", "foo") continue to work in HTML documents.
  • The name and the local-name functions in XPath returns the name of HTML elements in lower case. Previously, in HTML documents, they returned it in upper case.

The most probable upgrade problem is the pattern if (elt.localName == "FOO").

Example: Testing if an element is an HTML img element

Firefox 3.6, both text/html and application/xhtml+xml

if (elt.localName == "img" && elt.namespaceURI == "http://www.w3.org/1999/xhtml")

Firefox 3.5 and 3.6, only extension-supplied text/html without foreign (e.g. SVG) script-inserted elements

if (elt.tagName == "IMG")

Firefox 3.5 and 3.6, both text/html and application/xhtml+xml

if (elt instanceof HTMLImageElement)

contents.rdf no longer supported

Support for the obsolete contents.rdf method for registering chrome has been removed in Gecko 1.9.2, and is no longer supported by Firefox 3.6. This means that add-ons that use contents.rdf can no longer be installed.

Note: Add-ons that are already installed using the old contents.rdf method for registering chrome will continue to function if already installed. Make sure that you test your add-on by actually removing and reinstalling it to ensure that the install works after updating it to use an install manifest.

Revision Source

<p>{{ fx_minversion_header("3") }}</p>
<p>This article provides helpful information to extension developers trying to update their extensions to work properly in Firefox 3.6.</p>
<h2>User interface changes</h2>
<p>Right-clicking on elements (including links and images) no longer offers a "Properties" menu item. The properties dialog box was not useful for most users and has been removed. If your extension interacts with that menu item in any way, you'll need to revise your code to add it yourself, or contribute your own context menu entry directly.</p>
<h2>Add-on package changes</h2>
<p>In order to allow add-ons' icons to be displayed even when they're disabled, Gecko 1.9.2 added support for automatically detecting and using an icon named <code>icon.png</code>, located in the add-on's root directory. This is used if the add-on is disabled, or if the manifest is missing an <code>iconURL</code> entry.</p>
<h2>HTML 5 compliance improvements</h2>
<p>The DOM Level 2 views to HTML and XHTML documents are now unified per HTML 5.</p>
<ul> <li>The <a class="internal" href="/En/DOM/Node.localName" title="en/DOM/node.localName"><code>localName</code></a> DOM property now returns the name of HTML element nodes in lower case. Previously, in HTML documents, it returned it in upper case. (DOM Level 1 <a class="internal" href="/en/DOM/node.tagName" title="en/DOM/node.tagName"><code>tagName</code></a> continues to return in upper case in HTML documents.)</li> <li>The <a class="internal" href="/En/DOM/Node.namespaceURI" title="en/DOM/node.namespaceURI"><code>namespaceURI</code></a> DOM property now returns <code>"<span class="nowiki">http://www.w3.org/1999/xhtml</span>"</code> on HTML element nodes. Previously, in HTML documents, it returned <code>null</code>.</li> <li><code>document.<a class="internal" href="/en/DOM/document.createElementNS" title="en/DOM/document.createElementNS">createElementNS</a>(null, "FOO")</code> no longer creates an HTML element node in HTML documents. <code>document.<a class="internal" href="/en/DOM/document.createElement" title="en/DOM/document.createElement">createElement</a>("FOO")</code> or <code>document.createElementNS("<span class="nowiki">http://www.w3.org/1999/xhtml</span>", "foo")</code> continue to work in HTML documents.</li> <li>The <a href="/en/XPath/Functions/name" title="en/XPath/Functions/name"><code>name</code></a> and the <a href="/en/XPath/Functions/local-name" title="en/XPath/Functions/local-name"><code>local-name</code></a> functions in XPath returns the name of HTML elements in lower case. Previously, in HTML documents, they returned it in upper case.</li>
</ul>
<p>The most probable upgrade problem is the pattern <code>if (elt.localName == "FOO")</code>.</p>
<h3>Example: Testing if an element is an HTML img element</h3>
<h4>Firefox 3.6, both text/html and application/xhtml+xml</h4>
<p><code>if (elt.localName == "img" &amp;&amp; elt.namespaceURI == "<a class=" external" href="http://www.w3.org/1999/xhtml" rel="freelink">http://www.w3.org/1999/xhtml</a>")</code></p>
<h4>Firefox 3.5 and 3.6, only extension-supplied text/html without foreign (e.g. SVG) script-inserted elements</h4>
<p><code>if (elt.tagName == "IMG")</code></p>
<h4>Firefox 3.5 and 3.6, both text/html and application/xhtml+xml</h4>
<p><code>if (elt instanceof HTMLImageElement)</code></p>
<h2>contents.rdf no longer supported</h2>
<p>Support for the obsolete <code>contents.rdf</code> method for registering chrome has been removed in Gecko 1.9.2, and is no longer supported by Firefox 3.6. This means that add-ons that use contents.rdf can no longer be installed.</p>
<div class="note"><strong>Note:</strong> Add-ons that are already installed using the old contents.rdf method for registering chrome will continue to function if already installed. Make sure that you test your add-on by actually removing and reinstalling it to ensure that the install works after updating it to use an install manifest.</div>
Revert to this revision