Firefox 8 技術文件

Firefox 8 was released on November 8, 2011. This article provides information both for web developers and for add-on and Mozilla project developers to help take full advantage of the features of this release.

Changes for web developers






  • Double quotes are no longer accepted as a delimiter for RFC 2231 or RFC 5987 encoding, as per those RFCs.
  • MIME header field parser (Content-Disposition) now requires "=" in parameters.
  • Scripts are no longer downloaded when JavaScript is disabled.
  • SSL 2.0 is no longer supported.


  • The WebSocket object's send() method no longer incorrectly returns a Boolean value.
  • The WebSocket object's close() method now matches the current draft of the standard, and close events now properly use the CloseEvent interface.
  • The WebSocket object's extensions attribute is now supported.
  • The WebSocket constructor now supports an array of protocols as well as a single protocol string.
  • Mixed content is not allowed with WebSockets; that is, you can no longer open a connection to a non-secure WebSocket server from secure content.
  • Connection errors with WebSockets now trigger the onerror handler.
  • WebSocket API has been updated to the latest draft of the specification (see bug 674890, bug 674527, and bug 674716).
  • The deflate-stream extension to WebSockets has been disabled; it has been deprecated, and was breaking compatibility with some sites.


  • Cross-domain textures can now be allowed with CORS approval.
  • Cross-process rendering with Direct2D/Direct3D 10.


  • Support for the displaystyle attribute on the top-level "><math> (en-US) element has been added.
  • The interpretation of negative row numbers for the align attribute on "><mtable> (en-US) has been corrected.

Developer tools

  • The console object has a new dir() method, which displays an interactive list of the properties on a specified object.

Changes for Mozilla and add-on developers

See Updating add-ons for Firefox 8 for a guide to changes you're likely to have to make to make your add-ons compatible with Firefox 8.

備註: Firefox 8 requires that binary components be recompiled, as do all major releases of Firefox. See Binary Interfaces for details.



The new methods Components.utils.createObjectIn() and Components.utils.makeObjectPropsNormal() have been created to make it easier to create objects in specific compartments.

  • You can now instantiate DOM File objects from component code by simply doing new File, instead of having to instantiate an nsIDOMFile directly.
  • The nsTPtrArray array type has been removed. Its functionality is now all available on nsTArray, which now offers the SafeElementAt() method when instantiated using a pointer type. See the section on SafeElementAt() in the XPCOM array guide for more information.


It is no longer possible to access XPCOM objects from ChromeWorkers. XPConnect has been disabled in worker contexts as of bug 649537.


Changes to the build system

  • The following build configuration options have been removed:
    • --enable-timeline
    • --disable-storage
    • --necko-disk-cache
  • When compiling IDL files to headers, the header file jspubtd.h is automatically included when needed. Manual inclusions of jspubtd.h and/or jsapi.h in IDL files that use jsval or [implicit_jscontext] are no longer necessary.

Chrome registration

  • The platformversion flag can be used in the chrome.manifest to specify Gecko version compatibility.

Interface changes

Removed interfaces

The following interfaces were implementation details that are no longer needed:

  • nsITimelineService
  • nsIDOMHTMLIsIndexElement

The nsIWorkerFactory interface has been removed as well. Workers can still be created using the Worker and ChromeWorker constructors.

Other changes

  • When a window is minimized, un-minimized, or switches between full screen and windowed mode, it receives a sizemodechange event.
  • You can now use the extensions.autoDisableScopes preference to disable automatic installation of add-ons from specific add-on install locations.
  • The new document.mozSyntheticDocument (en-US) property on Document objects lets you determine whether a document is synthetic (that is, something like a standalone image, video, or audio file) rather than a full, standard DOM document. This can be useful, for example, if you want to present different user interface in this situation (such as adding contextual items differently depending on this case).
  • You can now specify a filter when opening about:config; for example, "about:config?filter=sessionstore" will show only session storage related preferences.

See also