1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
---
title: Firefox 6 技術文件
slug: Mozilla/Firefox/Releases/6
translation_of: Mozilla/Firefox/Releases/6
---
<div><section id="Quick_links">
<ol>
<li class="toggle">
<details>
<summary>Firefox developer release notes</summary>
<ol>
<li><a href="/zh-TW/docs/Mozilla/Firefox/Releases">Firefox developer release notes</a></li>
</ol>
</details>
</li>
<li class="toggle">
<details>
<summary>擴充套件</summary>
<ol>
<li><a href="/zh-TW/Add-ons/WebExtensions">瀏覽器擴充功能</a></li>
<li><a href="/zh-TW/Add-ons/Themes">主題</a></li>
</ol>
</details>
</li>
<li class="toggle">
<details>
<summary>Firefox internals</summary>
<ol>
<li><a href="/zh-TW/docs/Mozilla/">Mozilla project</a></li>
<li><a href="/zh-TW/docs/Mozilla/Gecko">Gecko</a></li>
<li><a href="/zh-TW/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li>
<li><a href="/zh-TW/docs/Mozilla/JavaScript_code_modules">JavaScript 程式碼模組</a></li>
<li><a href="/zh-TW/docs/Mozilla/js-ctypes">JS-ctypes</a></li>
<li><a href="/zh-TW/docs/Mozilla/MathML_Project">MathML 專案</a></li>
<li><a href="/zh-TW/docs/Mozilla/MFBT">MFBT</a></li>
<li><a href="/zh-TW/docs/Mozilla/Projects">Mozilla 專案</a></li>
<li><a href="/zh-TW/docs/Mozilla/Preferences">Preference system</a></li>
<li><a href="/zh-TW/docs/Mozilla/WebIDL_bindings">WebIDL bindings</a></li>
<li><a href="/zh-TW/docs/Mozilla/Tech/XPCOM">XPCOM</a></li>
<li><a href="/zh-TW/docs/Mozilla/Tech/XUL">XUL</a></li>
</ol>
</details>
</li>
<li class="toggle">
<details>
<summary>Building and contributing</summary>
<ol>
<li><a href="/zh-TW/docs/Mozilla/Developer_guide/Build_Instructions">建置教學</a></li>
<li><a href="/zh-TW/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">Configuring build options</a></li>
<li><a href="/zh-TW/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">How the build system works</a></li>
<li><a href="/zh-TW/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla 原始碼</a></li>
<li><a href="/zh-TW/docs/Mozilla/Localization">在地化</a></li>
<li><a href="/zh-TW/docs/Mozilla/Mercurial">Mercurial</a></li>
<li><a href="/zh-TW/docs/Mozilla/QA">Quality assurance</a></li>
<li><a href="/zh-TW/docs/Mozilla/Using_Mozilla_code_in_other_projects">在我們的專案中使用 Mozilla 程式碼</a></li>
</ol>
</details>
</li>
</ol>
</section></div><p>Firefox 6, based on Gecko 6.0, was released on August 16, 2011. This article provides links to information about the changes that affect developers in this release.</p>
<h2 id="Changes_for_web_developers">Changes for web developers</h2>
<h3 id="HTML">HTML</h3>
<dl>
</dl>
<ul>
<li>The HTML5 <a href="/zh-TW/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a> element, which lets you create a progress bar, is now supported.</li>
<li>The parsing of the HTML5 <a href="/zh-TW/docs/Web/HTML/Element/track" title="The documentation about this has not yet been written; please consider contributing!"><code><track></code></a> element, which specifies text tracks for media elements, is now supported. This element should appear in the DOM now, though its behavior is still not implemented.</li>
<li>The <a href="/zh-TW/docs/Web/HTML/Element/iframe" title="The documentation about this has not yet been written; please consider contributing!"><code><iframe></code></a> element is now clipped correctly by its container when the container's corners have been rounded using the <a href="/zh-TW/docs/Web/CSS/border-radius" title="The documentation about this has not yet been written; please consider contributing!"><code>border-radius</code></a> property.</li>
<li><a href="/zh-TW/docs/Web/HTML/Element/form" title="The documentation about this has not yet been written; please consider contributing!"><code><form></code></a> elements' text <a href="/zh-TW/docs/Web/HTML/Element/input" title="The HTML <input> element is used to create interactive controls for web-based forms in order to accept data from the user."><code><input></code></a> fields no longer support the XUL <code><span><a href="https://developer.mozilla.org/zh-TW/docs/XUL/Property/maxwidth">maxwidth</a></span></code> property; this was never intentional, and is in violation of the HTML specification. You should instead use the <code><a href="/zh-TW/docs/Web/HTML/Element/input#attr-size">size</a></code> attribute to set the maximum width of input fields.</li>
<li>The <a href="/zh-TW/docs/Web/HTML/Element/canvas" title="這個 HTML <canvas> 元素 可以被使用於對腳本程式(JaveScript) 繪圖 .舉例來說, 它能用來畫圖,組合照片,甚至作動畫. 你也許(應該) 在<canvas>區段內提供替代方案的內容 .這內容將能被一些不支援<canvas>以及無法使用Javescript功能的瀏覽器所渲染 ."><code><canvas></code></a> <a href="/zh-TW/docs/Web/API/CanvasRenderingContext2d" title='要取得此實作此介面的實體物件,可以於一個 &lt;canvas> 元素上以 "2d" 為參數呼叫 getContext() 方法:'><code>CanvasRenderingContext2d</code></a> properties <code>fillStyle</code> and <code>strokeStyle</code> used to ignore garbage included after a valid color definition; now this is correctly treated as an error. For example, "red blue" as a color used to be treated as "red", when it should have been ignored.</li>
<li>The width and height of <a href="/zh-TW/docs/Web/HTML/Element/canvas" title="這個 HTML <canvas> 元素 可以被使用於對腳本程式(JaveScript) 繪圖 .舉例來說, 它能用來畫圖,組合照片,甚至作動畫. 你也許(應該) 在<canvas>區段內提供替代方案的內容 .這內容將能被一些不支援<canvas>以及無法使用Javescript功能的瀏覽器所渲染 ."><code><canvas></code></a> elements can now properly be set to 0px; previously, these were getting arbitrarily set to 300px when you tried to do that.</li>
<li>Support for the HTML <a href="/en/HTML/Global_attributes#attr-data-*" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-data-*">custom data attributes</a> (data-*) has been added. The DOM <a href="/zh-TW/docs/Web/API/Element/dataset" title="The documentation about this has not yet been written; please consider contributing!"><code>element.dataset</code></a> property allows to access them.</li>
<li>When a <a href="/zh-TW/docs/Web/HTML/Element/textarea" title="The documentation about this has not yet been written; please consider contributing!"><code><textarea></code></a> element receives focus, the text insertion point is now placed, by default, at the beginning of the text rather than at the end. This makes Firefox's behavior consistent with other browsers.</li>
</ul>
<h3 id="CSS">CSS</h3>
<dl>
<dt>
<a href="/zh-TW/docs/Web/CSS/text-decoration-color" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-decoration-color</code></a></dt>
<dd>
This new property lets you set the color used by text decorations, such as underlines, overlines, and strikethroughs.</dd>
<dt>
<a href="/zh-TW/docs/Web/CSS/text-decoration-line" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-decoration-line</code></a></dt>
<dd>
This new property lets you set the kind of text decorations added to an element.</dd>
<dt>
<a href="/zh-TW/docs/Web/CSS/text-decoration-style" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-decoration-style</code></a></dt>
<dd>
This new property lets you set the style of text decorations, such as underlines, overlines, and strikethroughs. Styles include single-strokes, double strokes, wavy lines, dotted lines, and so forth.</dd>
<dt>
<a href="/zh-TW/docs/Web/CSS/hyphens" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-hyphens</code></a></dt>
<dd>
This new property lets you control how hyphenation of words during line wrapping is handled.</dd>
<dt>
<a href="/zh-TW/docs/Web/CSS/orient" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-orient</code></a></dt>
<dd>
A new (currently Mozilla-specific) property which lets you control the vertical or horizontal orientation of certain elements (particularly <a href="/zh-TW/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a>).</dd>
<dt>
<a href="/zh-TW/docs/Web/CSS/::-moz-progress-bar" title="The documentation about this has not yet been written; please consider contributing!"><code>::-moz-progress-bar</code></a></dt>
<dd>
A Mozilla-specific pseudo-element that lets you style the area of an <a href="/zh-TW/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a> element representing the completed portion of a task.</dd>
</dl>
<h4 id="Other_changes">Other changes</h4>
<ul>
<li>The <a href="/zh-TW/docs/Web/CSS/@-moz-document" title="The documentation about this has not yet been written; please consider contributing!"><code>@-moz-document</code></a> property has a new <code>regexp()</code> function, which lets you match the document's URL to a <a href="/en/JavaScript/Guide/Regular_Expressions" title="en/Core JavaScript 1.5 Guide/Regular Expressions">regular expression</a>.</li>
<li>The <a href="/zh-TW/docs/Web/CSS/azimuth" title="The documentation about this has not yet been written; please consider contributing!"><code>azimuth</code></a> CSS property is no longer supported, as we have removed what little code we had for the <code>aural</code> media group. It was never significantly implemented, so it made more sense to remove the crufty implementation for the time being rather than try to patch it up.</li>
<li>In the past, the <a href="/zh-TW/docs/Web/CSS/:hover" title="The documentation about this has not yet been written; please consider contributing!"><code>:hover</code></a> pseudoclass was not applied to class selectors when in quirks mode; for example, <code>.someclass:hover</code> did not work. This quirk has been removed.</li>
<li>The <a href="/zh-TW/docs/Web/CSS/:indeterminate" title="The documentation about this has not yet been written; please consider contributing!"><code>:indeterminate</code></a> pseudo-class can be applied to <a href="/zh-TW/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a> elements. This is non-standard, but we hope it will be adopted by other browsers, because it will be useful.</li>
<li>The <code>-moz-win-exclude-glass </code>value has been added to the <a href="/zh-TW/docs/Web/CSS/-moz-appearance" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-appearance</code></a> CSS property in order to exclude opaque regions in Aero Glass glaze effects on Windows systems.</li>
<li>
<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=658949" title="FIXED: data URL with hash - content doesn't match location.">bug 658949</a> changed how the hash (#) symbol is treated in data URIs which may break CSS stylesheets which contain such a symbol if it is not escaped.</p>
</li>
</ul>
<h3 id="DOM">DOM</h3>
<dl>
<dt>
<a href="/en/CSS/Using_media_queries_from_code" title="en/CSS/Using media queries from code">Using media queries from code</a></dt>
<dd>
You can now test the result of a media query string programmatically using the <a href="/zh-TW/docs/Web/API/Window/matchMedia" title="The documentation about this has not yet been written; please consider contributing!"><code>window.matchMedia()</code></a> method and the <a href="/zh-TW/docs/Web/API/MediaQueryList" title="MediaQueryList 物件維護一組針對 document 的 media querie , 並且當 media querie 相對應的文件狀態改變時,觸發註冊的事件處理器通知之。"><code>MediaQueryList</code></a> interface.</dd>
<dt>
<a href="/en/DOM/Touch_events" title="en/DOM/Touch events">Touch events</a></dt>
<dd>
Firefox 6 adds support for W3C standard touch events; these make it easy to interpret one or more touches at a time on touch-sensitive surfaces such as touch screens and trackpads.</dd>
<dt>
<a href="/en/Server-sent_events" title="en/Server-sent events">Server-sent events</a></dt>
<dd>
Server-sent events make it possible for a web application to ask a server to send events just like any locally-created DOM event.</dd>
</dl>
<ul>
<li><code>navigator.securityPolicy</code>, which has returned an empty string for a long time, has been removed outright.</li>
<li><a href="/zh-TW/docs/Web/API/BlobBuilder" title="The documentation about this has not yet been written; please consider contributing!"><code>BlobBuilder</code></a> is now implemented, although for now it's prefixed (so you need to use <code>MozBlobBuilder</code>).</li>
<li>The <a href="/zh-TW/docs/Web/API/Document/height" title="The documentation about this has not yet been written; please consider contributing!"><code>document.height</code></a> and <a href="/zh-TW/docs/Web/API/Document/width" title="傳回目前文件中,<body> 元素的寬度有多少像素。"><code>document.width</code></a> have been removed. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=585877" title="FIXED: remove document.height / document.width">bug 585877</a></li>
<li>The <a href="/zh-TW/docs/Web/API/DocumentType" title="DocumentType 介面表示了一個代表文件類型的 Node 節點。"><code>DocumentType</code></a> object's <code>entities</code> and <code>notations</code> properties, which were never implemented and always returned <code>null</code>, have been removed, since they've been removed from the specification anyway.</li>
<li>The <code>DOMConfiguration</code> interface and the <code>document.domConfig</code> property that used it have both been removed; they were never supported and have since been removed from the DOM specification.</li>
<li>The <code>hashchange</code> event now correctly includes <a href="/en/DOM/window.onhashchange#The_hashchange_event" title="en/DOM/window.onhashchange#The hashchange event">the <code>newURL</code> and <code>oldURL</code> fields</a>.</li>
<li>The <a href="/zh-TW/docs/Web/API/FileReader" title="藉由 FileReader 物件,Web 應用程式能以非同步(asynchronously)方式讀取儲存在用戶端的檔案(或原始資料暫存)內容,可以使用 File 或 Blob 物件指定要讀取的資料。"><code>FileReader</code></a> interface's <code>abort()</code> method now throws an exception when used if no file read is in progress.</li>
<li>The <a href="/zh-TW/docs/Web/API/Window/postMessage" title="The documentation about this has not yet been written; please consider contributing!"><code>window.postMessage()</code></a> method now uses <a href="/en/DOM/The_structured_clone_algorithm" title="en/DOM/The structured clone algorithm">the structured clone algorithm</a> to let you pass JavaScript objects instead of just strings from one window to another.</li>
<li>The <a href="/zh-TW/docs/Web/API/Window/history" title="The documentation about this has not yet been written; please consider contributing!"><code>window.history</code></a> API now uses <a href="/en/DOM/The_structured_clone_algorithm" title="en/DOM/The structured clone algorithm">the structured clone algorithm</a> to serialize the objects you pass to the <code>pushState()</code> and <code>replaceState()</code> methods; this lets you use more complex objects (including those that contain cyclic graphs of references).</li>
<li>You can now <a href="/en/Printing#Detecting_print_requests" title="https://developer.mozilla.org/en/Printing#Detecting_print_requests">detect when printing has been initiated and has completed</a> by listening for the new <code>beforeprint</code> and <code>afterprint</code> events.</li>
<li>The <code>document.strictErrorChecking</code> property has been removed, since it was never implemented and was removed from the DOM specification.</li>
<li>The standard <a href="/zh-TW/docs/Web/API/Event/defaultPrevented" title="回傳一個布林值,表示事件的預設行為是否被取消,也就是事件物件是否曾執行 preventDefault() 方法。"><code>event.defaultPrevented</code></a> property is now supported; you should use this instead of the non-standard <code>getPreventDefault()</code> method to detect whether or not <a href="/zh-TW/docs/Web/API/Event/preventDefault" title="如果事件可以被取消,就取消事件(即取消事件的預設行為)。但不會影響事件的傳遞,事件仍會繼續傳遞。"><code>event.preventDefault()</code></a> was called on the event.</li>
<li>The <a href="/zh-TW/docs/Web/API/Window/top" title="The documentation about this has not yet been written; please consider contributing!"><code>window.top</code></a> property is now properly read only.</li>
<li>DOM views, which we never documented, have been removed. This was a bit of implementation detail that was unnecessarily complicating things, so we got rid of it. If you notice this change, you're probably doing something wrong.</li>
<li>The <code>EventTarget</code> function <a href="/en/XPCOM_Interface_Reference/nsIDOMEventTarget" title="en/XPCOM Interface Reference/nsIDOMEventTarget"><code>addEventListener()</code></a>'s <code>useCapture</code> parameter is now optional, as it is in WebKit (and as per the latest version of the specification).</li>
<li>The <code>mozResponseArrayBuffer</code> property of the <a href="/en/DOM/XMLHttpRequest" title="en/XMLHttpRequest"><code>XMLHttpRequest</code></a> object has been replaced with the <code>responseType</code> and <code>response</code> properties.</li>
<li>The <a href="/zh-TW/docs/Web/API/Element/dataset" title="The documentation about this has not yet been written; please consider contributing!"><code>element.dataset</code></a> property has been added to the <a href="/en/DOM/HTMLElement" title="en/DOM/HTMLElement"><code>HTMLElement</code></a> interface allowing access to the <a href="/en/HTML/Global_attributes#attr-data-*" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-data-*"><code>data-*</code> global attributes</a> of an element.</li>
<li>The <a href="/zh-TW/docs/Web/API/CustomEvent" title="CustomEvent interface 是應用程式為了任意目的所初始化的事件。"><code>CustomEvent</code></a> interface has been implemented. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=427537" title="FIXED: Implement CustomEvent DOM3 specification">bug 427537</a>)</li>
<li>For security reasons, <code>data:</code> and <code>javascript:</code> URIs no longer inherit the security context of the current page when the user enters them in the location bar; instead, a new, empty, security context is created. This means that script loaded by entering <code>javascript:</code> URIs in the location bar no longer has access to DOM methods and the like, for example. These URIs continue to work as before when used by script, however.</li>
</ul>
<h3 id="JavaScript">JavaScript</h3>
<ul>
<li>In the past, it was possible to use the <code>new</code> operator on several built-in functions (eval, parseInt, Date.parse...) that should not have allowed it, according to the specification. This behavior is no longer supported. Using the <code>new</code> operator in this way was never officially supported and was not widely done, so it's unlikely that this change affects you.</li>
<li>ECMAScript Harmony <a href="/en/JavaScript/Reference/Global_Objects/WeakMap" title="en/JavaScript/Reference/Global_Objects/WeakMap">WeakMaps</a> have been added as a prototype implementation.</li>
</ul>
<h3 id="SVG">SVG</h3>
<ul>
<li>The <code><a href="/zh-TW/docs/Web/SVG/Attribute/pathLength">pathLength</a></code> attribute is now supported.</li>
<li>SVG patterns, gradients, and filters now work correctly when loaded from <a href="/en/data_URIs" title="https://developer.mozilla.org/en/data_URIs"><code>data:</code> URLs</a>.</li>
</ul>
<h3 id="MathML">MathML</h3>
<ul>
<li>The implementation of <code><a href="/zh-TW/docs/Web/MathML/Element/mstyle" title="<mstyle>"><mstyle></a></code> has been corrected.</li>
</ul>
<h3 id="Accessibility_ARIA">Accessibility (ARIA)</h3>
<ul>
<li>A state change event is now correctly sent when the value of <code>aria-busy</code> changes.</li>
<li>An attribute change event is now correctly sent when <code>aria-sort</code> occurs.</li>
</ul>
<h3 id="Networking">Networking</h3>
<dl>
<dt>
<a href="/en/WebSockets" title="en/WebSockets">WebSockets</a></dt>
<dd>
WebSockets was updated to protocol version 07 for Firefox 6. In addition, the global <code>WebSocket</code> object has been renamed to <code>MozWebSocket</code> to prevent it from incorrectly being used to detect the availability of unprefixed WebSockets.</dd>
</dl>
<ul>
<li>Parsing of the <code>Content-Disposition</code> header has been fixed to properly interpret backslash-escaped ASCII characters as just that character itself. Previously it was incorrectly replacing that character with an underscore ("_").</li>
<li>The value of the path field on <code>Set-Cookie</code> headers is now interpreted correctly when quotes are used; previously, they were being treated as part of the path string instead of as delimiters. <strong>This change may affect compatibility with some web sites</strong>, so authors should check their code.</li>
<li>The <a class="external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.42" title="www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"><code>Upgrade</code></a> request header is now supported; you can request an upgrade of an HTTP channel to another protocol by calling <code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIHttpChannelInternal#HTTPUpgrade()">nsIHttpChannelInternal.HTTPUpgrade()</a></code>.</li>
</ul>
<h3 id="Other_changes_2">Other changes</h3>
<ul>
<li>Support for microsummaries has been removed; these were never widely used, were not very discoverable, and continuing to support them was making improvements to the Places (bookmark and history) architecture difficult.</li>
<li>WebGL now supports the <a class="external" href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt" title="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"><code>OES_texture_float</code></a> extension.</li>
<li>The new <a href="/en/Tools/Scratchpad" title="en/Tools/Scratchpad">Scratchpad</a> tool provides a handy place to experiment with JavaScript code.</li>
<li>The <code>console.trace()</code> method has been added to the <a href="/en/Tools/Web_Console" title="https://developer.mozilla.org/en/Using_the_Web_Console">ConsoleAPI </a>(see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=585956" title="FIXED: Implement console.trace() in web console">bug 585956</a>).</li>
</ul>
<h2 id="Changes_for_Mozilla_and_add-on_developers">Changes for Mozilla and add-on developers</h2>
<p>For an overview of the changes you may need to make in order to make your add-on compatible with Firefox 6, see <a href="/en/Firefox/Updating_add-ons_for_Firefox_6" title="en/Firefox/Updating add-ons for Firefox 6">Updating add-ons for Firefox 6</a>.</p>
<div class="note">
<strong>Note:</strong> Firefox 6 requires that binary components be recompiled, as do all major releases of Firefox. See <a href="/En/Developer_Guide/Interface_Compatibility#Binary_Interfaces" title="En/Developer Guide/Interface Compatibility#Binary Interfaces">Binary Interfaces</a> for details.</div>
<h3 id="JavaScript_code_modules">JavaScript code modules</h3>
<h4 id="FileUtils.jsm">FileUtils.jsm</h4>
<ul>
<li>The <code>openSafeFileOutputStream()</code> method now opens files with the <code>DEFER_OPEN</code> <a href="/en/XPCOM_Interface_Reference/nsIFileOutputStream#Behavior_flag_constants" title="en/XPCOM Interface Reference/nsIFileOutputStream#Behavior flag constants">behavior flag</a> instead of attempting to open them immediately.</li>
</ul>
<h4 id="XPCOMUtils.jsm">XPCOMUtils.jsm</h4>
<ul>
<li>The new <a href="/en/JavaScript_code_modules/XPCOMUtils.jsm#importRelative()" title="en/JavaScript code modules/XPCOMUtils.jsm#importRelative()"><code>importRelative()</code></a> method lets you load one JavaScript code module from a path relative to the path of another JavaScript code module. This makes it easier to build modules that depend on each other.</li>
</ul>
<h3 id="XPCOM">XPCOM</h3>
<ul>
<li><a href="/en/XPCOM_array_guide#nsCOMArray.3cT.3e" title="en/XPCOM array guide#nsCOMArray.3cT.3e"><code>nsCOMArray<T></code></a> now has a <a href="/en/XPCOM_array_guide#Deleting_objects" title="en/XPCOM array guide#Deleting objects"><code>RemoveObjectsAt()</code></a> method for removing multiple objects at once from the array.</li>
</ul>
<h3 id="Using_the_DOM_from_chrome">Using the DOM from chrome</h3>
<dl>
<dt>
<a href="/en/Extensions/Using_the_DOM_File_API_in_chrome_code" title="en/Extensions/Using the DOM File API in chrome code">Using the DOM File API in chrome code</a></dt>
<dd>
Although you've always been able to use the DOM File API from chrome code, the <a href="/zh-TW/docs/Web/API/File" title="File 介面提供了檔案的資訊並且允許網頁中的 JavaScript 存取檔案的內容。"><code>File</code></a> constructor now supports specifying a local pathname string when used from chrome. In addition, you can also specify the file to access using the DOM File API using an <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code> object.</dd>
</dl>
<h3 id="Interface_changes">Interface changes</h3>
<ul>
<li><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryQueryOptions" title="">nsINavHistoryQueryOptions</a></code> now supports sorting in frecency order using the new <code>SORT_BY_FRECENCY_ASCENDING</code> and <code>SORT_BY_FRECENCY_DESCENDING</code> constants.</li>
<li><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker" title="">nsIFilePicker</a></code> has a new <code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIFilePicker#addToRecentDocs">nsIFilePicker.addToRecentDocs</a></code> attribute, which lets you indicate that the selected file should be added to the user's "recent documents" list if there is one. This attribute has no effect when in private browsing mode.</li>
<li><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavBookmarkObserver" title="">nsINavBookmarkObserver</a></code> methods with item ID parameters now require a GUID as well.</li>
<li><code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIPrefBranch#clearUserPref()">nsIPrefBranch.clearUserPref()</a></code> no longer throws an exception if the specified preference doesn't exist or has no user-set value. Instead, it simply does nothing.</li>
<li>The <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMemoryReporter" title="">nsIMemoryReporter</a></code> interface now provides support for indicating the kind of memory being described (mapped, heap, or other).</li>
<li>The <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISHEntry" title="">nsISHEntry</a></code> <code>stateData</code> attribute now returns a <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIStructuredCloneContainer" title="">nsIStructuredCloneContainer</a></code>.</li>
<li><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code> has a new <code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIURI#ref">nsIURI.ref</a></code> attribute, which returns the reference portion (the part after the "#") of the URI. It also has new methods <code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIURI#cloneIgnoringRef()">nsIURI.cloneIgnoringRef()</a></code> which clones the <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code> without the ref member and <code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIURI#equalsExceptRef()">nsIURI.equalsExceptRef()</a></code> which compares to another <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code> ignoring the ref member.</li>
</ul>
<h4 id="New_interfaces">New interfaces</h4>
<dl>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIAsyncFavicons" title="">mozIAsyncFavicons</a></code></dt>
<dd>
A new service that lets you access the favicon service asynchronously.</dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEventSource" title="">nsIEventSource</a></code></dt>
<dd>
<em>Details forthcoming.</em></dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGSettingsCollection" title="">nsIGSettingsCollection</a></code></dt>
<dd>
<em>Details forthcoming.</em></dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIGSettingsService" title="">nsIGSettingsService</a></code></dt>
<dd>
<em>Details forthcoming.</em></dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpUpgradeListener" title="">nsIHttpUpgradeListener</a></code></dt>
<dd>
The callback interface for handling HTTP upgrade requests via the <code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIHttpChannelInternal#HTTPUpgrade()">nsIHttpChannelInternal.HTTPUpgrade()</a></code> method.</dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIStructuredCloneContainer" title="">nsIStructuredCloneContainer</a></code></dt>
<dd>
A container for objects that have been serialized using the <a href="/en/HTML/Structured_clones" title="en/HTML/Structured clones">structured clone algorithm</a>.</dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITelemetry" title="">nsITelemetry</a></code></dt>
<dd>
Implements telemetry support to allow recording of telemetry data to be used to present histograms for performance tracking purposes. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649502" title="FIXED: Expose histograms to JS">bug 649502</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=585196" title="FIXED: telemetry infrastructure">bug 585196</a>.</dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITimedChannel" title="">nsITimedChannel</a></code></dt>
<dd>
See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=576006" title="FIXED: Implement timing interface for channels">bug 576006</a>.</dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebSocketListener" title="">nsIWebSocketListener</a></code></dt>
<dd>
See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=640003" title="FIXED: WebSockets - upgrade to ietf-07">bug 640003</a>.</dd>
<dt>
<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebSocketProtocol" title="">nsIWebSocketProtocol</a></code></dt>
<dd>
See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=640003" title="FIXED: WebSockets - upgrade to ietf-07">bug 640003</a>.</dd>
</dl>
<h4 id="Removed_interfaces">Removed interfaces</h4>
<p>The following interfaces were implementation details that are no longer needed:</p>
<ul>
<li><code>nsIDOMDocumentEvent</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=655517" title="FIXED: Remove nsIDOMDocumentEvent">bug 655517</a>)</li>
<li><code>nsIDOMDocumentTraversal</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=655514" title="FIXED: Remove nsIDOMDocumentTraversal">bug 655514</a>)</li>
<li><code>nsIDOMDocumentRange</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=655513" title="FIXED: Remove nsIDOMDocumentRange">bug 655513</a>)</li>
<li><code>IWeaveCrypto</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=651596" title="FIXED: Eliminate IWeaveCrypto">bug 651596</a>)</li>
<li><code>nsIDOM3DocumentEvent</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=481863" title="FIXED: Remove nsIDOM3DocumentEvent">bug 481863</a>)</li>
<li><code>nsIDOMAbstractView</code></li>
<li><code>nsILiveTitleNotificationSubject</code></li>
<li><code>nsIPlugin</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=637253" title="FIXED: decomtamination: remove nsIPlugin and nsIPluginInstance">bug 637253</a>)</li>
<li><code>nsIPluginInstance</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=637253" title="FIXED: decomtamination: remove nsIPlugin and nsIPluginInstance">bug 637253</a>)</li>
<li><code>nsIHTMLEditRules</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=633750" title="FIXED: deCOM nsIHTMLEditRules">bug 633750</a>)</li>
<li><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIXSLTProcessorObsolete" title="">nsIXSLTProcessorObsolete</a></code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649534" title="FIXED: Remove nsIXSLTProcessorObsolete">bug 649534</a>)</li>
</ul>
<h3 id="Other_changes_3">Other changes</h3>
<dl>
<dt>
<a href="/en/Mozilla/Preferences/Using_preferences_from_application_code" title="en/Preferences/Using preferences from application code">Using preferences from application code</a></dt>
<dd>
A new static API is available for easily accessing preferences; this is only available to application code and can't be used by add-ons.</dd>
</dl>
<h2 id="See_also">See also</h2>
<div>
<div class="multiColumnList">
<ul>
<li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/5">Firefox 5 for developers</a></li><li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/4">Firefox 4 for developers</a></li><li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/3.6">Firefox 3.6 for developers</a></li><li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 for developers</a></li><li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/3">Firefox 3 for developers</a></li><li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/2">Firefox 2 for developers</a></li><li><a href="/zh-TW/docs/Mozilla/Firefox/Releases/1.5">Firefox 1.5 for developers</a></li></ul>
</div></div>
|