Firefox 9 技術文件

Firefox 9 was released for Windows on December 20, 2011. Mac and Linux version 9.0.1, which fixed a crashing bug discovered at the last minute, were released on December 21, 2011.

Changes for web developers




No change.



  • Workers implemented in blob URLs were broken in Firefox 8, and work again starting in Firefox 9.


  • The WebGL (en-US) context drawingBufferWidth and drawingBufferHeight attributes are now supported.


  • The non-standard restyle value for the actiontype attribute on "><maction> (en-US) elements has been removed.
  • While still unsupported, using the "><mlabeledtr> element no longer breaks rendering completely. See bug 689641 for progress on actual support of this element.


  • You can now send the contents of JavaScript typed arrays (that is, the contents of an ArrayBuffer object) using XMLHttpRequest.
  • WebSocket connections now permit non-characters in otherwise valid UTF-8 data frames to be received, instead of failing.
  • The HTTP Accept header for XSLT requests has been changed to simply "*/*" for simplicity. Since fetching XSLT has always fallen back to "*/*" anyway, it made sense to simplify the initial request.
  • Attempts by a server to use the 301 Moved Permanently or 307 Temporary Redirect response codes to redirect the user to a javascript: URI now result in a "bad connection" error instead of actually redirecting. This prevents certain types of cross-site scripting attacks.
  • Content served with an empty Content-Disposition (en-US) were previously treated as if the Content-Disposition (en-US) were "attachment"; this didn't always work as expected. These are now handled as if the Content-Disposition (en-US) were "inline".
  • The default maximum size of an item in the disk cache has been increased to 50 MB; previously, only items up to 5 MB were cached.

Developer tools

Changes for Mozilla and add-on developers

See Updating add-ons for Firefox 9 for an overview of the changes you may need to make to get your add-ons working in Firefox 9.


  • The tab element now has a pending attribute, whose value is true, when the tab is in the process of being restored by the session store service. This can be used for styling the tab in themes. The attribute isn't present on tabs that aren't pending.
  • The tab element now has an unread attribute, whose value is true, when the tab has changed since the last time it was the active tab or if it hasn't been selected since the current session began. The attribute isn't present on tabs that are not unread.
  • You can now use a panel as a drag image for DOM drag and drop operations. This lets you use the standard drag & drop API for drag and drop of XUL content (en-US).
  • The notificationbox element's appendNotification method now lets you specify a callback that gets called for interesting events related to the notification box. Currently, the only event is "removed", which tells you the box has been removed from its window.

JavaScript code module changes

  • FileUtils.jsm now has a File constructor that returns an nsIFile object representing a file specified by its pathname.

Service changes


  • NSPR now has an "append" module, which lets you append new data to the end of an existing log.

Interface changes

Removed interfaces

  • nsIGlobalHistory3 has been removed during streamlining of the Places and DocShell code.

Miscellaneous interface changes

  • The nsISound interface has a new constant, EVENT_EDITOR_MAX_LEN. The allows for playing the system sound for when more characters than the maximum allowed are typed into a text field. Currently, this is only used on Windows.
  • The nsIScriptError2 interface has new timeStamp and innerWindowID properties; in addition, the initWithWindowID() method now takes an inner window ID instead of an outer window ID.
  • The nsIBidiKeyboard.haveBidiKeyboards attribute has been added; this lets you determine if the system has at least one keyboard installed for each direction: left-to-right and right-to-left.
  • The new nsIEditor.isSelectionEditable attribute lets you determine if the current selection anchor is editable. This helps to support cases where only parts of the document are editable, by letting you see if the current selection is in an editable section.
  • The nsIBrowserHistory.registerOpenPage() and nsIBrowserHistory.unregisterOpenPage() methods have been removed as part of a performance overhaul in the Places system. You can use the corresponding methods in mozIPlacesAutoComplete instead.
  • The nsIDOMWindowUtils.wrapDOMFile() method has been added; this returns a DOM File object for a given nsIFile.
  • The nsIChromeFrameMessageManager.removeDelayedFrameScript() method was added to support removing delayed load scripts. Bootstrapped add-ons should use this, at shutdown, to remove any scripts it loaded using nsIChromeFrameMessageManager.loadFrameScript() with the delayed load flag set. This is exposed to add-ons as browser.messageManager.removeDelayedFrameScript().
  • The nsIAppStartup interface has a new interrupted attribute, which lets you know if the startup process was interrupted at any point by an interactive prompt. This can be helpful, for example, when timing startups during performance evaluation, to be able to drop numbers from sessions that were interrupted.
  • The nsIEditorSpellCheck interface has been revised to support per-site selection of spell checker dictionaries.

IDL parser

The IDL parser no longer includes support for the never fully-implemented notion of unique pointers.

Build system changes

  • The --enable-application=standalone option for building standalone XPConnect has been removed; it hasn't worked since 2007 anyway.
  • Support for building Necko and Transformiix XSLT standalone has been removed; you can no longer use --enable-application=network or --enable-application=content/xslt.
  • The build system now looks for .mozconfig at $topsrcdir/.mozconfig or $topsrcdir/mozconfig, and nowhere else, unless you override the .mozconfig path using the MOZCONFIG environment variable.
  • The xpidl utility has been replaced in the SDK with pyxpidl.

Other changes

  • The spell checker no longer has an arbitrary 130-character word-length limit on the length of words it will attempt to spell check. This limit was previously in place to prevent crashes that were occurring in the spell checker, but the underlying bugs have since been fixed.
  • You can now register components to add features to the window.navigator object by using the "JavaScript-navigator-property" category. See Adding APIs to the navigator object for details and examples.

See also