diff options
Diffstat (limited to 'files/zh-cn/mozilla/firefox/releases')
5 files changed, 620 insertions, 0 deletions
diff --git a/files/zh-cn/mozilla/firefox/releases/19/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/19/site_compatibility/index.html new file mode 100644 index 0000000000..c026e80052 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/19/site_compatibility/index.html @@ -0,0 +1,144 @@ +--- +title: Site Compatibility for Firefox 19 +slug: Site_Compatibility_for_Firefox_19 +translation_of: Mozilla/Firefox/Releases/19/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 19 <a href="http://www.mozilla.org/zh-CN/firefox/beta/">Beta</a> was released on <time datetime="2013-01-10">January 10</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p> +<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p> +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/19.0beta/releasenotes/">Firefox 19 Beta Release Notes</a></li> + <li><a href="/zh-CN/docs/Firefox_19_for_developers">Firefox 19 for developers</a> (some changes are not listed yet)</li> + <li>Add-on Compatibility for Firefox 19 (Add-ons Blog)</li> +</ul> +<p>This list may be updated until the release of the final version, so please check back later.</p> +<section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="flexbox脱前缀">flexbox脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801098">Bug 801098 – Unprefix CSS3 flexbox</a></li> + </ul> + <p>The <a href="/zh-CN/docs/CSS/Using_CSS_flexible_boxes">CSS3 flexible boxes (flexbox)</a> implementation has been prefixed. From now on, use the related properties and keywords without <code>moz</code> prefix. Note that the flexbox is still disabled by default in Firefox 19. If you'd like to test the feature, open <code>about:config</code> and change the value of <code>layout.css.flexbox.enabled</code> to <code>true</code>.</p> + </section> + <section id="sect3"> + <h3 id="-moz-initial属性脱前缀"><code>-moz-initial</code>属性脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=806068">Bug 806068 – Unprefix -moz-initial</a></li> + </ul> + <p>The <code>-moz-initial</code> keyword has been unprefixed. While <code>-moz-initial</code> will remain in the meantime as an alias of <a href="/zh-CN/docs/CSS/initial"><code>initial</code></a>, it will be <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807184">removed at some time</a>, so use the unprefixed keyword instead.</p> + </section> + <section id="sect4"> + <h3 id="-moz-placeholder伪类已修改成伪元素-moz-placeholder"><code>:-moz-placeholder</code>伪类已修改成伪元素<code>::-moz-placeholder</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=737786">Bug 737786 – Switch from :-moz-placeholder to ::-moz-placeholder (pseudo-class to pseudo-element)</a></li> + </ul> + <p>The <a href="/zh-CN/docs/CSS/:-moz-placeholder"><code>:-moz-placeholder</code></a> pseudo-class that matches form elements with the <a href="/zh-CN/docs/HTML/Forms_in_HTML#The_placeholder_attribute"><code>placeholder</code></a> attribute has been removed, and the <a href="/zh-CN/docs/CSS/::-moz-placeholder"><code>::-moz-placeholder</code></a> pseudo-element has been added instead. The implementation of WebKit has been a pseudo-element, and this change is a part of the standardization effort.</p> + </section> + <section id="sect5"> + <h3 id="CSS动画中带有!important的关键帧规则声明将被忽略"><code>CSS动画中带有!important</code>的关键帧规则声明将被忽略</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=784466">Bug 784466 – [css3-animations] we should drop declarations in keyframe rules that have !important</a></li> + </ul> + <p>Following the latest <a href="/zh-CN/docs/CSS/Using_CSS_animations">CSS3 animations</a> spec, key frame rule declarations with the <code>!important</code> keyword are now be ignored and parse errors will be returned.</p> + </section> + <section id="sect6"> + <h3 id="在aboutconfig中添加了一些控制带前缀的CSS属性的有效性的选项">在about:config中添加了一些控制带前缀的CSS属性的有效性的选项</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=804944">Bug 804944 – add preferences for sets of CSS prefixed properties</a></li> + </ul> + <p>While this is not a change affecting site compatibility, it's worth mentioning because this has been developed as part of efforts to keep compatibility. Preferences to disable some major prefixed properties have been added: <code>layout.css.prefixes.border-image</code>, <code>layout.css.prefixes.transforms</code>, <code>layout.css.prefixes.transitions</code> and <code>layout.css.prefixes.animations</code>. Web developers can disable those preferences (change the values to <code>false</code>) to test whether style rules are applied as intended even after those prefixed implementations are removed.</p> + </section> +</section> +<section id="sect7"> + <h2 id="DOM">DOM</h2> + <section id="sect8"> + <h3 id="Element.getElementsBy*_现在将返回HTMLCollection对象"><code>Element.getElementsBy*</code> 现在将返回<code>HTMLCollection对象</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=799464">Bug 799464 – Make Element.getElementsBy* return HTMLCollection</a></li> + </ul> + <p><a href="/zh-CN/docs/DOM/element.getElementsByTagName"><code>getElementsByTagName</code></a>, <a href="/zh-CN/docs/DOM/element.getElementsByTagNameNS"><code>getElementsByTagNameNS</code></a>以及<a href="/zh-CN/docs/DOM/document.getElementsByClassName"><code>getElementsByClassName</code></a>方法返回的元素列表对象的类型从<a href="/zh-CN/docs/DOM/NodeList"><code>NodeList</code></a>(遵循DOM3核心规范)变为<a href="/zh-CN/docs/DOM/HTMLCollection"><code>HTMLCollection</code></a>(遵循DOM4规范草案).</p> + </section> + <section id="sect9"> + <h3 id="hasFeatureisSupported方法现在总会返回true"><code>hasFeature</code>/<code>isSupported</code>方法现在总会返回<code>true</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801425">Bug 801425 – Make hasFeature() and isSupported() always return true</a></li> + </ul> + <p>The <code><a href="/zh-CN/docs/DOM/document.implementation">document.implementation</a>.hasFeature</code> and <a href="/zh-CN/docs/DOM/Node.isSupported"><code>Element.isSupported</code></a> methods have been changed to always return <code>true</code>. The spec has been changed because those APIs were considered useless. However the SVG features are exception; those methods continue to return the support statuses.</p> + </section> + <section id="sect10"> + <h3 id="createElement(null)不再抛出异常"><code>createElement(null)</code>不再抛出异常</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=802562">Bug 802562 – createElement(null) should work like createElement("null")</a></li> + </ul> + <p>Previously the <a href="/zh-CN/docs/DOM/document.createElement"><code>document.createElement</code></a> method has thrown exception <code>INVALID_CHARACTER_ERR</code> if the argument was <code>null</code>. The method now returns the <code>HTMLUnknownElement</code> object because the argument should be treated as a string and considered to be the same code as <code>document.createElement("null")</code>.</p> + </section> + <section id="sect11"> + <h3 id="document.referrer遵循了最新规范"><code>document.referrer</code>遵循了最新规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=809290">Bug 809290 – document.referrer should be based on the script entry point</a></li> + </ul> + <p>When the URL of a nested inline frame (<code>iframe</code>) or a grandchild window is programmatically changed from the parent window, the value of the <a href="/zh-CN/docs/DOM/document.referrer"><code>document.referrer</code></a> property now points the URL of the parent window where the script is written instead of the child window that refers directly. This is due to a change of the spec and leads to the same behavior as Internet Explorer and Opera. WebKit to follow.</p> + </section> + <section id="sect12"> + <h3 id="如果修改日期未知则File.lastModifiedDate属性将返回当前日期"><code>如果修改日期未知,则File.lastModifiedDate</code>属性将返回当前日期</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793459">Bug 793459 – Update File.lastModifiedDate to latest spec</a></li> + </ul> + <p>Following the latest <a href="http://www.w3.org/TR/FileAPI/">File API</a> spec, the <code>lastModifiedDate</code> property of a <a href="/zh-CN/docs/DOM/File"><code>File</code></a> object now returns the current date if the file's last modified date is unknown. Previously it returns <code>null</code> in such case.</p> + </section> + <section id="sect13"> + <h3 id="Encoding_API_遵循了最新规范">Encoding API 遵循了最新规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801487">Bug 801487 – Update StringEncoding API per the latest spec and fix some bugs</a></li> + </ul> + <p>Following a change of the <a href="http://encoding.spec.whatwg.org/#api">Encoding API</a> spec, the implementation of <code>TextEncoder</code> and <code>TextDecoder</code> has been updated.</p> + </section> + <section id="sect14"> + <h3 id="移除XForms支持">移除XForms支持</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=656311">Bug 656311 – Remove XML Events, or improve the implementation</a></li> + </ul> + <p>The XML Events implementation has been removed. The development of the <a href="https://addons.mozilla.org/zh-CN/firefox/addon/mozilla-xforms/">Mozilla XForms</a> extension that has used the API has been <a href="http://www.philipp-wagner.com/blog/2011/07/the-future-of-mozilla-xforms/">practically discontinued</a>. The <a href="/zh-CN/docs/XForms">XForms</a> accessibility support has also been <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=811729">removed</a> from Firefox 19.</p> + </section> +</section> +<section id="sect15"> + <h2 id="JavaScript">JavaScript</h2> + <section id="sect16"> + <h3 id="Map.size和Set.size从方法变成属性"><code>Map.size</code>和<code>Set.size</code>从方法变成属性</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807001">Bug 807001 – Map.prototype.size and Set.prototype.size should be accessor properties</a></li> + </ul> + <p>The <code>size</code> method, that returns the number of key/value pairs saved in a <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Map"><code>Map</code></a> object and the number of values saved in a <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Set"><code>Set</code></a> object, are changed to be read-only properties.</p> + </section> +</section> +<section id="sect17"> + <h2 id="事件处理">事件处理</h2> + <section id="sect18"> + <h3 id="一些事件句柄属性只存在于body和frameset元素上">一些事件句柄属性只存在于<code>body</code>和<code>frameset</code>元素上</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=809765">Bug 809765 – Stop compiling the beforeunload attribute into an event handler on elements other than <body> and <frameset></a></li> + </ul> + <p>Previously, the <a href="/zh-CN/docs/DOM/window.onbeforeunload"><code>onbeforeunload</code></a> attribute has been recognized even if it has been set on any elements, and the named handler is called when the event is fired. To comply with the spec, it's now ignored when it has been set on elements other than <a href="/zh-CN/docs/HTML/Element/body"><code>body</code></a> and <a href="/zh-CN/docs/HTML/Element/frameset"><code>frameset</code></a>. The other attributes treated the same include <a href="/zh-CN/docs/DOM/window.onafterprint"><code>onafterprint</code></a>, <a href="/zh-CN/docs/DOM/window.onbeforeprint"><code>onbeforeprint</code></a>, <a href="/zh-CN/docs/DOM/window.onhashchange"><code>onhashchange</code></a>, <code>onoffline</code>, <code>ononline</code>, <code>onpagehide</code>, <code>onpageshow</code>, <a href="/zh-CN/docs/DOM/window.onpopstate"><code>onpopstate</code></a>, <a href="/zh-CN/docs/DOM/window.onresize"><code>onresize</code></a> and <a href="/zh-CN/docs/DOM/window.onunload"><code>onunload</code></a>.</p> + </section> +</section> +<section id="sect19"> + <h2 id="文件处理">文件处理</h2> + <section id="sect20"> + <h3 id="不再支持Content-Disposition响应头中的name参数"><code>不再支持Content-Disposition</code>响应头中的<code>name</code>参数</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=776339">Bug 776339 – remove support of Content-Disposition "name" parameter</a></li> + </ul> + <p>The <code>name</code> parameter included in the HTTP <code>Content-Disposition</code> header used for file downloading is now ignored. This parameter is non-standard and supported only by Firefox and Google Chrome. From now, use the standard <code>filename</code> parameter instead.</p> + </section> +</section> +<section id="sect43"> + <h2 id="插件">插件</h2> + <section id="sect44"> + <h3 id="移除了对Carbon_NPAPI的支持">移除了对Carbon NPAPI的支持</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=598397">Bug 598397 - remove support for Carbon NPAPI</a></li> + </ul> + <p>The Carbon event model and the Quickdraw drawing model, deprecated since Firefox 4, are no longer available. Webmasters should make sure your content works well if it requires any special plug-in. If it doesn't work on Firefox 19, please contact the plug-in vendor.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/21/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/21/site_compatibility/index.html new file mode 100644 index 0000000000..cf566f4262 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/21/site_compatibility/index.html @@ -0,0 +1,145 @@ +--- +title: Firefox 21网站兼容性 +slug: Site_Compatibility_for_Firefox_21 +translation_of: Mozilla/Firefox/Releases/21/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="-moz-user-selectnone的表现变得和-moz-user-select-moz-none相同也就是和其他浏览器实现了统一"><code>-moz-user-select:none的表现变得和</code><code>-moz-user-select:-moz-none</code>相同,也就是和其他浏览器实现了统一</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816298">Bug 816298 – Change "-moz-user-select:none" to behave like WebKit, IE, and Opera (and "-moz-user-select:-moz-none")</a></li> + </ul> + <p>Previously, when you set the <code>none</code> keyword to the <a href="/zh-CN/docs/CSS/user-select"><code>-moz-user-select</code></a> property, the text of on the element and sub-elements became unselectable, even if one of those sub-elements had <code>-moz-user-select:text</code>. Starting with Firefox 21, <code>none</code> behaves like <code>-moz-none</code> and other browsers, so selection can be re-enabled on sub-elements using <code>-moz-user-select:text</code>.</p> + </section> +</section> +<section id="sect15"> + <h2 id="DOM">DOM</h2> + <section id="sect23"> + <h3 id="删除了对table的cols和layout属性的支持">删除了<code>对table</code>的<code>cols</code>和<code>layout</code>属性的支持</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835169">Bug 835169 – Do we need support for the table[cols] attribute?</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835439">Bug 835439 – Remove support for the table[layout] attribute</a></li> + </ul> + <p>Firefox no longer accepts the <code>cols</code> and <code>layout</code> properties on the <a href="/zh-CN/docs/HTML/Element/table"><code>table</code></a> elements. No other browsers support these obscure properties.</p> + </section> + <section id="sect24"> + <h3 id="scrollWidth和scrollHeight不再受overflowvisible的影响"><code>scrollWidth</code>和<code>scrollHeight</code>不再受<code>overflow:visible</code>的影响</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833542">Bug 833542 – scrollWidth, scrollHeight different when overflow is hidden versus visible</a></li> + </ul> + <p>The <a href="/zh-CN/docs/DOM/element.scrollWidth"><code>scrollWidth</code></a> and <a href="/zh-CN/docs/DOM/element.scrollHeight"><code>scrollHeight</code></a> properties might have wrong values when CSS <code>overflow:visible</code> was set on the element. This behavior has been fixed to match the values as if <code>overflow:hidden</code> is set.</p> + </section> + <section id="sect25"> + <h3 id="window不再接受自定义的索引属性"><code>window</code>不再接受自定义的索引属性</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=828787">Bug 828787 – Stop allowing indexed expandos on windows</a></li> + </ul> + <p>Setting indexed expandos (custom properties which have number as the property name) on the <a href="/zh-CN/docs/DOM/window"><code>window</code></a> object is no longer allowed. Your code like <code>window[2] = "myString"</code> will be ignored from now on.</p> + </section> + <section id="sect26"> + <h3 id="window对象上的索引属性变的可枚举"><code>window</code>对象上的索引属性变的可枚举</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=823228">Bug 823228 - Move indexed properties from nsWindowSH::GetProperty to the outer window proxy</a></li> + </ul> + <p>Previously, <a href="/zh-CN/docs/HTML/Element/iframe"><code>iframe</code>s</a> in the DOM were not enumerable on the <code>window</code> object. This behavior has been changed to comply with the spec, which means they are now returned with <code>Object.keys(window)</code>. This is important to note for things like global leak detection, since appending <code>iframe</code>s to the document will modify the enumerable keys on the <code>window</code> object.</p> + </section> + <section id="sect27"> + <h3 id="XMLHttpRequest.setRequestHeader方法的实现遵循了当前规范"><code>XMLHttpRequest.setRequestHeader</code>方法的实现遵循了当前规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=819051">Bug 819051 – XMLHttpRequest.setRequestHeader() overwrites instead of combines values for the same header.</a></li> + </ul> + <p>Previously, if the same headers were repeatedly set with <a href="/zh-CN/docs/DOM/XMLHttpRequest#setRequestHeader%28%29"><code>XMLHttpRequest.setRequestHeader</code></a>, the last-specified value was used. This behavior has been changed to comply with the spec, so those values will be properly combined.</p> + </section> + <section id="sect28"> + <h3 id="formMethod和formEnctype的默认值成为一个空字符串"><code>formMethod</code>和<code>formEnctype</code>的默认值成为一个空字符串</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=787095">Bug 787095 – Update formMethod reflection to have the empty string as default value (and 'get' as invalid value)</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=839171">Bug 839171 – Update formMethod reflection to have the empty string as default value (and 'get' as invalid value)</a></li> + </ul> + <p>The HTML5 spec of the <a href="/zh-CN/docs/HTML/Element/Input#attr-formmethod"><code>formMethod</code></a> and <a href="/zh-CN/docs/HTML/Element/Input#attr-formenctype"><code>formEnctype</code></a> properties has been updated to have the empty string as default value. Firefox followed the change.</p> + </section> + <section id="sect29"> + <h3 id="如果传递多条规则CSSStyleSheet.insertRule方法会报错"><code>如果传递多条规则,CSSStyleSheet.insertRule</code>方法会报错</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=765599">Bug 765599 – CSSStyleSheet.insertRule should throw when there are more than one rule</a></li> + </ul> + <p>If multiple rules was passed to the <a href="/zh-CN/docs/DOM/CSSStyleSheet/insertRule"><code>CSSStyleSheet.insertRule</code></a> method, only the first rule was inserted into the stylesheet. Instead, Firefox now throws an exception <code>SYNTAX_ERR</code> like other browsers.</p> + </section> + <section id="sect30"> + <h3 id="从NodeIterator和TreeWalker上删除掉expandEntityReferences属性">从<code>NodeIterator</code>和<code>TreeWalker</code>上删除掉<code>expandEntityReferences属性</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=672190">Bug 672190 – consider removing expandEntityReferences from NodeIterator and TreeWalker</a></li> + </ul> + <p>The <a href="/zh-CN/docs/DOM/NodeIterator.expandEntityReferences"><code>expandEntityReferences</code></a> property, which returned a flag indicating whether or not the children of entity reference nodes were visible to the object, has been removed from the <a href="/zh-CN/docs/DOM/NodeIterator"><code>NodeIterator</code></a> and <a href="/zh-CN/docs/DOM/TreeWalker"><code>TreeWalker</code></a> objects, as it never made much sense.</p> + </section> + <section id="sect31"> + <h3 id="CSSKeyframesRule.insertRule方法被改名为appendRule"><code>CSSKeyframesRule.insertRule方法被改名为</code><code>appendRule</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841896">Bug 841896 – CSSKeyframesRule should have a `appendRule` method, not `insertRule`</a></li> + </ul> + <p>One of the methods of the <a href="/zh-CN/docs/DOM/CSSKeyframesRule"><code>CSSKeyframesRule</code></a> interface, <code>insertRule</code> has been renamed to <code>appendRule</code> to match a spec change.</p> + </section> + <section id="sect32"> + <h3 id="HTMLInputElement.inputmode现在默认被禁用"><code>HTMLInputElement.inputmode</code>现在默认被禁用</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857355">Bug 857355 – Hide HTMLInputElement's inputMode API behind a pref and only turn it on for Aurora/Nightly</a></li> + </ul> + <p><a href="/zh-CN/docs/DOM/HTMLInputElement"><code>HTMLInputElement</code></a>'s <code>inputmode</code> API, which has been <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=746142">implemented</a> since Firefox 17, is now disabled by default because the spec is still unstable. You have to enable the <code>dom.forms.inputmode</code> pref or use the <a href="http://www.mozilla.org/zh-CN/firefox/aurora/">Aurora</a> channel to try out this feature. Note that this API will be renamed <code>inputMode</code> (capitalized <code>M</code>) in <a href="/zh-CN/docs/Site_Compatibility_for_Firefox_22">Firefox 22</a>.</p> + </section> +</section> +<section id="sect33"> + <h2 id="JavaScript">JavaScript</h2> + <section id="sect34"> + <h3 id="E4X已经被完全删除">E4X已经被完全删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=788293">Bug 788293 – Remove E4X from Spidermonkey</a></li> + </ul> + <p>The support of <a href="/zh-CN/docs/E4X">ECMAScript for XML (E4X)</a>, deprecated and disabled since <a href="/zh-CN/docs/Site_Compatibility_for_Firefox_17#E4X_has_been_disabled">Firefox 17</a>, has finally been dropped. You can no longer use the feature regardless of the hidden preference.</p> + </section> + <section id="sect35"> + <h3 id="parseInt把以0开头的字符串当成十进制数字解析而不是以前的八进制"><code>parseInt把以0开头的字符串当成十进制数字解析,而不是以前的八进制</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=786135">Bug 786135 – Make parseInt("042") === 42, now that other engines are moving that way</a></li> + </ul> + <p>The <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/parseInt"><code>parseInt</code></a> method implementation has been updated to conform to the ECMAScript 5 spec, and it now parses leading-zero strings as decimal, not octal. Therefore, <code>parseInt("042")</code> will return <code>42</code> instead of <code>34</code>. If you'd like to parse strings as octal, specify the radix like <code>parseInt(str, 8)</code>.</p> + </section> + <section id="sect36"> + <h3 id="修正String.localeCompare在无参情况下的表现以符合ES5规范">修正<code>String.localeCompare</code>在无参情况下的表现,以符合ES5规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=789393">Bug 789393 – String.prototype.localeCompare() with no argument always returns 0</a></li> + </ul> + <p>The <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/String/localeCompare"><code>String.localeCompare</code></a> method implementation has been updated to conform to the latest ECMAScript 5 spec. If no argument is passed, the method takes the <code>"undefined"</code> string as the argument.</p> + </section> +</section> +<section id="sect37"> + <h2 id="SVG">SVG</h2> + <section id="sect38"> + <h3 id="删除掉那些未实现的SVG特性">删除掉那些未实现的SVG特性</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=824218">Bug 824218 – Remove unimplemented SVG features</a></li> + </ul> + <p>Unimplemented SVG features have been removed instead of just returning the <code>NOT_IMPLEMENTED</code> errors. These features include the <code>viewport</code> and <code>currentView</code> properties of <a href="/zh-CN/docs/DOM/SVGSVGElement"><code>SVGSVGElement</code></a>.</p> + </section> +</section> +<section id="sect39"> + <h2 id="AudioVideo">Audio/Video</h2> + <section id="sect41"> + <h3 id="mozAudioContext属性脱前缀"><code>mozAudioContext</code>属性脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833631">Bug 833631 – Unprefix mozAudioContext</a></li> + </ul> + <p>The <code>mozAudioContext</code> implementation has been unprefixed. It's still <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=788310">disabled by default</a>, though. To try out this feature, change the value of the <code>media.webaudio.enabled</code> pref to <code>true</code>.</p> + </section> +</section> +<section id="sect42"> + <h2 id="安全">安全</h2> + <section id="sect43"> + <h3 id="CSP实现更新到符合最新规范">CSP实现更新到符合最新规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=746978">Bug 746978 – sync CSP directive parsing and directive names with w3c CSP 1.0 spec</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=783049">Bug 783049 – CSP : use existing/old parser for X-Content-Security-Policy header, new/CSP 1.0 spec compliant parser for Content-Security-Policy header</a></li> + </ul> + <p>Content Security Policy (CSP) 1.0 spec has been implemented. The existing parser will be used when a policy is served via the <code>X-Content-Security-Policy</code> header, and the new parser that follows the 1.0 spec will be used when a policy is served via the officially spec'd <code>Content-Security-Policy</code> header. Consult the latest spec if you'd like to implement CSP on your site. The <a href="/zh-CN/docs/Security/CSP">documents on MDN</a> will be updated sometime soon.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/23/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/23/site_compatibility/index.html new file mode 100644 index 0000000000..34f2ab9b60 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/23/site_compatibility/index.html @@ -0,0 +1,92 @@ +--- +title: Site Compatibility for Firefox 23 +slug: Site_Compatibility_for_Firefox_23 +translation_of: Mozilla/Firefox/Releases/23/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 23 <a href="http://www.mozilla.org/en-US/firefox/aurora/">Aurora</a> (pre-Beta) was released on <time datetime="2013-05-17">May 17, 2013</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p> +<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p> +<ul> + <li><a href="http://www.mozilla.org/en-US/firefox/23.0a2/auroranotes/">Firefox 23 Aurora Release Notes</a></li> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/23">Firefox 23 for developers</a></li> +</ul> +<p>This list may be updated until the release of the final version on <time datetime="2013-08-06">August 6, 2013</time>, so please check back later.</p> +<section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="能产生文字闪烁效果的text-decorationblink属性值被删除">能产生文字闪烁效果的<code>text-decoration:blink</code>属性值被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857820">Bug 857820 – Drop only blink effect from text-decoration: blink; and completely remove <blink> element</a></li> + </ul> + <p>Firefox previously supported the Netscape-derived blink effect with the <code>blink</code> keyword for the CSS <a href="/en-US/docs/Web/CSS/text-decoration"><code>text-decoration</code></a> property as well as the HTML <a href="/en-US/docs/Web/HTML/Element/blink"><code>blink</code></a> element and the DOM <a href="/en-US/docs/JavaScript/Reference/Global_Objects/String/blink"><code>String.blink</code></a> method. Starting with Firefox 23, the blink effect no longer works. While <code>text-decoration:blink</code> continues to be supported by the CSS parser and the DOM APIs, the HTML parser has dropped the <code>blink</code> element support, thus the element will be treated as an unknown element. Internet Explorer, Chrome and Safari haven't supported the effect. Opera may also drop the support once it switches to the Blink rendering engine.</p> + </section> +</section> +<section id="sect7"> + <h2 id="DOM">DOM</h2> + <section id="sect8"> + <h3 id="添加到侧边栏的功能被删除">添加到侧边栏的功能被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=691647">Bug 691647 – clean up nsISidebar (remove window.sidebar.addPanel/addPersistentPanel)</a></li> + </ul> + <p><code>window.sidebar.addPanel</code> and <code>window.sidebar.addPersistentPanel</code> are no longer supported. These methods were a part of a Netscape-derived API which allowed Web publishers to integrate their contents as sidebar panels of the browser. They were not standardized, rarely used, and not very well supported. No other browsers have implemented these.</p> + <p>There is also a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=862147">plan</a> to remove <a href="/en-US/docs/Web/API/window.sidebar"><code>window.sidebar</code></a> itself in the future.</p> + </section> + <section id="sect9"> + <h3 id="requestAnimationFrame脱前缀"><code>requestAnimationFrame</code>脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=704063">Bug 704063 – Add unprefixed requestAnimationFrame</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=753453">Bug 753453 – requestAnimationFrame callback should return DOMHighResTimeStamp</a></li> + </ul> + <p><a href="/en-US/docs/Web/API/window.requestAnimationFrame"><code>requestAnimationFrame</code></a>, the unprefixed version of <code>mozRequestAnimationFrame</code>, has been added. This unprefixed method passes a <a href="/en-US/docs/Web/API/DOMHighResTimeStamp"><code>DOMHighResTimeStamp</code></a> to callbacks. It has microsecond precision and can be compared to <a href="/en-US/docs/Web/API/window.performance.now"><code>performance.now()</code></a>.</p> + <p>On the other hand, the prefixed method, which will be removed in the future, continues to pass an epoch-based <a href="/en-US/docs/Web/API/DOMTimeStamp"><code>DOMTimeStamp</code></a> to callbacks. The passed-in value has millisecond precision and can be compared to <a href="/en-US/docs/Web/API/window.mozAnimationStartTime"><code>mozAnimationStartTime</code></a>.</p> + </section> + <section id="sect10"> + <h3 id="跨域文档的contentDocument属性现在返回null">跨域文档的<code>contentDocument</code>属性现在返回<code>null</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=829872">Bug 829872 – Consider returning null from contentDocument getters when the caller does not subsume the document</a></li> + </ul> + <p>The <code>contentDocument</code> property on frames now returns <a href="/en-US/docs/JavaScript/Reference/Global_Objects/null"><code>null</code></a> if the caller doesn't subsume the document. This change affects the <code>contentDocument</code> property on the <a href="/en-US/docs/Web/HTML/Element/frame"><code>frame</code></a>, <a href="/en-US/docs/Web/HTML/Element/iframe"><code>iframe</code></a> and <a href="/en-US/docs/Web/HTML/Element/object"><code>object</code></a> elements as well as the <code>getSVGDocument</code> method on the <a href="/en-US/docs/Web/HTML/Element/embed"><code>embed</code></a>, <code>iframe</code> and <code>object</code> elements.</p> + </section> + <section id="sect13"> + <h3 id="window.defaultStatus被删除"><code>window.defaultStatus</code>被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=862917">Bug 862917 – Remove window.defaultStatus</a></li> + </ul> + <p>The <a href="/en-US/docs/Web/API/window.defaultStatus"><code>window.defaultStatus</code></a> property is no longer available. Setting this property has had no effect in Firefox because the default preference has disallowed changes to the status text by Web pages. Recently, the Firefox UI dropped support for enabling that pref. Also, this property is not specified in the HTML5 spec. <a href="/en-US/docs/Web/API/window.status"><code>window.status</code></a> is still available.</p> + </section> + <section id="sect14"> + <h3 id="不再允许创建AnimationEvent和TransitionEvent">不再允许创建<code>AnimationEvent</code><code>和TransitionEvent</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=868751">Bug 868751 – Remove support for document.createEvent("AnimationEvent"), document.createEvent("TransitionEvent"), AnimationEvent.initAnimationEvent, and TransitionEvent.initTransitionEvent</a></li> + </ul> + <p>The support for obsolete <code>document.createEvent("AnimationEvent")</code>, <code>document.createEvent("TransitionEvent")</code>, <a href="/en-US/docs/Web/API/AnimationEvent#initAnimationEvent%28%29"><code>AnimationEvent.initAnimationEvent</code></a>, and <code>TransitionEvent.initTransitionEvent</code> has been removed.</p> + </section> +</section> +<section id="sect15"> + <h2 id="视频和音频">视频和音频</h2> + <section id="sect16"> + <h3 id="Audio_Data_API被废弃">Audio Data API被废弃</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=855570">Bug 855570 – Deprecate Audio Data API</a></li> + </ul> + <p>The non-standard, experimental <a href="/en-US/docs/Introducing_the_Audio_API_Extension">Audio Data API</a> is now considered deprecated. The standard <a href="/en-US/docs/Web_Audio_API">Web Audio API</a> can be used instead.</p> + </section> + <section id="sect17"> + <h3 id="HTMLMediaElement.initialTime被删除"><code>HTMLMediaElement.initialTime</code>被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=742537">Bug 742537 – Remove HTMLMediaElement.initialTime</a></li> + </ul> + <p>The <code>HTMLMediaElement.initialTime</code> property is no longer available, due to the removal from the spec.</p> + </section> +</section> +<section id="sect18"> + <h2 id="安全和隐私">安全和隐私</h2> + <section id="sect19"> + <h3 id="在SSL页面(HTTPS)上的非SSL活动内容会被默认阻止">在SSL页面(HTTPS)上的非SSL活动内容会被默认阻止</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=834836">Bug 834836 – Turn on pref to block mixed active content</a></li> + </ul> + <p><a href="/en-US/docs/Site_Compatibility_for_Firefox_18">Firefox 18</a> introduced preferences to block loading content from non-SSL (<code>http</code>) sites on SSL (<code>https</code>) pages. One of those preferences, <code>security.mixed_content.block_active_content</code> is now enabled by default in order to enhance user security. That means insecure scripts, stylesheets, plug-in contents, inline frames, <a href="/en-US/docs/Web/CSS/@font-face">Web fonts</a> and <a href="/en-US/docs/WebSockets">WebSockets</a> are blocked on secure pages, and a notification is displayed instead. It will <strong>not</strong> block "display content" like images, videos or audio. See <a href="https://blog.mozilla.org/tanvi/2013/04/10/mixed-content-blocking-enabled-in-firefox-23/">Tanvi Vyas' blog post</a> for details.</p> + <p>Mozilla is tracking mixed content issues found on <a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=844556">major sites</a> as well as <a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=843977">its own properties</a>.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/24/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/24/site_compatibility/index.html new file mode 100644 index 0000000000..296e580123 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/24/site_compatibility/index.html @@ -0,0 +1,22 @@ +--- +title: Firefox 24网站兼容性 +slug: Site_Compatibility_for_Firefox_24 +translation_of: Mozilla/Firefox/Releases/24/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 24 <a href="http://www.mozilla.org/zh-CN/firefox/aurora/">Aurora</a> (pre-Beta) will be released on <time datetime="2013-06-28">June 28, 2013</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p> +<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p> +<ul> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/24">Firefox 24 for developers</a></li> +</ul> +<p>This list may be updated until the release of the final version on <time datetime="2013-09-17">September 17, 2013</time>, so please check back later.</p> +<section id="sect1"> + <h2 id="DOM">DOM</h2> + <section id="sect2"> + <h3 id="releaseEventscaptureEventsrouteEvent等方法被删除"><code>releaseEvents</code>,<code>captureEvents,</code><code>routeEvent</code>等方法被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=673919">Bug 673919 – Remove releaseEvents, captureEvents, routeEvent</a></li> + </ul> + <p>The <a href="/zh-CN/docs/Web/API/window.releaseEvents"><code>releaseEvents</code></a>, <a href="/zh-CN/docs/Web/API/window.captureEvents"><code>captureEvents</code></a>, <a href="/zh-CN/docs/Web/API/window.routeEvent"><code>routeEvent</code></a>, <code>enableExternalCapture</code> and <code>disableExternalCapture</code> methods on the <a href="/zh-CN/docs/Web/API/Window"><code>window</code></a> object have been removed. They were Netscape-derived APIs <a href="/zh-CN/docs/Gecko_1.9_Changes_affecting_websites">deprecated since Firefox 3</a> and the implementation has been no-op (doing nothing). Recently Google Chrome (the Blink rendering engine) also removed the support for those methods. The standard <a href="/zh-CN/docs/Web/API/Event">DOM Event</a> methods, including <a href="/zh-CN/docs/Web/API/EventTarget.addEventListener"><code>addEventListener</code></a> and <a href="/zh-CN/docs/Web/API/EventTarget.removeEventListener"><code>removeEventListener</code></a>, should be used instead.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/3/updating_extensions/index.html b/files/zh-cn/mozilla/firefox/releases/3/updating_extensions/index.html new file mode 100644 index 0000000000..96a2e8ec19 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/3/updating_extensions/index.html @@ -0,0 +1,217 @@ +--- +title: 为Firefox 3升级扩展 +slug: Updating_extensions_for_Firefox_3 +tags: + - Firefox 3 +translation_of: Mozilla/Firefox/Releases/3/Updating_extensions +--- +<div><section class="Quick_links" id="Quick_Links"> + <ol> + <li class="toggle"> + <details> + <summary>Firefox developer 发布说明</summary> + <ol> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Releases">Firefox developer 发布说明</a></li> + </ol> + </details> + </li> + <li class="toggle"> + <details> + <summary>附加组件</summary> + <ol> + <li><a href="/zh-CN/Add-ons/WebExtensions">浏览器扩展</a></li> + <li><a href="/zh-CN/Add-ons/Themes">主题</a></li> + </ol> + </details> + </li> + <li class="toggle"> + <details> + <summary>Firefox 的内部机制</summary> + <ol> + <li><a href="/zh-CN/docs/Mozilla/">Mozilla 项目</a></li> + <li><a href="/zh-CN/docs/Mozilla/Gecko">Gecko</a></li> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li> + <li><a href="/zh-CN/docs/Mozilla/JavaScript_code_modules">JavaScript代码模块</a></li> + <li><a href="/zh-CN/docs/Mozilla/js-ctypes">JS-ctypes</a></li> + <li><a href="/zh-CN/docs/Mozilla/MathML_Project">MathML 项目</a></li> + <li><a href="/zh-CN/docs/Mozilla/MFBT">MFBT</a></li> + <li><a href="/zh-CN/docs/Mozilla/Projects">Mozilla 项目</a></li> + <li><a href="/zh-CN/docs/Mozilla/Preferences">Preference 系统</a></li> + <li><a href="/zh-CN/docs/Mozilla/WebIDL_bindings">WebIDL 绑定</a></li> + <li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM">XPCOM</a></li> + <li><a href="/zh-CN/docs/Mozilla/Tech/XUL">XUL</a></li> + </ol> + </details> + </li> + <li class="toggle"> + <details> + <summary>构建与作出贡献</summary> + <ol> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Build_Instructions">构建说明</a></li> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">配置构建选项</a></li> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">构建系统如何工作</a></li> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla源代码</a></li> + <li><a href="/zh-CN/docs/Mozilla/Localization">本地化</a></li> + <li><a href="/zh-CN/docs/Mozilla/Mercurial">Mercurial</a></li> + <li><a href="/zh-CN/docs/Mozilla/QA">质量保证</a></li> + <li><a href="/zh-CN/docs/Mozilla/Using_Mozilla_code_in_other_projects">在其他项目中使用来自Mozilla的代码</a></li> + </ol> + </details> + </li> + </ol> +</section></div> + +<p><span class="comment">英文原文取自于 <a class="external" href="http://developer.mozilla.org/en/docs/Extensions" rel="freelink">http://developer.mozilla.org/en/docs/Extensions</a></span> 这篇文章将对于那些想把他们的扩展在Firefox 3中正常运行的开发者提供一些有用的信息。</p> + +<p>在进入主题之前,首先要提示一下:如果你的扩展所需要的唯一改变只是安装文件中的<code>maxVersion</code>信息,并且你的扩展所在的主机是<a class="link-https" href="https://addons.mozilla.org">addons.mozilla.org</a>,事实上你不需要上传你的新的版本的扩展!只需要在AMO中使用开发者控制面板调整<code>maxVersion</code>。通过这种方式你可以避免你的扩展被再次审核。</p> + +<h3 id=".E7.AC.AC.E4.B8.80.E6.AD.A5_.E5.8D.87.E7.BA.A7.E5.AE.89.E8.A3.85.E6.96.87.E4.BB.B6" name=".E7.AC.AC.E4.B8.80.E6.AD.A5:_.E5.8D.87.E7.BA.A7.E5.AE.89.E8.A3.85.E6.96.87.E4.BB.B6">第一步: 升级安装文件</h3> + +<p>第一步,当然,对于大多数的扩展也仅需要这一步——更新安装文件<code>install.rdf</code>,声明扩展兼容Firefox 3。</p> + +<p>找到声明兼容的最大版本号的那一行(对于Firefox2,如下):</p> + +<pre class="eval"> <span class="nowiki"><em:maxVersion>2.0.*</em:maxVersion></span> +</pre> + +<p>对于Firefox 3,如下:</p> + +<pre class="eval"> <span class="nowiki"><em:maxVersion>3.0.*</em:maxVersion></span> +</pre> + +<p>然后重新安装扩展。</p> + +<p>注意,在Firefox3的本版号中没有额外的“.0”,所以请使用“3.0.*”,而非“3.0.0.*”。</p> + +<div class="blockIndicator note"><strong>Note:</strong> Note that at this point more changes in Firefox 3 are expected. These changes may break some extensions, so you shouldn't release an extension with <code>3.0.*</code> <code>maxVersion</code> to the users until the Firefox 3 release candidate is out. During the Firefox 3 Beta period, you should use <code>3.0b5</code> as your <code>maxVersion</code>.</div> + +<p><br> + There have been (and will continue to be) a number of API changes that will likely break some extensions. We're still working on compiling a complete list of these changes.</p> + +<div class="blockIndicator note"><strong>Note:</strong> If your extension still uses an <code><a href='"cn/Install.js"'>Install.js</a></code> script instead of an <a href='"cn/Install_Manifests"'>install manifest</a>, you need to make the transition to an install manifest now. Firefox 3 no longer supports <code>install.js</code> scripts in XPI files.</div> + +<h4 id="Add_localizations_to_the_install_manifest" name="Add_localizations_to_the_install_manifest">Add localizations to the install manifest</h4> + +<p>Firefox 3 supports new properties in the install manifest to specify localized descriptions. The old methods still work however the new allow Firefox to pick up the localizations even when the add-on is disabled and pending install. See <a href="/cn/Localizing_extension_descriptions" title="cn/Localizing_extension_descriptions">Localizing extension descriptions</a> for more details.</p> + +<h3 id="Step_2_.E7.A1.AE.E4.BF.9D.E6.8F.90.E4.BE.9B.E5.AE.89.E5.85.A8.E7.9A.84.E6.9B.B4.E6.96.B0" name="Step_2:_.E7.A1.AE.E4.BF.9D.E6.8F.90.E4.BE.9B.E5.AE.89.E5.85.A8.E7.9A.84.E6.9B.B4.E6.96.B0">Step 2: 确保提供安全的更新</h3> + +<p>If you are hosting addons yourself and not on a secure add-on hosting provider like <a class="link-https" href="https://addons.mozilla.org">addons.mozilla.org</a> then you must provide a secure method of updating your add-on. This will either involve hosting your updates on an SSL website, or using cryptographic keys to sign the update information. Read <a href="/cn/Extension_Versioning,_Update_and_Compatibility#Securing_Updates" title="cn/Extension_Versioning,_Update_and_Compatibility#Securing_Updates">Securing Updates</a> for more information.</p> + +<h3 id="Step_3_Deal_with_changed_APIs" name="Step_3:_Deal_with_changed_APIs">Step 3: Deal with changed APIs</h3> + +<p>Several APIs have been changed in significant ways. The most significant of these, which will likely affect a large number of extensions, are:</p> + +<h4 id="DOM" name="DOM">DOM</h4> + + +<p>将外部文档的节点插入当前文档之前,你必须使用 <a href="/zh-CN/docs/Web/API/Document/importNode" title="将外部文档的一个节点拷贝一份,然后可以把这个拷贝的节点插入到当前文档中."><code>document.importNode()</code></a> 从外部文档导入源节点,或者使用 <a href="/zh-CN/docs/Web/API/Document/adoptNode" title="从其他的document文档中获取一个节点。 该节点以及它的子树上的所有节点都会从原文档删除 (如果有这个节点的话), 并且它的ownerDocument 属性会变成当前的document文档。 之后你可以把这个节点插入到当前文档中。"><code>document.adoptNode()</code></a>导入源节点, + 想要了解更多的 <a href="/zh-CN/docs/Web/API/Node/ownerDocument" title="Node.ownerDocument 只读属性会返回当前节点的顶层的 document 对象。"><code>Node.ownerDocument</code></a> 问题,请参考 <a class="external" href="http://www.w3.org/DOM/faq.html#ownerdoc" rel="noopener">W3C DOM FAQ</a>.</p> + + <p>即使你不执行导入动作,就执行插入外部文档中的节点.Firefox目前也不会报错(如果严格按标准执行,很多已有的网站都无法正常运行). + 我们鼓励开发者严格按标准修改自己已有的不符合上述标准的代码.</p> + +<h4 id="Bookmarks__History" name="Bookmarks_&_History">Bookmarks & History</h4> + +<p>If your extension accesses bookmark or history data in any way, it will need substantial work to be compatible with Firefox 3. The old APIs for accessing this information have been replaced by the new <a href="/cn/Places" title="cn/Places">Places</a> architecture. See the <a href="/cn/Places_migration_guide" title="cn/Places_migration_guide">Places migration guide</a> for details on updating your existing extension to use the Places API.</p> + +<h4 id="Download_Manager" name="Download_Manager">Download Manager</h4> + +<p>The Download Manager API has changed slightly due to the transition from an RDF data store to using the <a href="/cn/Storage" title="cn/Storage">Storage</a> API. This should be a pretty easy transition to make. In addition, the API for monitoring download progress has changed to support multiple download manager listeners. See <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadManager" title="">nsIDownloadManager</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadProgressListener" title="">nsIDownloadProgressListener</a></code>, and <a href="/cn/Monitoring_downloads" title="cn/Monitoring_downloads">Monitoring downloads</a> for more information.</p> + +<h4 id="Password_Manager" name="Password_Manager">Password Manager</h4> + +<p>If your extension accesses user login information using the Password Manager, it will need to be updated to use the new Login Manager API.</p> + +<ul> + <li>The article <a href="/cn/Using_nsILoginManager" title="cn/Using_nsILoginManager">Using nsILoginManager</a> includes examples, including a demonstration of how to write your extension to work with both the Password Manager and the Login Manager, so it will work with both Firefox 3 and earlier versions.</li> + <li><code><a href="/cn/NsILoginInfo" title="cn/NsILoginInfo">nsILoginInfo</a></code></li> + <li><code><a href="/cn/NsILoginManager" title="cn/NsILoginManager">nsILoginManager</a></code></li> +</ul> + +<p>You can also override the built-in password manager storage if you want to provide your own password storage implementation in your extensions. See <a href="/cn/Creating_a_Login_Manager_storage_module" title="cn/Creating_a_Login_Manager_storage_module">Creating a Login Manager storage module</a> for details.</p> + +<h4 id="Popups_.28Menus.2C_Context_Menus.2C_Tooltips_and_Panels.29" name="Popups_.28Menus.2C_Context_Menus.2C_Tooltips_and_Panels.29">Popups (Menus, Context Menus, Tooltips and Panels)</h4> + +<p>The XUL Popup system was heavily modified in Firefox 3. The Popup system includes main menus, context menus and popup panels. A guide to <a href="/cn/XUL/PopupGuide" title="cn/XUL/PopupGuide">using Popups</a> has been created, detailing how the system works. One thing to note is that <code>popup.<span id="m-showPopup"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/showPopup">showPopup</a></code></span></code> has been deprecated in favor of new <code>popup.<span id="m-openPopup"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/openPopup">openPopup</a></code></span></code> and <code>popup.<span id="m-openPopupAtScreen"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/openPopupAtScreen">openPopupAtScreen</a></code></span></code>.</p> + +<h4 id="Autocomplete" name="Autocomplete">Autocomplete</h4> + +<p>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAutoCompleteController" title="">nsIAutoCompleteController</a></code> interface's <code><a href="/cn/NsIAutoCompleteController#handleEnter.28.29" title="cn/NsIAutoCompleteController#handleEnter.28.29">handleEnter()</a></code> method has been changed to accept an argument that indicates whether the text was selected from the autocomplete popup or by the user pressing enter after typing text.</p> + +<h4 id="DOMParser" name="DOMParser">DOMParser</h4> + +<ul> + <li>When a <code>DOMParser</code> is instantiated, it inherits the calling code's principal and the <code>documentURI</code> and <code>baseURI</code> of the window the constructor came from.</li> + <li>If the caller has UniversalXPConnect privileges, it can pass parameters to <code>new DOMParser()</code>. If fewer than three parameters are passed, the remaining parameters will default to <code>null</code>. + <ul> + <li>The first parameter is the principal to use; this overrides the default principal normally inherited.</li> + <li>The second parameter is the <code>documentURI</code> to use.</li> + <li>The third parameter is the <code>baseURI</code> to use.</li> + </ul> + </li> + <li>If you initialize a <code>DOMParser</code> using a contract, such as by calling <code>createInstance()</code>, and you don't call the <code>DOMParser</code>'s <code>init()</code> method, attempting to initiate a parsing operation will automatically create and initialize the <code>DOMParser</code> with a null principal and <code>null</code> pointers for <code>documentURI</code> and <code>baseURI</code>.</li> +</ul> + +<h4 id="Removed_interfaces" name="Removed_interfaces">Removed interfaces</h4> + +<p>The following interfaces were removed from Gecko 1.9, which drives Firefox 3. If your extension makes use of any of these, you'll need to update your code:</p> + +<ul> + <li><code>nsIDOMPaintListener</code></li> + <li><code>nsIDOMScrollListener</code></li> + <li><code>nsIDOMMutationListener</code></li> + <li><code>nsIDOMPageTransitionListener</code></li> + <li><code>nsICloseAllWindows</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=386200" title='FIXED: SeaMonkey only: no "view cert button" in untrusted cert error dialog'>bug 386200</a>)</li> +</ul> + +<h3 id="Step_4_Check_for_relevant_chrome_changes" name="Step_4:_Check_for_relevant_chrome_changes">Step 4: Check for relevant chrome changes</h3> + +<p>There has been a minor change to the chrome that may require changes in your code. A new <code>vbox</code> has been added, called "browser-bottombox", which encloses the find bar and status bar at the bottom of the browser window. Although this doesn't affect the appearance of the display, it may affect your extension if it overlays chrome relative to these elements.</p> + +<p>For example, if you previously overlaid some chrome before the status bar, like this:</p> + +<pre><window id="main-window"> + <something insertbefore="status-bar" /> +</window> +</pre> + +<p>You should now overlay it like this:</p> + +<pre><vbox id="browser-bottombox"> + <something insertbefore="status-bar" /> +</vbox> +</pre> + +<p>Or use the following technique to make your overlay work on both Firefox 2 and Firefox 3:</p> + +<pre><window id="main-window"> + <vbox id="browser-bottombox" insertbefore="status-bar"> + <something insertbefore="status-bar" /> + </vbox> +</window> +</pre> + +<div class="blockIndicator note"><strong>Note:</strong> This change is effective for Firefox 3 beta 4 and the pre-beta 4 nightlies.</div> + +<h3 id="Other_changes" name="Other_changes">其他方面的修改</h3> + +<p><em>Add simple changes you had to make while updating your extension to work with Firefox 3 here.</em></p> + +<ul> + <li><code><a class="external" rel="freelink">chrome://browser/base/utilityOverlay.js</a></code> is no longer supported for security reasons. If you were previously using this, you should switch to <code><a class="external" rel="freelink">chrome://browser/content/utilityOverlay.js</a></code>.</li> + <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAboutModule" title="">nsIAboutModule</a></code> implementations are now required to support the <code>getURIFlags</code> method. See <a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/about/public/nsIAboutModule.idl" rel="custom">nsIAboutModule.idl</a> for documentation. This affects extensions that provide new <code>about:</code> URIs. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=337746" title='FIXED: [FIX]Move "safe about" hardcoding out of security manager'>bug 337746</a>)</li> + <li>The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabbrowser" title="tabbrowser">tabbrowser</a></code> element is no longer part of "toolkit" (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=339964" title="FIXED: move tabbrowser.xml out of mozilla/toolkit and into mozilla/browser">bug 339964</a>). This means this element is no longer available to XUL applications and extensions. It continues to be used in the main Firefox window (browser.xul).</li> + <li>Changes to <a href="/cn/NsISupports_proxies" title="cn/NsISupports_proxies">nsISupports proxies</a> and possibly to threading-related interfaces need to be documented.</li> + <li>If you use XML processing instructions, such as <code><?xml-stylesheet ?></code> in your XUL files, be aware of the changes made in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=319654" title="FIXED: Processing instructions in XUL are not added to the content model">bug 319654</a>: + <ol> + <li>XML PIs are now added to a XUL document's DOM. This means <a href="/zh-CN/docs/Web/API/Document/firstChild" title="此页面仍未被本地化, 期待您的翻译!"><code>document.firstChild</code></a> is no longer guaranteed to be the root element. If you need to get the root document in your script, use <a href="/zh-CN/docs/Web/API/Document/documentElement" title="Document.documentElement 是一个会返回文档对象(document)的根元素的只读属性(如HTML文档的 <html> 元素)。"><code>document.documentElement</code></a> instead.</li> + <li><code><?xml-stylesheet ?></code> and <code><?xul-overlay ?></code> processing instructions now have no effect outside the document prolog.</li> + </ol> + </li> + <li><code>window.addEventListener("load", myFunc, true)</code> is not fired when loading web content (browser page loads). This is due to <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=296639" title="FIXED: Split windows into an inner and outer object">bug 296639</a> which changes the way inner and outer windows communicate. The simple fix here is to use <code>gBrowser.addEventListener("load", myFunc, true)</code> as described <a href="/cn/Code_snippets/Tabbed_browser#Detecting_page_load" title="cn/Code_snippets/Tabbed_browser#Detecting_page_load">here</a> and works in Firefox 2 as well.</li> + <li><code>content.window.getSelection()</code> gives an object (which can be converted to a string by <code>toString()</code>), unlike the now deprecated <code>content.document.getSelection()</code> which returns a string</li> + <li><code>event.preventBubble()</code> was deprecated in Firefox 2 and has been removed in Firefox 3. Use <a href="/cn/DOM/event.stopPropagation" title="cn/DOM/event.stopPropagation"><code>event.stopPropagation()</code></a>, which works in Firefox 2 as well.</li> + <li>Timers that are initiated using <code>setTimeout()</code> are now blocked by modal windows due to the fix made for <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=52209" title="FIXED: JS timers can fire while a modal dialog is open">bug 52209</a>. You may use <code>nsITimer</code> instead.</li> + <li>If your extension needs to allow an untrusted source (e.g., a web site) to access the extension's chrome, then you must use the new <a href="/cn/Chrome_Registration#contentaccessible" title="cn/Chrome_Registration#contentaccessible"><code>contentaccessible</code> flag</a>.</li> +</ul> |