diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/mozilla/firefox | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/mozilla/firefox')
69 files changed, 9246 insertions, 0 deletions
diff --git a/files/zh-cn/mozilla/firefox/australis_add-on_compat/index.html b/files/zh-cn/mozilla/firefox/australis_add-on_compat/index.html new file mode 100644 index 0000000000..0f0031c0f1 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/australis_add-on_compat/index.html @@ -0,0 +1,130 @@ +--- +title: Australis and add-on compatibility +slug: Mozilla/Firefox/Australis_add-on_compat +tags: + - 扩展 +translation_of: Mozilla/Firefox/Australis_add-on_compat +--- +<div>{{FirefoxSidebar}}</div> + +<h2 id="扩展程序的改变">扩展程序的改变</h2> + +<p><strong>我们已经移除了扩展程序的工具栏(包括状态栏)。</strong>您不应再依赖它的存在。已有一个填隙片会尝试迁移您的图标,但它可能不起作用或只能部分起作用。 最好的解决方案是更改按钮的位置。 这也许是一个很好的时机去考虑您的扩展程序是否真的需要在默认情况下对所有用户可见的工具栏按钮。<strong>使用扩展程序SDK开发的扩展程序不需要注意这次改变。</strong></p> + +<p><strong>我们已经移除了应用(Firefox)菜单。</strong> 取而代之的是一个<strong>新的基于面板的菜单</strong>,可以用导航栏远端的一个按钮打开它。可以将工具栏项目拖进/拖出这个面板。</p> + +<p>一些默认的工具栏按钮ID已更改,我们添加了一些新的ID,并且后退/前进按钮,URL栏,停止/重新加载按钮的顺序将不再可自定义。这也意味着用户不能用常规的自定义流程在这些按钮中添加新的(扩展程序提供的)按钮。</p> + +<p>独立的暂停刷新按钮已被移除</p> + +<p>我们正在更改工具栏按钮的添加方式。 虽然我们尝试保持某种向后兼容性,但是以下的 the following are deprecated and will be removed in the near future: the <code style="">toolbar.insertItem</code> 方法, <code style="">toolbar.currentSet</code> 属性, and the <code style="">currentset</code> 属性 on toolbars. If possible, please stop relying on them. Instead, you should use the <a href="http://mxr.mozilla.org/projects-central/source/ux/browser/components/customizableui/src/CustomizableUI.jsm">CustomizableUI</a> module.</p> + +<p>CustomizableUI introduces a new API to insert, move and remove toolbar buttons and other toolbar items, as well as creating panels that are anchored to these toolbarbuttons. We believe this will be simpler and more powerful than the previous mix of APIs.</p> + +<p>Because of the new customization APIs, your toolbar buttons may not be direct children of a XUL <code style=""><toolbar></code>; they might still be in a toolbar, or they might be in the "customization target" of a toolbar (a descendant node in a toolbar), or they might be in the new menu panel. The customization target of any toolbar (whether the target is a child node, or the toolbar itself) via <code style="">toolbar.customizationTarget.</code></p> + +<p><strong>Icon sizes in toolbars have changed</strong>, and you should ideally provide a larger icon for your add-on's buttons, should they exist, for use in the menu panel and customization area (palette). The new icon sizes are the same on all platforms and are:</p> + +<ul> + <li>Toolbars:<br> + <strong>16px</strong> (32px @2dppx) without padding.<br> + Internal icons on the navbar use 18px. For add-ons, by default the padding is set up so it should work well if add-ons specify an icon of size 16px.</li> + <li>Menu panel/Customization area (palette):<br> + <strong>32px</strong> (64px @2dppx)<br> + Please note that smaller icons will be <em>upscaled</em>.</li> +</ul> + +<p>When in the customization area (palette), the button will be wrapped in a toolbarpaletteitem with a <code style="">place</code> attribute set to <code style="">palette</code>. Putting it all together, your updated CSS might look like this:</p> + +<pre class="brush: css notranslate" style="">#my-addon-button { + list-style-image: url(icon16.png); +} +#my-addon-button[cui-areatype="menu-panel"], +toolbarpaletteitem[place="palette"] > #my-addon-button { + list-style-image: url(icon32.png); +} + +/* High-resolution displays */ +@media (min-resolution: 2dppx) { + #my-addon-button { + list-style-image: url(icon32.png); + } + #my-addon-button[cui-areatype="menu-panel"], + toolbarpaletteitem[place="palette"] > #my-addon-button { + list-style-image: url(icon64.png); + } +} +</pre> + +<p>Tab markup and styling have changed. If your add-on affects the tabstrip or provides alternative visualizations of the tabstrip, changes tab colors, or anything else related to the tabstrip, you may want to verify that it still works.</p> + +<p>The navigation toolbar is always visible (except in popup windows where a reduced navigation toolbar with the urlbar is visible) and can no longer be hidden e.g. for update pages or in-content UI. The related Add-on SDK module <a href="/en-US/Add-ons/SDK/High-Level_APIs/addon-page">addon-page</a> has been removed as it no longer has any effect.</p> + +<p>Items in the navigation toolbar can be overflowed if the browser window is made too small. Items in the toolbar will be moved into the new "overflow panel" when this occurs. The overflow panel is anchored to a button that appears in the navigation toolbar when one or more items are overflowed. If your item should never be overflowed, set an <code style="">overflows</code> attribute to <code style="">false</code> on the item. The <code style="">urlbar-container</code> is not overflowable by default, for example. Items that are overflowed have the <code style="">overflowedItem</code> attribute set to <code style="">true</code>.</p> + +<p>The menu panel uses a 3-column grid layout. Items should either fit in a single grid column (<code style="">toolbarbutton</code>s will be styled to do so automatically) or span the entire width of the panel if they wouldn't fit in a single grid column, e.g. for wide <code style="">toolbaritem</code>s. In order to have the latter work correctly, you should use the <code style="">panel-wide-item</code> class on your <code style="">toolbaritem</code>.</p> + +<p>If your add-on provides a <code style=""><toolbarbutton type="menu"/></code> or <code style=""><toolbarbutton type="menu-button"/></code>, consider moving to a subview-based design, which will work much better in the menu panel. There's some <a href="/en-US/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm">documentation</a> you can look at, as well as <a href="http://hg.mozilla.org/projects/ux/annotate/8b514254b168/browser/components/customizableui/src/CustomizableWidgets.jsm#l56">the implementation of the history widget</a>.</p> + +<p>If your add-on provides a simple <code style="">toolbarbutton</code> then it should automatically be styled correctly in the menu panel, overflow panel and palette. If it provides a <code style="">toolbaritem</code> it is likely you will need to do additional work to make it look nice in places other than a toolbar.</p> + +<p>All items will have context menus allowing users to move the items between the palette, panel and the navigation toolbar. If your add-on uses the contextmenu itself, we will not override or change it (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=892463">this bug</a> for a lengthy discussion as to why). You are requested, however, to update your menus yourself so that users do have the possibility of using these options even for your add-on's button.</p> + +<p>The <code style="">class</code> attribute on tab close buttons has been changed. Extensions shouldn't be relying on the class attribute value since it is a list of tokens and should instead look for the <code style="">anonid </code>attribute with value "<code style="">close-button</code>".</p> + +<p>The <code style="">close-icon</code> class now works cross-platform to provide a close icon with a default, hover, and active state. Previously, this wasn't available on Linux and the GTK close icon (gtk-close) was used instead.</p> + +<p>The BrowserToolboxCustomizeDone, BrowserToolboxCustomizeChange, and BrowserCustomizeToolbar global window functions have been removed. <a href="/en-US/docs/XUL/Toolbars/Toolbar_customization_events">The customize events fired from the toolbox</a> are now the preferred mechanism for hooking new logic into the customization feature.</p> + +<h3 id="Add-on_SDK_Australis_APIs" style="">Add-on SDK Australis APIs</h3> + +<p>If you're using the Add-on SDK, there are several new APIs for building your add-on's user interface in Australis. See the <a href="/en-US/Add-ons/SDK/High-Level_APIs/ui">reference documentation</a>. Also note that the <code style=""><a href="/en-US/Add-ons/SDK/High-Level_APIs/widget">widget</a></code> module has been deprecated in favor of the new APIs.</p> + +<h2 id="Changes_for_themes">Changes for themes</h2> + +<p>We've changed the tab markup. If you style these differently, you'll need to check whether it still works.</p> + +<p>We'll be drawing tabs in the titlebar and on top, on all platforms (currently implemented on Windows and OS X), except when not showing tabs at all (in popup windows).</p> + +<p>Support for small icons mode as well as text and icons mode have been removed.</p> + +<p>We've changed the default iconsets, and there are new icon sizes for the menupanel. If you're building on the default theme with new icons, you'll need to rearrange your icons in your Toolbar icon files. In both this case and if you supply a complete theme, you will also need to provide icons for the menu panel. The new icon sizes are the same on all platforms and are:</p> + +<ul> + <li>Toolbars:<br> + <strong>16px</strong> (32px @2dppx) without padding.<br> + Internal icons on the navbar use 18px. For add-ons, by default the padding is set up so it should work well if add-ons specify an icon of size 16px.</li> + <li>Menu panel/Customization area (palette):<br> + <strong>32px</strong> (64px @2dppx)<br> + Please note that smaller icons will be <em>upscaled</em>.</li> +</ul> + +<p>We've removed the add-on bar, but have a shim in place to migrate icons to other places. Any styles pertaining to should be removed so as not to disturb the migration work.</p> + +<p>We've changed a few toolbarbutton IDs, such as those for the bookmark and history buttons. We also added new ones.</p> + +<p>The application (Firefox) menu has been removed.</p> + +<p>The back, forward, stop and refresh buttons will no longer be movable. They will always remain in their current position next to the urlbar. Your CSS rules can probably be simplified now that this is the case.</p> + +<p>The navigation toolbar can no longer be hidden e.g. for update pages or in-content UI.<br> + </p> + +<h2 id="Known_issues_related_to_add-ons">Known issues related to add-ons</h2> + +<ul> + <li>Add-ons that have copied their toolbarbutton-insertion code from Adblock Plus hide their toolbarbutton icon. They keep track of their insertion point by themselves. Even though our compatibility shims correctly insert these button initially, their detection code decides it is not in a toolbar (it is in fact in a customization target inside a toolbar, see above) and removes the icon on restart. This has been fixed in Adblock Plus but add-ons using similar code patterns might still be affected.</li> + <li>Many add-ons check whether their button is in the toolbox (rather than in a toolbar or some other visible place) by checking the result of <code style="">document.getElementById()</code>. This is <strong>no longer enough</strong>. If your button is in the menu panel, it will not be moved there until the menu panel is first shown. Instead, use:<a href="/en-US/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm"><code style=""> CustomizableUI.getPlacementOfWidget("mytoolbarbuttonId")</code></a>. This will return <code style="">null</code> if and only if the widget is in the palette.</li> + <li>If a <code style=""><menulist></code> element is wrapped inside a toolbaritem, popping up the <code style=""><menulist></code> closes the new menu panel. This issue is being tracked <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=964944">here</a>.</li> + <li>Add-ons that automatically re-add their icons to the add-on bar when removed will need to fix their own insertion code to not do that.</li> + <li>Elements inserted in the statusbar element or the add-on bar itself will not be shown. This can only be fixed by the add-on authors, who need to update their add-on to use toolbaritems instead of statuspanels, and insert into a normal toolbar.</li> + <li>For toolbaritems and toolbarbuttons inserted into the add-on bar, we will attempt to migrate them to a visible toolbar automatically <strong>if</strong> the add-on bar was visible in the user's profile before migrating to Australis. However, depending on your add-on's code this may or may not work correctly without further code changes on your part.</li> + <li>Toolbar buttons of type <code style="">menu </code>with a <code style="">orient="horizontal"</code> attribute will not display properly in the menu panel. This attribute should probably be avoided altogether.</li> +</ul> + +<h2 id="See_Also">See Also</h2> + +<ul> + <li><a href="/en-US/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm">CustomizableUI.jsm</a></li> + <li><a href="/en-US/Firefox/Releases/29">Firefox 29 for developers</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/developer_edition/index.html b/files/zh-cn/mozilla/firefox/developer_edition/index.html new file mode 100644 index 0000000000..8764178a14 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/developer_edition/index.html @@ -0,0 +1,57 @@ +--- +title: 开发者版本 +slug: Mozilla/Firefox/Developer_Edition +translation_of: Mozilla/Firefox/Developer_Edition +--- +<div>{{FirefoxSidebar}}</div><p><img alt="" src="https://mdn.mozillademos.org/files/9069/firefox-dev-ed_logo-only_1024.png" style="display: block; height: 256px; margin-left: auto; margin-right: auto; width: 256px;"></p> + +<p style="text-align: center;">一个为网页开发者量身定制的 Firefox。</p> + +<p><a href=" https://www.mozilla.org/en-US/firefox/developer/" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">下载 Firefox 开发者版本</a></p> + +<hr> +<div class="column-container"> +<div class="column-half"> +<h3 id="最新的_Firefox_特性"><strong>最新的 Firefox 特性</strong></h3> + +<p>Firefox 开发者版本会在 <a href="https://wiki.mozilla.org/Release_Management/Release_Process">Firefox 发布流程</a>中取代 Aurora 通道。像 Aurora 通道一样, 每 6 周新特性当它们在 Nightly 版本中稳定后,会登录到开发者版本中。</p> + +<p>通过使用开发者版本,你将会比常规发布的 Firefox 提前至少 12 周体验到新的工具以及平台特性。</p> + +<p><a href="/en-US/Firefox/Releases/35">来看看开发者版本中有什么新的内容</a>。</p> +</div> + +<div class="column-half"> +<h3 id="实验性开发工具"><strong>实验性开发工具</strong></h3> + +<p>我们还包含了一系列没有足够测试的实验性工具。</p> + +<p>例如,开发者版本包含了 <a href="/en-US/docs/Tools/Firefox_Tools_Adapter">Firefox Tools Adapter</a>,它可以帮你将 <a href="/en-US/docs/Tools">Firefox 开发工具</a> 连接到其他平台的浏览器上,像 Android 上的 Chrome 以及 iOS 上的 Safari。</p> +</div> +</div> + +<div class="column-container"> +<div class="column-half"> +<h3 id="单独的配置文件"><strong>单独的配置文件</strong></h3> + +<p>Firefox 开发版有自己一套单独的配置文件,这就意味着它不会影响你电脑里已经安装了的稳定版或者 Beta 版的 Firefox。</p> +</div> + +<div class="column-half"> +<h3 id="专为网页开发者而设"><strong>专为网页开发者而设</strong></h3> + +<p>我们为网页开发者提供了量身的默认设置。例如,默认开启了 Chrome 以及远程调试功能。</p> +</div> +</div> + +<div class="column-container"> +<div class="column-half"> +<h3 id="一个独特的主题"><strong>一个独特的主题</strong></h3> + +<p>这将让你更迅速地进入开发工具中。</p> +</div> + +<div class="column-half"> </div> +</div> + +<p> </p> diff --git a/files/zh-cn/mozilla/firefox/enterprise_deployment/index.html b/files/zh-cn/mozilla/firefox/enterprise_deployment/index.html new file mode 100644 index 0000000000..13d68ed3ce --- /dev/null +++ b/files/zh-cn/mozilla/firefox/enterprise_deployment/index.html @@ -0,0 +1,138 @@ +--- +title: 将火狐部署到企业环境下 +slug: Mozilla/Firefox/Enterprise_deployment +tags: + - 发布 企业环境 火狐 管理员手册 +translation_of: Mozilla/Firefox/Enterprise_deployment_before_60 +--- +<div>{{FirefoxSidebar}}</div><p>本页将为您介绍在企业配置环境下针对Mac OS X、Windows系统中火狐管理的整个流程。如您遇有不清楚的地方,请发送邮件至<a href="mailto:enterprise@mozilla.org?subject=Question%3A">enterprise@mozilla.org</a>。</p> + +<h2 id="选择一个火狐的版本">选择一个火狐的版本</h2> + +<p> </p> + +<h3 id="快速发布版(RR)">快速发布版(RR)</h3> + +<p>火狐发布的每一个更新都会将主版本号增加,每6周便会发布新功能、Bug修复信息,如有必要,更新中也会加入额外的安全更新信息。当主版本更新后,Mozilla将不再提供上一版本的Bug修复。</p> + +<p>具体更新发布计划请关注Mozilla wiki的<a href="https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates">版本更新日程表</a>中的”发布日程”。</p> + +<h3 id="稳定版_(ESR)">稳定版 (ESR)</h3> + +<p>火狐每隔7个主版本都会释出一个稳定版的发布内容。这些稳定发布的版本会将54周(9个“六周”一次的更新周期)以来一系列的bug进行修复。这两个版本中都会共同包含第12周(两个发布版本周期)的ESR更新内容。</p> + +<p>到目前为止,扩展支持发布版本的版本号有10、17、24和31。</p> + +<p>绝大多数企业以及组织机构更倾向与选择ESR版本,主要是因为稳定版发布间隔较长,以让各企业用户有充裕的时间对兼容性进行考核(ESR为42周,而RR则仅为6周),一旦在测试期间发现问题,用户也将拥有12周时间建立解决方案(每12周ESR版本会有重复发布)。</p> + +<p>需要注意的是,如果您先使用RR后转为ESR较旧的版本时,将可能受到一些不利因素的影响。即便假设您此前使用的26RR版本火狐,和现改用24.2ESR版本发布于统一天,不同版本差异也会产生不利的因素。这是因为新功能仅会在RR版本发布前加入快速发布版进行评测,但由于一些原因Mozilla决定待功能到某一特定版本后才触发使用,在这之前都会在用户配置文件重将对应功能关闭。一旦您选择了旧版本火狐,用户文档保存的将是最后一次保存的文件,其中即可能设定新功能为启用的状态,进而导致在ESR版中功能失效。如果您执意要从RR过度到ESR版本,您需要等到最新的ESR发布版本释出后再这样做。</p> + +<h2 id="安装">安装</h2> + +<ol> + <li>从<a href="http://www.mozilla.org/firefox/all/">http://www.mozilla.org/firefox/all/</a> (RR)或 <a href="https://www.mozilla.org/firefox/organizations/all.html">https://www.mozilla.org/firefox/organizations/all.html</a> (ESR)处获取发布版本安装包,单击“下载”按钮获取软件包或下载器;</li> + <li>根据您选择的安装模式进行安装,命令行下静默安装的参数为 -ms;</li> + <li>您也可以额外指定一个INI文件用以指定建立快捷方式等维护服务;具体请参照<a href="https://wiki.mozilla.org/Installer:Command_Line_Arguments">命令行安装参数</a>章节中的相关内容.</li> +</ol> + +<h2 id="设置">设置</h2> + +<ol> + <li>找到火狐的<strong>程序主文件夹,</strong>(Win7 64位操作系统默认安装位置是 <code>C:\Program Files (x86)\Mozilla Firefox</code>; OSX 10.8 则是默认安装在 <code>/Applications/Firefox.app/Contents/MacOS</code>。下文提到的这些子文件夹都在此程序主文件夹下;</li> + <li>在defaults/pref子文件夹中新建一个Javascript文件 <code>autoconfig.js</code> 或者别的名字,但是建议您还是选用英文字母组合命名文件。该文件将告诉火狐查询对应的配置信息(具体请参考 <a href="http://mike.kaply.com/2012/03/15/customizing-firefox-default-preference-files/">自定义火狐的默认选项文件</a>章节重的相关内容),您需要至少写入以下两行:</li> + <li> + <pre class="brush: js">pref("general.config.filename", "mozilla.cfg"); +pref("general.config.obscure_value", 0);</pre> + </li> + <li>新建.cfg文件,一般命名为<code>mozilla.cfg</code>,同样的它的文件名也可以用其它名字。它用于匹配识别general.config.filename的内容。将第一个语句跳过或注释掉后便可设置您的选项。具体都有哪些选项,您可参考about:config中的内容写入、或者您也可以参考后面的示例配置选项内容。任何about:config选项都可以通过以下函数之一进行设置: + <dl> + <dt> </dt> + <dt><strong>pref </strong></dt> + <dd>此选项可设置每次打开浏览器都按照此配置内容指定用户使用习惯。因此,即便用户在使用过程中可以随意更改偏好,但每次重新启动浏览器,用户之前的配置都将被抹消。如果您需要此方面的相关设置,请在about:config中查找“user set”。</dd> + <dt><strong>defaultPref</strong></dt> + <dd>此选项可用于修改默认值,但用户通常可以将其更改并将修改内容保存到用户会话中。如果用户偏好被重置,重置的内容将变为此设定值。此项目在about:config的“default”中。</dd> + <dt><strong>lockPref</strong></dt> + <dd>此选项可用于锁定指定项目,以防止用户在使用过程中通过界面或about:config对指定的配置选项进行修改。 通常锁定项的表现方式是变灰或移除选项内容。在about:config中则显示为“locked”。有一些选项必须通过<span class="author-g-fer323ku83ypu55t"><strong>lockPref</strong>设置比如<strong>app.update.enabled</strong>。如果只用pref设置该内容,该设置无效。</span></dd> + <dt><span class="author-g-fer323ku83ypu55t">clearPref</span></dt> + <dd><span class="author-g-fer323ku83ypu55t">此选项可以将某些指定的内容“放空”。此选项可以便于跳过某些网站的浏览器版本号检查功能。</span></dd> + </dl> + </li> +</ol> + +<p>相关内容请您参考<a href="http://mike.kaply.com/2012/03/16/customizing-firefox-autoconfig-files/">自定义火狐的自动配置文件</a>以及<a href="http://mike.kaply.com/2012/03/20/customizing-firefox-autoconfig-files-continued/">继续自定义火狐的自动配置文件</a>中的内容。如果您是倾向于零UI操作的狂热者,您可能需要用到<a href="http://mike.kaply.com/cck2/">CCK2</a>这个扩展。</p> + +<h3 id="配置文件示例">配置文件示例</h3> + +<p>如果您倾向于配置“极为复杂的用户偏好”,就请跳过这里。自火狐31版发布起,以下示例为您展示了常用的设置选项示例。如果您有某些指定的配置需求,请自行查询<a href="http://kb.mozillazine.org/Knowledge_Base">知识库中</a>的信息。</p> + +<pre class="brush: js"><span class="brush: js">//关闭更新器 +lockPref("app.update.enabled", false); +//确认更新起已经绝对关闭 +lockPref("app.update.auto", false); +lockPref("app.update.mode", 0); +lockPref("app.update.service.enabled", false); + +//取消插件兼容性检查 +clearPref("extensions.lastAppVersion"); + +//第一次运行火狐时不再提示“了解您的权益” +pref("browser.rights.3.shown", true); + +//每次更新后不再显示更新发布注记 +pref("browser.startup.homepage_override.mstone","ignore"); + +//修改主页地址(用户可改) +defaultPref("browser.startup.homepage", "http://home.example.com"); + +//关闭浏览器内默认的PDF阅读器 +pref("pdfjs.disabled", true); + +//关闭flash、js转换 +pref("shumway.disabled", true); + +//不再提示安装flash插件 +pref("plugins.notifyMissingFlash", false); + +//关闭插件提示 +lockPref("plugins.hide_infobar_for_outdated_plugin", true); +clearPref("plugins.update.url"); + +//关闭健康诊断报告 +lockPref("datareporting.healthreport.service.enabled", false); + +</span>// Disable all data upload (Telemetry and FHR) +lockPref("datareporting.policy.dataSubmissionEnabled", false); +<span class="brush: js"> +//关闭崩溃报告 +lockPref("toolkit.crashreporter.enabled", false); +Components.classes["@mozilla.org/toolkit/crash-reporter;1"].getService(Components.interfaces.nsICrashReporter).submitReports = false;</span><em> </em> +</pre> + +<h2 id="扩展包">扩展包</h2> + +<ol> + <li>安装扩展,通过about:support找到该拓展对应的GUID;</li> + <li>找到<a href="https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data">用户配置文件目录</a> (如win7的是:<code>%APPDATA%\Mozilla\Firefox\Profiles</code> , 在about:support中单击<strong>显示文件夹</strong>,然后在“扩展”下找到你需要的插件。插件文件可能是单独的xpi文件,或者是一个包含多个文件的目录。</li> + <li>确定如何发布此扩展。最简单的方式是将xpi直接拽到<strong>程序主文件夹<code>/</code></strong><code>distribution/extensions目录下,但是这仅限于用户配置文件已记录该插件的安装情况。您另外还可以手动打开火狐重新安装。具体请参考</code><a href="http://mike.kaply.com/2012/02/09/integrating-add-ons-into-firefox/">让插件与火狐合二为一</a>的相关章节。</li> +</ol> + +<p>Also keep in mind: <a href="http://mike.kaply.com/2013/05/03/add-on-scopes-redux/">Add-on scopes redux/</a></p> + +<h2 id="随时变化">随时变化</h2> + +<h3 id="目录结构的变化">目录结构的变化</h3> + +<p>到目前为止,火狐的目录结构已经变更过两次。如果您需要使用21版本以前的火狐,请注意以下的变化:</p> + +<ul> + <li>在14版中,当所有pref设置都写在一个/defaults/pref中的某文件时,设置将可能失效。解决办法是新建文件夹<code>defaults/preferences</code>并将配置文件放在这里;</li> + <li>在21版中新加入了browser文件夹。该文件夹将替换之前的.ini文件,<code>defaults/preferences</code>、<code>defaults/profile、</code><code>extensions</code>、<code>plugins以及searchplugins都将放在这里。plugins下的</code>Plug-ins可以通过修改.plugins.load_appdir_plugins 为 <strong>true</strong> 来重新激活。</li> +</ul> + +<p>自动配置<code>general.config.filename</code>和<code>general.config.obscure_value可以在defaults/pref</code>中完成,但文件名应该以英文字母‘a’开头,比如“autoconfig.js”</p> + +<p>如果您的版本defaults/pref与插件设置相悖,您可以尝试将目录结构改为和新版一样。</p> + +<h3 id="ESR_24.x的变化(有Adobe_PDF支持)">ESR 24.x的变化(有Adobe PDF支持)</h3> + +<p>火狐RR19.x起将PDF查看器嵌入到自己内部来, 即便您已经将火狐配置了其它PDF视图软件,但嵌入支持直到24.x版本以后才开始启用。而内容类型描述也与Adobe文档的PDF文件不同,若要取消此功能,请您将前面示例中的pdfjs.disabled改为true即可。</p> diff --git a/files/zh-cn/mozilla/firefox/experimental_features/index.html b/files/zh-cn/mozilla/firefox/experimental_features/index.html new file mode 100644 index 0000000000..390a652feb --- /dev/null +++ b/files/zh-cn/mozilla/firefox/experimental_features/index.html @@ -0,0 +1,623 @@ +--- +title: Experimental features in Firefox +slug: Mozilla/Firefox/Experimental_features +tags: + - 实验的 + - 火狐 + - 特性 + - 设置 +translation_of: Mozilla/Firefox/Experimental_features +--- +<div>{{FirefoxSidebar}}</div><p class="summary">Mozilla发布了测试的nightly版本,用于测试新的浏览器特性。 实验性特性,例如所提议的可用的Web平台标准的实现。这个页面列出了Firefox Nightly中的一些新特性和启用方法等信息。在发布这些功能之前,你可以测试Web站点和应用程序,并确保一切都能与最新的Web技术功能协同工作。</p> + +<p>你需要下载隔夜版或是开发者版,来测试下面这些实验性特性。</p> + +<h2 id="HTML">HTML</h2> + +<table style="height: 359px; width: 823px;" class="standard-table"> + <thead> + <tr> + <th scope="col">功能</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox 开发者版</th> + <th scope="col">Firefox 测试版</th> + <th scope="col">Firefox 发行版</th> + <th scope="col">Preference</th> + </tr> + <tr> + <td><strong>日期和时间输入</strong>{{HTMLElement("input")}}为 <a href="/en-US/docs/Web/HTML/Element/input/date">日期</a> 和 <a href="/en-US/docs/Web/HTML/Element/input/time">时间</a> 相关的输入类型提供的新用户界面</td> + <td>开启<br> + <sub>(从51开始支持, 从55开始默认开启)</sub></td> + <td>开启<br> + <sub>(从51开始支持)</sub></td> + <td>关闭<br> + <sub>(从51开始支持)</sub></td> + <td>---</td> + <td><code>dom.forms.datetime</code></td> + </tr> + <tr> + <td><strong>{{HTMLElement("dialog")}}</strong><br> + 包含与之交互的DOM元素的对话框元素。Implementation of modal dialogs and accessibility still missing.</td> + <td>关闭<br> + <sub>(从53开始支持)</sub></td> + <td>关闭<br> + <sub>(从53开始支持)</sub></td> + <td>---</td> + <td>---</td> + <td><code>dom.dialog_element.enabled</code></td> + </tr> + </thead> +</table> + +<h2 id="CSS">CSS</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">功能</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + </thead> + <tbody> + <tr> + <td><strong>Subgrids</strong></td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>layout.css.grid-template-subgrid-value.enabled</code></td> + </tr> + <tr> + <td><strong>Display stray control characters in CSS as hex boxes</strong><br> + This feature renders control characters (Unicode category Cc) other than <em>tab</em> (<code>U+0009</code>), <em>line feed</em> (<code>U+000A</code>), <em>form feed</em> (<code>U+000C</code>), and <em>carriage return</em> (<code>U+000D</code>) as a hexbox when they are not expected.</td> + <td>43</td> + <td>43</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1329613">Disabled</a></td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1329613">Disabled</a></td> + <td><code>layout.css.control-characters.enabled</code> or <code>layout.css.control-characters.visible</code></td> + </tr> + <tr> + <td><strong>Positioned CSS Masks</strong><br> + A subset of CSS Masks that includes <a href="/en-US/docs/Web/CSS/CSS_Masks">longhand properties of CSS Masks</a>, as well as a change in the shorthand property</td> + <td>51</td> + <td>51</td> + <td>53</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1251161">Disabled</a></td> + <td>Controlled by a compile flag (MOZ_ENABLE_MASK_AS_SHORTHAND).</td> + </tr> + <tr> + <td><strong>The <code>font-display</code> descriptor for <code>@font-face</code></strong><br> + To improve Web fonts performance, {{cssxref("@font-face")}} has an experimental {{cssxref("@font-face/font-display", "font-display")}} descriptor.</td> + <td>关闭<br> + <sub>(available since 46)</sub></td> + <td>关闭<br> + <sub>(available since 46)</sub></td> + <td>关闭<br> + <sub>(available since 46)</sub></td> + <td>关闭<br> + <sub>(available since 46)</sub></td> + <td><code>layout.css.font-display.enabled</code></td> + </tr> + <tr> + <td> + <p><strong><code>font-variation-settings</code> 属性</strong><br> + {{cssxref("font-variation-settings")}} 提供了OpenType或TrueType字体印刷特点的低级别的控制, by specifying the four letter axis names of the features you want to vary, along with their variation values.</p> + </td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td> + <p><code>layout.css.font-variations.enabled</code><br> + Functions only in Mac OS Sierra (and later).<br> + <br> + For the downloadable fonts on axis-praxis, you also need <code>gfx.downloadable_fonts.keep_variation_tables</code> (in Firefox 54 and later)</p> + </td> + </tr> + <tr> + <td><strong><code>touch-action</code> CSS 属性</strong><br> + The {{cssxref("touch-action")}} CSS property is part of the {{SpecName("Pointer Events")}} specification and allows you to specify how and in what way the user is able to manipulate an object by touch.</td> + <td>50</td> + <td>—</td> + <td>—</td> + <td>—</td> + <td><code>layout.css.touch_action.enabled</code></td> + </tr> + <tr id="shape-outside"> + <td> + <p><strong>The <code>shape-outside</code> CSS property</strong><br> + The {{cssxref("shape-outside")}} CSS property is part of the {{SpecName("CSS Shapes")}} specification and allows you to specify a float area causing inline contents to wrap around a shape.</p> + + <p>Firefox currently implements the <code><shape-box></code> values ({{bug(1309467)}}) as well as the <code>circle()</code> ({{bug(1311244)}}), <code>ellipse()</code> ({{bug(1326406)}}), and <code>polygon()</code> ({{bug(1326409)}}) functions.</p> + </td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>—</td> + <td>—</td> + <td>—</td> + <td><code>layout.css.shape-outside.enabled</code></td> + </tr> + <tr> + <td><strong>The <code>contain</code> CSS property</strong><br> + The {{cssxref("contain")}} CSS property is part of the {{SpecName("CSS Containment")}} specification and allows you to indicate that an element and its contents are independent of the rest of the document tree, allowing {{Glossary("User agent", "user agents")}} to optimize the rendering of a page.</td> + <td>关闭<br> + <sub>(available since 45)</sub></td> + <td>关闭<br> + <sub>(available since 45)</sub></td> + <td>关闭<br> + <sub>(available since 45)</sub></td> + <td>关闭<br> + <sub>(available since 45)</sub></td> + <td><code>layout.css.contain.enabled</code></td> + </tr> + <tr id="column-span"> + <td> + <p><strong>The <code>column-span</code> CSS property</strong><br> + The {{cssxref("column-span")}} CSS property is part of the {{SpecName("CSS3 Multicol")}} specification and allows you to specify how many columns an element spans across.</p> + + <p>Firefox currently only parses the property ({{bug(1339298)}}), it's not actually implemented yet ({{bug(616436)}}).</p> + </td> + <td>关闭<br> + <sub>(recognized since 55, but not implemented yet)</sub></td> + <td>—</td> + <td>—</td> + <td>—</td> + <td><code>layout.css.column-span.enabled</code></td> + </tr> + <tr> + <td><strong>The <code>frames()</code> timing function</strong><br> + See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/single-transition-timing-function#The_frames()_class_of_timing-functions">The frames() class of timing-functions</a> for more details.</td> + <td>开启</td> + <td><sub>N/A</sub></td> + <td>关闭<br> + <sub>(available since 55)</sub></td> + <td>关闭<br> + <sub>(available since 55)</sub></td> + <td>None</td> + </tr> + </tbody> +</table> + +<h2 id="JavaScript">JavaScript</h2> + +<p id="ECMAScript_2016">See also <a href="/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_Next_support_in_Mozilla">ECMAScript Next support</a> for implemented features of ECMAScript 2016 and later, that are not experimental and thus available without preferences in Firefox Release.</p> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Feature</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + </thead> + <tbody> + <tr> + <td><strong>Additions to the <code>ArrayBuffer</code> object</strong><br> + Adds the {{jsxref("ArrayBuffer.transfer()")}} that returns a new <code>ArrayBuffer</code> whose contents have been taken from the <code>oldBuffer</code>'s data (<a href="https://gist.github.com/lukewagner/2735af7eea411e18cf20">spec</a>).</td> + <td>36</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>None</td> + </tr> + <tr> + <td><strong>TypedObject objects</strong> (<a href="https://github.com/dslomov-chromium/typed-objects-es7">spec</a>)</td> + <td>Enabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>None</td> + </tr> + <tr> + <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/SIMD">SIMD</a> (<a href="https://github.com/johnmccutchan/ecmascript_simd">specification and polyfill</a>)</td> + <td>Enabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>None</td> + </tr> + <tr> + <td><strong>ECMAScript modules</strong><br> + Allows you to use native ECMAScript modules, for example defining modules with <code><script type="module"></code>, defining fallback scripts with <code><script nomodule></code>, and <a href="/en-US/docs/Web/JavaScript/Reference/Statements/import">importing</a> code features that have been <a href="/en-US/docs/Web/JavaScript/Reference/Statements/export">exported</a> from modules.</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.moduleScripts.enabled</code></td> + </tr> + </tbody> +</table> + +<h2 id="APIs">APIs</h2> + +<h3 id="Canvas_WebGL">Canvas & WebGL</h3> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Feature</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + </thead> + <tbody> + <tr> + <td><strong><code>WEBGL_debug_renderer_info</code> extension</strong><br> + The {{domxref("WEBGL_debug_renderer_info")}} extension allows you to transmit information useful to help debugging problems to the server.</td> + <td>42</td> + <td>42</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=742798">Disabled</a></td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=742798">Disabled</a></td> + <td><code>webgl.enable-debug-renderer-info</code></td> + </tr> + <tr> + <td><strong>OffscreenCanvas</strong><br> + The {{domxref("OffscreenCanvas")}} interface provides a canvas that can be rendered off screen. It is available in both the window and <a href="/en-US/docs/Web/API/Web_Workers_API">worker</a> contexts.</td> + <td>Disabled<br> + <sub>(available since 44)</sub></td> + <td>Disabled<br> + <sub>(available since 44)</sub></td> + <td>Disabled<br> + <sub>(available since 44)</sub></td> + <td>Disabled<br> + <sub>(available since 44)</sub></td> + <td><code>gfx.offscreencanvas.enabled</code></td> + </tr> + <tr> + <td><strong><a href="/en-US/docs/Web/API/Canvas_API/Tutorial/Hit_regions_and_accessibility">Hit regions</a></strong><br> + Whether the mouse coordinates are within a particular area on the canvas is a common problem to solve. The hit region API allows you define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools.</td> + <td>Disabled<br> + <sub>(available since 30)</sub></td> + <td>Disabled<br> + <sub>(available since 30)</sub></td> + <td>Disabled<br> + <sub>(available since 30)</sub></td> + <td>Disabled<br> + <sub>(available since 30)</sub></td> + <td><code>canvas.hitregions.enabled</code></td> + </tr> + </tbody> +</table> + +<h3 id="DOM">DOM</h3> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Feature</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + </thead> + <tbody> + <tr> + <td><strong>Mac上的WebVR API 1.1</strong><br> + <a href="/en-US/docs/Web/API/WebVR_API">WebVR API</a> 允许你控制并和使用虚拟现实设备。</td> + <td>Enabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.vr.enabled</code></td> + </tr> + <tr> + <td><strong>游戏手柄扩展</strong><br> + <a href="/en-US/docs/Web/API/Gamepad_API#Experimental_Gamepad_extensions">The Gamepad Extensions</a> provide access to additional functionality such as pose information in the case of WebVR controllers, and haptic actuator control (e.g. controller vibration hardware).</td> + <td>Enabled</td> + <td>Enabled</td> + <td>Enabled</td> + <td>Disabled</td> + <td><code>dom.gamepad-extensions.enabled</code></td> + </tr> + <tr> + <td><strong>Experimental fetch controller/signal/observer interfaces</strong><br> + Also known as "cancellable fetch", <a href="/en-US/docs/Web/API/Fetch_API#Experimental_fetch_controllersignalobserver_interfaces">these interfaces</a> contain functionality to allow fetch request operations to be observed and controlled during their lifetimes.</td> + <td>Disabled<br> + <sub>(Available since 55)</sub></td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.fetchObserver.enabled</code> and <code>dom.fetchController.enabled</code> (not in <code>about:config</code> by default; you must set them yourself).</td> + </tr> + <tr> + <td><strong>FlyWeb</strong><br> + <a href="https://flyweb.github.io/">FlyWeb</a> is a project at Mozilla focused on bringing a new set of APIs to the browser for advertising and discovering local-area web servers.</td> + <td>51</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.flyweb.enabled</code></td> + </tr> + <tr> + <td><code><strong>HTMLMediaElement.seekToNextFrame()</strong></code><br> + Part of an experimentation process around support non-real-time access to media for tasks including filtering, editing, and so forth, the {{domxref("HTMLMediaElement.seekToNextFrame()")}} advances the the current play position to the next frame in the media.</td> + <td>49<br> + <sub>(Fundamental update in version 50)</sub></td> + <td>49<br> + <sub>(Fundamental update in version 50)</sub></td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>media.seekToNextFrame.enabled</code></td> + </tr> + <tr> + <td><strong><code>GeometryUtils.getBoxQuads()</code></strong> ({{bug(917755)}})</td> + <td>31</td> + <td>31</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1107559">Disabled</a></td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1107559">Disabled</a></td> + <td><code>layout.css.getBoxQuads.enabled</code></td> + </tr> + <tr> + <td><strong><code>GeometryUtils.convertPointFromNode()</code></strong>,<br> + <strong><code>GeometryUtils.RectFromNode()</code></strong>, and<br> + <code><strong>GeometryUtils.convertQuadFromNode()</strong></code><br> + ({{bug(918189)}})</td> + <td>31</td> + <td>31</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1107559">Disabled</a></td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1107559">Disabled</a></td> + <td><code>layout.css.convertFromNode.enabled</code></td> + </tr> + <tr> + <td><strong><code>Node.rootNode</code></strong><br> + The {{domxref("Node.rootNode")}} property returns a {{domxref("Node")}} object representing the topmost node in the tree, or the current node if it's the topmost node in the tree.<br> + <em>This feature is kept experimental as its naming poses Web compatibility problems. It will be renamed in the future.</em></td> + <td>48</td> + <td>48</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1269155">Disabled</a></td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1269155">Disabled</a></td> + <td><code>dom.node.rootNode.enabled</code></td> + </tr> + <tr> + <td><strong>Performance Observer API</strong><br> + The {{domxref("PerformanceObserver")}} interface is used to <em>observe</em> performance measurement events and be notified of new <a href="/en-US/docs/Web/API/PerformanceEntry" title="The PerformanceEntry object encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image).">performance entries</a> as they are recorded in the browser's <em>performance timeline</em>.</td> + <td>49</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.enable_performance_observer</code></td> + </tr> + <tr> + <td><strong>WebVTT Regions API</strong><br> + <a href="/en-US/docs/Web/API/Web_Video_Text_Tracks_Format">WebVTT</a> regions are parts of the video viewport that provide a rendering area for WebVTT cues. The {{domxref("VTTRegion")}} is the interface exposing the WebVTT cues.<br> + <em>This interface is considered to be in flux and isn't therefore activated in any version by default.</em></td> + <td>Disabled<br> + <sub>(Experimental implementation since version 30)</sub></td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>media.webvtt.regions.enabled</code></td> + </tr> + <tr> + <td><strong>音频和视频轨道支持</strong><br> + Implements {{domxref("HTMLMediaElement.audioTracks")}} and {{domxref("HTMLMediaElement.videoTracks")}}.<br> + <em>Firefox doesn't support multiple audio or video tracks, preventing the most common use cases for these properties to work properly. That's why these properties are not activated by default in any version.</em></td> + <td>Disabled<br> + <sub>(Experimental implementation since version 33)</sub></td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>media.track.enabled</code></td> + </tr> + <tr> + <td><strong>Better value for <code>Event.timestamp</code></strong><br> + The property {{domxref("Event.timestamp")}} is returning a {{domxref("DOMHighResTimeStamp")}}, which is now relative to the Unix epoch.</td> + <td>32 (Windows)<br> + 43 (Linux)</td> + <td>32 (Windows)<br> + 43 (Linux)</td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026804">Disabled</a></td> + <td><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026804">Disabled</a></td> + <td><code>media.track.enabled</code></td> + </tr> + <tr id="pointer-events"> + <td><strong>指针事件</strong></td> + <td>50</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.w3c_pointer_events.enabled</code></td> + </tr> + <tr> + <td><strong>Pointer Events {{domxref("PointerEvent.tangentialPressure")}} and {{domxref("PointerEvent.twist")}}</strong></td> + <td>54</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.w3c_pointer_events.enabled</code></td> + </tr> + <tr> + <td><strong>Intersection Observer API</strong><br> + The {{domxref("Intersection Observer API")}} allows you to configure a callback that is called whenever one item, called a target, intersects either the device viewport or a specified element called.</td> + <td>Disabled<br> + <sub>(available since 53)</sub></td> + <td>—</td> + <td>—</td> + <td>—</td> + <td><code>dom.IntersectionObserver.enabled</code></td> + </tr> + <tr> + <td><strong><a href="/en-US/docs/Web/API/Web_Animations_API">Web Animations API: KeyframeEffect and KeyframeEffectReadOnly</a></strong><br> + The {{domxref("KeyframEffectReadOnly()", "KeyframeEffectReadOnly.KeyframeEffectReadOnly()")}} and {{domxref("KeyframeEffect()", "KeyframeEffect.KeyframeEffect()")}} constructors can be used to clone existing {{domxref("KeyframeEffectReadOnly")}} object instances by being given the object to clone as their only parameter (see {{bug(1273784)}}.)</td> + <td>52</td> + <td>52</td> + <td>Disabled</td> + <td>Disabled</td> + <td>None</td> + </tr> + <tr> + <td><strong>{{domxref("PromiseRejectionEvent")}} and related features</strong><br> + Providing a way to monitor and more finely control the rejection of Promises.<br> + </td> + <td>Disabled<br> + <sub>(available since 55)</sub></td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>dom.promise_rejection_events.enabled</code></td> + </tr> + <tr> + <td><strong><a href="/en-US/docs/Web/API/Payment_Request_API">Payment Request API</a></strong><br> + 为网络支付提供的一个API。</td> + <td>Disabled<br> + <sub>(available since 55)</sub></td> + <td>Disabled<br> + <sub>(available since 55)</sub></td> + <td>Disabled<br> + <sub>(available since 55)</sub></td> + <td>Disabled<br> + <sub>(available since 55)</sub></td> + <td><code>dom.payments.request.enabled</code></td> + </tr> + </tbody> +</table> + +<h3 id="WebRTC">WebRTC</h3> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Feature</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + </thead> + <tbody> + <tr> + <td><strong>TCP ICE candidates</strong><br> + ICE candidates that use TCP rather than UDP are considered during ICE negotiation.</td> + <td> + <p>Disabled<br> + 41</p> + + <p>Enabled<br> + 54</p> + </td> + <td>Disabled<br> + 41</td> + <td>Disabled<br> + 41</td> + <td>Disabled<br> + 41</td> + <td><code>media.peerconnection.ice.tcp</code></td> + </tr> + </tbody> +</table> + +<h2 id="开发者工具">开发者工具</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Feature</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + </thead> + <tbody> + <tr id="new-debugger-frontend"> + <td><strong>Debugger rewrite in HTML</strong></td> + <td>52</td> + <td>52</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>devtools.debugger.new-debugger-frontend</code></td> + </tr> + <tr id="new-console-frontend"> + <td><strong>Console rewrite in HTML</strong></td> + <td>52</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>devtools.webconsole.new-frontend-enabled</code></td> + </tr> + <tr id="performance-tool-options"> + <td><strong>Experimental Performance tool options</strong><br> + Enables options in the UI for JIT optimizations, memory, etc.</td> + <td>41</td> + <td>Disabled</td> + <td>Disabled</td> + <td>Disabled</td> + <td><code>devtools.performance.ui.experimental</code></td> + </tr> + <tr id="layout-side-panel"> + <td><strong>Layout side panel</strong><br> + The Layout side panel allows to inspect and manage different CSS layout types like <a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid Layout</a>.</td> + <td>Disabled<br> + <sub>(available since 52)</sub></td> + <td>Disabled<br> + <sub>(available since 52)</sub></td> + <td>Disabled<br> + <sub>(available since 52)</sub></td> + <td>Disabled<br> + <sub>(available since 52)</sub></td> + <td><code>devtools.layoutview.enabled</code></td> + </tr> + </tbody> +</table> + +<h2 id="其他">其他</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Feature</th> + <th scope="col">Firefox Nightly</th> + <th scope="col">Firefox Developer Edition</th> + <th scope="col">Firefox Beta</th> + <th scope="col">Firefox Release</th> + <th scope="col">Preference</th> + </tr> + <tr> + <td><a href="https://support.mozilla.org/t5/Other/How-to-add-a-shortcut-to-a-website-on-Android/ta-p/21992"><strong>添加到主屏幕</strong></a><br> + The <code>icons</code>, <code>name</code>, <code>short_name</code>, and <code>theme_color</code> fields of the <a href="/en-US/docs/Web/Manifest">Web App Manifest</a> (if present) can now be as the source of the homescreen/apps window icons, apps window title, homescreen icon title, and apps window color (respectively) for "Add to home screen" (Firefox Mobile only).</td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>关闭<br> + <sub>(available since 53)</sub></td> + <td>关闭<br> + <sub>(available since 52)</sub></td> + <td><code>manifest.install.enabled</code></td> + </tr> + <tr> + <td><strong>TLS 1.3</strong></td> + <td>开启</td> + <td>开启</td> + <td>关闭</td> + <td>关闭</td> + <td><code>security.tls.version.max</code> to <code>4</code></td> + </tr> + </thead> +</table> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases">Firefox 开发者发行日志</a></li> + <li><a href="https://nightly.mozilla.org/">Firefox Nightly</a></li> + <li><a href="https://www.mozilla.org/en-US/firefox/developer/">Firefox 开发者版本</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/headless_mode/index.html b/files/zh-cn/mozilla/firefox/headless_mode/index.html new file mode 100644 index 0000000000..855339e6d1 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/headless_mode/index.html @@ -0,0 +1,270 @@ +--- +title: Headless mode +slug: Mozilla/Firefox/Headless_mode +translation_of: Mozilla/Firefox/Headless_mode +--- +<div>{{FirefoxSidebar}}</div> + +<p class="summary">Headless模式是运行Firefox的一种非常有用的方式。就像听起来一样,Firefox正常运行,但没有任何可见UI组件。虽然不太适合浏览网页,但它对自动化测试非常有用。本文提供了有关运行 headless Firefox 的所有知识。</p> + +<h2 id="Using_headless_mode">Using headless mode</h2> + +<p>This section provide usage instructions for headless mode.</p> + +<h3 id="Basic_usage">Basic usage</h3> + +<p>You can run Firefox in headless mode from the command line, by including the <code>-headless</code> flag. For example:</p> + +<pre class="brush: bash">/path/to/firefox -headless</pre> + +<h3 id="Taking_screenshots">Taking screenshots</h3> + +<p>Since Firefox 57, the <code>-screenshot</code> flag allows you to take screenshots of websites. The basic usage:</p> + +<pre class="brush: bash">/path/to/firefox -headless -screenshot https://developer.mozilla.com</pre> + +<p>This creates a full-height screenshot of <code>https://developer.mozilla.com,</code> in the active directory called <code>screenshot.png</code>, with a viewport width of 800px.</p> + +<p>You can omit <code>-headless</code> when using <code>-screenshot, </code>as it is implied:</p> + +<pre class="brush: bash">/path/to/firefox -screenshot https://developer.mozilla.com</pre> + +<p>To override the default values, mentioned above, you can use the following flags/features:</p> + +<ul> + <li><code>-screenshot name url</code> — Set a custom name for the screenshot by including it between the <code>-screenshot</code> flag and the URL you want to capture. You can specify other web-compatible image formats such as <code>.jpg</code>, <code>.bmp</code>, etc.</li> + <li><code>--window-size=x</code> — Set a custom viewport width when taking the screenshot (full height is maintained). Note that the single argument version of this doesn't work.</li> + <li><code>--window-size=x,y</code> — Set a custom viewport width and height to capture.</li> +</ul> + +<p>For example, the following command creates a screenshot of <code>https://developer.mozilla.com</code>, in the active directory called <code>test.jpg</code>, with a viewport width of 800px, and a height of 1000px:</p> + +<pre class="brush: bash">/path/to/firefox -screenshot test.jpg https://developer.mozilla.com --window-size=800,1000</pre> + +<h3 id="Browser_support">Browser support</h3> + +<p>Headless Firefox works on Fx55+ on Linux, and 56+ on Windows/Mac.</p> + +<h2 id="Automated_testing_with_headless_mode">Automated testing with headless mode</h2> + +<p>The most useful way to use headless Firefox, is to run automated tests. You can make your testing process much more efficient.</p> + +<h3 id="Selenium_in_Node.js">Selenium in Node.js</h3> + +<p>Here we'll create a <a href="http://www.seleniumhq.org/">Selenium</a> test, using <a href="https://nodejs.org/">Node.js</a> and the <code><a href="https://www.npmjs.com/package/selenium-webdriver">selenium-webdriver</a></code> package. For this guide, we'll assume that you already have basic familiarity with Selenium, Webdriver, and Node, and you already have a testing environment created. If now, work through our <a href="https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Your_own_automation_environment#Setting_up_Selenium_in_Node">Setting up Selenium in Node</a> guide, and return when you have.</p> + +<p>First, confirm you've installed Node and the <code>selenium-webdriver</code> on your system. Then create a new file, called <code>selenium-test.js,</code> and follow the steps below to populate it with test code.</p> + +<div class="note"> +<p><strong>Note</strong>: Alternatively, you could clone our <a href="https://github.com/mdn/headless-examples">headless-examples repo</a>. This also includes a package file, so you can just use <code>npm install</code> to install necessary dependencies.</p> +</div> + +<ol> + <li> + <p>Let's add some code. Inside this file, start by importing the main <code>selenium-webdriver</code> module, and the <code>firefox</code> submodule:</p> + + <pre class="brush: js">var webdriver = require('selenium-webdriver'), + By = webdriver.By, + until = webdriver.until; + +var firefox = require('selenium-webdriver/firefox');</pre> + </li> + <li> + <p>Next, we create a new <code>binary</code> object representing Firefox Nightly, and add the <code>-headless</code> argument, so it will run in headless mode:</p> + + <pre class="brush: js">var binary = new firefox.Binary(firefox.Channel.NIGHTLY); +binary.addArguments("-headless");</pre> + </li> + <li> + <p>Now let's create a new driver instance for Firefox, using <code>setFirefoxOptions()</code> to include an options object, which specifies that we want to run the test using the above binary. This step will be unnecessary on Linux, and after headless mode lands in the release channel on Windows/Mac, but it is still useful if you want to test Nightly-specific features:</p> + + <pre class="brush: js">var driver = new webdriver.Builder() + .forBrowser('firefox') + .setFirefoxOptions(new firefox.Options().setBinary(binary)) + .build();</pre> + + <p>Alternatively, you can use options to set the binary and the headless arguments:</p> + + <pre class="brush: js">var firefoxOptions = new firefox.Options(); +firefoxOptions.setBinary('/path/to/binary'); +firefoxOptions.headless(); + +const driver = new webdriver.Builder() + .forBrowser('firefox') + .setFirefoxOptions(firefoxOptions) + .build(); +</pre> + </li> + <li> + <p>Finally, add the following code, which performs a simple test on the Google search homepage:</p> + + <pre class="brush: js">driver.get('https://www.google.com'); +driver.findElement(By.name('q')).sendKeys('webdriver'); + +driver.sleep(1000).then(function() { + driver.findElement(By.name('q')).sendKeys(webdriver.Key.TAB); +}); + +driver.findElement(By.name('btnK')).click(); + +driver.sleep(2000).then(function() { + driver.getTitle().then(function(title) { + if(title === 'webdriver - Google Search') { + console.log('Test passed'); + } else { + console.log('Test failed'); + } + }); +}); + +driver.quit();</pre> + </li> + <li> + <p>Finally, run your test with following command:</p> + + <pre class="brush: bash">node selenium-test</pre> + </li> +</ol> + +<p>That's it! After a few seconds, you should see the message "Test passed" returned in the console.</p> + +<p><a href="https://mykzilla.org/2017/08/30/headless-firefox-in-node-js-with-selenium-webdriver/">Headless Firefox in Node.js with selenium-webdriver</a>, by Myk Melez, contains additional useful tips and tricks for running Node.js Selenium tests with headless mode.</p> + +<h3 id="Selenium_in_Java">Selenium in Java</h3> + +<div class="note"> +<p><strong>Note</strong>: Thanks a lot to nicholasdipiazza for writing these instructions!</p> +</div> + +<p>This guide assumes you already have Geckodriver on your machine, as explained in <a href="https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Your_own_automation_environment#Setting_up_Selenium_in_Node">Setting up Selenium in Node</a>, and an IDE set up which supports Gradle projects.</p> + +<ol> + <li> + <p>Download our <a href="https://github.com/mdn/headless-examples/blob/master/headlessfirefox-gradle.zip">headlessfirefox-gradle.zip</a> archive (<a href="https://github.com/mdn/headless-examples/tree/master/headlessfirefox-gradle">see the source here</a>). Extract it, and import the headlessfirefox folder into your IDE, as a gradle project.</p> + </li> + <li> + <p>Edit the <code>build.gradle</code> file, to set selenium to a later version, if needed. At the time of writing, we used 3.5.3.</p> + + <pre class="brush: java">group 'com.mozilla' +version '1.0' + +apply plugin: 'java' + +sourceCompatibility = 1.8 + +repositories { + mavenCentral() +} + +dependencies { + compile('org.seleniumhq.selenium:selenium-api:3.5.3') + compile('org.seleniumhq.selenium:selenium-remote-driver:3.5.3') + compile('org.seleniumhq.selenium:selenium-server:3.5.3') + + testCompile group: 'junit', name: 'junit', version: '4.12' +}</pre> + </li> + <li> + <p>Edit the <code>webdriver.gecko.driver</code> property, in the HeadlessFirefoxSeleniumExample.java file, to equal the path where you installed geckodriver (see line 15 below).</p> + + <pre class="brush: java">package com.mozilla.example; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.FirefoxBinary; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.firefox.FirefoxOptions; + +import java.util.concurrent.TimeUnit; + +public class HeadlessFirefoxSeleniumExample { + public static void main(String [] args) { + FirefoxBinary firefoxBinary = new FirefoxBinary(); + firefoxBinary.addCommandLineOptions("--headless"); + System.setProperty("webdriver.gecko.driver", "/opt/geckodriver"); + FirefoxOptions firefoxOptions = new FirefoxOptions(); + firefoxOptions.setBinary(firefoxBinary); + FirefoxDriver driver = new FirefoxDriver(firefoxOptions); + try { + driver.get("http://www.google.com"); + driver.manage().timeouts().implicitlyWait(4, + TimeUnit.SECONDS); + WebElement queryBox = driver.findElement(By.name("q")); + queryBox.sendKeys("headless firefox"); + WebElement searchBtn = driver.findElement(By.name("btnK")); + searchBtn.click(); + WebElement iresDiv = driver.findElement(By.id("ires")); + iresDiv.findElements(By.tagName("a")).get(0).click(); + System.out.println(driver.getPageSource()); + } finally { + driver.quit(); + } + } +}</pre> + </li> + <li> + <p>Run the java class, and you should see the HTML content of this page printed in your console/terminal.</p> + </li> +</ol> + +<h3 id="Selenium_in_Python">Selenium in Python</h3> + +<p>This guide assumes you already have geckodriver on your machine, as explained in <a href="https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Your_own_automation_environment#Setting_up_Selenium_in_Node">Setting up Selenium in Node</a>.</p> + +<ol> + <li> + <p>Install the latest version of the <a href="https://pypi.python.org/pypi/selenium">Python client for Selenium</a>.</p> + </li> + <li> + <p>Edit the following, to set the <code>executable_path</code> on line 11, to the path where you installed geckodriver:</p> + + <pre class="brush: python">from selenium.webdriver import Firefox +from selenium.webdriver.common.by import By +from selenium.webdriver.common.keys import Keys +from selenium.webdriver.firefox.options import Options +from selenium.webdriver.support import expected_conditions as expected +from selenium.webdriver.support.wait import WebDriverWait + +if __name__ == "__main__": + options = Options() + options.add_argument('-headless') + driver = Firefox(executable_path='geckodriver', firefox_options=options) + wait = WebDriverWait(driver, timeout=10) + driver.get('http://www.google.com') + wait.until(expected.visibility_of_element_located((By.NAME, 'q'))).send_keys('headless firefox' + Keys.ENTER) + wait.until(expected.visibility_of_element_located((By.CSS_SELECTOR, '#ires a'))).click() + print(driver.page_source) + driver.quit()</pre> + </li> + <li> + <p>Run the Python script, and you should see the HTML content of this page printed in your console/terminal.</p> + </li> +</ol> + +<h3 id="Other_testing_solutions">Other testing solutions</h3> + +<ul> + <li>Slimerjs has Firefox support built in on Linux, with Mac and Windows support, coming soon. See <a href="https://adriftwith.me/coding/2017/04/21/headless-slimerjs-with-firefox/">Headless SlimerJS with Firefox</a> by Brendan Dahl for more details.</li> + <li><a href="https://github.com/DevExpress/testcafe">TestCafe</a> (v.0.18.0 and higher) also supports testing in headless Firefox, by default. See <a href="https://devexpress.github.io/testcafe/blog/testcafe-v0-18-0-released.html#testing-in-headless-firefox">the documentation</a> for the details.</li> +</ul> + +<p>In addition, you can use headless Firefox to run automated tests written in most other popular testing apps, as long as you are able to set environment variables.</p> + +<h2 id="Troubleshooting_and_further_help">Troubleshooting and further help</h2> + +<p>If you are having trouble getting headless mode to work, then do not worry — we are here to help. This section is designed to be added to as more questions arise, and answers are found.</p> + +<ul> + <li>On Linux, certain libraries are currently required on your system, even though headless mode doesn't use them, as Firefox links against them. See {{bug(1372998)}}, for more details and progress towards a fix.</li> +</ul> + +<p>If you want to ask the engineers a question, the best place to go is the <code>#headless</code> channel on <a href="https://wiki.mozilla.org/IRC">Mozilla IRC</a>. If you are pretty sure you've found a bug, file it on <a href="https://bugzilla.mozilla.org/">Mozilla Bugzilla</a>.</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://intoli.com/blog/running-selenium-with-headless-firefox/">Using Selenium with Headless Firefox (on Windows)</a> by Andre Perunicic (uses Python)</li> + <li><a href="https://mykzilla.org/2017/08/30/headless-firefox-in-node-js-with-selenium-webdriver/">Headless Firefox in Node.js with selenium-webdriver</a> by Myk Melez</li> + <li><a href="https://adriftwith.me/coding/2017/04/21/headless-slimerjs-with-firefox/">Headless SlimerJS with Firefox</a> by Brendan Dahl</li> + <li><a href="http://blog.rousek.name/2017/09/08/going-headless-with-firefox-since-55/">Using Selenium with Headless Firefox on Travis-CI</a> by Josef Rousek</li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/index.html b/files/zh-cn/mozilla/firefox/index.html new file mode 100644 index 0000000000..b0bc71f5b5 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/index.html @@ -0,0 +1,74 @@ +--- +title: Firefox +slug: Mozilla/Firefox +tags: + - Firefox + - Mozilla + - NeedsTranslation + - TopicStub +translation_of: Mozilla/Firefox +--- +<div>{{FirefoxSidebar}}</div> + +<p><a class="external external-icon" href="https://www.mozilla.org/firefox/all/">Firefox(非正式中文名称“火狐”)</a>是Mozilla出品的网页浏览器,可用于Windows、Mac OS X、Linux等桌面操作系统,也可以用于Android等移动操作系统。得益于对最新的网络标准的广泛兼容和强有力的<a href="/zh-CN/docs/Tools">开发工具</a>,Firefox对最终用户和开发者而言都是优秀的浏览器。</p> + +<p>Firefox是一个开源项目,许多代码都是由志愿者社群提供的。在此你将了解如何为Firefox项目做贡献,你也可以找到关于制作附加组件、使用Firefox开发者工具等内容。</p> + +<div class="summary"> +<p>了解如何为 <a class="external external-icon" href="https://www.mozilla.org/firefox/">Firefox</a>添加附加组件,如何开发和构建Firefox自身,以及了解Firefox以及其他组件内部如何运作。</p> +</div> + +<ul class="card-grid"> + <li><span>面向开发者的发布说明</span> + + <p><a href="/zh-CN/docs/Firefox/Releases">面向开发者的发布说明</a>;了解每一个Firefox新版本为网站开发者与拓展开发者带来的新功能.</p> + </li> + <li><span>项目文档</span> + <p>获取关于 <a href="/zh-CN/docs/Mozilla"> Firefox 的内部机制 </a> 和它的构建系统的详细信息,从而在代码中找到方向。</p> + </li> + <li><span>开发者指南</span> + <p>我们的 <a href="/zh-CN/docs/Developer_Guide">开发者指南</a> 提供了关于获取与编译Firefox源代码、在代码中找到方向、以及对项目作出贡献的详细说明。</p> + </li> +</ul> + +<h2 id="Firefox_发布频道">Firefox 发布频道</h2> + +<p>Firefox 通过 5 个 <strong>发布频道</strong> 进行发布。</p> + +<h3 id="Firefox_Nightly">Firefox Nightly</h3> + +<p>每天晚上,我们都使用 <a href="/zh-CN/docs/mozilla-central">mozilla-central</a> 代码库中的最新代码构建的版本。这些版本适用于开发者或想要尝试最新的、处于活跃开发中的特性的使用者。</p> + +<p><a class="external external-icon" href="https://nightly.mozilla.org/" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">下载 Firefox Nightly</a></p> + +<h3 id="Firefox_Developer_Edition">Firefox Developer Edition</h3> + +<p>这是一个为开发者量身定制的版本。每隔六周,我们便选择Firefox Nightly 频道中足够稳定的特性创建一个新版本的Firefox Developer Edition。同时我们还仅仅在该发布频道中为开发者添加一些特有的特性。</p> + +<p><a href="/zh-CN/docs/Firefox/Developer_Edition">了解关于Firefox Developer Edition的更多信息</a>。</p> + +<p><a class="external external-icon" href="https://www.mozilla.org/firefox/developer/" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">下载 Firefox Developer Edition</a></p> + +<h3 id="Firefox_Beta">Firefox Beta</h3> + +<p>在Firefox Developer Edition停留六周之后,我们将选择足够稳定的特性构建一个新版本的 Firefox Beta 。Firefox Beta 版本适用于热衷于测试将在下一个Firefox 版本中推出的新特性的用户。</p> + +<p><a class="external external-icon" href="https://www.mozilla.org/firefox/channel/#beta" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">下载 Firefox Beta</a></p> + +<h3 id="Firefox">Firefox</h3> + +<p>当在Beta频道中稳定六周之后,我们便发布新版本Firefox,将新特性推送至数亿用户。</p> + +<p><a class="external external-icon" href="https://www.mozilla.org/firefox/channel/#firefox" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">下载 Firefox</a></p> + +<h3 id="Firefox_延长支持版_ESR">Firefox 延长支持版 (ESR)</h3> + +<p>Firefox ESR 是在较长周期提供支持的桌面版本Firefox,适用于学校、大学、商业机构等组织以及需要延长支持用以进行大规模部署的用户。</p> + +<p><a href="/zh-CN/docs/Firefox/Firefox_ESR">了解关于 Firefox 延长支持版的更多信息</a>。</p> + +<p><a class="external external-icon" href="https://www.mozilla.org/firefox/organizations/all/" style="width: 250px; display: block; margin-left: auto; margin-right: auto; padding: 10px; text-align: center; border-radius: 4px; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">下载 Firefox ESR</a></p> + +<h2 id="Firefox_配置">Firefox 配置</h2> + +<p>如果你在日常中使用多个Firefox发行频道,或者多个不同的配置选项,你应该阅读了解如何通过Firefox的配置管理器与其他管理工具实现<a href="/zh-CN/docs/Mozilla/Firefox/Multiple_profiles">使用多个Firefox配置</a>。</p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html new file mode 100644 index 0000000000..38fde2acbf --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/cross_process_object_wrappers/index.html @@ -0,0 +1,114 @@ +--- +title: 跨进程对象包装器 +slug: Mozilla/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers +--- +<div>{{FirefoxSidebar}}</div><div class="summary"> +<p>本文档介绍了 Cross Process Object Wrappers (CPOWs),这使 chrome 代码能够同步访问多进程 Firefox 中的内容。</p> +</div> + +<p>在多进程 Firefox 中,chrome 代码运行在与 Web 内容不同的另一个进程中。因此 chrome 代码不能直接与 Web 内容交互;相反,它必须考虑将与 Web 内容交互的脚本放在单独的脚本中,这被称为框架脚本(frame scripts),也称帧脚本。</p> + +<p>Chrome 代码可以使用消息管理器加载框架脚本到内容进程,然后可以使用消息传递 API 与它们通信。有关于此的更多信息,详见 <a href="/en-US/docs/The_message_manager">消息管理器</a> 的使用文档。</p> + +<p>Chrome 到内容的通信必须是异步的。这是因为 chrome 进程运行着 Firefox UI,因此如果被内容进程所影响,缓慢的内容进程可能致使 Firefox 对用户无响应。<br> + <br> + 将同步代码转换成异步可能是困难并且耗时的。作为一个迁移的辅助,消息框架使框架脚本变成了内容对象,通过一个被称为 Cross Process Object Wrapper(简称 CPOW)的包装器,使其在 chrome 中可用。但是,尽管 CPOWs 很方便,它们存在<a href="/en-US/docs/Cross_Process_Object_Wrappers#Limitations_of_CPOWs">严重的局限性并且可能导致响应性问题</a>,因此只应在必要时使用,并仅作为迁移的辅助。</p> + +<h2 id="从框架脚本传递_CPOWs">从框架脚本传递 CPOWs</h2> + +<p>框架脚本可以发送消息到 chrome,使用两个全局函数之一:<a href="/en-US/docs/The_message_manager#Content_to_chrome"><code>sendAsyncMessage()</code> 或者 <code>sendSyncMessage()</code></a>。这些函数的第三个可选参数是被包装的属性对象。举例来说,框架脚本在用户点击它时发送一个 DOM 节点到 chrome,并将 <code>clicked</code> 属性作为第三个参数:</p> + +<pre class="brush: js">// frame script +addEventListener("click", function (event) { + sendAsyncMessage("my-e10s-extension-message", {}, { clicked : event.target }); +}, false);</pre> + +<p>在 chrome 脚本中,DOM 节点现在是通过 Cross Process Object Wrapper 访问,作为该消息的 <code>objects</code> 属性的个属性。chrome 脚本可以获得和设置包装的对象属性,以及调用它的函数:</p> + +<pre class="brush: js">// chrome script +windowMM.addMessageListener("my-e10s-extension-message", handleMessage); + +function handleMessage(message) { + let wrapper = message.objects.clicked; + console.log(wrapper.innerHTML); + wrapper.innerHTML = "<h2>已被 chrome 修改!</h2>" + wrapper.setAttribute("align", "center"); +}</pre> + +<h2 id="自动生成的_CPOWs">自动生成的 CPOWs</h2> + +<p>没有自我声明多进程兼容的附加组件会加载一些<a href="/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#Compatibility_shims">兼容性垫片</a>。其中一个垫片提供了以下行为:每当 chrome 代码尝试直接访问内容(例如通过 <a href="/en/docs/Working_with_windows_in_chrome_code#The_content_shortcut"><code>window.content</code></a> 或者 <a href="/en-US/docs/Mozilla/Tech/XUL/browser#p-contentDocument"><code>browser.contentDocument</code></a>),提供一个包装了内容的 CPOW。这意味着下面这样的例子在多进程 Firefox 中也能正常工作。</p> + +<pre class="brush: js">gBrowser.selectedBrowser.contentDocument.body.innerHTML = "被 chrome 代码替换";</pre> + +<p>但仍然要记住,这是通过 CPOW 访问,并不是直接访问内容。</p> + +<h2 id="双向_CPOWs">双向 CPOWs</h2> + +<p>一个常见的模式是 chrome 代码访问内容对象并添加事件监听器到那里。为了解决这个问题,CPOWs 是双向的。这意味着如果内容传递了一个 CPOW 到 chrome 进程,chrome 进程可以同步传递对象(如事件监听器函数)到 CPOW 中定义的函数。</p> + +<p>这意味着你可以写这样的代码:</p> + +<pre class="brush: js">// frame script + +/* +在 mouseover,发送 button 到 chrome 脚本,以一个CPOW形式。 +*/ + +var button = content.document.getElementById("click-me"); + +button.addEventListener("mouseover", function (event) { + sendAsyncMessage("my-addon-message", {}, { element : event.target }); +}, false);</pre> + +<pre class="brush: js">// chrome script + +/* +载入框架脚本,然后监听消息。 +在我们得到消息时,提取 CPOW 并添加一个函数作为监听器到按钮的 "click" 事件。 +*/ + + browserMM.loadFrameScript("chrome://my-addon/content/frame-script.js", false); + browserMM.addMessageListener("my-addon-message", function(message) { + let wrapper = message.objects.element; + wrapper.addEventListener("click", function() { + console.log("被点击了"); + }); + }); +</pre> + +<h2 id="映射内容文档到_XUL_浏览器">映射内容文档到 XUL 浏览器</h2> + +<p>一个常见的模式是获取 XUL <a href="/en-US/docs/XUL/browser"><code><browser></code></a>,它对应一个内容文档。要做到这点, <code>gBrowser.getBrowserForDocument</code> <code>和 gBrowser.getBrowserForContentWindow</code> 分别可以传递一个内容文档和内容窗口的 CPOW,并且返回这些文档 / 窗口所属的 XUL <code><browser>。</code>如果没有找到这样的浏览器,两者都是返回 null。</p> + +<h2 id="CPOWs_的限制">CPOWs 的限制</h2> + +<p>尽管 CPOWs 可以方便的使用,但它有几个主要的局限性,在下面列出。</p> + +<h3 id="CPOWs_与平台_API">CPOWs 与平台 API</h3> + +<p>你不能传递 CPOWs 到预期会收到 DOM 对象的平台 API。举例来说,你不能传递一个 CPOW <code>到 </code><a href="http://dxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIFocusManager.idl"><code>nsIFocusManager.setFocus()</code></a>。</p> + +<h3 id="Chrome_响应性">Chrome 响应性</h3> + +<p>在 chrome 这边缺少同步 API 是有意的:因为 chrome 进程运行着 Firefox UI,任何响应性问题都将影响整个浏览器。在制成 chrome 进程与内容进程的过程中,CPOWs 打破了这个原则,并且致使内容进程可能使整个浏览器陷入无响应状态。</p> + +<h3 id="性能">性能</h3> + +<p>尽管包装器看起来像是一个完全在 chrome 脚本范围下管控的对象,但它实际上只是一个到内容进程中一个对象的引用。在你访问一个包装器的属性时,它发送一个同步消息到内容进程及返回结果。这意味着它比使用一个对象慢很多倍。</p> + +<h3 id="消息顺序">消息顺序</h3> + +<p>CPOWs 可能违反你做出的有关消息排序的假设。考虑以下代码:</p> + +<pre class="brush: js">mm.addMessageListener("GotLoadEvent", function (msg) { + mm.sendAsyncMessage("ChangeDocumentURI", {newURI: "hello.com"}); + let uri = msg.objects.document.documentURI; + dump("收到加载事件: " + uri + "\n"); +}); +</pre> + +<p>这发送了一个消息,要求框架脚本更改当前文档的 URI,然后通过一个 CPOW 访问当前的文档 URI。你可能预期 <code>uri</code> 的值得到设置的 "hello.com"。但这不一定:为了避免死锁,CPOW 消息可以绕过正常的消息并且被优先处理。对 documentURI 属性的请求有可能在 "ChangeDocumentURI" 的消息之前被处理,并因而 <code>uri</code> 持有它在更改之前的值。<br> + <br> + 出于这个原因,最好不要混用 CPOWs 和正常的消息管理器消息。还有一个坏主意是将 CPOWs 用于任何安全相关,因为你可能获得不一致的结果,与使用消息管理器的相关代码。</p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/debugging_frame_scripts/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/debugging_frame_scripts/index.html new file mode 100644 index 0000000000..57c1b3412a --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/debugging_frame_scripts/index.html @@ -0,0 +1,53 @@ +--- +title: 调试框架脚本 +slug: Mozilla/Firefox/Multiprocess_Firefox/Debugging_frame_scripts +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Debugging_frame_scripts +--- +<div>{{FirefoxSidebar}}</div><div class="geckoVersionNote"> +<p>浏览器内容工具箱仅在 Firefox Nightly 中可用,并且仅在多进程模式下可用。</p> +</div> + +<p>你可以使用浏览器内容工具箱来调试框架脚本。浏览器内容工具箱是一个单独的窗口,它包括一些共享的 <a href="/en-US/docs/Tools">Firefox 开发者工具</a>,具体来说:<a href="/en-US/docs/Web/API/Console">控制台</a>,<a href="/en-US/docs/Tools/Debugger">JavaScript 调试器</a>,以及<a href="/en-US/docs/Tools/Scratchpad">代码草稿纸</a> —— 但它们着重于浏览器的内容进程。这意味着你可以调试你的附加组件中的框架脚本。</p> + +<h2 id="打开浏览器内容工具箱">打开浏览器内容工具箱</h2> + +<p>{{EmbedYouTube("Cg6X_zIu7Xk")}}</p> + +<p>要打开浏览器内容工具箱,你需要:</p> + +<ul> + <li>正在运行 Firefox Nightly</li> + <li>多进程 Firefox 已启用:打开“选项”页面,选择"启用 E10S (多进程)“,然后重新启动。在你运行多进程 Firefox 时,一个虚拟指示符会出现,远程选项卡的标题会有下划线。</li> + <li>在 Firefox 开发者工具的设置中启用 <a href="/en-US/docs/Tools/Tools_Toolbox#Settings">"chrome 和附加组件调试" 和 "远程调试"</a>。</li> +</ul> + +<p>你应该已经在 Firefox 菜单中 ”Web 开发者“的子菜单中看到”浏览器内容工具箱“(或者工具菜单,如果你显示了菜单栏,或者在 OS X)。它会打开一个单独的窗口:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/9761/browser-content-toolbox.png" style="display: block; height: 854px; margin-left: auto; margin-right: auto; width: 723px;">If you've used the <a href="/en-US/docs/Tools/Tools_Toolbox">Firefox Developer Tools</a> before, this should look pretty familiar.</p> + +<p>Along the top is a row of tabs that you can use to switch the active tool. Currently we only support the <a href="/en-US/docs/Web/API/Console">Console</a>, the <a href="/en-US/docs/Tools/Debugger">Debugger</a>, and <a href="/en-US/docs/Tools/Scratchpad">Scratchpad</a> in the Browser Content Toolbox. At the right of this row are three buttons that activate the <a href="/en-US/docs/Tools/Web_Console#The_split_console">split console</a>, open settings, and close the toolbox.</p> + +<p>The rest of the toolbox is taken up with the tool you've currently selected.</p> + +<h2 id="使用">使用</h2> + +<p>{{EmbedYouTube("XF0ULNnNOxg")}}</p> + +<h3 id="调试器">调试器</h3> + +<p>The Debugger lists all the scripts that are loaded into the content process. You'll find your frame scripts listed under the chrome:// URL you registered for them:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/9771/browser-content-toolbox-listing.png" style="display: block; margin-left: auto; margin-right: auto; width: 723px;">You can set breakpoints, of course, and do all the other <a href="/en-US/docs/Tools/Debugger">things supported by the debugger</a>.</p> + +<h3 id="控制台">控制台</h3> + +<p>The Console logs output from your frame scripts. If you want to use it to evaluate JavaScript in your frame script's scope, there's a trick you need to know:</p> + +<ul> + <li>在你的框架脚本中设置一个断点。</li> + <li>When you hit the breakpoint, switch to the Console, or activate the <a href="/en-US/docs/Tools/Web_Console#The_split_console">split console</a> by pressing "Escape".</li> +</ul> + +<p>Now the console's scope is your frame script's scope, and you can interact directly with it:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/9769/browser-content-toolbox-debugging.png" style="display: block; margin-left: auto; margin-right: auto; width: 839px;"></p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/faq/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/faq/index.html new file mode 100644 index 0000000000..3299dd0856 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/faq/index.html @@ -0,0 +1,18 @@ +--- +title: FAQ +slug: Mozilla/Firefox/Multiprocess_Firefox/FAQ +translation_of: Mozilla/Firefox/Multiprocess_Firefox/FAQ +--- +<div>{{FirefoxSidebar}}</div><h2 id="使命">使命</h2> + +<p> </p> + +<h2 id="历史">历史</h2> + +<p> </p> + +<h2 id="方式">方式</h2> + +<p> </p> + +<h2 id="影响">影响</h2> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/index.html new file mode 100644 index 0000000000..2936128948 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/index.html @@ -0,0 +1,78 @@ +--- +title: 多进程 Firefox +slug: Mozilla/Firefox/Multiprocess_Firefox +tags: + - NeedsTranslation + - TopicStub +translation_of: Mozilla/Firefox/Multiprocess_Firefox +--- +<div>{{FirefoxSidebar}}</div><p>在目前版本的桌面版 Firefox 中,整个浏览器运行在单个操作系统进程中。尤其是 JavaScript 在同一进程中运行着用户界面(UI,也称 "chrome 代码"),它还搭载着所有网页(也称“内容”,即“标签页”)。<br> + <br> + 未来版本的 Firefox 将在单独的进程中运行浏览器界面,与网页内容的进程分离。这种架构的第一次迭代是所有浏览器标签页在同一个进程中运行,浏览器界面运行在另一个进程中。在未来的迭代中,我们期望有一个以上的内容进程。提供多进程 Firefox 的项目名为 Electrolysis,有时被简称为 e10s。</p> + +<p>普通的网页不会受到多进程 Firefox 的影响。Firefox 本身和 Firefox 附加组件的开发者将受到影响,如果他们的代码依赖于能直接访问 Web 内容。</p> + +<p>不同于此前的直接访问内容,chrome JavaScript 将使用<a href="/Firefox/Multiprocess_Firefox/Message_manager">消息管理器</a>来访问内容。为了帮助缓解过渡期,我们实现了<a href="/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">跨进程对象包装器(CPOW)</a>和一些<a href="/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#Compatibility_shims">面向附加组件开发者的兼容性垫片</a>。如果你是一名附加组件开发者并且想知道自己是否受到影响,参见<a href="/Mozilla/Add-ons/Working_with_multiprocess_Firefox">多进程 Firefox 工作指南</a>。</p> + +<p>多进程 Firefox 目前在 <a class="external external-icon" href="https://www.mozilla.org/firefox/developer/">开发者版本</a> 默认启用。</p> + +<hr> +<div class="column-container"> +<div class="column-half"> +<dl> + <dt><a href="/Firefox/Multiprocess_Firefox/Technical_overview">技术概述</a></dt> + <dd>高等层面看待多进程 Firefox 如何被实现。</dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Glossary">术语表</a></dt> + <dd>多进程 Firefox 领域相关的术语参考。</dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager">消息管理器</a></dt> + <dd>完整的指南,在 chrome 与内容之间通信的对象。</dd> + <dt><a href="/en-US/Add-ons/SDK/Guides/Multiprocess_Firefox_and_the_SDK">基于 SDK 的附加组件</a></dt> + <dd>如何迁移使用 Add-on SDK 开发的附加组件。</dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Which_URIs_load_where">各类 URI 在哪里加载</a></dt> + <dd>各类 URI 的快速指南:chrome:, about:, file:, resource: - 在哪个进程被加载。</dd> +</dl> +</div> + +<div class="column-half"> +<dl> + <dt><a href="/Firefox/Multiprocess_Firefox/Motivation">动机</a></dt> + <dd>为什么我们要实现多进程的 Firefox:性能、安全和稳定性。</dd> + <dt><a href="/Mozilla/Add-ons/Working_with_multiprocess_Firefox">附加组件迁移指南</a></dt> + <dd>如果你是一名附加组件开发者,看看你的影响,以及如何更新你的代码。</dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">跨进程对象包装器(CPOW)</a></dt> + <dd>Cross Process Object Wrappers 是一个迁移辅助,使 chrome 代码能够访问内容。</dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Debugging_frame_scripts">调试内容进程</a></dt> + <dd>如何调试运行在内容进程中的代码,包括框架和进程脚本。</dd> + <dt><a href="/docs/Mozilla/Firefox/Multiprocess_Firefox/Tab_selection_in_multiprocess_Firefox">多进程 Firefox 中的标签选择</a></dt> + <dd>多进程 Firefox 中如何切换标签页。</dd> +</dl> +</div> +</div> + +<hr> +<div class="column-container"> +<div class="column-half"> +<dl> + <dt><a href="/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts">chrome 脚本的限制</a></dt> + <dd>哪些 chrome 代码的做法将不再有效,以及如何解决。</dd> +</dl> +</div> + +<div class="column-half"> +<dl> + <dt><a href="/Firefox/Multiprocess_Firefox/Limitations_of_frame_scripts">框架脚本的限制</a></dt> + <dd>哪些框架脚本的做法将不再有效,以及如何代替。</dd> +</dl> +</div> +</div> + +<hr> +<h2 id="联系我们">联系我们</h2> + +<p>有关此项目的更多信息、参与或提问。</p> + +<ul> + <li><strong>Electrolysis 项目页面</strong>: <a href="https://wiki.mozilla.org/Electrolysis">https://wiki.mozilla.org/Electrolysis</a></li> + <li><strong>IRC</strong>: #e10s on <a href="https://wiki.mozilla.org/IRC">irc.mozilla.org</a></li> + <li><strong>邮件列表</strong>: <a href="https://groups.google.com/forum/#!forum/mozilla.dev.tech.electrolysis">dev.tech.electrolysis</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/limitations_of_chrome_scripts/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/limitations_of_chrome_scripts/index.html new file mode 100644 index 0000000000..130ce276e3 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/limitations_of_chrome_scripts/index.html @@ -0,0 +1,197 @@ +--- +title: chrome 脚本的限制 +slug: Mozilla/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts +--- +<div>{{FirefoxSidebar}}</div><p>This page describes patterns that used to work in the chrome process that will no longer work in multiprocess Firefox. These are the sorts of things that will break an old add-on in multiprocess Firefox. The fix is generally some variant of "do that in a frame script loaded into the content process".</p> + +<p>This is one of a pair of articles: the other one lists <a href="/en-US/Firefox/Multiprocess_Firefox/Limitations_of_frame_scripts">limitations of frame scripts</a>.</p> + +<h2 id="兼容性垫片">兼容性垫片</h2> + +<p>For many of the patterns described here we've implemented compatibility shims so the patterns still work. For example: whenever extensions try to access web content from the chrome process, the browser will return a <a href="https://developer.mozilla.org/en-US/docs/Cross_Process_Object_Wrappers">Cross Process Object Wrapper</a> that gives the chrome code synchronous access to the content.</p> + +<p>You'll get the shims for your add-on by default, unless you set the <a href="/en-US/Add-ons/Install_Manifests#multiprocessCompatible"><code>multiprocessCompatible</code> flag in your add-on's install manifest</a>.</p> + +<p>However, these shims are not a substitute for migrating extensions:</p> + +<ul> + <li>they are only a temporary measure, and will be removed eventually</li> + <li>they can have a bad effect on responsiveness</li> + <li>there are likely to be edge cases in which they don't work properly</li> +</ul> + +<p>For each pattern we've noted:</p> + +<ul> + <li>whether a shim exists and what kind of behavior it provides</li> + <li>how to update your add-on so you don't need the shim</li> +</ul> + +<h2 id="gBrowser.contentWindow_window.content...">gBrowser.contentWindow, window.content...</h2> + +<h3 id="如果没有垫片">如果没有垫片</h3> + +<p>所有在 chrome 进程中的 API 提供的直接访问内容对象将不再工作。例如:</p> + +<pre class="brush: js">// chrome code + +gBrowser.contentWindow; // null + +gBrowser.contentDocument; // null + +gBrowser.selectedBrowser.contentWindow; // null + +window.content; // null + +content; // null +</pre> + +<p>特别说明,docshells 存在于内容进程,因此它们也无法访问:</p> + +<pre>gBrowser.docShell; // null + +gBrowser.selectedBrowser.docShell; // null</pre> + +<h3 id="如果有垫片">如果有垫片</h3> + +<p>在这些情况下,垫片为你通过一个 <a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">CPOW</a> 提供内容对象。</p> + +<p>In some situations, the content process may not be initialized when an add-on asks for access to its content. In this case, the shim will return a JavaScript object that looks somewhat like a window or a document for about:blank. However, this "dummy" object is completely static and only exposes a few of the normal properties that windows and documents have. For this reason, add-ons that try to access content objects in fresh <browser> elements may run into trouble.</p> + +<p>To make the shim unnecessary: factor the code that needs to access content into a separate script, load that script into the content process as a frame script, and communicate between the chrome script and the frame script using the message-passing APIs. See the article on <a href="/en-US/Firefox/Multiprocess_Firefox/The_message_manager">using the message manager</a>.</p> + +<h2 id="CPOW_的限制">CPOW 的限制</h2> + +<p><a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">跨进程对象包装器</a> (CPOWs) 是一个迁移辅助,给 chrome 代码带来同步访问内容对象的能力。但是,在使用它时也有各种<a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers#Limitations_of_CPOWs">限制</a>。</p> + +<h2 id="nsIContentPolicy">nsIContentPolicy</h2> + +<h3 id="如果没有垫片_2">如果没有垫片</h3> + +<p>在多进程的 Firefox 上,你无法在 chrome 进程中使用 <a href="http://dxr.mozilla.org/mozilla-central/source/dom/base/nsIContentPolicy.idl"><code>nsIContentPolicy</code></a>,因为它需要接触网络内容。</p> + +<h3 id="如果有垫片_2">如果有垫片</h3> + +<p>The shim enables you to add content policies in the chrome process. It transparently registers an <code>nsIContentPolicy</code> in the content process, whose <code>shouldLoad</code> just forwards to the chrome process. The content to check is forwarded as a <a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">CPOW</a>. The chrome process then checks the content against the policy supplied by the add-on, and forwards the response back to the child to be enforced.</p> + +<p>为了使垫片不再必要,在内容进程中定义和注册 <code>nsIContentPolicy</code>。如果你需要确保该政策只注册一次,使用一个 <a href="/en-US/docs/User:wbamberg/Multiprocess_Firefox-2/Message_manager/Process_scripts">process 脚本</a> 来注册该政策。</p> + +<h2 id="nsIWebProgressListener">nsIWebProgressListener</h2> + +<p>这个 API 在 chrome 进程中工作。有一个垫片让你可以访问传递到 <code>onStateChange</code> 的<code> </code><a href="http://dxr.mozilla.org/mozilla-central/source/uriloader/base/nsIWebProgress.idl"><code>nsIWebProgress</code></a> 对象的 <code>DOMWindow</code> 属性。但是,该 <code>DOMWindow</code> 是异步传递,因此在 chrome 进程收到时,DOM 可能已经改变了(例如,因为代码运行的内容进程已经修改它,或者我们已经导航到另一个页面)。</p> + +<p>还要注意,不同于其他垫片,这个垫片始终有效。</p> + +<p>我们正在努力修复此问题,见 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1118880">bug 1118880</a>。</p> + +<p>另外,你可以在内容进程中使用 <code>nsIWebProgressListener</code>。</p> + +<h2 id="chrome_进程中的_Observers">chrome 进程中的 Observers</h2> + +<p>根据不同的主题,你需要在 chrome 进程或者一个框架脚本中注册 observers。</p> + +<p>对于大多数主题,你需要在 chrome 进程中注册 observers。</p> + +<p>但是,你必须在一个框架脚本中监听 <a href="/en/docs/Observer_Notifications#Documents"><code>content-document-global-created</code> and <code>document-element-inserted</code></a>。这些主题的 <a href="http://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsIObserver.idl">Observers</a> 获取内容对象并作为 <code>aSubject</code> 参数到 <code>observe()</code>,因此通知不会发送到 chrome 进程。</p> + +<p>有一个垫片会将两个主题转发到 chrome 进程,将 <a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">CPOWs</a> 发送为 <code>aSubject</code> 参数。</p> + +<h3 id="HTTP_请求">HTTP 请求</h3> + +<p>你不能观测(observe)内容进程中的 <a href="https://developer.mozilla.org/en/docs/Observer_Notifications#HTTP_requests">HTTP 请求</a>。如果这样做,你将得到一个错误。<br> + <br> + 如果你在 chrome 进程中这样做,它一般会工作。observer 通知的主题将是一个 <code><a href="http://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsIHttpChannel.idl">nsIHttpChannel</a></code>,正如你所期望的。</p> + +<p>A common pattern here is to use the <code>notificationCallbacks</code> property of the <code>nsIHttpChannel</code> to get the DOM window that initiated the load, like this:</p> + +<pre class="brush: js">observe: function (subject, topic, data) { + if (topic == "http-on-modify-request") { + var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); + var domWindow = httpChannel.notificationCallbacks.getInterface(Ci.nsIDOMWindow); + } +}</pre> + +<p>或者这样:</p> + +<pre class="brush: js">observe: function (subject, topic, data) { + if (topic == "http-on-modify-request") { + var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); + var domWindow = httpChannel.notificationCallbacks.getInterface(Ci.nsILoadContext).associatedWindow; + } +}</pre> + +<p>In multiprocess Firefox these patterns will no longer work: the <code>getInterface</code> call will fail.</p> + +<p>In multiprocess Firefox, <code>notificationCallbacks</code> is a special object that tries to emulate the single-process <code>notificationsCallbacks</code> object as best it can. It will return a dummy <code>nsILoadContext</code> when asked, but any attempt to get a window out of it will fail.<br> + <br> + There is an outstanding bug (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1108827">bug 1108827</a>) to implement a shim here that will make <code>notificationCallbacks</code> a <a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">CPOW</a> for the objects in the content process.</p> + +<p>The correct way to access the DOM window is through a message manager. In an HTTP observer, you can get the browser message manager for the window using code like this:</p> + +<pre class="brush: js">observe: function (subject, topic, data) { + if (topic == "http-on-modify-request") { + var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); + var loadContext = httpChannel.notificationCallbacks.getInterface(Ci.nsILoadContext); + // topFrameElement is the <browser> element + var topFrameElement = loadContext.topFrameElement; + var browserMM = topFrameElement.messageManager; + console.log("browserMM: " + browserMM); + } +}</pre> + +<p>However, before Firefox 38, this technique will not work if multiprocess Firefox is disabled: specifically, <code>topFrameElement</code> will be null. This means that if you need to write code that works before Firefox 38 and on both multiprocess and non-multiprocess variants, you need to implement both paths:</p> + +<ul> + <li>test whether <code>topFrameElement</code> is null</li> + <li>if it is, you're running in single-process Firefox, and should use the old way</li> + <li>if it isn't, you're running in multiprocess Firefox and should use the new way</li> +</ul> + +<p>From Firefox 38 onwards, the topFrameElement approach always works.</p> + +<h2 id="DOM_事件">DOM 事件</h2> + +<h3 id="如果没有垫片_3">如果没有垫片</h3> + +<p>In multiprocess Firefox, if you want to register an event listener on some content DOM node, that needs to happen in the content process.</p> + +<p>It used to be that if you registered a listener on the <a href="/en-US/docs/XUL/browser">XUL <code><browser></code></a> or <a href="/en-US/docs/XUL/tab"><code><tab></code></a> element that hosted some DOM content, then events in the content would bubble up to the XUL and you could handle them there. This no longer happens in multiprocess Firefox.</p> + +<h3 id="如果有垫片_3">如果有垫片</h3> + +<p>The shim intercepts chrome process code that adds listeners to XUL elements and sets up listeners in the content process, relaying the result back to the chrome process. The <a href="/en-US/docs/Web/API/Event"><code>Event</code></a> object itself is relayed to the chrome process as a <a href="/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers">CPOW</a>.</p> + +<p>To make the shim unnecessary: register event listeners on the global object inside a <a href="/en-US/Firefox/Multiprocess_Firefox/The_message_manager">frame script</a>. For example:</p> + +<pre class="brush: js">addEventListener("load", handler, true) // for example</pre> + +<div>如果你需要在这时联系 chrome 进程,发送一个消息。</div> + +<div> </div> + +<h2 id="沙盒">沙盒</h2> + +<div>You can create sandboxes in the chrome or the content process. Sandboxes are often used as a safe way to manipulate web content, and if that's your goal, create the sandbox in the content process.</div> + +<div> </div> + +<div>There is a shim for sandboxes: if you make a sandbox in the chrome process and give it content principals (by passing a CPOW as the first argument to <a href="/en-US/docs/Components.utils.Sandbox">Components.utils.Sandbox</a>) then we'll actually make it in the content process.</div> + +<div> </div> + +<div> +<h2 id="nsIAboutModule">nsIAboutModule</h2> + +<p>By default, custom about: pages registered using nsIAboutModule are loaded in the chrome process. This means that you can't access their content from the content process (via XHR, for example).</p> + +<p>你可以在你注册 about: URI 的代码中改变这个默认值。见 <a href="/en-US/Firefox/Multiprocess_Firefox/about:_and_chrome:_URIs">about: 和 chrome: URI</a>。</p> +</div> + +<h2 id="JavaScript_代码模块_(JSM)">JavaScript 代码模块 (JSM)</h2> + +<div>在单进程的 Firefox 中,你可以使用 <a href="/en-US/docs/Mozilla/JavaScript_code_modules">JavaScript 代码模块 (JSM)</a> 来维持全局状态。在多进程的 Firefox 中,一个加载到某个进程的 JSM 不与加载到另一个进程的同样 JSM 共享状态:因此你不能使用一个 JSM 在 chrome 和内容进程之间共享状态。</div> + +<div> </div> + +<div>If an add-on wants to use a JSM to share state in this way, it's best to load the JSM in the chrome process, and have frame scripts store and access the JSM's state by sending messages to the chrome process using the message manager.</div> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/limitations_of_frame_scripts/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/limitations_of_frame_scripts/index.html new file mode 100644 index 0000000000..d942067bd3 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/limitations_of_frame_scripts/index.html @@ -0,0 +1,101 @@ +--- +title: 框架脚本的限制 +slug: Mozilla/Firefox/Multiprocess_Firefox/Limitations_of_frame_scripts +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Limitations_of_frame_scripts +--- +<div>{{FirefoxSidebar}}</div><p>框架脚本使用<a href="/en-US/docs/Security_check_basics#Principals">系统特权</a>运行,并且能够访问<a href="/en-US/docs/Components_object"> Components</a> 对象,使它们能够使用 <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> 对象和 <a href="/en-US/docs/Mozilla/JavaScript_code_modules">JSM</a>。许多特权的 API 在内容进程中仍然工作。数据结构的处理仍将工作。XHR 和 Workers 仍将工作。但是,某些 API 在 chrome 进程中工作,但在框架脚本中将不工作。本文列出最重要的那些 API。</p> + +<p>这是一对文章之一,另一篇是:<a href="/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts">chrome 脚本的限制</a>。</p> + +<h2 id="文件_IO">文件 I/O</h2> + +<p>你不应该从内容脚本写入或者读取磁盘,特别是配置文件目录。即使这是可能的,你也不应该这样做,应该预期它可能在任何时间停止工作。文件 I/O 应该全部放在 chrome 进程完成。例如:</p> + +<ul> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsIFileStreams.idl"><code>nsIFileInputStream</code></a></li> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsIFileStreams.idl"><code>nsIFileOutputStream</code></a></li> + <li><a href="/en-US/docs/Extensions/Using_the_DOM_File_API_in_chrome_code">Constructing a <code>File</code> from a string or <code>nsIFile</code></a> (但 <code>File</code> 对象可以通过消息管理器发送)</li> + <li><code><a href="/en-US/docs/Web/API/HTMLInputElement/mozSetFileNameArray">HTMLInputElement.mozSetFileNameArray</a></code> (替代: <code>mozSetFileArray</code>)</li> +</ul> + +<h2 id="XUL_和浏览器界面">XUL 和浏览器界面</h2> + +<p>任何试图接触界面或者与 XUL 相关的东西都很可能在内容进程中不工作。例如:</p> + +<ul> + <li><code><a href="http://dxr.mozilla.org/mozilla-central/source/embedding/components/windowwatcher/nsIPromptService.idl">nsIPromptService</a></code></li> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/widget/nsIFilePicker.idl"><code>nsIFilePicker</code></a></li> + <li><code>nsIXUL*</code></li> + <li><更多例子待补充></li> +</ul> + +<h2 id="Services">Services</h2> + +<p>某些服务不能在框架脚本中工作。</p> + +<ul> + <li>Services.search</li> + <li>Services.downloads</li> +</ul> + +<h2 id="Chrome_窗口">Chrome 窗口</h2> + +<p>任何需要使用 chrome 窗口的东西都不能在内容进程中工作。例如:</p> + +<ul> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/mobile/android/components/SessionStore.idl"><code>nsISessionStore</code></a></li> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/xpfe/appshell/nsIWindowMediator.idl"><code>nsIWindowMediator</code></a></li> + <li><更多例子待补充></li> +</ul> + +<h2 id="Places_API">Places API</h2> + +<p><a href="/en-US/docs/Mozilla/Tech/Places">Places API</a> 不能在框架脚本中使用。例如:</p> + +<ul> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsINavHistoryService.idl"><code>nsINavHistoryService</code></a></li> + <li><a href="http://dxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsINavBookmarksService.idl"><code>nsINavBookmarksService</code></a></li> +</ul> + +<h2 id="内容进程中的_Observers">内容进程中的 Observers</h2> + +<p>As noted in <a href="https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#Observers_in_the_chrome_process">Observers in the chrome process</a>, most <a href="http://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsIObserver.idl">observers</a> should be registered in the chrome process and will not work in the content process. The exceptions are:</p> + +<ul> + <li><code><a href="https://developer.mozilla.org/en-US/docs/Observer_Notifications#Documents">content-document-global-created</a></code></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Observer_Notifications#Documents"><code>document-element-inserted</code></a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Observer_Notifications#Windows"><code>outer-window-destroyed</code></a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Observer_Notifications#Windows"><code>inner-window-destroyed</code></a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Observer_Notifications#Windows"><code>dom-window-destroyed</code></a></li> +</ul> + +<p>这些必须在内容进程中注册。</p> + +<h2 id="内容窗口到_chrome_窗口的_QI">内容窗口到 chrome 窗口的 QI</h2> + +<div>There's a particular pattern often used to get from a content window to the associated chrome window. It looks something like this:</div> + +<div> </div> + +<pre class="brush: js">window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShellTreeItem) + .rootTreeItem + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindow);</pre> + +<div>This will no longer work. In the content process the root tree item is an <a href="http://dxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsITabChild.idl"><code>nsITabChild</code></a>, that cannot be converted to an <code>nsIDOMWindow</code>, so the second <code>getInterface</code> call here will fail.</div> + +<div> </div> + +<p>If you want a chrome window: send a message from the content process using the <a href="/en-US/Firefox/Multiprocess_Firefox/The_message_manager">message manager</a>. The <a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListener#receiveMessage()"><code>target</code></a> property of the object passed into the message handler in the chrome process is the XUL <a href="/en-US/docs/XUL/browser"><code><browser></code></a> receiving the message, and you can get the chrome window from that (Note: I'm not really sure how...).</p> + +<h2 id="nsIAboutModule">nsIAboutModule</h2> + +<p>默认情况下,使用 <a href="http://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/about/nsIAboutModule.idl"><code>nsIAboutModule</code></a> 注册的自定义的 <code>about:</code> 页面在 chrome 进程中加载。这意味着你不能从内容进程访问它们的内容(比如通过 XHR)。</p> + +<p>你可以在注册 about: URI 的代码中更改这个默认值。见 <a href="/en-US/Firefox/Multiprocess_Firefox/about:_and_chrome:_URIs">about: 和 chrome: URI</a>。</p> + +<h2 id="JavaScript_代码模块_(JSM)">JavaScript 代码模块 (JSM)</h2> + +<div>在多进程的 Firefox 中,一个加载到内容进程的 JSM 不予加载到 chrome 进程的同一个 JSM 共享任何状态。参考 <a href="/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#JavaScript_code_modules_%28JSMs%29">chrome 脚本的限制</a> 页面中的内容。</div> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/communicating_with_frame_scripts/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/communicating_with_frame_scripts/index.html new file mode 100644 index 0000000000..9c8abfa1c9 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/communicating_with_frame_scripts/index.html @@ -0,0 +1,205 @@ +--- +title: 与框架脚本通信 +slug: >- + Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Communicating_with_frame_scripts +translation_of: >- + Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Communicating_with_frame_scripts +--- +<div>{{FirefoxSidebar}}</div><p>Chrome 的代码与框架脚本的往来通信采用消息 API,它可以包含可 JSON 序列化的对象作为参数。</p> + +<p>这个 API 大多是对称的,但有一个主要的例外:框架脚本可以发送同步或者异步消息到 chrome,但 chrome 只能发送异步消息到内容。这是一种有意的设计,是为了防止内容不响应而导致的 chrome 失去响应。<br> + <br> + 在绝对必要时,框架脚本可以通过被称为 <a href="/en-US/docs/Cross_Process_Object_Wrappers">跨进程对象包装器</a>(也称 CPOWs)的东西到达 chrome,并且 chrome 可以使用这些包装器来获得到内容对象的同步访问。</p> + +<h2 id="内容到_chrome">内容到 chrome</h2> + +<p>框架脚本可以选择发送同步消息或者异步消息到 chrome 代码。</p> + +<h3 id="异步消息">异步消息</h3> + +<p>要发送异步消息,内容脚本应使用 <code>sendAsyncMessage()</code> 函数:</p> + +<pre class="brush: js">// frame script +sendAsyncMessage("my-addon@me.org:my-e10s-extension-message");</pre> + +<p><code>sendAsyncMessage()</code> takes one mandatory parameter, which is the name of the message. All messages share the same namespace, so to avoid conflicts with other code, you'll need to ensure that the names you use are unique. If you're using the message manager in an add-on, a good way to do that is to prefix messages with your add-on's ID.</p> + +<p>After the name, you can pass detailed data as a string or a JSON-serializable object, and after that you can pass any objects it wants to pass to content as <a href="/en-US/docs/Cross_Process_Object_Wrappers">CPOWs</a>.</p> + +<p>The example below sends a message named "my-e10s-extension-message", with a <code>data</code> payload containing <code>details</code> and <code>tag</code> properties, and exposes the <code>event.target</code> object as a CPOW:</p> + +<pre class="brush: js">// frame script +addEventListener("click", function (event) { + sendAsyncMessage("my-addon@me.org:my-e10s-extension-message", { + details : "they clicked", + tag : event.target.tagName + }, + { + target : event.target + }); +}, false);</pre> + +<p>要接收来自内容的消息,一个 chrome 脚本需要使用消息管理器的 <code>addMessageListener()</code> API 添加消息监听器:<br> + <br> + 传递给监听器的消息是一个对象,包含下列属性:</p> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td><code>name</code></td> + <td>字符串,包含消息的名称。</td> + </tr> + <tr> + <td><code>sync</code></td> + <td>布尔值,表示消息是否为同步发送,或者是异步发送。</td> + </tr> + <tr> + <td><code>data</code></td> + <td>JSON 对象,作为传递给 <code>sendAsyncMessage()</code> 的第二个参数。</td> + </tr> + <tr> + <td><code>target</code></td> + <td>这是 XUL 的 <code><browser></code> 元素,来自消息发送的位置。</td> + </tr> + <tr> + <td><code>objects</code></td> + <td>An object whose properties are any CPOWs exposed by the sender as the third argument to <code>sendAsyncMessage()</code></td> + </tr> + </tbody> +</table> + +<p>在下面的例子中,监听器只是记录所有的消息细节;</p> + +<pre class="brush: js">// chrome script +messageManager.addMessageListener("my-addon@me.org:my-e10s-extension-message", listener); + +function listener(message) { + console.log(message.name); + console.log(message.sync); + console.log(message.data); + console.log(message.target); + console.log(message.objects); +} +</pre> + +<p>So combining this message listener with the message above will give console output somewhat like this, when the user clicks a <code><div></code>:</p> + +<pre>"my-addon@me.org:my-e10s-extension-message" +false +Object { details: "they clicked", tag: "div" } +<xul:browser anonid="initialBrowser" ... > +{ target: <div#searchContainer> } +</pre> + +<p>If your code requires access to a <code>window</code> (for example to run <code>window.openDialog</code>), and your message listener is run from somewhere without access to a <code>window</code> (e.g. an XPCOM component), you can access the window of the <code>browser</code> that sent the message with <code>message.target.ownerDocument.defaultView</code>.</p> + +<h3 id="同步消息">同步消息</h3> + +<p>要发送一个同步消息,框架脚本应使用全局的 <code>sendSyncMessage()</code> 函数:</p> + +<pre class="brush: js">// frame script +sendSyncMessage("my-addon@me.org:my-e10s-extension-message");</pre> + +<p>在一个 chrome 脚本收到一个同步消息时,它应该从它的消息监听器返回一个值:</p> + +<pre class="brush: js">// chrome script +messageManager.addMessageListener("my-addon@me.org:my-e10s-extension-message", listener); + +function listener(message) { + return "value from chrome"; +}</pre> + +<p>This value is then presented to the frame script in the return value of <code>sendSyncMessage()</code>. Because a single message can be received by more than one listener, the return value of <code>sendSyncMessage()</code> is an array of all the values returned from every listener, even if it only contains a single value:</p> + +<pre class="brush: js">// frame script +addEventListener("click", function (event) { + var results = sendSyncMessage("my-addon@me.org:my-e10s-extension-message", { + details : "they clicked", + tag : event.target.tagName + }); + content.console.log(results[0]); // "value from chrome" +}, false);</pre> + +<p>Like arguments, return values from <code>sendSyncMessage()</code> must be JSON-serializable, so chrome can't return functions.</p> + +<h3 id="removeMessageListener()">removeMessageListener()</h3> + +<p>要停止监听来自内容的消息,使用消息管理器的 <code>removeMessageListener()</code> 方法:</p> + +<pre class="brush: js">// chrome script +messageManager.removeMessageListener("my-addon@me.org:my-e10s-extension-message", listener);</pre> + +<h2 id="Chrome_到内容">Chrome 到内容</h2> + +<p>要从 chrome 发送一个消息到内容,你需要知道你正在使用什么类型的消息管理器。如果它是一个浏览器消息管理器,你可以使用消息管理器的 <code>sendAsyncMessage</code> 方法:</p> + +<pre class="brush: js">// chrome script +browser.messageManager.sendAsyncMessage("my-addon@me.org:message-from-chrome");</pre> + +<p>如果你有一个窗口或者全局消息管理器,你需要使用 <code>broadcastAsyncMessage</code> 方法:</p> + +<pre>// chrome script +window.messageManager.broadcastAsyncMessage("my-addon@me.org:message-from-chrome");</pre> + +<p>These methods takes one mandatory parameter, which is the message name. All messages share the same namespace, so to avoid conflicts with other code, you'll need to ensure that the names you use are unique. If you're using the message manager in an add-on, a good way to do that is to prefix messages with your add-on's ID.</p> + +<p>在消息名称后,你可以将详细的数据传递为一个字符串或者一个可 JSON 序列化的对象:</p> + +<pre class="brush: js">// chrome script +messageManager.sendAsyncMessage("my-addon@me.org:message-from-chrome", { + details : "some more details" +});</pre> + +<p>To receive a message from chrome, a frame script uses the global <code>addMessageListener()</code> function. This takes two parameters: the name of the message and a listener function. The listener will be passed a <code>message</code> object whose <code>data</code> property is the message payload:</p> + +<pre class="brush: js">// frame script +function handleMessageFromChrome(message) { + var payload = message.data.details; // "some more details" +} + +addMessageListener("my-addon@me.org:message-from-chrome", handleMessageFromChrome);</pre> + +<h3 id="message-manager-disconnect">message-manager-disconnect</h3> + +<p>If you're using a <a href="https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/The_message_manager">message manager</a> to communicate with a script that may be running in a different process, you can listen for the <a href="/en-US/docs/Observer_Notifications#Message_manager">message-manager-disconnect </a>observer notification to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages.</p> + +<p>For example, suppose we load a script into the current <code><browser></code> on some event, and keep the browser message manager in an array, so we can send it messages:</p> + +<pre class="brush: js">var messageManagers = []; + +... + +// on some event +var browserMM = gBrowser.selectedBrowser.messageManager; +browserMM.loadFrameScript("chrome://my-addon@me.org/content/frame-script.js", false); +messageManagers.push(browserMM); +console.log(messageManagers.length);</pre> + +<p>We can listen for <code>message-manager-disconnect</code> to update the array when the message managers disconnect (for example because the user closed the tab):</p> + +<pre class="brush: js">function myObserver() { +} + +myObserver.prototype = { + observe: function(subject, topic, data) { + var index = messageManagers.indexOf(subject); + if (index != -1) { + console.log("one of our message managers disconnected"); + mms.splice(index, 1); + } + }, + register: function() { + var observerService = Cc["@mozilla.org/observer-service;1"] + .getService(Ci.nsIObserverService); + observerService.addObserver(this, "message-manager-disconnect", false); + console.log("listening"); + }, + unregister: function() { + var observerService = Cc["@mozilla.org/observer-service;1"] + .getService(Ci.nsIObserverService); + observerService.removeObserver(this, "message-manager-disconnect"); + } +} + +var observer = new myObserver(); +observer.register();</pre> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/frame_script_environment/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/frame_script_environment/index.html new file mode 100644 index 0000000000..8d5e9d287b --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/frame_script_environment/index.html @@ -0,0 +1,104 @@ +--- +title: 框架脚本环境 +slug: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_environment +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_environment +--- +<div>{{FirefoxSidebar}}</div><p>框架脚本的全局是 <a href="http://dxr.mozilla.org/mozilla-central/source/dom/base/nsIMessageManager.idl#345">ContentFrameMessageManager</a>,提供下列环境:</p> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td><code>content</code></td> + <td>The DOM window of the content loaded in the browser. may be <code>null</code> (see below)</td> + </tr> + <tr> + <td><code>docShell</code></td> + <td>The <a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocShell"><code>nsIDocShell</code></a> associated with the browser.</td> + </tr> + <tr> + <td><code>addEventListener()</code></td> + <td>Listen to events from content.</td> + </tr> + <tr> + <td><code>removeEventListener()</code></td> + <td>Stop listening to events from content.</td> + </tr> + <tr> + <td><code>addMessageListener()</code></td> + <td>Listen to messages from chrome.</td> + </tr> + <tr> + <td><code>removeMessageListener()</code></td> + <td>Stop listening to messages from chrome.</td> + </tr> + <tr> + <td><code>sendAsyncMessage()</code></td> + <td>Send an asynchronous message to chrome.</td> + </tr> + <tr> + <td><code>sendSyncMessage()</code></td> + <td>Send a synchronous message to chrome.</td> + </tr> + <tr> + <td><code>dump()</code></td> + <td>Print a message to the console.</td> + </tr> + <tr> + <td><code>atob()</code></td> + <td>Base64 decode.</td> + </tr> + <tr> + <td><code>btoa()</code></td> + <td>Base64 encode.</td> + </tr> + <tr> + <td><code>Components</code></td> + <td>The usual <a href="/en-US/docs/Components_object"><code>Components</code> object</a>.</td> + </tr> + </tbody> +</table> + +<p>特别注意,框架脚本使用<code> content </code>访问 DOM 窗口,而不是 <code>window</code>:</p> + +<pre class="brush: js">// frame script +var links = content.document.getElementsByTagName("a");</pre> + +<p>All the frame scripts running in a tab share this global. However, any top-level variables defined by a script are not stored on the global: instead, top-level variables are stored in a special per-script object that delegates to the per-tab global. This means you don't have to worry about global variables you define conflicting with global variables defined by another frame script. You can still access the global directly via <code>this</code>.</p> + +<p>框架脚本使用系统主体运行。如果你想使用其他主题,可以使用 <a href="/en-US/docs/Components.utils.Sandbox"><code>Sandbox</code></a>。</p> + +<p>Frame scripts run with <a href="https://developer.mozilla.org/en-US/docs/Security_check_basics#Principals">system privileges</a> and have access to the <a href="https://developer.mozilla.org/en-US/docs/Components_object">Components</a> object, enabling them to use <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> objects and <a href="https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules">JSMs</a>. However, some APIs that work in the chrome process will not work in a frame script. See <a href="/en-US/Firefox/Multiprocess_Firefox/Limitations_of_frame_scripts">Limitations of frame scripts</a> for more details.</p> + +<h2 id="事件">事件</h2> + +<p>Besides the regular DOM events being captured/bubbling up from content the current <code>content</code> object the following additional events get fired in a frame script environment:</p> + +<table class="standard-table"> + <tbody> + <tr> + <td><a href="/en-US/docs/Web/Reference/Events/unload">unload</a></td> + <td> + <dl> + <dt style="float: left; text-align: right; width: 120px;">Bubbles</dt> + <dd style="margin: 0 0 0 120px;">No</dd> + </dl> + + <p>Fires when the frame script environment is shut down, i.e. when a tab gets closed.</p> + + <p>If you use a capturing event listener on the <code>ContentFrameMessageManager</code>, you should verify that its <code>event.target</code> is set to the <code>ContentFrameMessageManager</code> global object in order to avoid handling <code>unload</code> events from content.</p> + </td> + </tr> + <tr> + <td><a href="/en-US/docs/Web/Events/DOMWindowCreated">DOMWindowCreated</a></td> + <td> + <p>Fires when a new <code>content</code> object is created.<br> + <br> + This can be used if a framescript needs to interact with individual DOM windows instead of simply listening for events bubbling up from content.<br> + Another use is to interact with the content very early in the page load process, long before <a href="/en-US/docs/Web/Events/DOMContentLoaded">DOMContentLoaded</a> event is fired.<br> + </p> + </td> + </tr> + </tbody> +</table> + +<p> </p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/frame_script_loading_and_lifetime/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/frame_script_loading_and_lifetime/index.html new file mode 100644 index 0000000000..ee53fe52e2 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/frame_script_loading_and_lifetime/index.html @@ -0,0 +1,124 @@ +--- +title: 框架脚本的加载与寿命 +slug: >- + Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_loading_and_lifetime +translation_of: >- + Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_loading_and_lifetime +--- +<div>{{FirefoxSidebar}}</div><h2 id="加载框架脚本">加载框架脚本</h2> + +<p>要加载一个框架脚本,使用 <code>loadFrameScript()</code> 函数。</p> + +<p>这行代码加载一个框架脚本到当前选中的标签页。该框架脚本只是将 "foo" 写入到命令行:</p> + +<pre class="brush: js">// chrome script +var mm = gBrowser.selectedBrowser.messageManager; +mm.loadFrameScript('data:,dump("foo\\n")', true);</pre> + +<p><code>loadFrameScript()</code> 有两个强制性参数:</p> + +<ul> + <li>一个 URL 指向要加载的框架脚本。</li> + <li>一个布尔变量,<code>allowDelayedLoad</code></li> +</ul> + +<p>Note that if the message manager is a <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview#Global_frame_message_manager">global frame message manager</a> or a <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview#Window_message_manager">window message manager</a> then <code>loadFrameScript() </code>may load the script multiple times, once into each applicable frame.</p> + +<h3 id="chrome_URL">chrome: URL</h3> + +<p>扩展开发者通常会使用 <code>chrome://</code> URL 来指向一个框架脚本。</p> + +<p>要定义 <code>chrome://</code> URL 的映射和将一个框架脚本打包到扩展中,使用 "chrome.manifest" 文件来 <a href="/en/docs/Chrome_Registration">注册一个chrome URL</a>:</p> + +<pre class="brush: js">// chrome.manifest +content my-e10s-extension content.js</pre> + +<pre class="brush: js">// chrome script +mm.loadFrameScript("chrome://my-e10s-extension/content/content.js", true);</pre> + +<h3 id="allowDelayedLoad">allowDelayedLoad</h3> + +<p>如果消息管理器是一个 <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview#Global_frame_message_manager">全局框架消息管理器</a> 或者一个 <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview#Window_message_manager">窗口消息管理器</a>,那么:</p> + +<ul> + <li> + <p>如果 <code>allowDelayedLoad</code> 为 <code>true</code>,在 <code>loadFrameScript()</code> 调用后,框架脚本将加载到任何新的已打开的标签页。例如:</p> + + <pre class="brush: js">var mm = window.messageManager; +mm.loadFrameScript("chrome://my-e10s-extension/content/frame-script.js", true);</pre> + + <p>这段脚本将加载到此窗口中目前已打开的所有标签页,以及未来进入的新打开的标签页。</p> + </li> + <li>如果 <code>allowDelayedLoad</code> 为 <code>false</code>,那么脚本只会在执行调用时已打开的标签页中加载。</li> +</ul> + +<p>如果消息管理器是一个 <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview#Browser_message_manager">浏览器消息管理器</a>,你应该始终在这里传递 <code>true</code>。因为一个浏览器消息管理器永远只对应一个浏览器标签页,它的 <code>loadFrameScript()</code> 函数只加载框架脚本到一个标签页。因此传递 <code>allowDelayedLoad</code> 仅仅是一个方法来确保脚本被正确加载,在你的标签页在执行后还没有准备好时。</p> + +<p>如果你使用 <code>allowDelayedLoad</code>,你可以使用 <code>removeDelayedFrameScript</code> 取消它:</p> + +<pre class="brush: js">var mm = window.messageManager; +<code>mm.removeDelayedFrameScript</code>("chrome://my-e10s-extension/content/frame-script.js");</pre> + +<p>这意味着我们将停止加载脚本到新的标签页。请注意,此函数不会移除已经加载的任何脚本。</p> + +<h2 id="框架脚本的寿命">框架脚本的寿命</h2> + +<p>框架脚本将在 <code>loadFrameScript()</code> 被调用后尽快加载。如果你设置了 <code>allowDelayedLoad</code>,脚本将加载到一个新的标签页,一旦其已被创建。</p> + +<p>框架脚本与浏览器的标签页相关联,而不是与页面。因此一旦你加载它们,它们就会持续存在,直至标签页被关闭,因此即便你重新加载或者文档重新导航也不会丢失。</p> + +<p>如果你想一个框架脚本在每次新文档被加载后执行操作,你需要监听一个适当的 DOM 事件,通常是 <code><a href="/en-US/docs/Web/Events/DOMWindowCreated">DOMWindowCreated</a></code>, <code><a href="/en-US/docs/Web/Events/DOMContentLoaded">DOMContentLoaded</a></code>, 或者 <code><a href="/en-US/docs/Web/Events/load">load</a></code>。</p> + +<h2 id="卸载框架脚本">卸载框架脚本</h2> + +<p>框架脚本会在托管它们的标签页被关闭时自动卸载。目前还没有办法在已加载它们的标签页之中卸载它们,除了关闭标签页。</p> + +<p>若要监听你的框架脚本被卸载的事件(例如由于标签页被关闭),你必须将 <code>addMessageListener</code> 的第三个参数设置为 true,例如下面的 <code>bootstrap.js</code> 的代码:</p> + +<pre class="brush: js">Services.mm.addMessageListener( + 'my-addon-id', + { + receiveMessage: function() { + console.log('incoming message from frame script:', aMsg.data); + } + }, + true // must set this argument to true, otherwise sending message from framescript will not work during and after the unload event on the ContentMessageManager triggers +);</pre> + +<p>and then in your frame script listen for the unload event of the message manager (which is the global this), and then send a message. If you did not set third argument to true in <code>bootstrap.js</code> on <code>Services.mm.addMessageListener</code>, then this send message during and after unload event, will do nothing.</p> + +<pre class="brush: js">var gContentFrameMessageManager = this; + +addEventListener('unload', function(aEvent) { + if (aEvent.target == gContentFrameMessageManager) { + sendAsyncMessage('my-addon-id', 'framescript-died'); // if you did not set third argument of `Services.mm.addMessageListener` to `true`, then this will fail to send a message + } +}, false);</pre> + +<h3 id="有关卸载升级操作时的卸载">有关卸载/升级操作时的卸载</h3> + +<p>在你的附加组件被卸载或禁用时,你应该:</p> + +<ul> + <li>如果使用了 <code>allowDelayedLoad</code>,调用 <code>removeDelayedFrameScript</code> 取消它,确保框架脚本不会加载到任何新的标签页。</li> + <li>禁用已加载的任何框架脚本。没有任何机制来卸载已加载的框架脚本,因此你需要发送一个消息到你的框架脚本来告诉它们禁用自己(例如撤销所有已取得的更改,以及移除事件监听器)。</li> +</ul> + +<div class="note"> +<div class="warning"> +<p>There is a bug in non-e10s where this oder is not true. In e10s framescripts work fine on updating. For non-e10s waiting for <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1202125">Bug 1202125 - framescripts are not backwards loaded in message order in non-e10s</a>.</p> +</div> + +<p>Note: you might think that there is a race condition here due to the asynchronous nature of the message passing:</p> + +<ul> + <li>your add-on is disabled for an upgrade</li> + <li>your add-on broadcasts "disable" to your frame scripts</li> + <li>your add-on is upgraded, and the new code loads new frame scripts</li> + <li>the new frame scripts receive the "disable" message, and stop working</li> +</ul> + +<p>In fact, the message manager guarantees that <code>loadFrameScript</code> and <code>broadcastAsyncMessage</code> are guaranteed to affect frame scripts in the order that they are called, so in this case "disable" will be received and consumed before the new frame scripts are loaded.</p> +</div> + +<p>At the moment frame scripts are cached until the browser restarts: this problem is tracked as <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1051238">bug 1051238</a>. This is especially a problem for <a href="/en-US/Add-ons/Bootstrapped_extensions">restartless add-ons</a>, because when a new version of the add-on is installed, the old frame scripts will not be unloaded. The workaround here is to randomize the frame script's URL, for example by appending <code>"?" + Math.random()</code> to it.</p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/index.html new file mode 100644 index 0000000000..be6ba855c9 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/index.html @@ -0,0 +1,68 @@ +--- +title: 消息管理器 +slug: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager +--- +<div>{{FirefoxSidebar}}</div><p>消息管理器为 chrome 特权的 JavaScript 代码提供了跨进程边界的通信方式。它非常有用,可以允许 chrome 代码(包括浏览器自身的代码和外部代码)访问在单独的进程中运行的网页内容。</p> + +<p>这些指南介绍了如何在多进程 Firefox 中使用消息管理器。</p> + +<p>请注意,多进程 Firefox 的环境并非是必须的:这里描述的一切对单进程 Firefox 也同样有效,所以相同的代码在两个环境下都可以正常工作。</p> + +<hr> +<h2 id="指南">指南</h2> + +<div class="column-container"> +<div class="column-half"> +<dl> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview">消息管理器概述</a></dt> + <dd> </dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_loading_and_lifetime">框架脚本的加载与寿命</a></dt> + <dd> </dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/Communicating_with_frame_scripts">与框架脚本通信</a></dt> + <dd> </dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/Performance">性能的最佳实践</a></dt> + <dd> </dd> +</dl> +</div> + +<div class="column-half"> +<dl> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_environment">框架脚本环境</a></dt> + <dd> </dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/_Limitations_of_frame_scripts">框架脚本的限制</a></dt> + <dd> </dd> + <dt><a href="/Firefox/Multiprocess_Firefox/Message_Manager/Process_scripts">进程脚本</a></dt> + <dd> </dd> +</dl> +</div> +</div> + +<hr> +<h2 id="API_参考资料">API 参考资料</h2> + +<div class="column-container"> +<div class="column-half"> +<dl> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader">nsIFrameScriptLoader</a></dt> + <dd> </dd> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager">nsIMessageListenerManager</a></dt> + <dd> </dd> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster">nsIMessageBroadcaster</a></dt> + <dd> </dd> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender">nsIMessageSender</a></dt> + <dd> </dd> +</dl> +</div> + +<div class="column-half"> +<dl> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender">nsISyncMessageSender</a></dt> + <dd> </dd> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentFrameMessageManager">nsIContentFrameMessageManager</a></dt> + <dd> </dd> + <dt><a href="/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcessScriptLoader">nsIProcessScriptLoader</a></dt> + <dd> </dd> +</dl> +</div> +</div> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/message_manager_overview/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/message_manager_overview/index.html new file mode 100644 index 0000000000..fb85fa5e79 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/message_manager_overview/index.html @@ -0,0 +1,442 @@ +--- +title: 消息管理器概述 +slug: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Message_manager_overview +--- +<div class="summary"> +<p>在多进程 Firefox 中有两个进程:</p> + +<ul> + <li>chrome 进程,也称父进程,运行着浏览器 UI 界面 (chrome) 的代码和扩展安装的代码。</li> + <li>内容进程,也称子进程,运行着所有网页内容。在未来的 Firefox 版本中,不同的标签页可能运行在不同的进程中,但截至目前,所有内容标签页共享使用同一个内容进程。</li> +</ul> + +<p>消息管理器的设计目的是使运行在一个进程中的 chrome 特权的 JavaScript 代码能够与不同进程中的 chrome 特权的 JavaScript 代码通信。</p> + +<p>本文介绍了几种类型的消息管理器,如何访问它们,以及在一个较高层面你可以使用什么。</p> +</div> + +<p>在顶层,有两种不同类型的消息管理器:</p> + +<ul> + <li><em>框架消息管理器</em>:这些使 chrome 进程的代码能够加载脚本到内容进程中的浏览器框架(基本上,就是指一个浏览器标签页)。这些脚本被称为框架脚本,顾名思义,它们限定在特定的浏览器框架中。如果 chrome 代码想要在内容进程中运行可以方便访问网页内容的代码,通常就是使用消息管理器的时候了。</li> + <li><em>进程消息管理器</em>:这些对应着进程边界,使运行在父 (chrome) 进程中的代码能够与子 (内容) 进程中的代码通信。从 Firefox 38 起,这也使运行在父进程中的代码能够加载进程脚本到子进程。这些类似框架脚本,除了它们是全局访问子进程。进程脚本最有用的时候是进程想要只在内容进程中运行某些代码,来访问某些全局服务:例如,注册一个 <a href="/en/docs/Observer_Notifications">observer </a>或者一个 <a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPolicy">内容策略</a>。</li> +</ul> + +<h2 id="框架消息管理器">框架消息管理器</h2> + +<p>在多进程 Firefox 中,当 chrome 代码需要与网页内容交互时,它需要:</p> + +<ul> + <li>将需要直接访问内容的脚本代码放到一个单独的脚本,它被称为“框架脚本”。</li> + <li>使用框架消息管理器来加载这些框架脚本到内容进程</li> + <li>使用框架消息管理器 API 来与框架脚本通信</li> +</ul> + +<div class="note"> +<p>Some older articles on multiprocess Firefox and the message manager might refer to "content scripts" instead of "frame scripts", but this usage is deprecated because the Add-on SDK uses "content script" to refer to a <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Guides/Content_Scripts">similar but different kind of script</a>.</p> +</div> + +<p>因此从根本上,框架消息管理器使 chrome 代码能够:</p> + +<ul> + <li>加载一个脚本到一个内容进程中的框架(基本上,就是指一个浏览器标签页)。这些脚本被称为“框架脚本”。</li> + <li>使用消息传递 API 与框架脚本通信</li> +</ul> + +<p>有多种类型的框架消息管理器,如图所示:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/10795/frame-message-managers.png" style="display: block; height: 596px; margin-left: auto; margin-right: auto; width: 737px;"></p> + +<p>This diagram shows the setup when there are 2 browser windows open, one with 2 tabs open and one with 1 tab open.</p> + +<h3 id="Chrome_进程">Chrome 进程</h3> + +<p>In the chrome process, there's a hierarchy of frame message managers: the global frame message manager, window message managers, and browser message managers.</p> + +<h4 id="全局框架消息管理器">全局框架消息管理器</h4> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>There's a single <em>global frame message manager</em> in the chrome process.</p> + + <p>This operates on all frames, in all content tabs. If you load a frame script using the global frame message manager, the script gets loaded separately into every open tab: three times, in the diagram above. Similarly, if you send a message using the global frame message manager, it's received by all content tabs, and is then delivered to any frame scripts that are listening for it.</p> + + <p>Its most important functions and attributes are:</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#childCount">childCount</a></code> : contains the number of children (typically, browser windows)</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#getChildAt()">getChildAt()</a></code> : get the child at the given index</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader#loadFrameScript()">loadFrameScript()</a></code> : load a frame script into every tab in the browser</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#broadcastAsyncMessage()">broadcastAsyncMessage()</a></code> : send a message to frame scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : start listening to a specific message from all frame scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#removeMessageListener()">removeMessageListener()</a></code> : stop listening to a specific message</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader" title="">nsIFrameScriptLoader</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager" title="">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster" title="">nsIMessageBroadcaster</a></code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td> + <p>Access it using <code><a href="/en-US/docs/Components.classes">Components.classes</a></code>:</p> + + <pre class="brush: js language-js"> +// chrome script +let globalMM = Cc["@mozilla.org/globalmessagemanager;1"] + .getService(Ci.nsIMessageListenerManager);</pre> + </td> + </tr> + </tbody> +</table> + +<h4 id="窗口消息管理器">窗口消息管理器</h4> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>There's a <em>window message manager</em> for every browser window: two, in the diagram above.</p> + + <p>It operates on all content tabs in a given window. If you load a frame script using the window message manager it gets loaded separately into each tab open in that particular window. If you send a message using the window message manager, it gets sent to all content tabs in that window.</p> + + <p>Its most important functions and attributes are:</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#childCount">childCount</a></code> : contains the number of children (typically, browser tabs)</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#getChildAt()">getChildAt()</a></code> : get the child at the given index</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader#loadFrameScript()">loadFrameScript()</a></code> : load a frame script into every tab in this window</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#broadcastAsyncMessage()">broadcastAsyncMessage()</a></code> : send a message to all frame scripts in this window</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : start listening to a specific message from frame scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#removeMessageListener()">removeMessageListener()</a></code> : stop listening to a specific message</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader" title="">nsIFrameScriptLoader</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager" title="">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster" title="">nsIMessageBroadcaster</a></code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td> + <p>You can access it as a property of the browser window:</p> + + <pre class="brush: js"> +// chrome script +let windowMM = window.messageManager;</pre> + </td> + </tr> + </tbody> +</table> + +<h4 id="浏览器消息管理器">浏览器消息管理器</h4> + +<div class="note"> +<p>Note that in this context, "browser" refers to the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/browser">XUL <browser> object</a>, which is a frame that hosts a single Web document. It does not refer to the more general sense of a Web browser.</p> +</div> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>Finally, there's a <em>browser message manager</em> for every open content tab: three, in the diagram above.</p> + + <p>This corresponds one-to-one with a content tab. Scripts you load using a browser message manager are loaded only into that content tab, and messages you send are delivered only to that content tab.</p> + + <p>You can mix and match: so for example, you could load a script into every tab using the global message manager, but then send a message to the script instance loaded into a specific tab by using the browser message manager.</p> + + <p>Its most important functions are:</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader#loadFrameScript()">loadFrameScript()</a></code> : load a frame script into this browser frame (tab)</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender#sendAsyncMessage()">sendAsyncMessage()</a></code> : send a message to all frame scripts in this browser frame</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : start listening to a specific message from frame scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#removeMessageListener()">removeMessageListener()</a></code> : stop listening to a specific message</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code>nsIProcessChecker</code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameScriptLoader">nsIFrameScriptLoader</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender">nsIMessageSender</a></code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td> + <p>The browser message manager can be accessed as a property of the XUL <code><browser></code> element:</p> + + <pre class="brush: js"> +// chrome script +let browserMM = gBrowser.selectedBrowser.messageManager;</pre> + </td> + </tr> + </tbody> +</table> + +<h3 id="内容进程">内容进程</h3> + +<h4 id="内容框架消息管理器">内容框架消息管理器</h4> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>There's a <em>content frame message manager</em> for every open tab. It's the content-side end of frame message manager conversations.</p> + + <p>Frame scripts are loaded into the content frame message manager scope, and messages from chrome message managers end up here.</p> + + <p>The content frame message manager provides the <a href="/en-US/Firefox/Multiprocess_Firefox/Frame_script_environment">global object for frame scripts</a> (but note that there is trickery to ensure that top-level variables defined by frame scripts are not shared).</p> + + <p>Frame scripts can use this object to send messages to the chrome process, and to receive messages from the chrome process.</p> + + <p>Its most important attributes and functions are:</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentFrameMessageManager#content">content</a></code> : access the DOM window hosted by the tab</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentFrameMessageManager#docShell">docShell</a></code> : access the top-level docshell</p> + + <p><code><a href="/en-US/docs/Components_object">Components</a></code> : access privileged objects and APIs</p> + + <p><code><a href="/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener()</a></code> : listen to DOM events</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : receive messages from the chrome process</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender#sendAsyncMessage()">sendAsyncMessage()</a></code> : send asynchronous messages to the chrome process</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender#sendSyncMessage()">sendSyncMessage()</a></code> : send synchronous messages to the chrome process</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIDOMEventTarget">nsIDOMEventTarget</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender">nsIMessageSender</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender">nsISyncMessageSender</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentFrameMessageManager">nsIContentFrameMessageManager</a></code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td>The content frame message manager is the global object in frame scripts.</td> + </tr> + </tbody> +</table> + +<h2 id="进程消息管理器">进程消息管理器</h2> + +<p>Process message managers correspond to process boundaries, and enable code running in different processes to communicate. Multiprocess Firefox has the concept of:</p> + +<ul> + <li>a "parent process"</li> + <li>"child processes" which are processes spawned by the parent process.</li> +</ul> + +<p>For practical purposes, in multiprocess Firefox the parent process is the chrome process, and child processes are content processes. </p> + +<p>In each child process, there's a single <em>child process message manager</em> (CPMM). There's also an additional <em>child-in-process message manager</em> (CIPMM) in the parent process.</p> + +<p>For each child process message manager, there's a <em>parent process message manager</em> (PPMM) in the parent process.</p> + +<p>There's also a single <em>global parent process message manager</em> (GPPMM) in the parent process, that provides access to all the parent process message managers. The diagram below shows the setup that would result from having two child processes:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/10799/process-message-managers.png" style="display: block; height: 477px; margin-left: auto; margin-right: auto; width: 477px;"></p> + +<p>With the GPPMM, you can broadcast messages to the CIPMM and all CPMMs. With a PPMM, you can send a message to its corresponding CPMM. With a CPMM, you can send messages to the parent process: these messages are received first by the corresponding PPMM, then by the GPPMM.</p> + +<p>From Firefox 38 onwards, you can also use a parent process message manager to load a script into a child process. This is the recommended way to load a script that executes just once per child process, which is something you might want to do if you are interacting with some global service (for example, adding listeners to observer notifications or registering a content policy).</p> + +<h3 id="父消息管理器">父消息管理器</h3> + +<h4 id="全局父进程消息管理器">全局父进程消息管理器</h4> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>The global parent process message manager (GPPMM) is global to the parent process.</p> + + <ul> + <li>Messages sent using the GPPMM get sent to all CPMMs in all child processes.</li> + <li>Process scripts loaded using the GPPMM get loaded in all child processes.</li> + </ul> + + <p>Its most important functions and attributes are:</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#childCount">childCount</a></code> : contains the number of children (child processes, plus the in-content child)</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#getChildAt()">getChildAt()</a></code> : get the child at the given index</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcessScriptLoader#loadProcessScript()">loadProcessScript()</a></code> : load a process script into every content process</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#broadcastAsyncMessage()">broadcastAsyncMessage()</a></code> : send a message to all process scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : start listening to a specific message from process scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#removeMessageListener()">removeMessageListener()</a></code> : stop listening to a specific message</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcessScriptLoader">nsIProcessScriptLoader</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager" title="">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster" title="">nsIMessageBroadcaster</a></code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td> + <p>You can access the GPPMM with code like this:</p> + + <pre class="brush: js"> +// parent process +let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"] + .getService(Ci.nsIMessageBroadcaster);</pre> + + <p>You can also access it as the <code>ppmm</code> property of <a href="/en-US/docs/Mozilla/JavaScript_code_modules/Services.jsm">Services.jsm</a>, if you are in the parent process.</p> + </td> + </tr> + </tbody> +</table> + +<h4 id="父进程消息管理器">父进程消息管理器</h4> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>There's one parent process message manager (PPMM) in the parent process for every child process, and its API is oriented to that one child process.</p> + + <ul> + <li>Messages sent using the PPMM are received only by the corresponding CPMM</li> + <li>Scripts loaded using the PPMM are loaded only into the corresponding child process.</li> + </ul> + + <p>Its most important functions are:</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcessScriptLoader#loadProcessScript()">loadProcessScript()</a></code> : load a process script into the content process</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageBroadcaster#broadcastAsyncMessage()">broadcastAsyncMessage()</a></code> : send a message to process scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : start listening to a specific message from process scripts</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#removeMessageListener()">removeMessageListener()</a></code> : stop listening to a specific message</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code>nsIProcessChecker</code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcessScriptLoader">nsIProcessScriptLoader</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender">nsIMessageSender</a></code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td> + <p>You can access a PPMM using the <code>getChildAt()</code> function in the GPPMM:</p> + + <pre class="brush: js"> +// parent process +let ppmm = Services.ppmm.getChildAt(1);</pre> + </td> + </tr> + </tbody> +</table> + +<h3 id="子进程">子进程</h3> + +<h4 id="子进程消息管理器">子进程消息管理器</h4> + +<table class="fullwidth-table standard-table"> + <tbody> + <tr> + <td style="width: 20%;">Description</td> + <td> + <p>There's one child process message manager (CPMM) in each child process. Messages sent using the CPMM are sent to the corresponding PPMM and are also relayed to the GPPMM.</p> + + <p>Its most important attributes and functions are:</p> + + <p><code><a href="/en-US/docs/Components_object">Components</a></code> : access privileged objects and APIs</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener()">addMessageListener()</a></code> : receive messages from the parent process</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender#sendAsyncMessage()">sendAsyncMessage()</a></code> : send asynchronous messages to the parent process</p> + + <p><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender#sendSyncMessage()">sendSyncMessage()</a></code> : send synchronous messages to the parent process</p> + </td> + </tr> + <tr> + <td>Interfaces</td> + <td> + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager">nsIMessageListenerManager</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageSender">nsIMessageSender</a></code></p> + + <p><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender">nsISyncMessageSender</a></code></p> + + <p><code>nsIContentProcessMessageManager</code></p> + </td> + </tr> + <tr> + <td>How to access</td> + <td> + <p>Code running in a child process can access the CPMM with code like this:</p> + + <pre class="brush: js"> +// child process script +let cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"] + .getService(Ci.nsISyncMessageSender);</pre> + + <p>You can also access it as the <code>cpmm</code> property of <a href="/en-US/docs/Mozilla/JavaScript_code_modules/Services.jsm">Services.jsm</a>, if you are in the child process.</p> + </td> + </tr> + </tbody> +</table> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/performance/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/performance/index.html new file mode 100644 index 0000000000..3bcb04d88e --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/message_manager/performance/index.html @@ -0,0 +1,292 @@ +--- +title: 性能 +slug: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Performance +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Performance +--- +<div>{{FirefoxSidebar}}</div><p>着重讲几点框架脚本/消息管理器的使用方式和替代方法,以避免相关的性能缺陷。</p> + +<p>要牢记几点:</p> + +<ul> + <li>附加组件启动时注册的脚本将在会话恢复时被执行。较长的执行时间会使浏览器启动后的响应速度缓慢。</li> + <li>框架脚本还可以在未恢复的标签页上被执行。所有开销不止发生在已激活的标签页,而是取决于会话中的标签页总数。</li> +</ul> + +<div class="note"> +<p>下面的例子为了简洁,省略了一些样板代码</p> + +<p>“更好”的例子还省略了一些最佳实践。只是为了演示如何解决各子主题中描述的问题。</p> +</div> + +<h2 id="性能的最佳实践">性能的最佳实践</h2> + +<h3 id="每个进程中声明无状态函数">每个进程中声明无状态函数</h3> + +<p>不良:</p> + +<pre class="brush: js">// addon.js +<code>Services.mm.loadFrameScript</code>("framescript.js", true) +</pre> + +<pre class="brush: js">// framescript.js + +const precomputedConstants = // ... + +function helper(window, action) { + // ... do some work on the window +} + +function doSomething(message) { + result = helper(content, message.data) + sendAsyncMessage("my-addon:response-from-child", {something: result}) +} + +addMessageListener("my-addon:request-from-parent", doSomething) +</pre> + +<p> </p> + +<p>Why is this bad? Because declared functions are also objects. And since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block scopes must be set up etc.</p> + +<p>While it may seem fairly innocencous in this toy example, real scripts often have a lot more functions and initialize some fairly heavyweight objects.</p> + +<p>更好:</p> + +<p><em>addon.js 如上</em></p> + +<pre class="brush: js">// framescript.js +Components.utils.import("resource://my-addon/processModule.jsm", {}).addFrame(this) +</pre> + +<pre class="brush: js">// processModule.jsm + +const EXPORTED_SYMBOLS = ['addFrame']; + +const precomputedConstants = // ... + +function helper(window, action) { + // ... do some work on the window +} + +function doSomething(message) { + frameGlobal = message.target + result = helper(frameGlobal.content, message.data) + frameGlobal.sendAsyncMessage("my-addon:response-from-child", {something: result}) +} + +function addFrame(frameGlobal) { + frameGlobal.addMessageListener("my-addon:request-from-parent", doSomething) +} +</pre> + +<p><a href="/en-US/docs/Mozilla/JavaScript_code_modules/Using">Javascript modules</a> are per-process singletons and thus all their objects are only initialized once, which makes them suitable for stateless callbacks.<br> + <br> + But care must be taken to not leak references to the frame script global when it is passed into a JSM. Alternatively the frame's <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_environment">unload event</a> or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap">weak maps</a> can be used to ensure that frames can be cleaned up when their respective tab is closed.</p> + +<h3 id="每个进程中存放重量级的状态"><a name="per-process-state">每个进程中存放重量级的状态</a></h3> + +<p>不良:</p> + +<pre class="brush: js">// addon.js +var main = new MyAddonService(); + +main.onChange(stateChange); + +function stateChange() { + Services.mm.<code>broadcastAsyncMessage("my-addon:update-configuration", {newConfig: </code>main<code>.serialize()})</code> +} +</pre> + +<pre class="brush: js">// framescript.js +var mainCopy; + +function onUpdate(message) { + mainCopy = MyAddonService.deserialize(message.data.newConfig); +} + +addMessageListener("my-addon:update-configuration", onUpdate) + + +// mainCopy used by other functions +</pre> + +<p>The main issue here is that a separate object is kept for each tab. Not only does that increase memory footprint but the deserialization also has to be executed seperately for each tab, thus requiring more CPU time.</p> + +<p>不良:</p> + +<pre class="brush: js">// addon.js +var main = new MyAddonService(); + +main.onChange(stateChange); + +function stateChange() { + Services.ppmm.<code>broadcastAsyncMessage("my-addon:update-configuration", {newConfig: </code>main<code>.serialize()})</code> +}</pre> + +<pre class="brush: js">// processModule.jsm +const EXPORTED_SYMBOLS = ['getMainCopy']; + +var mainCopy; + +Services.cpmm.addMessageListener(<code>"my-addon:update-configuration"</code>, function(message) { + mainCopy = message.data.newConfig; +}) + +funtion getMainCopy() { + return mainCopy; +} + +</pre> + +<pre class="brush: js">// framescript.js +Components.utils.import("resource://my-addon/processModule.jsm") + +// getMainCopy() used by other functions +</pre> + +<p> </p> + +<h3 id="不要在框架脚本中注册观察者(及其他到全局服务的回调)">不要在框架脚本中注册观察者(及其他到全局服务的回调)</h3> + +<p>不良:</p> + +<pre class="brush: js">//framescript.js +Services.obs.addObserver("document-element-inserted", { + observe: function(doc, topic, data) { + if(doc.ownerGlobal.top != content) + return; // bail out if this is for another tab + decorateDocument(doc); + } +})</pre> + +<p>Observer notifications get fired for events that happen <em>anywhere</em> in the browser, they are not scoped to the current tab. If each framescript registers a seperate listener then the observed action will trigger the callbacks in all tabs.</p> + +<p>Additionally the example above does not clean unregister itself, thus leaking objects each time a tab is closed. Frame message manager message and event listeners are limited in their lifetime to that of the frame itself, this does not apply to observer registrations.</p> + +<p>更好:</p> + +<p><span style="display: none;"> </span><span style="display: none;"> </span><span style="display: none;"> </span><span style="display: none;"> </span> </p> + +<dl> + <dt>content-document-global-created 通知</dt> + <dd>可以用 <a href="/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Frame_script_environment">DOMWindowCreated</a> 事件取代</dd> + <dt>其他观察者和服务</dt> + <dd>应该在 <a href="/en-US/docs/Mozilla/Firefox/Multiprocess_Firefox/Message_Manager/Process_scripts">进程脚本</a> 中注册,或者用 JSM 代替</dd> +</dl> + +<p> </p> + +<h3 id="根据需要加载框架脚本">根据需要加载框架脚本</h3> + +<p>不良:</p> + +<pre class="brush: js">// addon.js +<code>Services.mm.loadFrameScript</code>("framescript.js", /*delayed:*/ true) + +// stuff communicating with the framescript +</pre> + +<pre class="brush: js">// framescript.js +function onlyOnceInABlueMoon() { + // we only need this during a total solar eclipse while goat blood rains from the sky + sendAsyncMessage('my-addon:paragraph-count', {num: content.document.querySelectorAll('p').length}) +} +addMessageListener("my-addon:request-from-parent", onlyOnceInABlueMoon) +</pre> + +<p>更好:</p> + +<pre class="brush: js">// addon.js +function onToolbarButton(event) { + let tabMM = gBrowser.mCurrentBrowser.frameLoader.messageManager; + let button = event.target; + let callback = (message) => { + tabMM.removeMessageListener("my-addon:paragraph-count", callback) + decorateButton(button, message.data.num) + } + tabMM.addMessageListener("my-addon:paragraph-count", callback); + tabMM.loadFrameScript("data:,sendAsyncMessage('my-addon:paragraph-count', {num: content.document.querySelectorAll('p').length})", false) +} + +function decorateButton(button, count) { + // do stuff with result +} +</pre> + +<p>This executes the script only when it is needed and only in one tab and allows it to be garbage-collected immediately after execution. As long as it the action does not happen frequently the memory and startup savings should outstrip the added cost of script evaluation.</p> + +<p>Delaying the script registration <a href="/en-US/docs/Observer_Notifications#Application_startup">until the session is restored</a> my provide some middle ground for some addons. It does not provide the same memory footprint reductions but it improves application startup.</p> + +<p> </p> + +<h3 id="向下推进信息,避免到父进程的调用">向下推进信息,避免到父进程的调用</h3> + +<p>不良:</p> + +<pre>// processscript.js + +function ContentPolicy() { + // ... +} + +Object.assign(ContentyPolicy.prototype, { + classDescription: ..., classID: ..., contractID: ..., + QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPolicy]), + + shouldLoad: function(type, location, origin, context) { + + let resultList = Services.cpmm.sendSyncMessage("my-addon:check-load", {destination: location, source: origin}) // <=== SYNC MESSAGE! + + if(resultList.every((r) => r == true)) + return Ci.nsIContentPolicy.<code>ACCEPT; + + return Ci.nsIContentPolicy.REJECT_REQUEST;</code> + } +}); + +// more boilerplate code here +</pre> + +<p>This example is a (somewhat condensed) <a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPolicy">content policy</a> which gets triggered for every network request in a child process to either allow or deny the request. Since the code calls to the parent process to check whether a specific request can be allowed it would slow down all page loads, as web pages generally issue dozens of requests.</p> + +<p>更好:</p> + +<p>Instead of only keeping the state in the parent an addon can employ a master-slave architecture where the parent has the authoritative state and replicates it to the child processes in advance so they can act based on their local copy.</p> + +<p>See the <a href="#per-process-state">previous chapter</a> on how to efficiently replicate addon state to each process.</p> + +<p> </p> + +<p> </p> + +<h3 id="附加组件卸载时的清理">附加组件卸载时的清理</h3> + +<p> </p> + +<p>不良:</p> + +<p>包括上述所有例子,*包括上述的“更好”*</p> + +<p>If your addon is restartless or uses the SDK then updates or the user turning it off and on will load to unload/reload events. Not handling those properly can lead to duplicate or conflicting code execution, especially when messages are sent. It can also lead to conflicts between the old and new code. Under some circumstances it may even cause exceptions when attempting to register something twice under the same ID.</p> + +<p>更好:</p> + +<pre class="brush: js">// addon.js +function onUnload() { + Services.mm.removeDelayedFrameScript("resources://my-addon/framescript.js"); + Services.ppmm.removeDelayedProcessScript("resources://my-addon/processcript.js"); + Services.mm.broadcastAsyncMessage("my-addon:unload"); + Services.ppmm.broadcastAsyncMessage("my-addon:unload"); +} +</pre> + +<p>在框架/进程脚本中:</p> + +<ul> + <li>移除各种监听器</li> + <li>移除观察者通知</li> + <li>移除自定义的类和服务</li> + <li><a href="/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.Sandbox#Freeing_the_sandbox">nuke 沙盒</a></li> + <li><a href="/en-US/docs/Mozilla/JavaScript_code_modules/Using#Unloading_code_modules">卸载 JSM</a></li> + <li>必要时还原内容 DOM 的状态,例如移除附加组件加入的不再需要的互动 UI 元素</li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/motivation/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/motivation/index.html new file mode 100644 index 0000000000..7ae3c2aaef --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/motivation/index.html @@ -0,0 +1,44 @@ +--- +title: 动机 +slug: Mozilla/Firefox/Multiprocess_Firefox/Motivation +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Motivation +--- +<div>{{FirefoxSidebar}}</div><p>使 Firefox 在单独的进程中运行内容的主要原因:性能、安全和稳定性。</p> + +<h2 id="性能">性能</h2> + +<p>Mozilla 在过去两年对性能的工作重点是浏览器的响应速度。目标是减少 “<a href="/en-US/docs/Glossary/Jank">jank</a>”—在加载大的页面时、表单中输入、或者滚动时,浏览器暂时性失去响应。响应问题在当今较高吞吐量的网络上日益显著。这些工作大部分已被 <a href="https://wiki.mozilla.org/Performance/Snappy">Snappy 项目</a>完成。主要的重点在:</p> + +<ul> + <li>将运行时间长的操作移入单独的线程,使主线程可以继续向用户做出响应。</li> + <li>异步或者在其他线程进行 I/O,使主线程不必等待磁盘。</li> + <li>将运行时间长的代码拆分成较短片段,并且在事件循环之间运行。增量式垃圾收集就是一个例子。</li> +</ul> + +<p>大部分能轻易做到的事情在这些领域已经完成。剩下的问题比较难以解决。举例来说,JavaScript 执行和布局都发生在主线程,并且阻挡着事件循环。在单独的线程中运行这些组件是困难的,因为它们访问数据,像是 DOM,它们不是线程安全的。作为替代方案,我们已经考虑让事件循环运行在 JavaScript 执行的中间,但这样做会毁掉大量 Firefox 其他地方做出的假设(更不用提附加组件)。</p> + +<p>在一个单独的进程中运行网络内容,是这些方法的一个不错的替代品。类似线程的方式,Firefox 可以在 JavaScript 和布局在内容进程中运行时运行事件循环。但是不同于线程,用户界面(UI)的代码不能访问内容 DOM 或者其他内容的数据结构,因此没有必要进行锁定或者线程安全。而不足之处是,理所当然的,任何在 Firefox UI 进程中运行的需要访问内容数据的代码,都必须明确的通过消息传递的方式来访问内容数据。</p> + +<p>我们觉得这种权衡有道理,有几个原因:</p> + +<ul> + <li>Firefox 代码访问内容 DOM 并不是很常见。</li> + <li>与 Firefox OS 共享的代码已经使用消息传递。</li> + <li>在多进程模型中,使用消息传递访问内容失败的 Firefox 代码将明显的失败,一致的方式。在线程模型中,没有适当锁定的访问内容的代码将以微妙的方式失败,很难调试。</li> +</ul> + +<h2 id="安全">安全</h2> + +<p>目前来说,如果某人发现了一个 Firefox 中的可利用漏洞,他们能够接管用户的计算机。有很多种技术来缓解这种问题,但其中最强大的是<a href="http://en.wikipedia.org/wiki/Sandbox_%28computer_security%29">沙盒</a>。从技术上讲,沙盒不需要多个进程。但是,涵盖沙盒的单进程 Firefox 并不会很有用。沙盒能阻止进程执行,一个乖巧进程绝不会做的操作。遗憾的是,乖巧的 Firefox 进程(尤其是已安装附加组件的 Firefox)会访问很多网络和文件系统。因此,对单进程的 Firefox 沙盒不能限制太多。</p> + +<p>在多进程 Firefox 中,内容进程将被沙盒化。一个乖巧的内容进程不会直接访问文件系统;它必须询问主线程来执行请求。在那时,主进程可以验证请求是否安全和合理。因此,对内容进程的沙盒化可以是相当严格的。我们希望这样的布局可以使 Firefox 更难被安全漏洞所利用。</p> + +<h2 id="稳定性">稳定性</h2> + +<p>目前来说,在网页中运行的代码出现崩溃将导致整个浏览器崩溃。而多进程 Firefox 中,只有崩溃的内容进程会被终止。</p> + +<div class="note"> +<p>此页面整合了很多 Bill McCloskey 的有关多进程 Firefox 的文章: <a href="http://billmccloskey.wordpress.com/2013/12/05/multiprocess-firefox/">http://billmccloskey.wordpress.com/2013/12/05/multiprocess-firefox/</a></p> +</div> + +<p> </p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/tab_selection_in_multiprocess_firefox/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/tab_selection_in_multiprocess_firefox/index.html new file mode 100644 index 0000000000..f396b7dcb5 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/tab_selection_in_multiprocess_firefox/index.html @@ -0,0 +1,21 @@ +--- +title: 多进程 Firefox 中的标签选择 +slug: Mozilla/Firefox/Multiprocess_Firefox/Tab_selection_in_multiprocess_Firefox +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Tab_selection_in_multiprocess_Firefox +--- +<div>{{FirefoxSidebar}}</div><p>在单进程的 Firefox 中,当用户切换标签页时,这是同步操作。当浏览器加载新选择的标签页时,浏览器会阻塞,然后切换到该标签页。这表示标签页选定是通过设置 XUL 的 tab 对象的 <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code> 属性。代码(包括浏览器代码、扩展或主题)想要更改选定标签页的外观时,可以使用 <code>selected</code> 属性来应用 CSS 到该标签页。</p> + +<p>在多进程的 Firefox 中,标签页切换是异步的。在用户切换标签页时,chrome 进程发送一个请求到内容进程来加载该页面到新选择的标签页。chrome 进程中的函数会立即返回,以便其他代码可以运行。一旦内容进程准备就绪,它发回一个消息到 chrome 进程,然后在用户界面中切换标签页。</p> + +<p>还有 chrome 进程中的计时器:如果内容进程在计时器到期前没有响应,那么浏览器虽然继续切换标签页,但也显示一个包含标识的空标签页,直到目前的内容进程完成页面的加载。目前的计时器被设定为300毫秒。</p> + +<p>还有,相应的,两个属性用于指示标签页选择:</p> + +<ul> + <li>旧的 <code><a href="/en-US/docs/XUL/Attribute/selected">selected</a></code> 属性是同步设置,在进程的开始。它表示标签页选择已经开始,但在用户界面还没有被更新。</li> + <li>新的属性 <code><a href="/en-US/docs/Mozilla/Tech/XUL/Attribute/visuallyselected">visuallyselected</a></code> 现在表示浏览器在用户界面已实际更新(显示)的标签页,包括内容进程已就绪或者计时器已过期这两种情况。</li> +</ul> + +<p>这意味着想要对当前选中标签页应用的样式需要使用 <code>visuallyselected</code> 属性。如果使用 <code>selected</code> 属性,那么在新选择的标签页的样式被更新时会有一个短暂的断层,浏览器仍然在显示旧的标签页的内容。</p> + +<footer class="entry-meta"> </footer> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/technical_overview/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/technical_overview/index.html new file mode 100644 index 0000000000..18917fabc4 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/technical_overview/index.html @@ -0,0 +1,164 @@ +--- +title: 技术概述 +slug: Mozilla/Firefox/Multiprocess_Firefox/Technical_overview +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Technical_overview +--- +<div>{{FirefoxSidebar}}</div><div class="note"> +<p>这个页面主要是 Bill McCloskey 的关于多进程 Firefox 的摘要: <a class="external external-icon" href="http://billmccloskey.wordpress.com/2013/12/05/multiprocess-firefox/">http://billmccloskey.wordpress.com/2013/12/05/multiprocess-firefox/</a></p> +</div> + +<p>从总体上来看,多进程 Firefox 的运行方式如下。当 Firefox 启动时的进程被称为父进程。起初和单程 Firefox 一样:打开一个窗口用于显示<code><a href="http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.xul">browser.xul</a>,它</code>包含主要的 UI 元素。XUL是Firefox的GUI工具箱, 由它提供了类似Web HTML的方式来声明定义UI元素。Firefox 的 UI也有一个<code>window</code> 对象。它有一个<code>document</code> 属性,并含了在 <code>browser.xul</code> 中所有的XML元素。所有的菜单,工具栏,侧边栏和标签页都是 <code>document</code> 下的 XML 元素。每一个标签页(tab)都包含一个 <code><browser></code> 元素用来显示网页内容.</p> + +<p>多进程与单进程的最主要区别是每个 <code><browser></code> 都有一个<code>remote="true"</code> 的属性。当这个 browser 元素被添加到 document 时,将会启动一个新的内容进程,也称为子进程。同时创建一个跨进程通信的IPC通道。开始时子进程显示<code> about:blank</code>,父进程通过给子进程发送命令来导航显示的内容。</p> + +<h2 id="绘制"><strong id="drawing">绘制</strong></h2> + +<p>有时,显示的网页内容需要从子进程传递到父进程然后再显示到屏幕。多进程模式依赖于一个新的特性(<a href="http://benoitgirard.wordpress.com/2012/05/15/off-main-thread-compositing-omtc-and-why-it-matters/"><em>off main thread compositing</em></a> ,OMTC)。简单来说,每个窗口被分成若干层,概念上类似于photoshop中的层。每一次Firefox进行渲染时,这些层被提交到合成线程来构建为一个图片。</p> + +<p>层是树状结构。树的根节点对应一个Firefox窗口。根节点层包其他子层,如绘制菜单和标签页。一个子树对应所有网页内容。网页内容可被分成更多的层,这些层都以同一个内容层为根节点。</p> + +<p>在多进程Firefox中,内容层的子树是一个垫片(shim)。在大多数时间,它包含一个能够简单地保持到子进程的通信链接的引用的占位符节点。内容进程包括网页内容的层树。它构建并且描绘这个层树。当描绘完成时,它通过IPC将层数的结构发送给父进程。当父进程受到这个层树时,它删除这个占位符内容节点并且将其替换为源于内容的实际树。然后它正常地合成并且绘制。当它完成后,它将占位符放回。</p> + +<p>因为Firefox OS的需要,OMTC怎样于多进程一起工作的基本构架已经存在了一段时间。然而,Matt Woodrow和 David Anderson已经完成了大量工作来使得其在Windows,Mac和Linux正常工作。一个巨大的挑战是使多进程Firefox能够在所有平台下都能使OMTC启动。现在,只有Macs默认使用OMTC。</p> + +<h2 id="用户输入"><strong id="input">用户输入</strong></h2> + +<p>Events in Firefox work the same way as they do on the web. Namely, there is a DOM tree for the entire window, and events are threaded through this tree in capture and bubbling phases. Imagine that the user clicks on a button on a web page. In single-process Firefox, the root DOM node of the Firefox window gets the first chance to process the event. Then, nodes lower down in the DOM tree get a chance. The event handling proceeds down through to the XUL <code><browser></code> element. At this point, nodes in the web page’s DOM tree are given a chance to handle the event, all the way down to the button. The bubble phase follows, running in the opposite order, all the way back up to the root node of the Firefox window.</p> + +<p>With multiple processes, event handling works the same way until the <code><browser></code> element is hit. At that point, if the event hasn’t been handled yet, it gets sent to the child process by IPC, where handling starts at the root of the content DOM tree. The parent process then waits to run its bubbling phase until the content process has finished handling the event.</p> + +<h2 id="进程间通信"><strong id="ipc">进程间通信</strong></h2> + +<p>所有 IPC 使用 Chromium IPC 程序库。每个子进程都有单独的与父进程的 IPC 链接。子进程之间不能直接通信。为了避免死锁和确保响应能力,父进程不允许坐等子进程的消息。但是,子进程可以阻塞等待父进程的消息。</p> + +<p>相比于人们预期的直接通过 IPC 发送数据包,我们使用代码生成使这个过程更漂亮。IPC 协议在 <a href="https://wiki.mozilla.org/IPDL">IPDL</a> 中定义, which sort of stands for “inter-* protocol definition language”. A typical IPDL file is <code><a href="http://mxr.mozilla.org/mozilla-central/source/netwerk/ipc/PNecko.ipdl">PNecko.ipdl</a></code>. It defines a set messages and their parameters. Parameters are serialized and included in the message. To send a message <code>M</code>, C++ code just needs to call the method <code>SendM</code>. To receive the message, it implements the method <code>RecvM</code>.</p> + +<p>IPDL is used in all the low-level C++ parts of Gecko where IPC is required. In many cases, IPC is just used to forward actions from the child to the parent. This is a common pattern in Gecko:</p> + +<pre class="brush: cpp">void AddHistoryEntry(param) { + if (XRE_GetProcessType() == GeckoProcessType_Content) { + // If we're in the child, ask the parent to do this for us. + SendAddHistoryEntry(param); + return; + } + + // Actually add the history entry... +} + +bool RecvAddHistoryEntry(param) { + // Got a message from the child. Do the work for it. + AddHistoryEntry(param); + return true; +} +</pre> + +<p>When <code>AddHistoryEntry</code> is called in the child, we detect that we’re inside the child process and send an IPC message to the parent. When the parent receives that message, it calls <code>AddHistoryEntry</code> on its side.</p> + +<p>For a more realistic illustration, consider the Places database, which stores visited URLs for populating the awesome bar. Whenever the user visits a URL in the content process, we call <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/History.cpp?rev=8b9687f6c602#2326">this code</a>. Notice the content process check followed by the <code>SendVisitURI</code> call and an immediate return. The message is received <a href="http://mxr.mozilla.org/mozilla-central/source/dom/ipc/ContentParent.cpp?rev=fecda5f4a0df#2666">here</a>; this code just calls <code>VisitURI</code> in the parent.</p> + +<p>The code for IndexedDB, the places database, and HTTP connections all runs in the parent process, and they all use roughly the same proxying mechanism in the child.</p> + +<h2 id="框架脚本"><strong id="contentscripts">框架脚本</strong></h2> + +<p>IPDL takes care of passing messages in C++, but much of Firefox is actually written in JavaScript. Instead of using IPDL directly, JavaScript code relies on <a href="/en-US/Firefox/Multiprocess_Firefox/The_message_manager">the message manager</a> to communicate between processes. To use the message manager in JS, you need to get hold of a message manager object. There is a global message manager, message managers for each Firefox window, and message managers for each <code><browser></code> element. A message manager can be used to load JS code into the child process and to exchange messages with it.</p> + +<p>As a simple example, imagine that we want to be informed every time a <code>load</code> event triggers in web content. We’re not interested in any particular browser or window, so we use the global message manager. The basic process is as follows:</p> + +<pre class="brush: js">// Get the global message manager. +let mm = Cc["@<span class="skimlinks-unlinked">mozilla.org/globalmessagemanager;1</span>"]. + getService(Ci.nsIMessageListenerManager); + +// Wait for load event. +mm.addMessageListener("GotLoadEvent", function (msg) { + dump("Received load event: " + <span class="skimlinks-unlinked">msg.data.url</span> + "\n"); +}); + +// Load code into the child process to listen for the event. +mm.loadFrameScript("chrome://content/<span class="skimlinks-unlinked">content-script.js</span>", true); +</pre> + +<p>For this to work, we also need to have a file <code>content-script.js</code>:</p> + +<pre class="brush: js">// Listen for the load event. +addEventListener("load", function (e) { + // Inform the parent process. + let docURL = content.document.documentURI; + sendAsyncMessage("GotLoadEvent", {url: docURL}); +}, false); +</pre> + +<p>This file is called a <em>frame script</em>. When the <code>loadFrameScript</code> function call runs, the code for the script is run once for each <code><browser></code> element. This includes both remote browsers and regular ones. If we had used a per-window message manager, the code would only be run for the browser elements in that window. Any time a new browser element is added, the script is run automatically (this is the purpose of the <code>true</code> parameter to <code>loadFrameScript</code>). Since the script is run once per browser, it can access the browser’s window object and docshell via the <code>content</code> and <code>docShell</code> globals.</p> + +<p>The great thing about frame scripts is that they work in both single-process and multiprocess Firefox. To learn more about the message manager, see the <a href="/en-US/Firefox/Multiprocess_Firefox/The_message_manager">message manager guide</a>.</p> + +<h2 id="跨进程_API"><strong id="shims">跨进程 API</strong></h2> + +<p>There are a lot of APIs in Firefox that cross between the parent and child processes. An example is the <code>webNavigation</code> property of XUL <code><browser></code> elements. The <code>webNavigation</code> property is an object that provides methods like <code>loadURI</code>, <code>goBack</code>, and <code>goForward</code>. These methods are called in the parent process, but the actions need to happen in the child. First I’ll cover how these methods work in single-process Firefox, and then I’ll describe how we adapted them for multiple processes.</p> + +<p>The <code>webNavigation</code> property is defined using the XML Binding Language (XBL). XBL is a declarative language for customizing how XML elements work. Its syntax is a combination of XML and JavaScript. Firefox uses XBL extensively to customize XUL elements like <code><browser></code> and <code><tabbrowser></code>. The <code><browser></code> customizations reside in <code><a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/browser.xml?rev=754cf7fc84cd">browser.xml</a></code>. <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/browser.xml?rev=754cf7fc84cd#262">Here</a> is how <code>browser.webNavigation</code> is defined:</p> + +<pre class="brush: xml"><field name="_webNavigation">null</field> + +<property name="webNavigation" readonly="true"> + <getter> + <![CDATA[ + if (!this._webNavigation) + this._webNavigation = this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation); + return this._webNavigation; + ]]> + </getter> +</property> +</pre> + +<p>This code is invoked whenever JavaScript code in Firefox accesses <code>browser.webNavigation</code>, where <code>browser</code> is some <code><browser></code> element. It checks if the result has already been cached in the <code>browser._webNavigation</code> field. If it hasn’t been cached, then it fetches the navigation object based off the browser’s <em>docshell</em>. The docshell is a Firefox-specific object that encapsulates a lot of functionality for loading new pages, navigating back and forth, and saving page history. In multiprocess Firefox, the docshell lives in the child process. Since the <code>webNavigation</code> accessor runs in the parent process, <code>this.docShell</code> above will just return null. As a consequence, this code will fail completely.</p> + +<p>One way to fix this problem would be to create a fake docshell in C++ that could be returned. It would operate by sending IPDL messages to the real docshell in the child to get work done. We may eventually take this route in the future. We decided to do the message passing in JavaScript instead, since it’s easier and faster to prototype things there. Rather than change every docshell-using accessor to test if we’re using multiprocess browsing, we decided to create a new XBL binding that applies only to remote <code><browser></code> elements. It is called <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/remote-browser.xml?rev=9583bd3099ae"><code>remote-browser.xml</code></a>, and it extends the existing <code>browser.xml</code> binding.</p> + +<p>The <code>remote-browser.xml</code> binding returns a JavaScript <em>shim object</em> whenever anyone uses <code>browser.webNavigation</code> or other similar objects. The shim object is implemented <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/RemoteWebNavigation.jsm">in its own JavaScript module</a>. It uses the message manager to send messages like <code>"WebNavigation:LoadURI"</code> to <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/content/browser-child.js?rev=9583bd3099ae#107">a content script loaded by <code>remote-browser.xml</code></a>. The content script performs the actual action.</p> + +<p>The shims we provide emulate their real counterparts imperfectly. They offer enough functionality to make Firefox work, but add-ons that use them may find them insufficient. I’ll discuss strategies for making add-ons work in more detail later.</p> + +<h2 id="跨进程对象包装器"><strong id="cpows">跨进程对象包装器</strong></h2> + +<p>The message manager API does not allow the parent process to call <code>sendSyncMessage</code>; that is, the parent is not allowed to wait for a response from the child. It’s detrimental for the parent to wait on the child, since we don’t want the browser UI to be unresponsive because of slow content. However, converting Firefox code to be asynchronous (i.e., to use <code>sendAsyncMessage</code> instead) can sometimes be onerous. As an expedient, we’ve introduced a new primitive that allows code in the parent process to access objects in the child process synchronously.</p> + +<p>These objects are called cross-process object wrappers, frequently abbreviated to CPOWs. They’re created using the message manager. Consider this example content script:</p> + +<pre class="brush: js">addEventListener("load", function (e) { + let doc = content.document; + sendAsyncMessage("GotLoadEvent", <strong>{}, {document: doc}</strong>); +}, false); +</pre> + +<p>In this code, we want to be able to send a reference to the document to the parent process. We can’t use the second parameter to <code>sendAsyncMessage</code> to do this: that argument is converted to JSON before it is sent up. The optional third parameter allows us to send object references. Each property of this argument becomes accessible in the parent process as a CPOW. Here’s what the parent code might look like:</p> + +<pre class="brush: js">let mm = Cc["@<span class="skimlinks-unlinked">mozilla.org/globalmessagemanager;1</span>"]. + getService(Ci.nsIMessageListenerManager); + +mm.addMessageListener("GotLoadEvent", function (msg) { + let uri = <strong>msg.objects.document.documentURI</strong>; + dump("Received load event: " + uri + "\n"); +}); +mm.loadFrameScript("chrome://content/<span class="skimlinks-unlinked">content-script.js</span>", true); +</pre> + +<p>It’s important to realize that we’re send object <em>references</em>. The <code>msg.objects.document</code> object is only a wrapper. The access to its <code>documentURI</code> property sends a synchronous message down to the child asking for the value. The dump statement only happens after a reply has come back from the child.</p> + +<p>Because every property access sends a message, CPOWs can be slow to use. There is no caching, so 1,000 accesses to the same property will send 1,000 messages.</p> + +<p>Another problem with CPOWs is that they violate some assumptions people might have about message ordering. Consider this code:</p> + +<pre class="brush: js">mm.addMessageListener("GotLoadEvent", function (msg) { + mm.sendAsyncMessage("ChangeDocumentURI", {newURI: "<span class="skimlinks-unlinked">hello.com</span>"}); + let uri = <strong>msg.objects.document.documentURI</strong>; + dump("Received load event: " + uri + "\n"); +}); +</pre> + +<p>This code sends a message asking the child to change the current document URI. Then it accesses the current document URI via a CPOW. You might expect the value of <code>uri</code> to come back as <code>"hello.com"</code>. But it might not. In order to avoid deadlocks, CPOW messages can bypass normal messages and be processed first. It’s possible that the request for the <code>documentURI</code> property will be processed before the <code>"ChangeDocumentURI"</code> message, in which case <code>uri</code> will have some other value.</p> + +<p>For this reason, it’s best not to mix CPOWs with normal message manager messages. It’s also a bad idea to use CPOWs for anything security-related, since you may not get results that are consistent with surrounding code that might use the message manager.</p> + +<p>Despite these problems, we’ve found CPOWs to be useful for converting certain parts of Firefox to be multiprocess-compatible. It’s best to use them in cases where users are less likely to notice poor responsiveness. As an example, we use CPOWs to implement the context menu that pops up when users right-click on content elements. Whether this code is asynchronous or synchronous, the menu cannot be displayed until content has responded with data about the element that has been clicked. The user is unlikely to notice if, for example, tab animations don’t run while waiting for the menu to pop up. Their only concern is for the menu to come up as quickly as possible, which is entirely gated on the response time of the content process. For this reason, we chose to use CPOWs, since they’re easier than converting the code to be asynchronous.</p> + +<p>It’s possible that CPOWs will be phased out in the future. Asynchronous messaging using the message manager gives a user experience that is at least as good as, and often strictly better than, CPOWs. We strongly recommend that people use the message manager over CPOWs when possible. Nevertheless, CPOWs are sometimes useful.</p> diff --git a/files/zh-cn/mozilla/firefox/multiprocess_firefox/which_uris_load_where/index.html b/files/zh-cn/mozilla/firefox/multiprocess_firefox/which_uris_load_where/index.html new file mode 100644 index 0000000000..df24c59988 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/multiprocess_firefox/which_uris_load_where/index.html @@ -0,0 +1,53 @@ +--- +title: 各类 URI 在哪里加载 +slug: Mozilla/Firefox/Multiprocess_Firefox/Which_URIs_load_where +translation_of: Mozilla/Firefox/Multiprocess_Firefox/Which_URIs_load_where +--- +<div>{{FirefoxSidebar}}</div><p>浏览器加载一个页面到 chrome 或者内容进程,基于它的 URI 方案(URI scheme)。对于某些方案,你可以改变默认行为。</p> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Scheme</th> + <th scope="col">Behavior</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>about:</code></td> + <td> + <p>默认情况下,<code>about:</code> 页面始终在 chrome 进程加载。但是,在你注册新的 <code>about:</code> 页面时,你可以改变此默认值。</p> + + <p>两个新标志定义在 <code><a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/about/nsIAboutModule.idl">nsIAboutModule</a></code>:</p> + + <ul> + <li><code>URI_CAN_LOAD_IN_CHILD</code>: 页面将加载在加载它的 <code><a href="/en-US/docs/XUL/browser">browser</a></code> 所在的进程。</li> + <li><code>URI_MUST_LOAD_IN_CHILD</code>: 页面将始终加载在一个子进程</li> + </ul> + + <p>要使用上述任一标志,在你的 <a href="/en-US/docs/Custom_about:_URLs">注册 <code>about:</code> URI 的代码</a> 的 <code>getURIFlags</code> 实现中返回它。</p> + </td> + </tr> + <tr> + <td><code>chrome:</code></td> + <td> + <p><code>默认情况下,chrome:</code> 页面始终加载在 chrome 进程。但是,在你注册新的 <code>chrome:</code> 页面时,你可以改变此默认值。</p> + + <p>两个新标志定义在 <a href="/en-US/docs/Chrome_Registration">chrome.manifest 文件</a>:</p> + + <ul> + <li>remoteenabled: 页面将加载在加载它的 <code><a href="/en-US/docs/XUL/browser">browser</a></code> 所在的进程。</li> + <li>remoterequired: 页面将始终加载在一个子进程</li> + </ul> + </td> + </tr> + <tr> + <td><code>file:</code></td> + <td>始终在内容进程中加载。</td> + </tr> + <tr> + <td><code>resource:</code></td> + <td>始终在内容进程中加载。</td> + </tr> + </tbody> +</table> diff --git a/files/zh-cn/mozilla/firefox/privacy/index.html b/files/zh-cn/mozilla/firefox/privacy/index.html new file mode 100644 index 0000000000..e9a4126aa6 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/privacy/index.html @@ -0,0 +1,22 @@ +--- +title: 隐私 +slug: Mozilla/Firefox/Privacy +tags: + - 安全 + - 隐私 +translation_of: Mozilla/Firefox/Privacy +--- +<div>{{FirefoxSidebar}}</div> + +<p class="summary">本文档是所有隐私相关的文档的列表。</p> + +<p>{{ ListSubpages () }}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li><a href="https://support.mozilla.org/zh-CN/products/firefox/privacy-and-security">隐私与安全设置 | Firefox 帮助</a></li> + <li><a href="/zh-CN/docs/Web/Security"> +Web 安全 +</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/errors/index.html b/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/errors/index.html new file mode 100644 index 0000000000..a1e1f54a75 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/errors/index.html @@ -0,0 +1,24 @@ +--- +title: Errors +slug: Mozilla/Firefox/Privacy/Storage_access_policy/Errors +tags: + - Cookies + - Errors + - NeedsTranslation + - Storage + - TopicStub + - storage access policy +translation_of: Mozilla/Firefox/Privacy/Storage_access_policy/Errors +--- +<div>{{FirefoxSidebar}}</div> + +<p>This page lists the errors that can be raised due to Firefox's anti-tracking functionality, governed by the <a href="/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy">Storage access policy</a>. You can find further information about them by clicking on the links below:</p> + +<p>A request to access cookies or storage was blocked because</p> + +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy/Errors/CookieBlockedByPermission">of custom cookie permission</a></li> + <li><a href="/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy/Errors/CookieBlockedTracker">it came from a tracker and content blocking is enabled</a></li> + <li><a href="/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy/Errors/CookieBlockedAll">we are blocking all storage access requests</a></li> + <li><a href="/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy/Errors/CookieBlockedForeign">we are blocking all third-party storage access requests and content blocking is enabled</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/errors/禁用外部cookie/index.html b/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/errors/禁用外部cookie/index.html new file mode 100644 index 0000000000..d2c05cd375 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/errors/禁用外部cookie/index.html @@ -0,0 +1,39 @@ +--- +title: 禁用:所有第三方存储访问请求 +slug: Mozilla/Firefox/Privacy/Storage_access_policy/Errors/禁用外部Cookie +tags: + - cookie + - 存储 + - 存储访问策略 + - 跟踪 + - 错误 +translation_of: Mozilla/Firefox/Privacy/Storage_access_policy/Errors/CookieBlockedForeign +--- +<div>{{FirefoxSidebar}}</div> + +<h2 id="消息">消息</h2> + +<p>Firefox:</p> + +<pre class="syntaxbox">禁用外部Cookie:由于浏览器禁用第三方内容展示及存储访问请求,Cookie和存储访问被拦截无法使用。</pre> + +<h2 id="出现此类情形的原因?">出现此类情形的原因?</h2> + +<p>由于浏览器禁用第三方内容的选项被开启,因此第三方Cookie使用请求和存储请求被拦截了。</p> + +<p>通过以下操作可以修改权限或移除站点:</p> + +<ul> + <li>跳转到 <em>首选项 > 隐私与安全 > 内容拦截</em></li> + <li>点击 <em>管理例外</em> 按钮添加例外</li> + <li>选中 <em>自定义</em> 内容拦截并取消 <em>Cookie</em> 前面的勾</li> +</ul> + +<p>如果被拦截的资源不需要进行身份验证,你也可以给相关元素添加 <code>crossorigin="anonymous"</code> 属性来达到消除警告的目的。</p> + +<h2 id="相关资料">相关资料</h2> + +<ul> + <li><a href="https://support.mozilla.org/zh-CN/kb/%E5%86%85%E5%AE%B9%E6%8B%A6%E6%88%AA">内容拦截</a> on <a href="https://support.mozilla.org">support.mozilla.org</a></li> + <li><a href="https://developer.mozilla.org/zh-CN/docs/Web/HTML/CORS_settings_attributes"><code>crossorigin</code> 属性</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/index.html b/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/index.html new file mode 100644 index 0000000000..801d5bfad1 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/privacy/storage_access_policy/index.html @@ -0,0 +1,261 @@ +--- +title: 'Storage access policy: Block cookies from trackers' +slug: Mozilla/Firefox/Privacy/Storage_access_policy +tags: + - NeedsTranslation + - Privacy + - TopicStub + - storage access policy + - tracking protection +translation_of: Mozilla/Firefox/Privacy/Storage_access_policy +--- +<div>{{FirefoxSidebar}}</div> + +<p class="summary">Firefox includes a new storage access policy that blocks cookies and other site data from third-party tracking resources. This policy is designed as an alternative to the <a href="/en-US/docs/Mozilla/Cookies_Preferences">older cookie policies</a>, which have been available in Firefox for many years. This policy protects against cross-site tracking while minimizing the site breakage associated with traditional cookie blocking. This article explains how the policy works and how you can test it.</p> + +<h2 id="Testing_in_Firefox">Testing in Firefox</h2> + +<p>This cookie policy has been available in Firefox since version 63. This documentation describes the policy that we intend to ship to Firefox Release users, but may not match what is implemented in the current Release version of Firefox. That's because we document new aspects of the policy as soon as they land in <a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">Firefox Nightly</a>, our pre-release channel. Firefox Nightly may also contain experimental features that we don't yet plan to ship to Release users; experimental features will not be included in this documentation, but may nevertheless impact the functionality of domains classified as trackers.</p> + +<p>We recommend sites test with <a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly">Firefox Nightly</a>, as this includes the newest version of our protections. As described above, note that Nightly may include additional protections that end up getting removed or changed before they reach our Release users. We’ll keep this page updated with the newest information as we strengthen our protections.</p> + +<p>These protections are on by default in Nightly. The cookie policy can be enabled in other versions of Firefox through the <a href="https://support.mozilla.org/en-US/kb/content-blocking">Content Blocking settings</a> (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate Firefox version).</p> + +<h3 id="Report_Broken_Sites">Report Broken Sites</h3> + +<p>If you find a website broken as a result of this change, file a bug under the Tracking Protection component within the Firefox product on <a href="https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&blocked=1480137&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&cf_platform_rel=---&cf_status_firefox62=---&cf_status_firefox63=---&cf_status_firefox64=---&cf_status_firefox_esr60=---&cf_status_geckoview62=---&cf_tracking_firefox62=---&cf_tracking_firefox63=---&cf_tracking_firefox64=---&cf_tracking_firefox_esr60=---&cf_tracking_firefox_relnote=---&cf_tracking_geckoview62=---&component=Tracking%20Protection&contenttypemethod=list&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-203=X&flag_type-37=X&flag_type-41=X&flag_type-5=X&flag_type-607=X&flag_type-721=X&flag_type-737=X&flag_type-748=X&flag_type-787=X&flag_type-799=X&flag_type-800=X&flag_type-803=X&flag_type-835=X&flag_type-846=X&flag_type-855=X&flag_type-864=X&flag_type-914=X&flag_type-916=X&flag_type-929=X&flag_type-930=X&flag_type-933=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=Firefox&rep_platform=Unspecified&target_milestone=---&version=unspecified">Bugzilla</a>. Alternatively you can report broken sites directly in Firefox by clicking "Report a Problem" in the Content Blocking section of the <a href="https://support.mozilla.org/en-US/kb/control-center-site-privacy-and-security-firefox">Control Center</a> (this shortcut may not be available in all versions of Firefox).</p> + +<h2 id="Tracking_protection_explained">Tracking protection explained</h2> + +<p>How does Firefox determine which resources are tracking resources?</p> + +<p>Firefox uses the Tracking Protection list to determine which resources are tracking resources. The Tracking Protection list is <a href="https://github.com/disconnectme/disconnect-tracking-protection/issues">maintained by Disconnect</a>. When the list is applied in Firefox, we make two important changes:</p> + +<ul> + <li>First, we only use the "Basic Protection" version of the list, which <a href="https://github.com/mozilla-services/shavar-prod-lists#blacklist">excludes some categories of trackers</a>. In the future, we may expand our protections to use the "Strict Protection" version of the list.</li> + <li>Second, Firefox uses an additional "<a href="https://github.com/mozilla-services/shavar-prod-lists/blob/master/disconnect-entitylist.json">entity list</a>", which prevents <a href="https://github.com/mozilla-services/shavar-prod-lists#entity-list">domains from being classified as trackers when they are loaded on a top-level site owned by the same organization</a>.</li> +</ul> + +<p>Firefox uses the built-in <a href="https://support.mozilla.org/en-US/kb/tracking-protection">Tracking Protection</a> URL classifier to determine which resources match the tracking protection list. Domains are matched against the list in accordance with the <a href="https://developers.google.com/safe-browsing/v4/urls-hashing#suffixprefix-expressions">SafeBrowsing v4 specification</a>. Specifically, we check the exact hostname of the resource against the list, as well as the last four hostnames formed by starting with the last five components and successively removing the leading component. Consider the following examples:</p> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Hostname on the list</th> + <th scope="col">Hostname of resource</th> + <th scope="col">Matched</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>example.com</code></td> + <td><code>example.com</code></td> + <td>Yes</td> + </tr> + <tr> + <td><code>example.com</code></td> + <td><code>a.b.example.com</code></td> + <td>Yes</td> + </tr> + <tr> + <td><code>blah.example.com</code></td> + <td><code>example.com</code></td> + <td>No</td> + </tr> + <tr> + <td><code>a.b.example.com</code></td> + <td><code>c.d.example.com</code></td> + <td>No</td> + </tr> + <tr> + <td><code>blah.example.com</code></td> + <td><code>foo.blah.example.com</code></td> + <td>Yes</td> + </tr> + </tbody> +</table> + +<h2 id="What_does_the_storage_access_policy_block">What does the storage access policy block?</h2> + +<p>The storage access policy blocks resources identified as trackers from accessing their cookies and other site storage when they are loaded in a third-party context. This prevents those resources from retrieving tracking identifiers stored in cookies or site storage and using them to identify users across visits to multiple first parties. Specifically, Firefox does this by imposing the following restrictions:</p> + +<p>Cookies:</p> + +<ul> + <li>Block {{httpheader("Cookie")}} request headers and ignore {{httpheader("Set-Cookie")}} response headers.</li> + <li>Return an empty string for calls to {{domxref("Document.cookie")}} and ignore requests to set cookies via <code>Document.cookie</code>.</li> +</ul> + +<p>DOM Storage:</p> + +<ul> + <li><a href="/en-US/docs/Web/API/Web_Storage_API">localStorage</a>: <code><a href="/en-US/docs/Web/API/Window/localStorage">Window.localStorage</a></code>: read and write attempts throw a <code>SecurityError</code> exception. Prior to Firefox 70: <code><a href="/en-US/docs/Web/API/Window/localStorage">Window.localStorage</a></code> is <code>null</code>. Thus, attempts to read and write using this object will throw a <code>TypeError</code> exception.</li> + <li><a href="/en-US/docs/Web/API/Web_Storage_API">sessionStorage</a>: read and write attempts are permitted.</li> + <li><a href="/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a>: read and write attempts throw a <code>SecurityError</code> exception.</li> +</ul> + +<p>Messaging and Workers:</p> + +<ul> + <li><a href="/en-US/docs/Web/API/Broadcast_Channel_API">Broadcast Channel</a>: attempts to create a new {{domxref("BroadcastChannel")}} will throw a <code>SecurityError</code> exception.</li> + <li><a href="/en-US/docs/Web/API/Web_Workers_API">Shared Worker</a>: attempts to create a new {{domxref("SharedWorker")}} will throw a <code>SecurityError</code> exception.</li> + <li><a href="/en-US/docs/Web/API/Service_Worker_API">Service Worker</a>: attempts to create a new {{domxref("ServiceWorker")}} will throw a <code>SecurityError</code> exception.</li> +</ul> + +<p>DOM Cache:</p> + +<ul> + <li>Calls to {{domxref("CacheStorage")}} will always reject with a <code>SecurityError</code>.</li> +</ul> + +<p>Browser caches:</p> + +<ul> + <li>The <a href="/en-US/docs/Mozilla/HTTP_cache">HTTP cache</a>, the Image cache, and the <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Svc">Alternative Services (Alt-Svc) cache</a> are all partitioned for tracking resources, such that each top-level origin will have a separate partition and tracking resources on different top-level origins will be cached separate from each other.</li> +</ul> + +<p>Network connections:</p> + +<ul> + <li><a href="https://wiki.mozilla.org/Security/Server_Side_TLS#Session_Resumption">TLS sessions</a> will not be resumed using a session ticket when an HTTPS connection is made to an embedded third-party resource that is classified as a tracker.</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Connection_management_in_HTTP_1.x#Persistent_connections">HTTP connection reuse</a> by domains classified as trackers is limited to requests that occur under the same top-level origin. For example, a request for content from tracker.example on news.example will not reuse an HTTP connection with a request for content from tracker.example on shopping.example or with requests that occur when tracker.example is visited directly (i.e., as a first party).</li> +</ul> + +<h3 id="What_is_not_blocked_by_the_policy">What is not blocked by the policy?</h3> + +<ol> + <li>This policy does not currently restrict third-party storage access for resources that are not classified as tracking resources. We may choose to apply additional restrictions to third-party storage access in the future.</li> + <li>The restrictions applied by the policy will not prevent third-party scripts classified as tracking resources from accessing storage in the main context of the page. These scripts can continue to use storage scoped to the top-level origin.</li> + <li>Origins classified as trackers will have access to their own storage when they are loaded in a first-party context.</li> + <li>Cross-origin resources loaded from the same eTLD+1 as the top-level context will still have access to their storage.</li> + <li>Origins normally classified as trackers will <a href="https://github.com/mozilla-services/shavar-prod-lists#entity-list">not be blocked if the top-level page origin is determined to be from the same organization as them</a>.</li> +</ol> + +<h2 id="Storage_access_grants">Storage access grants</h2> + +<p>In order to improve web compatibility and permit third-party integrations that require storage access, Firefox will grant storage access scoped to the first party for a particular third-party origin as described in this section. Currently, Firefox includes some web compatibility heuristics that grant storage access to third-party resources classified as trackers when a user interacts with those third parties. We do this when we expect that not granting access would cause the web page to break. We also support an initial implementation of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API">Storage Access API</a>, through which embedded {{htmlelement("iframe")}}s can request storage access by calling {{domxref("Document.requestStorageAccess()")}}. Although both of these approaches provide the same level of storage access, we recommend third parties switch to using the Storage Access API in order to guarantee their access to storage.</p> + +<h3 id="Automatic_storage_access_upon_interaction">Automatic storage access upon interaction</h3> + +<p>In order to improve web compatibility, Firefox currently includes some heuristics to grant storage access automatically to third parties that receive user interaction. These heuristics are intended to allow some third-party integrations that are common on the web to continue to function. They are intended to be temporary and will be removed in a future version of Firefox. They should not be relied upon for current and future web development.</p> + +<p>Third-party storage access may be granted to resources that have been classified as tracking resources when a user gesture triggers a pop-up window that has <a href="/en-US/docs/Web/API/Window/opener">opener access</a> to the originating document. When that occurs, there are two possible ways a third-party origin can be granted access:</p> + +<ul> + <li>The origin of the resource that is initially loaded in the pop-up window is granted storage access on the opener document if that origin has received user interaction as a first party within the past 30 days.</li> + <li>After the initial resource is loaded in the pop-up window, the window may go through a series of redirects to other hosts. If a user interacts with the pop-up window following a redirect, the origin of the content loaded in the pop-up window is given storage access on the opener document.</li> +</ul> + +<h3 id="Scope_of_storage_access">Scope of storage access</h3> + +<p>When storage access is granted, it is scoped to the origin of the opener document or subdomains of that origin. Access that is granted on the subdomain of an origin does not extend to the top-level origin. As an example, if a resource from <code>tracker.example</code> is granted storage access on <code>foo.example.com</code>, then <code>tracker.example</code> will be able to access its cookies on <code>bar.foo.example.com</code> but not <code>example.com</code>. Instead, if <code>tracker.example</code> were granted access on <code>example.com</code> it would be able to access its storage on <code>bar.foo.example.com</code>, <code>foo.example.com</code>, and <code>example.com</code>.</p> + +<p>When storage access is granted to <code>tracker.example</code> on <code>example.com</code>, all resources loaded from <code>tracker.example</code> on any top-level document loaded from <code>example.com</code> are immediately given storage access. This includes all resources loaded in the main context of the page, embedded <code><iframe></code>s, and resources loaded within embedded <code><iframe></code>s. Storage access is not extended to other resources loaded on <code>example.com</code> (e.g. <code>other-tracker.example</code>), nor to other first parties on which <code>tracker.example</code> is embedded (e.g. <code>example.org</code>).</p> + +<p>Storage access grants extend into the first level of nested contexts, but no further. This means that <code><iframe></code>s embedded in the main context of the page and loaded from a domain classified as a tracker will have full access to all storage locations accessible through JavaScript. Similarly, requests for resources loaded in <code><iframe></code>s embedded in the main context of the page will have access to HTTP cookies. However, further nested contexts, including but not limited to those from the origin classified as a tracker, will not be granted storage access.</p> + +<p>Consider the following embedding scenarios on a top-level page loaded from <code>example.com</code> on which <code>tracker.example</code> has been granted storage access.</p> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Embedding</th> + <th scope="col">tracker.example resource storage access</th> + </tr> + </thead> + <tbody> + <tr> + <td>An image is loaded from <code>tracker.example</code> and embedded in the main context of <code>example.com</code>.</td> + <td>HTTP: Yes<br> + JS: N/A</td> + </tr> + <tr> + <td><code>example.com</code> embeds an <code><iframe></code> from <code>example.org</code>. That <code><iframe></code> goes on to load an image from <code>tracker.example</code>.</td> + <td>HTTP: Yes<br> + JS: N/A</td> + </tr> + <tr> + <td><code>example.com</code> embeds an <code><iframe></code> from <code>example.org</code>. That <code><iframe></code> goes on to embed an <code><iframe></code> from <code>tracker.example</code>.</td> + <td>HTTP: Yes<br> + JS: No</td> + </tr> + <tr> + <td><code>example.com</code> embeds an <code><iframe></code> from <code>tracker.example</code>.</td> + <td>HTTP: Yes<br> + JS: Yes</td> + </tr> + <tr> + <td><code>example.com</code> embeds an <code><iframe></code> from <code>example.com</code> (same origin). The nested <code><iframe></code> embeds an <code><iframe></code> from <code>tracker.example</code>.</td> + <td>HTTP: Yes<br> + JS: No</td> + </tr> + </tbody> +</table> + +<h3 id="Storage_access_expiration">Storage access expiration</h3> + +<p>The storage access grant expires after 30 days. Domains classified as tracking resources may be granted third-party storage access on multiple first parties, and the storage permission for each party expires independently. The above heuristics will also serve to extend the lifetime of a third-party storage permission on origins that have already been granted access. Each time the heuristic is activated, or a success call to the Storage Access API is made, the pre-existing storage access expiration will be extended by 30 days, counting from the time the previous access was granted.</p> + +<p>Please note that in the future we expect to make changes to how long storage access will remain valid for. As mentioned before, the way to know that you will be able to use storage as a third-party going forward will be using the Storage Access API.</p> + +<h2 id="Debugging">Debugging</h2> + +<p>We encourage site owners to test their sites, particularly those that rely on third-party content integrations. We’ve added several new features to Firefox to make testing easier.</p> + +<h3 id="Developer_Tools_notifications">Developer Tools notifications</h3> + +<p>The <a href="/en-US/docs/Tools/Network_Monitor">Network Monitor</a> in Firefox Developer Tools now includes an indicator for all resource requests that have been classified as tracking resources. This indicator is shown as a shield icon in the domain column. In the sample image below, <code>trackertest.org</code> is classified as a tracking resource, while the request to example.com is not.</p> + +<p><img alt="network requests in Firefox devtools indicating which ones are tracking resources with a small shield icon" src="https://mdn.mozillademos.org/files/16181/Screen_Shot_2018-09-21_at_10.34.22_AM.png" style="border-style: solid; border-width: 1px; display: block; height: 57px; margin: 0px auto; width: 600px;"></p> + +<h3 id="Adding_custom_domains_to_the_Tracking_Protection_list">Adding custom domains to the Tracking Protection list</h3> + +<p>Curious how things will work if a third-party domain on your site were classified as a tracker? We’ve added a preference that allows you to add custom domains to the Tracking Protection URL classifier. To do so:</p> + +<ol> + <li>Type <code>about:config</code> in your address bar. If you are presented with a page that warns you "This may void your warranty!", click "I accept the risk!"</li> + <li>Right click on the next page and click "New" > "String".</li> + <li>For the preference name enter "urlclassifier.trackingAnnotationTable.testEntries".</li> + <li>For the preference value enter comma separated origins that you’d like to have classified as trackers. E.g. "example.net,example.org".</li> +</ol> + +<div class="warning"> +<p><strong>Warning</strong>: Be sure to remove these entries after you have finished testing.</p> +</div> + +<h2 id="FAQ">FAQ</h2> + +<p>This cookie policy has the potential to lead to site breakage, but has been designed to allow common third-party integrations to continue to work while preventing cross-site tracking. In this section we describe the functionality you can expect in different integration scenarios.</p> + +<h3 id="Will_this_storage_access_policy_block_ads_from_displaying_on_my_website">Will this storage access policy block ads from displaying on my website?</h3> + +<p>No — this feature only restricts access to cookies and site data that can be used to track users across websites. Blocking tracking identifiers does not prevent the display of advertisements.</p> + +<h3 id="I_use_a_third-party_analytics_service_that_is_classified_as_a_tracker._Will_I_still_receive_analytics_data">I use a third-party analytics service that is classified as a tracker. Will I still receive analytics data?</h3> + +<p>This depends on how the third-party analytics service is implemented. Third-party analytics providers will no longer be able to user their third-party storage to collect data. This means that providers using cookies which are scoped to their third-party domain, or local storage and other site data stored under their origin, will no longer have access to those identifiers across other websites.</p> + +<p>If these services are embedded into the main context of the page, they can continue to use first-party cookies and site storage to track users across page visits on that specific first-party domain.</p> + +<h3 id="I_use_third-party_services_for_social_login_like_and_share_button_integration._Will_my_users_still_be_able_to_make_use_of_these_services">I use third-party services for social login, like, and share button integration. Will my users still be able to make use of these services?</h3> + +<p>This depends on how the social integration is implemented. We expect that many of the popular social integrations will continue to function as they do under Firefox’s current cookie policy with some minor differences in the user experience.</p> + +<p>A social content provider that is classified as a tracker will not have access to their third-party cookies when the user first visits a new first party. Thus, the user may appear logged out to the service despite being logged in when they visit the provider’s website directly. Depending on the type of integration, the user may have to take some action to interact with the social content provider before the provider is given access to their cookies. For example:</p> + +<ul> + <li>For social login, the user may have to click a login button on the first party.</li> + <li>For social like or share buttons, the user will have to first interact with the button in a logged-out state. Once they do, many social content providers will prompt them to log in.</li> +</ul> + +<p>After these interactions, the provider will receive third-party storage access if they prompt the user in a way that is captured by the storage access activation heuristics described above. These providers should consider switching to explicitly request storage access through the Storage Access API as soon as possible. An <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1469714">initial implementation of this API</a> is currently available in Nightly.</p> + +<h3 id="I_use_third-party_pixels_and_other_tools_to_measure_the_effectiveness_of_my_ad_campaigns._Will_I_still_be_able_to_measure_the_conversion_rate_of_my_ads">I use third-party pixels and other tools to measure the effectiveness of my ad campaigns. Will I still be able to measure the conversion rate of my ads?</h3> + +<p>This depends on how the third party has implemented the measurement tool, but generally ad conversion measurement will be more difficult. Consider the following examples:</p> + +<ol> + <li>You run an ad on a social media website that is seen several times by a user, but never clicked. That user later visits your website, which includes a conversion tracking tag from the same social media website. This type of conversion is often referred to as a “view-through conversion.” Since the social media website does not have access to their third-party storage, they will not recognize the user as the same user that saw the advertisements on their website and the conversion will not be tracked. We expect that most view-through conversion tracking techniques will no longer work, including those offered by display networks.</li> + <li>You run an ad on a display network or social media website that is clicked by a user. That user lands on your website, which includes a conversion tracking tag from the same website that displayed your ad. This type of conversion is often referred to as a “click-through conversion.” Since the social media site or display network will not have access to their third-party storage, they will not recognize the user as the same user that saw the advertisements on their website and the conversion will not be tracked. We expect that this version of click-through conversion will no longer work.</li> + <li>You run an ad that appears on a social media website. A user clicks on your advertisement and is taken to a landing page that contains a conversion tracking tag from the third-party network. On the social media website, the network annotates the advertisement landing page URL with a query parameter that signals that the visit was the result of a click on an advertisement. On your website, the display network’s tag checks the URL query parameters and saves any ad tracking parameters to first-party storage. If a user later completes a conversion event, the network’s tag checks first-party storage to determine which click (or clicks) was responsible for the visit. We expect that click-through conversion implemented in this way will continue to work.</li> +</ol> diff --git a/files/zh-cn/mozilla/firefox/privacy/tracking_protection/index.html b/files/zh-cn/mozilla/firefox/privacy/tracking_protection/index.html new file mode 100644 index 0000000000..66620f47d9 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/privacy/tracking_protection/index.html @@ -0,0 +1,87 @@ +--- +title: Tracking Protection +slug: Mozilla/Firefox/Privacy/Tracking_Protection +tags: + - 隐私 +translation_of: Mozilla/Firefox/Privacy/Tracking_Protection +--- +<div>{{FirefoxSidebar}}</div> + +<h2 id="什么是跟踪保护">什么是跟踪保护?</h2> + +<p>Firefox 浏览器桌面版和 Android 移动版内置跟踪保护。在隐私窗口或标签页(Android移动版)内,Firefox会阻止跨网站的内容加载。</p> + +<p>如果拦截的内容是网页的一部分,用户可能会注意到网页排版出现问题。如果页面上的其它元素把拦截内容的空位给填补上时,用户完全不会注意到 Firefox 浏览器阻止了一些内容加载。</p> + +<p>当 Firefox 浏览器拦截到内容时,在控制台会有类似这样一条日志消息:</p> + +<pre class="notranslate">位于“http://some/url”的资源<span class="message-body-wrapper"><span class="message-flex-body"><span class="devtools-monospace message-body"><span class="objectBox objectBox-string">已被内容拦截功能拦截。</span></span></span></span></pre> + +<p>Firefox 浏览器 Android 移动版需要使用远程调试来看到控制台的输出内容。</p> + +<p><img alt="Page information showing possible blocked content." src="https://mdn.mozillademos.org/files/16583/blocked_content.png" style="border-style: solid; border-width: 1px; display: block; height: 384px; margin: 0px auto; width: 416px;"></p> + +<p>点下地址栏左侧这个标志ⓘ 可以查看当前页面的信息。按下第一行的按钮可以关闭对当前网站的跟踪保护。</p> + +<p>如果存在跟踪Cookie,您可以通过单击上图中的“阻止跟踪Cookie”查看以下弹出窗口来查看列表:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/16584/tracking_cookies.png" style="border-style: solid; border-width: 1px; display: block; height: 384px; margin: 0px auto; width: 416px;"></p> + +<p>您可以单击“管理内容阻止”来更改阻止设置:</p> + +<p><img alt="" src="https://mdn.mozillademos.org/files/16585/content_blocking.png" style="border-style: solid; border-width: 1px; display: block; margin: 0px auto;"></p> + +<h2 id="Firefox如何选择要阻止的内容?_基于要从中加载内容的域阻止内容。_Firefox将提供一个站点列表,这些站点已经被确定为参与用户的跨站点跟踪。启用跟踪保护后,Firefox将阻止来自列表中站点的内容。_跟踪用户的网站通常是第三方广告和分析网站。">Firefox如何选择要阻止的内容?<br> + 基于要从中加载内容的域阻止内容。<br> + Firefox将提供一个站点列表,这些站点已经被确定为参与用户的跨站点跟踪。启用跟踪保护后,Firefox将阻止来自列表中站点的内容。<br> + 跟踪用户的网站通常是第三方广告和分析网站。</h2> + +<h2 id="这对你的网站意味着什么?_最明显的是,这意味着当启用跟踪保护时:_从第三方跟踪服务的内容将对用户不可见_您的网站将无法使用第三方广告或参与跟踪的分析服务_更微妙的是,如果站点的其他部分依赖于正在加载的跟踪器,那么当启用跟踪保护时,这些部分也将被破坏。例如,如果站点包含在加载跟踪站点的内容时运行的回调,则不会执行该回调。_例如,您不应以以下方式使用Google_Analytics:">这对你的网站意味着什么?<br> + 最明显的是,这意味着当启用跟踪保护时:<br> + 从第三方跟踪服务的内容将对用户不可见<br> + 您的网站将无法使用第三方广告或参与跟踪的分析服务<br> + 更微妙的是,如果站点的其他部分依赖于正在加载的跟踪器,那么当启用跟踪保护时,这些部分也将被破坏。例如,如果站点包含在加载跟踪站点的内容时运行的回调,则不会执行该回调。<br> + 例如,您不应以以下方式使用Google Analytics:</h2> + +<pre class="brush:html example-bad notranslate"><a href="http://www.example.com" onclick="trackLink('http://www.example.com', event);"> + Visit example.com +</a> + +<script> +function trackLink(url,event) { + event.preventDefault(); + ga('send', 'event', 'outbound', 'click', url, { + 'transport': 'beacon', + 'hitCallback': function() { + document.location = url; + } + }); +} +</script></pre> + +<p>相反,您应该通过检查ga对象是否已初始化来解释Google Analytics丢失的情况:</p> + +<pre class="brush:html example-good notranslate"><a href="http://www.example.com" onclick="trackLink('http://www.example.com', event);"> + Visit example.com +</a> + +<script> +function trackLink(url,event) { + event.preventDefault(); + if (window.ga && <span class="pl-smi">ga</span>.loaded) { + ga('send', 'event', 'outbound', 'click', url, { + 'transport': 'beacon', + 'hitCallback': function() { document.location = url; } + }); + } else { + document.location = url; + } +} +</script> +</pre> + +<p>关于这项技术的更多信息可以在Google分析、隐私和事件跟踪上找到。</p> + +<div class="blockIndicator note"> +<p>注意:以这种方式依赖第三方并不是一个好的做法,因为如果第三方速度慢或不可用,或者跟踪器已被加载项阻止,则站点可能会被破坏。</p> +</div> diff --git a/files/zh-cn/mozilla/firefox/releases/1.5/index.html b/files/zh-cn/mozilla/firefox/releases/1.5/index.html new file mode 100644 index 0000000000..a028828a01 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/1.5/index.html @@ -0,0 +1,123 @@ +--- +title: Firefox 1.5 for developers +slug: Mozilla/Firefox/Releases/1.5 +tags: + - Add-ons + - CSS + - DOM + - Extensions + - HTML + - JavaScript + - NeedsTranslation + - RDF + - SVG + - TopicStub + - Web Development + - Web Standards + - XML + - XML Web Services + - XSLT + - XUL +translation_of: Mozilla/Firefox/Releases/1.5 +--- +<div>{{FirefoxSidebar}}</div><p>Based on the <a href="/en-US/docs/Gecko" title="en-US/docs/Gecko">Gecko</a> 1.8 engine, Firefox 1.5 improved its already best in class standards support, and provided new capabilities to enable the next generation of web applications. Firefox 1.5 features improved support for CSS2 and CSS3, APIs for scriptable and programmable 2D graphics through <a href="/en-US/docs/SVG" title="en-US/docs/SVG">SVG</a> 1.1 and <a class="internal" href="/en-US/docs/HTML/Canvas" title="en-US/docs/HTML/Canvas"><code><canvas></code></a>, <a href="/en-US/docs/XForms" title="en-US/docs/XForms">XForms</a> and XML events, as well as many DHTML, JavaScript, and DOM enhancements.</p> + +<h2 id="Developer_Tools">Developer Tools</h2> + +<p>Several tools and browser extensions are available to help developers support Firefox 1.5.</p> + +<ul> + <li><a href="/en-US/docs/DOM_Inspector" title="en-US/docs/DOM_Inspector">DOM Inspector</a>, a tool that allows developers to inspect and modify documents without having to edit the document directly. DOM Inspector is available as part of the Custom install option in Firefox 1.5 under Developer Tools.</li> + <li>JavaScript console, a tool to write and test JavaScript code as well as view JavaScript and CSS errors on a page.</li> + <li>View page source, with syntax highlighting and find features.</li> + <li><a class="link-https" href="https://addons.mozilla.org/extensions/showlist.php?application=firefox&category=Developer%20Tools">Browser extensions</a> including the <a class="external" href="http://www.joehewitt.com/software/firebug/">FireBug</a>, <a href="/en-US/docs/Web_Developer_Extension_(external)" title="en-US/docs/Web_Developer_Extension_(external)">Web Developer toolbar</a>, <a href="/en-US/docs/Live_HTTP_Headers_(external)" title="en-US/docs/Live_HTTP_Headers_(external)">Live HTTP Headers</a>, <a href="/en-US/docs/HTML_Validator_(external)" title="en-US/docs/HTML_Validator_(external)">HTML Validator</a> and many more.</li> +</ul> + +<p><strong>Note:</strong> Some extensions do not currently support Firefox 1.5, and will be automatically disabled.</p> + +<h2 id="Overview">Overview</h2> + +<p>Some of the new features in Firefox 1.5:</p> + +<h3 id="Web_site_and_application_developers">Web site and application developers</h3> + +<dl> + <dt><a href="/en-US/docs/SVG_In_HTML_Introduction" title="en-US/docs/SVG_In_HTML_Introduction">SVG In XHTML Introduction</a></dt> + <dd>Learn how to use SVG in XHTML pages and how to use JavaScript and CSS to manipulate the picture in the same way you would script regular XHTML. See also <a href="/en-US/docs/SVG_in_Firefox" title="en-US/docs/SVG_in_Firefox">SVG in Firefox</a> to learn about the status and known problems of SVG implementation in Firefox.</dd> + <dt><a href="/en-US/docs/HTML/Canvas/Drawing_Graphics_with_Canvas" title="en-US/docs/Drawing_Graphics_with_Canvas">Drawing Graphics with Canvas</a></dt> + <dd>Learn about the new <code><canvas></code> tag and how to draw graphs and other objects in Firefox.</dd> + <dt><a href="/en-US/docs/CSS/Using_CSS_multi-column_layouts" title="en-US/docs/CSS3_Columns">CSS3 Columns</a></dt> + <dd>Learn about the new support for automatic multi-column text layout as proposed for <a href="/en-US/docs/CSS/CSS3" title="CSS3">CSS3</a>.</dd> + <dt><a href="/en-US/docs/Using_Firefox_1.5_caching" title="en-US/docs/Using_Firefox_1.5_caching">Using Firefox 1.5 caching</a></dt> + <dd>Learn about <code>bfcache</code> and how it speeds up back and forward navigation.</dd> +</dl> + +<h3 id="XUL_and_Extension_Developers">XUL and Extension Developers</h3> + +<dl> + <dt><a href="/en-US/docs/Building_an_Extension" title="en-US/docs/Building_an_Extension">Building an Extension</a></dt> + <dd>This tutorial will take you through the steps required to build a very basic extension for Firefox. Also see <a class="external" href="http://kb.mozillazine.org/Getting_started_with_extension_development">another tutorial on MozillaZine knowledge base</a>, which demonstrates the new features of the Extension Manager in 1.5 that make creating a new extension even easier.</dd> + <dt><a href="/en-US/docs/XPCNativeWrapper" title="en-US/docs/XPCNativeWrapper">XPCNativeWrapper</a></dt> + <dd><code>XPCNativeWrapper</code> is a way to wrap up an object so that it's <a href="/en-US/docs/Safely_accessing_content_DOM_from_chrome" title="en-US/docs/Safely_accessing_content_DOM_from_chrome">safe to access from privileged code</a>. It can be used in all Firefox versions, though the behavior changed somewhat starting with Firefox 1.5 (Gecko 1.8).</dd> + <dt><a href="/en-US/docs/Preferences_System" title="en-US/docs/Preferences_System">Preferences System</a></dt> + <dd>Learn about the new widgets that allow you to create Options windows easier using less JavaScript code.</dd> + <dt><a href="/en-US/docs/International_characters_in_XUL_JavaScript" title="en-US/docs/International_characters_in_XUL_JavaScript">International characters in XUL JavaScript</a></dt> + <dd>XUL JavaScript files can now contain non-ASCII characters.</dd> + <dt><a href="/en-US/docs/Tree_Widget_Changes" title="en-US/docs/Tree_Widget_Changes">Tree API changes</a></dt> + <dd>The interfaces for accessing XUL <code><tree></code> elements have changed.</dd> + <dt><a href="/en-US/docs/XUL_Changes_for_Firefox_1.5" title="en-US/docs/XUL_Changes_for_Firefox_1.5">XUL Changes for Firefox 1.5</a></dt> + <dd>Summary of XUL changes. See also <a href="/en-US/docs/Adapting_XUL_Applications_for_Firefox_1.5" title="en-US/docs/Adapting_XUL_Applications_for_Firefox_1.5">Adapting XUL Applications for Firefox 1.5</a>.</dd> +</dl> + +<h4 id="Networking-related_changes">Networking-related changes</h4> + +<ul> + <li>Certificate prompts can now be overridden on a per-channel basis. This works by setting an interface requestor as an <a href="/en-US/docs/nsIChannel" title="en-US/docs/nsIChannel">nsIChannel</a>'s notificationCallbacks and giving out an interface for <a href="/en-US/docs/NsIBadCertListener" title="en-US/docs/NsIBadCertListener">nsIBadCertListener</a>.</li> + <li>nsIWebBrowserPersist's listeners can now implement <a href="/en-US/docs/XPCOM_Interface_Reference/nsIInterfaceRequestor" title="en-US/docs/nsIInterfaceRequestor">nsIInterfaceRequestor</a>::GetInterface and will get an opportunity to provide all interfaces that channels might ask for, including <a href="/en-US/docs/NsIProgressEventSink" title="en-US/docs/NsIProgressEventSink">nsIProgressEventSink</a> (not too useful, redundant with <a href="/en-US/docs/nsIWebProgressListener" title="en-US/docs/nsIWebProgressListener">nsIWebProgressListener</a>). Useful interfaces here include <a href="/en-US/docs/NsIChannelEventSink" title="en-US/docs/NsIChannelEventSink">nsIChannelEventSink</a> and <a href="/en-US/docs/NsIBadCertListener" title="en-US/docs/NsIBadCertListener">nsIBadCertListener</a>.</li> + <li>Extensions or other necko consumers, including XMLHttpRequest, can set a Cookie header explicitly, and necko will not replace it. Stored cookies will be merged with the explicitly set header, in a way that the explicit header will override the stored cookies.</li> +</ul> + +<h2 id="New_End_user_Features">New End user Features</h2> + +<h3 id="User_Experience">User Experience</h3> + +<ul> + <li><strong>Faster browser navigation</strong> with improvements to back and forward button performance.</li> + <li><strong>Drag and drop reordering for browser tabs.</strong></li> + <li><strong>Answers.com is added to the search engine list</strong> for dictionary lookup.</li> + <li><strong>Improvements to product usability</strong> including descriptive error pages, redesigned options menu, RSS discovery, and "Safe Mode" experience.</li> + <li><strong>Better accessibility support</strong> including DHTML accessibility.</li> + <li><strong>Report a broken Web site wizard</strong> to report Web sites that are not working in Firefox.</li> + <li><strong>Better support for Mac OS X</strong> (10.2 and greater) including profile migration from Safari and Mac Internet Explorer.</li> +</ul> + +<h3 id="Security_and_Privacy">Security and Privacy</h3> + +<ul> + <li><strong>Automated update</strong> to streamline product upgrades. Notification of an update is more prominent, and updates to Firefox may now be half a megabyte or smaller. Updating extensions has also improved.</li> + <li><strong>Improvements to popup blocking.</strong></li> + <li><strong>Clear Private Data</strong> feature provides an easy way to quickly remove personal data through a menu item or keyboard shortcut.</li> +</ul> + +<h3 id="Support_for_open_Web_standards">Support for open Web standards</h3> + +<p>Firefox support for Web standards continues to lead the industry with consistent cross-platform implementations for:</p> + +<ul> + <li>Hypertext Markup Language (<a href="/en-US/docs/HTML" title="en-US/docs/HTML">HTML</a>) and Extensible Hypertext Markup Language (<a href="/en-US/docs/XHTML" title="en-US/docs/XHTML">XHTML</a>): <a class="external" href="http://www.w3.org/TR/html401/">HTML 4.01</a> and <a class="external" href="http://www.w3.org/TR/xhtml1/">XHTML 1.0/1.1</a></li> + <li>Cascading Style Sheets (<a href="/en-US/docs/CSS" title="en-US/docs/CSS">CSS</a>): <a class="external" href="http://www.w3.org/TR/REC-CSS1">CSS Level 1</a>, <a class="external" href="http://www.w3.org/TR/REC-CSS2">CSS Level 2</a> and parts of <a class="external" href="http://www.w3.org/Style/CSS/current-work.html">CSS Level 3</a></li> + <li>Document Object Model (<a href="/en-US/docs/DOM" title="en-US/docs/DOM">DOM</a>): <a class="external" href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/">DOM Level 1</a>, <a class="external" href="http://www.w3.org/DOM/DOMTR#dom2">DOM Level 2</a> and parts of <a class="external" href="http://www.w3.org/DOM/DOMTR#dom3">DOM Level 3</a></li> + <li>Mathematical Markup Language: <a class="external" href="http://www.w3.org/Math/">MathML Version 2.0</a></li> + <li>Extensible Markup Language (<a href="/en-US/docs/XML" title="en-US/docs/XML">XML</a>): <a class="external" href="http://www.w3.org/TR/REC-xml">XML 1.0</a>, <a class="external" href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</a>, <a class="external" href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML Documents 1.0</a>, <a class="external" href="http://lists.w3.org/Archives/Public/www-xml-linking-comments/2001AprJun/att-0074/01-NOTE-FIXptr-20010425.htm">Fragment Identifier for XML</a></li> + <li>XSL Transformations (<a href="/en-US/docs/XSLT" title="en-US/docs/XSLT">XSLT</a>): <a class="external" href="http://www.w3.org/TR/xslt">XSLT 1.0</a></li> + <li>XML Path Language (<a href="/en-US/docs/XPath" title="en-US/docs/XPath">XPath</a>): <a class="external" href="http://www.w3.org/TR/xpath">XPath 1.0</a></li> + <li>Resource Description Framework (<a href="/en-US/docs/RDF" title="en-US/docs/RDF">RDF</a>): <a class="external" href="http://www.w3.org/RDF/">RDF</a></li> + <li>Simple Object Access Protocol (SOAP): <a class="external" href="http://www.w3.org/TR/SOAP/">SOAP 1.1</a></li> + <li><a href="/en-US/docs/JavaScript" title="en-US/docs/JavaScript">JavaScript</a> 1.6, based on <a href="/en-US/docs/ECMAScript" title="en-US/docs/ECMAScript">ECMA-262</a>, revision 3: <a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262</a></li> +</ul> + +<p>Firefox 1.5 supports the following data transport protocols (HTTP, FTP, SSL, TLS, and others), multilingual character data (Unicode), graphics (GIF, JPEG, PNG, SVG, and others) and the latest version of the world's most popular scripting language, <a href="/en-US/docs/New_in_JavaScript_1.6" title="en-US/docs/New_in_JavaScript_1.6">JavaScript 1.6</a>.</p> + +<h2 id="Changes_since_Firefox_1.0">Changes since Firefox 1.0</h2> + +<p>Many changes have been introduced into Firefox since it was first released on November 9, 2004. Firefox has progressed with many new features and bug fixes. A detailed list of changes is available from <a class="external" href="http://www.squarefree.com/burningedge/releases/1.5-comprehensive.html">squarefree.com</a>.</p> diff --git a/files/zh-cn/mozilla/firefox/releases/1.5/using_firefox_1.5_caching/index.html b/files/zh-cn/mozilla/firefox/releases/1.5/using_firefox_1.5_caching/index.html new file mode 100644 index 0000000000..b062c43ddd --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/1.5/using_firefox_1.5_caching/index.html @@ -0,0 +1,184 @@ +--- +title: Using Firefox 1.5 caching +slug: Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching +translation_of: Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching +--- +<div>{{FirefoxSidebar}}</div><h2 id="Introduction" name="Introduction">介绍</h2> + +<p><a href="/en-US/docs/Firefox_1.5_for_developers" title="Firefox_1.5_for_developers">Firefox 1.5</a> 对整个web页面的一个浏览器会话进行了内存缓存,包括他们对JavaScript状态。在访问过的页面间后退和前进不需要页面加载同时保存JavaScript状态。这个特性,被称为bfcache(“后退前进缓存”),使得页面导航(切换)非常快。这个状态缓存被保存直到用户关闭浏览器。 </p> + +<p>有时候,Firefox不缓存页面。下面是一些页面不被缓存的常见的编程的原因:</p> + +<ul> + <li>页面使用 <code>unload</code> 或者 <code>beforeunload</code> 处理程序;</li> + <li>页面设置 "cache-control: no-store".</li> + <li>页面是 HTTPS 同时页面至少有一个以下设置: + <ul> + <li>"Cache-Control: no-cache"</li> + <li>"Pragma: no-cache"</li> + <li>使用 "Expires: 0" 或者 "Expires" 设置相对于 “Date” header值的过去日期值(除非指定 "Cache-Control: max-age=");</li> + </ul> + </li> + <li>当用户导航跳离页面时页面还没有完全加载或者因为其他原因有等待(pending)的网络请求 (例如 <code>XMLHttpRequest</code>));</li> + <li>页面运行IndexedDB事件;</li> + <li>顶级页面包含frames (例如 {{HTMLElement("iframe")}})因为这里列出的任何原因 而没有被缓存;</li> + <li>页面是在frame内而且用户在这个框架中加载一个新页面(在这种情况下, 当用户离开这个页面,最后加载入frames的内容会被缓存)。</li> +</ul> + +<p>这个新的缓存特性改变了页面的加载行为,web作者也许希望: </p> + +<ul> + <li>知晓被导航到的页面(当它从用户缓存中被加载)</li> + <li>在用户离开页面时定义页面行为 (同时还支持页面缓存)</li> +</ul> + +<p>两个新的浏览器事件使得用户可以做到这2个要求。</p> + +<h2 id="New_browser_events" name="New_browser_events">新的浏览器事件</h2> + +<p>如果你使用新的事件,你的页面在其他浏览器依然会正确显示 (我们已经测试了早期版本的Firefox, Internet Explorer, Opera, 和 Safari),而且在 Firefox 1.5加载时将会使用新的缓存功能。</p> + +<p>注意: 直至10-2009 开发版本的Safari 添加了这些新的事件的支持 (见 <a class="link-https" href="https://bugs.webkit.org/show_bug.cgi?id=28758" title="https://bugs.webkit.org/show_bug.cgi?id=28758">the webkit bug</a>).</p> + +<p>标准的页面行为是:</p> + +<ol> + <li>用户导航至一个页面</li> + <li>当页面加载,行内scripts执行。</li> + <li>一旦页面加载完毕, <code>onload</code> 事件执行。</li> +</ol> + +<p>有些页面包含第四步。如果一个页面使用 <code>unload</code> 或者 <code>beforeunload</code> 处理程序,当从页面导航离开时事件被执行。如果提供了一个<code>unload</code> 处理程序,页面将不会被缓存。</p> + +<p>当一个用户导航至一个被缓存的页面,行内scripts和<code>onload</code> 处理程序将不会执行 (步骤 2 和 3), 因为在大多数情况下,这些scripts的影响(执行效果)已经被保存。</p> + +<p>如果你想在每次用户导航到页面时都执行页面包含的scripts或者其他在页面加载期间执行的行为,或者你想知道什么时候用户导航至一个被缓存的页面,使用新的<code>pageshow</code> 事件.</p> + +<p>如果你拥有当用户导航离页面是执行的行为,但是你想利用这个新的缓存功能,因此不想使用unload处理程序,使用新的 <code>pagehide</code> 事件</p> + +<h3 id="pageshow_event" name="pageshow_event">pageshow 事件</h3> + +<p>这个事件和 <code>load</code> 事件一样的工作(效果), 除了它每次页面加载是都执行 that it fires every time the page is loaded (然而 <code>load</code> 事件在 Firefox 1.5中当页面从缓存中加载时不执行). 页面第一次加载时, <code>pageshow</code> 事件在 <code>load</code> 事件执行后执行。 <code>pageshow</code> 事件使用一个命名为<code>persisted</code> 的boolean属性,在初始加载时默认设置为 <code>false</code>。如果它不是初始加载,被设置为<code>true</code>(换句话说,但页面被缓存时它被设置为true).</p> + +<p>在 <code>pageshow</code> 事件执行时,设置每次页面加载时你想要运行的任何的JavaScript。</p> + +<p>如果你将JavaScript函数作为pageshow事件的一部分调用,你可以通过调用<code>pageshow</code> 事件作为<code>load</code>事件的一部分确保在不同于Firefox 1.5的浏览器在页面加载时调用这些函数,如在本文后面所示的示例。</p> + +<h3 id="pagehide_event" name="pagehide_event">pagehide 事件</h3> + +<p>如果你想定义当用户导航离页面时的行为,但是你不想使用 <code>unload</code> (这将导致页面不被缓存),你可以使用新的 <code>pagehide</code> 事件。像 <code>pageshow</code> , <code>pagehide</code> 事件使用一个命名为<code>persisted</code> 的属性。 这个属性在页面未被浏览器缓存时设置为 <code>false</code> ,如果页面被浏览器缓存则设置为 <code>true</code> 。如果这个属性被设置为 <code>false</code>, 如果有设置<code>unload</code> 处理程序的话,<code>unload</code> 事件在<code>pagehide</code> 事件执行后马上执行。</p> + +<p>当页面初次加载,Firefox 1.5 试图按事件会发生相同的顺序模拟load事件。Frames 被作为顶级文档一样对待。如果页面包含frames, 则当缓存当页面被加载:</p> + +<ul> + <li>每个frame的<code>pageshow</code> 事件在主文档的 <code>pageshow</code> 事件之前执行。</li> + <li>当用户导航离被缓存的页面, 每个frame的<code>pagehide</code> 事件在主文档的 <code>pagehide</code> 事件之前执行。</li> + <li>发生在一个 frame 的导航, 只有在受影响的frame触发事件。</li> +</ul> + +<h2 id="示例代码">示例代码</h2> + +<p>以下的示例演示了一个页面同时使用 <code>load</code> 和 <code>pageshow</code> 事件。这个示例页面行为如下:</p> + +<ul> + <li>在除了Firefox 1.5的浏览器,以下在每次页面加载都发生:<code>load</code> 事件触发<code>onLoad</code> 函数,该函数调用 <code>onPageShow</code> 函数 (如同一个附加功能).</li> + <li>在Firefox 1.5,页面第一次加载时 <code>load</code> 事件和其他浏览器上运行一样。 除了, <code>pageshow</code> 事件的执行和 <code>persisted</code> 设置为 <code>false</code>,没有额外的行动发生。</li> + <li>在 Firefox 1.5, 当页面从缓存中被加载,只有 <code>pageshow</code> 事件执行。随着 <code>persisted</code> 被设置为 <code>true</code>,只有 <code>onPageShow</code> 方法中的JavaScript行为被触发。</li> +</ul> + +<p>在这个例子中:</p> + +<ul> + <li>每次页面加载,页面计算并显示当前日期和时间。这个计算包括秒和毫秒,所以你可以很容易地测试功能。</li> + <li>第一次加载页面,光标放置在表单的Name字段。在 Firefox 1.5, 当用户导航回该页面,光标依然在页面导航离开时的位置。在其他浏览器,光标移回到Name字段。</li> +</ul> + +<pre class="brush:html"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<HTML> +<head> +<title>Order query Firefox 1.5 Example</title> +<style type="text/css"> +body, p { + font-family: Verdana, sans-serif; + font-size: 12px; + } +</style> +<script type="text/javascript"> +function onLoad() { + loadOnlyFirst(); + onPageShow(); +} + +function onPageShow() { +//calculate current time + var currentTime= new Date(); + var year=currentTime.getFullYear(); + var month=currentTime.getMonth()+1; + var day=currentTime.getDate(); + var hour=currentTime.getHours(); + var min=currentTime.getMinutes(); + var sec=currentTime.getSeconds(); + var mil=currentTime.getMilliseconds(); + var displayTime = (month + "/" + day + "/" + year + " " + + hour + ":" + min + ":" + sec + ":" + mil); + document.getElementById("timefield").value=displayTime; +} + +function loadOnlyFirst() { + document.zipForm.name.focus(); +} +</script> +</head> +<body onload="onLoad();" onpageshow="if (event.persisted) onPageShow();"> +<h2>Order query</h2> + +<form name="zipForm" action="http://www.example.com/formresult.html" method="get"> +<label for="timefield">Date and time:</label> +<input type="text" id="timefield"><br> +<label for="name">Name:</label> +<input type="text" id="name"><br> +<label for="address">Email address:</label> +<input type="text" id="address"><br> +<label for="order">Order number:</label> +<input type="text" id="order"><br> +<input type="submit" name="submit" value="Submit Query"> +</form> +</body> +</html> +</pre> + +<p>与此相反, 如果以上页面不监听 <code>pageshow</code> 事件,所有的计算作为 <code>load</code> 事件的一部分(取而代之的是如下面的示例代码片段所示的编码),Firefox 1.5 中,当用户导航离页面时,光标位置及date/time会被缓存。当用户返回回该页面,缓存的date/time将会显示。</p> + +<pre class="brush:html"><script> +function onLoad() { + loadOnlyFirst(); + +//calculate current time + var currentTime= new Date(); + var year = currentTime.getFullYear(); + var month = currentTime.getMonth()+1; + var day = currentTime.getDate(); + var hour=currentTime.getHours(); + var min=currentTime.getMinutes(); + var sec=currentTime.getSeconds(); + var mil=currentTime.getMilliseconds(); + var displayTime = (month + "/" + day + "/" + year + " " + + hour + ":" + min + ":" + sec + ":" + mil); + document.getElementById("timefield").value=displayTime; +} + +function loadOnlyFirst() { + document.zipForm.name.focus(); +} +</script> +</head> + +<body onload="onLoad();"> +</pre> + +<h2 id="Developing_Firefox_extensions" name="Developing_Firefox_extensions">开发Firefox扩展</h2> + +<p>Firefox 1.5 <a href="/en-US/docs/Building_an_Extension" title="Building_an_Extension">extensions</a> 需要允许缓存功能。如果你在开发一个兼容1.5 及以前版本的Firefox扩展,确保它监听事件触发 <code>load</code> 可被缓存,监听的 <code>pageshow</code> 事件触发不应该被缓存。</p> + +<p>例如,Firefox的Google工具栏为了兼容1.5和更早的版本,应该为autolink监听 <code>load</code> 事件函数,为PageRank监听 <code>pageshow</code> 事件函数。</p> diff --git a/files/zh-cn/mozilla/firefox/releases/12/index.html b/files/zh-cn/mozilla/firefox/releases/12/index.html new file mode 100644 index 0000000000..ee154efbfe --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/12/index.html @@ -0,0 +1,165 @@ +--- +title: Firefox 12 for developers +slug: Mozilla/Firefox/Releases/12 +tags: + - Firefox + - Firefox 12 + - Gecko 12 + - Web Developement +translation_of: Mozilla/Firefox/Releases/12 +--- +<div>{{FirefoxSidebar}}</div> + +<p>Firefox 12 was shipped on April 24, 2012. This page summarizes the changes in Firefox 12 that affect developers. This article provides information about the new features and key bugs fixed in this release, as well as links to more detailed documentation for both web developers and add-on developers.</p> + +<h2 id="Changes_for_Web_developers">Changes for Web developers</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>The <code>title</code> attribute now supports newline characters to allow multi-line tooltips.</li> + <li>If JavaScript is disabled, the {{HTMLElement("canvas")}} element was being rendered instead of showing the fallback content as per the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html">specification</a>. Now the fallback content is rendered instead.</li> + <li>The <code>crossorigin</code> attribute is now supported on {{HTMLElement("video")}}.</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>Support for the {{cssxref("text-align-last")}} property has been added (prefixed).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>Support for <a href="/en-US/docs/JavaScript/Sharp_variables_in_JavaScript" title="Sharp variables in JavaScript">sharp variables</a> (a Netscape non-standard extension) has been dropped.</li> + <li>{{jsxref("ArrayBuffer.prototype.slice()")}} has been implemented.</li> +</ul> + +<h3 id="DOM">DOM</h3> + +<ul> + <li>{{domxref("DOMParser")}} now supports parsing of HTML document fragments.</li> + <li>{{domxref("XMLHttpRequest")}} now supports timeouts using the <code>timeout</code> property and "timeout" event, as well as the <code>ontimeout</code> event handler on the {{domxref("XMLHttpRequestEventTarget")}} interface.</li> + <li>{{domxref("XMLHttpRequest")}} can now load from <a href="/en-US/docs/data_URIs" title="data URIs"><code>data:</code> URIs</a>.</li> + <li>When downloading large amounts of data, {{domxref("XMLHttpRequest")}} progress event handlers are now called periodically with the <code>responseType</code> set to "moz-blob" and the response being a {{domxref("Blob")}} containing all of the data received so far. This lets progress handlers begin processing data without having to wait for it all to arrive.</li> + <li>Gecko now supports <a href="/en-US/docs/DOM/Touch_events" title="en-US/docs/DOM/Touch_events">multi-touch</a> (instead of just single touches at a time) on Android.</li> + <li>While editing text using an IME, the <code>input</code> event is now sent whenever the contents of the element being edited have been changed; this happens after the <code>compositionupdate</code> event has been sent to indicate that the IME's text has been changed. You can use the <code>input</code> event handler, therefore, to monitor changes to the actual content of the element.</li> + <li>{{domxref("DOMError")}} as defined in the DOM 4 specification has been implemented.</li> + <li>The {{domxref("Document.createNodeIterator()")}} method has been updated to match the DOM4 specification. This makes the <code>whatToShow</code> and <code>filter</code> parameters optional and removes the non-standard fourth parameter, <code>entityReferenceExpansion</code>.</li> + <li>The {{domxref("Blob")}} interface's <code>slice()</code> method was affected by a bug that prevented it from properly accepting <code>start</code> and <code>end</code> values outside the range of a signed 64-bit integer; this has been fixed.</li> + <li>The {{domxref("element.getBoundingClientRect()")}} method now considers effect of <a href="/en-US/docs/CSS/Using_CSS_transforms" title="Using CSS transforms">CSS transforms</a> when computing the element's bounding rectangle.</li> + <li>The <code>crossOrigin</code> property is now supported by {{domxref("HTMLMediaElement")}}.</li> +</ul> + +<h4 id="New_WebAPIs">New WebAPIs</h4> + +<ul> + <li>Network Information API: Experimental support for {{domxref("window.navigator.connection")}} has been added (prefixed).</li> + <li>WebTelephony API: {{domxref("window.navigator.mozTelephony")}} has been implemented and provides support for dialing, answering, and managing phone calls on a device.</li> + <li>WebSMS API: {{domxref("window.navigator.mozSms")}} is now available for mobile devices to send SMS text messages.</li> + <li>Screen brightness API: {{domxref("window.screen.mozEnabled")}} and {{domxref("window.screen.mozBrightness")}} have been added to control the device's screen.</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<ul> + <li>Firefox now implements the {{domxref("SVGTests")}} DOM API, see {{bug("607854")}}</li> + <li>The {{domxref("SVGStringList")}} DOM interface support the non-standard <code>length</code> property see {{bug("711958")}}</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<ul> + <li>To control the directionality of MathML formulas, the <code>dir</code> attribute is now supported on the {{MathMLElement("math")}}, {{MathMLElement("mrow")}}, and {{MathMLElement("mstyle")}} elements as well as on <a href="/Special:Tags?tag=MathML:Token+Elements" title="Special:Tags?tag=MathML:Token+Elements">MathML Token Elements</a>. This is particularly important for some <a class="external" href="http://www.w3.org/TR/arabic-math/" title="http://www.w3.org/TR/arabic-math/">Arabic mathematical notations</a>.</li> + <li>The alignment attribute <code>align</code> defined in MathML3 has been implemented for {{MathMLElement("munder")}}, {{MathMLElement("mover")}}, and {{MathMLElement("munderover")}}.</li> +</ul> + +<h3 id="Networking">Networking</h3> + +<ul> + <li>Previously, Gecko reported the close code <code>CLOSE_NORMAL</code> when a WebSocket channel was closed due to an unexpected error, or if it was closed due to an error condition that the specification doesn't cover. Now <code>CLOSE_GOING_AWAY</code> is reported instead.</li> +</ul> + +<h3 id="Developer_tools">Developer tools</h3> + +<ul> + <li>The <a href="/en-US/docs/Tools/Web_Console" title="Web Console">Web Console</a> now caches error messages and log entries added using {{domxref("console.log()")}} if the console isn't currently open, and displays them when the console is opened.</li> + <li>You can now reset the zoom level, panning, and rotation in the <a href="/en-US/docs/Tools/Page_Inspector/3D_view" title="3D view">3D view</a> by pressing the "r" key.</li> + <li>You can now hide nodes in the <a href="/en-US/docs/Tools/Page_Inspector/3D_view" title="3D view">3D view</a> by pressing the "x" key after selecting them.</li> + <li>The <a href="/en-US/docs/Tools/Using_the_Source_Editor" title="en-US/docs/Tools/Using_the_Source_Editor">source editor</a> has a several new editing features and keyboard shortcuts; see <a href="/en-US/docs/Tools/Using_the_Source_Editor" title="Using the Source Editor">Using the Source Editor</a> for details</li> +</ul> + +<p>Mozilla has been working on integrating its own Web developer tools that complement the popular <a class="external" href="http://getfirebug.com/" title="Firebug Firefox add-on">Firebug</a> add-on. You can get more information about these tools as well as see a list of resources external to Firefox that will help you with your Web development. The entire list is located at <a href="/en-US/docs/Tools" title="Web Developer Tools">Web developer tools</a>.</p> + +<h3 id="Miscellaneous_changes">Miscellaneous changes</h3> + +<ul> + <li>The GEOSTD8 character set, which was never fully supported, is no longer supported at all.</li> +</ul> + +<h2 id="Changes_for_Mozilla_and_add-on_developers">Changes for Mozilla and add-on developers</h2> + +<h3 id="JavaScript_code_modules">JavaScript code modules</h3> + +<h4 id="source-editor.jsm">source-editor.jsm</h4> + +<ul> + <li>The <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#resetUndo%28%29" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#resetUndo%28%29"><code>resetUndo()</code></a> method was added; this lets you clear the undo stack.</li> + <li>The source editor now offers methods for providing search capability: <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#find()" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#find()"><code>find()</code></a>, <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#findNext()" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#findNext()"><code>findNext()</code></a>, and <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#findPrevious()" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#findPrevious()"><code>findPrevious()</code></a>.</li> +</ul> + +<h3 id="XUL">XUL</h3> + +<ul> + <li>The definition of the values for the {{XULAttr("chromemargin")}} attribute has changed slightly, to make it easier to make cross-platform XUL code look good on platforms with different default window border widths.</li> +</ul> + +<h3 id="XPCOM">XPCOM</h3> + +<ul> + <li><a href="/en-US/docs/nsISupports_proxies" title="nsISupports proxies"><code>nsISupports</code> proxies</a> are no longer supported. You should be using runnables instead; see <a href="/en-US/docs/XPCOM/Making_cross-thread_calls_using_runnables" title="en-US/docs/XPCOM/Making cross-thread calls using runnables">Making cross-thread calls using runnables</a>.</li> + <li>Firefox 11 changed the behavior of <a href="/en-US/docs/Components.utils.getWeakReference" title="Components.utils.getWeakReference"><code>Components.utils.getWeakReference()</code></a> to throw an exception when the object reference is null; the previous behavior of silently failing has been restored.</li> +</ul> + +<h3 id="XPConnect">XPConnect</h3> + +<ul> + <li>The <a href="/en-US/docs/PRUint64" title="PRUint64"><code>PRUint64</code></a> data type was incorrectly essentially identical to <a href="/en-US/docs/PRInt64" title="PRInt64"><code>PRint64</code></a> when used with XPConnect. This has been fixed.</li> +</ul> + +<h3 id="Interface_changes">Interface changes</h3> + +<ul> + <li>The <code>nsIScreen_MOZILLA_2_0_BRANCH</code> interface has been merged into {{interface("nsIScreen")}}. The APIs defined in that interface (for controlling minimum screen brightness) had not previously been documented, but now they are.</li> + <li>The {{interface("nsIScriptError2")}} interface has been merged into {{interface("nsIScriptError")}}.</li> + <li>{{ifmethod("nsIDownloadManager", "addDownload")}} is now handled asynchronously rather than synchronously.</li> + <li>The {{ifmethod("imgIContainerObserver", "frameChanged")}} method now receives as its first parameter an {{interface("imgIRequest")}} object identifying the corresponding request.</li> + <li>The {{ifmethod("nsIDOMWindowUtils", "sendTouchEvent")}} method has been added to allow synthesizing touch events.</li> + <li>You can now scroll the specified content to the vertical center of the view by specifying <code>SCROLL_CENTER_VERTICALLY</code> as the scroll constant when calling {{ifmethod("nsISelectionController", "scrollSelectionIntoView")}}.</li> + <li>The new {{ifattribute("nsIMemoryMultiReporter", "explicitNonHeap")}} attribute has been added; this is a more efficient way to obtain the sum of all of the multi-reporter's measurements that have a path that starts with "explicit" <strong>and</strong> are of the kind <code>KIND_NONHEAP</code>.</li> + <li>The {{ifattribute("nsIDOMWindowUtils", "paintingSuppressed")}} attribute has been added; this boolean value indicates whether or not painting is currently suppressed on the window. This is used on mobile to prevent bouncy rendering that occurs when attempts to draw the page begin before enough content is available to do so smoothly.</li> + <li>The <code>nsIDocCharset</code> and <code>nsIDocumentCharsetInfo</code> interfaces have been merged into {{interface("nsIDocShell")}}. As part of this work, the old <code>forcedDetector</code> attribute has been removed; it never did anything.</li> +</ul> + +<h3 id="SpiderMonkey">SpiderMonkey</h3> + +<ul> + <li><code>JSThread</code> has been eliminated.</li> + <li><code>JSThreadData</code> has been merged into <code>JSRuntime</code>.</li> +</ul> + +<h3 id="Building">Building</h3> + +<ul> + <li>When building on Windows, you must have the Windows 7 SDK installed.</li> +</ul> + +<h3 id="Other_changes">Other changes</h3> + +<ul> + <li>The editor component (known as <a href="/en-US/docs/Midas" title="Midas">Midas</a>) now <a href="/en-US/docs/Using_the_Editor_from_XUL#Editor_event_handling" title="en-US/docs/Using_the_Editor_from_XUL#Editor_event_handling">only accepts events</a> from privileged code.</li> +</ul> + +<h2 id="See_also">See also</h2> + +<div>{{Firefox_for_developers('11')}}</div> diff --git a/files/zh-cn/mozilla/firefox/releases/14/index.html b/files/zh-cn/mozilla/firefox/releases/14/index.html new file mode 100644 index 0000000000..8ef207f56e --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/14/index.html @@ -0,0 +1,98 @@ +--- +title: Firefox 14 for developers +slug: Mozilla/Firefox/Releases/14 +tags: + - Firefox + - Firefox 14 + - Gecko + - Gecko 14 +translation_of: Mozilla/Firefox/Releases/14 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 14 shipped on July 17, 2012. This article lists key changes that are useful for not only Web developers to know about, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="Changes_for_Web_developers">Changes for Web developers</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>{{ HTMLElement("progress") }}元素不在错误的归为一个表单元素,因此不再有一个<code>form</code>属性.</li> + <li>The default modifier keys for the <code><a href="/zh-cn/HTML/Global_attributes" title="Global attributes">accesskey</a></code> of HTML contents on Mac are changed to Control+Option. This is the same as WebKit-based browsers on Mac.</li> +</ul> + +<h3 id="DOM">DOM</h3> + +<ul> + <li><a href="/zh-cn/DOM/DOM_event_reference/input" title="input">input</a> events are fired also on editing host element of <a href="/zh-cn/DOM/element.contentEditable" title="Element.contentEditable">contenteditable</a> editor and root element of <a href="/zh-cn/DOM/document.designMode" title="document.designMode">designMode</a> editor.</li> + <li>{{ domxref("DOMException", "DOMException.code") }}已被废弃,根据最新的DOM Level 4 规范.</li> + <li>{{ domxref("Range.insertNode()") }} method now works correctly when used on collapsed ranges.</li> + <li>The {{ domxref("BlobBuilder", "MozBlobBuilder") }} interface has been deprecated in favor of the constructor on {{ domxref("Blob") }}. If you use <code>MozBlobBuilder</code> you'll see a warning message in the Web Console.</li> + <li>The {{domxref("Blob.Blob", "Blob()")}} constructor is now available to workers ({{bug(736686)}}).</li> + <li>Support for the <a href="/zh-cn/DOM/DOM_Mutation_Observers" title="zh-cn/DOM/DOM_Mutation_Observers">Mutation Observers</a> has been landed. It is designed as a replacement for the Mutation Events in DOM3, which has a number of issues regarding performance.</li> + <li>The {{ domxref("HTMLImageElement") }} interface's <code>x</code> and <code>y</code> properties were removed in Gecko 7.0 {{ geckoRelease("7.0") }} but restored in this release for compatibility reasons.</li> + <li>{{ domxref("Document") }}上的方法<code>execCommandShowHelp()</code>和<code>queryCommandText()</code>,没有任何作用,已被删除.</li> + <li>The <code>GeoPositionAddress</code> interface, an obsolete part of the <a href="/zh-cn/Using_geolocation" title="zh-cn/Using_geolocation">Geolocation</a> API, has been removed.</li> + <li>{{ domxref("Storage", "localStorage/sessionStorage") }} now correctly return <code>undefined</code> instead of <code>null</code> for undeclared keys through property access.</li> + <li>The {{domxref("ImageData")}} object has been implemented ({{bug(550309)}}).</li> + <li>Attributes and methods related to child nodes on {{domxref("Attr")}} interface where obsoleted ({{bug(737122)}}).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>The {{ cssxref("text-transform") }} and {{ cssxref("font-variant") }} CSS properties have been fixed to correctly handle the <code>i</code> → <code>İ</code> and <code>ı</code> → <code>I</code> <a class="external" href="http://en.wikipedia.org/wiki/Turkic_languages" title="http://en.wikipedia.org/wiki/Turkic_languages">Turkic</a>-specific case pairs.</li> + <li>The Dutch IJ digraph is now correctly handled by <code>text-transform: capitalization</code>. Similarly the Greek letter <code>Σ</code>, which has two lowercase forms, <code>σ</code> and <code>ς</code>, is now correctly handled by <code>text-transform: lowercase</code>.</li> + <li>Support for the <code>skew()</code> function has been removed from {{cssxref("transform")}} property, as it has been removed from the draft standard.</li> + <li>The syntax for {{ cssxref("border-image") }} has been updated to match the latest revision of the specification; it no longer accepts a trailing slash ("/").</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<p><em>No change.</em></p> + +<h3 id="MathML">MathML</h3> + +<ul> + <li>The syntax of the <code>statusline</code> action type on {{ MathMLElement("maction") }} elements has been adjusted to follow the MathML specification.</li> +</ul> + +<h3 id="HTTP">HTTP</h3> + +<ul> + <li>Gecko开始支持新的<a href="/zh-cn/HTTP" title="HTTP">HTTP</a> <a href="/zh-cn/HTTP/HTTP_response_codes#308" title="https://developer.mozilla.org/zh-cn/HTTP/HTTP_response_codes#308"><code>308</code>永久重定向</a> 状态码. 由于Gecko并不区分永久重定向和零食重定向,所以该状态码的表现行为和<a href="/zh-cn/HTTP/HTTP_response_codes#307" title="https://developer.mozilla.org/zh-cn/HTTP/HTTP_response_codes#307"><code>307 临时重定向</code></a>状态码是一样的, 和302以及301状态码的区别是,它们禁止用户代理改变重定之后的HTTP方法(<code>POST还是</code><code>POST</code>, <code>GET</code>还是<code>GET</code>).</li> +</ul> + +<h2 id="Changes_for_Mozilla_and_add-on_developers">Changes for Mozilla and add-on developers</h2> + +<h3 id="JavaScript_代码模块">JavaScript 代码模块</h3> + +<h4 id="source-editor.jsm">source-editor.jsm</h4> + +<ul> + <li>Added a keyboard shortcut to toggle commenting for the current selection (Ctrl-/ or Cmd-/ on Mac OS X).</li> + <li>Added the Ctrl-[ and Ctrl-] keyboard shortcuts for moving the text input position to the beginning and end of the current block.</li> + <li>Added the new <a href="/zh-cn/JavaScript_code_modules/source-editor.jsm#getLineStart%28%29" title="zh-cn/JavaScript_code_modules/source-editor.jsm#getLineStart%28%29"><code>getLineStart()</code></a> and <a href="/zh-cn/JavaScript_code_modules/source-editor.jsm#getLineEnd%28%29" title="zh-cn/JavaScript_code_modules/source-editor.jsm#getLineEnd%28%29"><code>getLineEnd()</code></a> methods.</li> +</ul> + +<h3 id="XUL">XUL</h3> + +<ul> + <li>在 {{ XULElem("window") }}元素上添加了新的 {{ XULAttr("fullscreenbutton") }}属性; 将该属性设置为<code>true,会在</code>窗口上添加一个进入全屏模式的按钮.</li> +</ul> + +<h3 class="editable" id="接口"><span>接口</span></h3> + +<ul> + <li>{{ interface("nsILocalFile") }}接口被合并到{{ interface("nsIFile") }}接口中. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=682360" title="https://bugzilla.mozilla.org/show_bug.cgi?id=682360">bug 682360</a>).</li> + <li>The methods in {{ interface("nsIPlacesImportExportService") }} for importing bookmarks have all been removed in favor of the <code><a href="/zh-cn/JavaScript_code_modules/BookmarkHTMLUtils.jsm" title="zh-cn/JavaScript_code_modules/BookmarkHTMLUtils.jsm">BookmarkHTMLUtils.jsm</a></code> JavaScript code module.</li> + <li>{{ interface("nsIDOMGeoPositionAddress") }} 接口已被移除.</li> +</ul> + +<h3 id="拼写检查">拼写检查</h3> + +<ul> + <li>Dictionary names are now parsed as full <a class="external" href="http://tools.ietf.org/html/bcp47" title="http://tools.ietf.org/html/bcp47">BCP 47</a> language tags (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=730209" title="https://bugzilla.mozilla.org/show_bug.cgi?id=730209">bug 730209</a>, <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=741842" title="https://bugzilla.mozilla.org/show_bug.cgi?id=741842">bug 741842</a>). Developers are encouraged to not hard-code the name of their language in their dictionary names.</li> +</ul> + +<h2 id="相关链接">相关链接</h2> + +<div>{{Firefox_for_developers('13')}}</div> diff --git a/files/zh-cn/mozilla/firefox/releases/15/index.html b/files/zh-cn/mozilla/firefox/releases/15/index.html new file mode 100644 index 0000000000..1c941836d7 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/15/index.html @@ -0,0 +1,122 @@ +--- +title: Firefox 15 for developers +slug: Mozilla/Firefox/Releases/15 +tags: + - Firefox + - Firefox 15 + - Gecko 15 +translation_of: Mozilla/Firefox/Releases/15 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 15 shipped on August 28, 2012. This article lists key changes that are useful for not only Web developers to know about, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="Changes_for_Web_developers">Changes for Web developers</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>The <code>size</code> attribute of the {{ HTMLElement("font") }} element is now handled according the HTML5 spec. It means that all integer greater than 10 or smaller than -10 are now considered equivalent to 10, respectively -10.</li> + <li>Support for <code>font-weight</code> and <code>point-size</code> attributes on the <code><font></code> element has been removed; these were non-standard and Gecko was the only engine supporting them.</li> + <li>The <a class="external" href="http://www.opus-codec.org/" title="http://www.opus-codec.org/">Opus codec</a> is now supported for audio in Ogg containers for the HTML {{ HTMLElement("audio") }} and {{ HTMLElement("video") }} elements.</li> + <li>The {{ HTMLElement("source") }} element now supports the <code>media</code> attribute.</li> + <li>The {{ HTMLElement("audio") }} and {{ HTMLElement("video") }} elements now support the played attribute, which provides a {{ domxref("TimeRanges") }} object listing the time ranges of the media that have been played back so far.</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>The {{ cssxref("font-feature-settings") }} property has been updated to the latest syntax: <code>font-feature-settings: "lnum" 1;</code></li> + <li>The CSS {{ cssxref("text-transform") }} property has been extended to correctly handle Unicode ligature characters (like <code>?</code>).</li> + <li>The CSS {{ cssxref("word-break") }} property has been implemented.</li> + <li>The {{ cssxref("border-image") }} property has been updated to match the latest Specification and properties have been unprefixed. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=713643">bug 713643</a>)</li> + <li>The <code>skew()</code> {{cssxref("transform")}} function dropped in Firefox 14 has been restored due to existing site compatibility. Authors are however, advised to use <code>skewX()</code> and <code>skewY(</code>) functions instead.</li> + <li>The value <code>plaintext</code> of CSS {{cssxref("unicode-bidi")}} property now applies to inline elements too. ({{bug("746987")}}).</li> +</ul> + +<h3 id="DOM">DOM</h3> + +<ul> + <li>The DOM Events Level 3 methods <a href="/zh-cn/DOM/KeyboardEvent#getModifierState%28%29" title="https://developer.mozilla.org/zh-cn/DOM/KeyboardEvent#getModifierState%28%29"><code>KeyboardEvent.getModifierState()</code></a> and <a href="/zh-cn/DOM/MouseEvent#getModifierState%28%29" title="https://developer.mozilla.org/zh-cn/DOM/MouseEvent#getModifierState%28%29"><code>MouseEvent.getModifierState()</code></a>, which let you query the state of modifier keys, like <code>Ctrl</code> or <code>Shift</code>, have been implemented (bugs <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=630811" title="https://bugzilla.mozilla.org/show_bug.cgi?id=630811">630811</a> and <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=731878" title="https://bugzilla.mozilla.org/show_bug.cgi?id=731878">731878</a>). But the behavior conforms to the latest D3E draft. So, some modifier key names are different from IE ({{ bug("769190") }}).</li> + <li>On mouse events, support for querying the state of the mouse buttons using the <a href="/zh-cn/DOM/MouseEvent" title="zh-cn/DOM/MouseEvent"><code>MouseEvent.buttons</code></a> attribute, has been implemented.</li> + <li>On keyboard events, support for querying the key location (standard, left or right of modifier key, in the Numpad) using the <a href="/zh-cn/DOM/KeyboardEvent#Attributes_location" title="https://developer.mozilla.org/zh-cn/DOM/KeyboardEvent#Attributes_location">KeyboardEvent.location</a> attribute, has been implemented ({{ bug("166240") }}).</li> + <li>KeyboardEvent.keycode result has been computed from better rules which were almost same on Windows/Linux/Mac. And now they are available on some keyboard layouts which are not ASCII capable layouts on Linux and Mac, such as Arabic, Cyrillic, Thai and so on. See <a href="/zh-cn/DOM/KeyboardEvent#Virtual_key_codes" title="zh-cn/DOM/KeyboardEvent#Virtual_key_codes">the document for virtual key codes</a>.</li> + <li>The <a href="/zh-cn/DOM/range.detach" title="https://developer.mozilla.org/zh-cn/DOM/range.detach"><code>range.detach()</code></a> method has been transformed in a no-op and will probably be removed in the future.</li> + <li>The method <code>HTMLVideoElement.mozHasAudio()</code> has been implemented. It indicates if there is an audio track associated to a given video element. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=480376" title="https://bugzilla.mozilla.org/show_bug.cgi?id=480376">bug </a><a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=480376" title="https://bugzilla.mozilla.org/show_bug.cgi?id=480376">480376</a>)</li> + <li>The <code>Performance</code> API has a new method, <code>now()</code>, supporting high resolution timers of type<code> DOMHighResTimeStamp</code>. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=539095" title="https://bugzilla.mozilla.org/show_bug.cgi?id=539095">bug 539095</a>).</li> + <li>The <code>Window.java</code> and <code>Window.packages</code> attributes has been removed. These were never documented, and hopefully you're not using them!</li> + <li>The <a href="/zh-cn/API/WebSMS" title="zh-cn/API/WebSMS">WebSMS API</a> has been updated and now supports a <code>read </code>attribute indicating whether an SMS text message is read or unread.</li> + <li>The <a class="link-https" href="https://wiki.mozilla.org/WebAPI/FileHandleAPI" title="https://wiki.mozilla.org/WebAPI/FileHandleAPI">FileHandle API</a> has been implemented.</li> + <li>The <a href="/zh-cn/DOM/Blob" title="zh-cn/DOM/Blob"><code>Blob</code></a> constructor now takes <code>ArrayBufferView</code> as a member of <code><var>blobParts</var></code> parameter in addition to <code>ArrayBuffer</code>. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=752402">bug 752402</a>)</li> + <li>The {{domxref("DeviceLightEvent")}} specified in the <a href="http://www.w3.org/TR/ambient-light/" title="http://www.w3.org/TR/ambient-light/">Ambient Light Events Working Draft</a> has been implemented.</li> + <li>The {{domxref("DeviceProximityEvent")}} and {{domxref("UserProximityEvent")}} <a href="http://www.w3.org/TR/proximity/" title="http://www.w3.org/TR/proximity/">Proximity Events</a> have been implemented.</li> + <li>The {{domxref("File")}} <code>lastModifiedDate</code> property has been implemented. ({{bug("673586")}})</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>Support for the <a href="/zh-cn/JavaScript_typed_arrays/DataView" title="/zh-cn/JavaScript_typed_arrays/DataView"><code>DataView</code></a> interface from the Typed Arrays specification has been added. This provides low-level access to the data contained in an <a href="/zh-cn/JavaScript_typed_arrays/ArrayBuffer" title="zh-cn/JavaScript_typed_arrays/ArrayBuffer"><code>ArrayBuffer</code></a>.</li> + <li>Support for new ECMAScript 2015 built-ins: <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/isNaN" title="JavaScript/Reference/Global_Objects/isNaN"><code>Number.isNaN()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toInteger"><code>Number.toInteger()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger"><code>Number.isInteger()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite"><code>Number.isFinite()</code></a> has been added. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=749818" title="https://bugzilla.mozilla.org/show_bug.cgi?id=749818">bug 749818</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=749818" title="https://bugzilla.mozilla.org/show_bug.cgi?id=761495">bug 761495</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=749818" title="https://bugzilla.mozilla.org/show_bug.cgi?id=761480">bug 761480</a>).</li> + <li>添加了对<code>ES6中的<a href="/zh-CN/docs/Web/JavaScript/Reference/Functions/Default_parameters">默认参数</a></code>的支持. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=757676" title="https://bugzilla.mozilla.org/show_bug.cgi?id=757676">bug 757676</a>)</li> + <li>添加了对<code>ES6中的<a href="/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters">剩余参数</a></code>的支持.(<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=574132" title="https://bugzilla.mozilla.org/show_bug.cgi?id=574132">bug 574132</a>)</li> +</ul> + +<h3 id="WebGL">WebGL</h3> + +<ul> + <li>Support for the <a href="/zh-cn/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc" title="zh-cn/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc"><code>WEBGL_compressed_texture_s3tc</code></a> extension has been added. Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<ul> + <li>Mathematical operators can now use downloadable fonts specified with {{ cssxref("@font-face") }}. This makes the <a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/mathml-fonts/" title="https://addons.mozilla.org/en-US/firefox/addon/mathml-fonts/">MathML-fonts add-on</a> work with stretchy operators too.</li> + <li>The <code>selection</code> attribute of the {{ MathMLElement("maction") }} is now only taken into account with the <code>toggle</code> actiontype.</li> + <li><a class="external" href="http://www.w3.org/TR/MathML3/chapter3.html#id.3.3.4.2.1" title="http://www.w3.org/TR/MathML3/chapter3.html#id.3.3.4.2.1"><span id="summary_alias_container"><span id="short_desc_nonedit_display">Deprecated namedspace binding</span></span></a> has been removed ({{ bug("673759") }}).</li> + <li>Supported syntax for <a href="/zh-cn/MathML/Attributes/Values" title="Values">Length</a> and {{ MathMLElement("mpadded") }} values have been made closer to the one specified in MathML3 spec.</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<ul> + <li>Added support for the {{SVGElement("view")}} element ({{bug("512525")}}).</li> +</ul> + +<h3 id="Network">Network</h3> + +<ul> + <li>Support for the SPDY v3 protocol has landed. It is disabled by default and can be enabled by setting the preference <code>network.http.spdy.enabled.v3</code> to true. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=737470">bug 737470</a>)</li> +</ul> + +<h2 id="附加组件开发变更">附加组件开发变更</h2> + +<h3 id="接口变更">接口变更</h3> + +<dl> + <dt>{{ interface("nsIDOMWindowUtils") }}</dt> + <dd><code>aModifiers</code> of <code>sendMouseEvent()</code>, <code>sendTouchEvent()</code>, <code>sendMouseEventToWindow()</code>, <code>sendMouseScrollEvent()</code> and <code>sendKeyEvent()</code> supports all modifier keys which are supported by <a href="/zh-cn/DOM/KeyboardEvent#getModifierState%28%29" title="https://developer.mozilla.org/zh-cn/DOM/KeyboardEvent#getModifierState%28%29"><code>KeyboardEvent.getModifierState()</code></a>. Use <code>MODIFIER_*</code> values. And now the 5th parameter of <code>sendKeyEvent()</code> is changed from <code>boolean</code> to <code>unsigned long</code>. For backward compatibility, if caller passes <code>true</code> or <code>false</code> to it, the behavior isn't changed. This change allows callers to specify the key's location.</dd> + <dt>{{ interface("nsIBrowserHistory") }}</dt> + <dd>The <code>hidePage()</code> method was never implemented, and has been removed entirely in this release. The <code>addPageWithDetails()</code> method has also been removed as part of the ongoing work to make all <a href="/zh-cn/Places" title="zh-cn/Places">Places</a> APIs asynchronous; use {{ ifmethod("mozIAsyncHistory", "updatePlaces") }} instead. Also, the <code>count</code> attribute was removed; it had not returned an actual count in some time (instead, it was simply indicating whether or not any entries existed). You can use {{ ifattribute("nsINavHistoryService", "hasHistoryEntries") }} instead.</dd> + <dt>{{interface("inIDOMUtils")}}</dt> + <dd>The {{ifmethod("inlDOMUtils", "parseStyleSheet")}} method has been added and allows the (re-)parsing of Cascading Style Sheets.</dd> + <dt>{{interface("nsIINIParserWriter")}}</dt> + <dd>The {{ifmethod("nsIINIParserWriter", "writeFile")}} method now accepts a <code>flags</code>property. This currently offers only one option: you can now tell it to write the file in UTF-16 format instead of UTF-8, for better compatibility with Windows and certain installers.</dd> +</dl> + +<h4 id="新增接口">新增接口</h4> + +<dl> + <dt>{{ interface("nsISpeculativeConnect") }}</dt> + <dd>Provides a way to hint to the networking layer that you are likely to ask to open a connection to a given URI sometime in the near future. This lets the network layer begin the sometimes high-latency process of opening a new network connection ahead of time.</dd> +</dl> + +<h4 id="移除接口">移除接口</h4> + +<p>The following interfaces have been removed.</p> + +<ul> + <li>{{ interface("nsIGlobalHistory") }}</li> +</ul> + +<h2 id="相关链接">相关链接</h2> + +<p>{{Firefox_for_developers('14')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/16/index.html b/files/zh-cn/mozilla/firefox/releases/16/index.html new file mode 100644 index 0000000000..7d63499c62 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/16/index.html @@ -0,0 +1,114 @@ +--- +title: Firefox 16 for developers +slug: Mozilla/Firefox/Releases/16 +tags: + - Firefox + - Firefox 16 +translation_of: Mozilla/Firefox/Releases/16 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 16 shipped on October 9, 2012. This article lists key changes that are useful for not only Web developers to know about, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="Web开发">Web开发</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>The {{HTMLElement("meter")}} element is now supported.</li> + <li>Support for the HTML Microdata API has been added. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=591467">bug 591467</a>)</li> + <li>{{HTMLElement("canvas")}} now supports the CSS <code>currentColor</code> in all case. ({{bug("629882")}})</li> + <li>{{HTMLElement("input")}} now allows filtering based on arbitrary mimetypes in <code>accept</code> ({{bug("565274")}}).</li> + <li>Two new attributes, <code>width</code> and <code>height</code> have been added to the {{HTMLElement("input")}} element (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=683855">bug 683855</a>).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>实现了标准的不带前缀的 <a href="/En/CSS/Using_CSS_transforms" title="En/CSS/Using_CSS_transforms">CSS Transforms</a>. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=745523">bug 745523</a>)</li> + <li>Support for reverse animation direction (keywords <code>reverse</code> and <code>alternate-reverse</code> on the {{cssxref("animation-direction")}} property) has been added. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=655920">bug 655920</a>).</li> + <li>You can now animate the CSS {{cssxref("height")}} and {{cssxref("width")}} properties.</li> + <li>The {{cssxref("animation-duration")}} and {{cssxref("transition-duration")}} CSS properties now reject negative values (and do not handle them as <code>0s</code> anymore) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=773102" title="https://bugzilla.mozilla.org/show_bug.cgi?id=773102">bug 773102</a>).</li> + <li>Support for the standard, unprefixed version of <a href="https://developer.mozilla.org/en-US/docs/CSS/Using_CSS_transforms" title="CSS/Using_CSS_transforms">CSS Transforms</a> has been landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=745523">bug 745523</a>). {{cssxref("<length>")}} cannot be used for translation values in <code>matrix()</code> and <code>matrix3d()</code> anymore ({{bug(719054)}}).</li> + <li>Support for the standard, unprefixed version of <a href="https://developer.mozilla.org/en-US/docs/CSS/Using_CSS_gradients" title="CSS/Using_CSS_gradients">CSS Gradients</a> has been landed. Note that the syntax has changed significantly since the prefixed version, so you should read up on this (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=752187">bug 752187</a>).</li> + <li>The {{cssxref("box-sizing", "-moz-box-sizing")}} implementation has been updated to apply to table cells too (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=338554">bug 338554</a>).</li> + <li>Support for the standard, unprefixed version of {{cssxref("calc")}} has been landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=771678" title="https://bugzilla.mozilla.org/show_bug.cgi?id=771678">bug 771678</a>).</li> + <li>The {{cssxref("<resolution>")}} CSS data type has been extended to support the <code>dppx</code>(<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=741644" title="https://bugzilla.mozilla.org/show_bug.cgi?id=741644">bug 741644</a>).</li> + <li>On screen, for <a href="https://developer.mozilla.org/en-US/docs/CSS/Media_queries" title="CSS/Media_queries">media queries</a>, <code>dppx</code>, <code>dpi</code>, and <code>dpcm</code> are now representing values based on CSS pixels and no more with the physical units (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=771390" title="https://bugzilla.mozilla.org/show_bug.cgi?id=771390">bug 771390</a>).</li> + <li>Three new pseudo-classes <code>:-moz-meter-optimum</code>, <code>:-moz-meter-sub-optimum</code>, and <code>:-moz-meter-sub-sub-optimum</code> have been added for accessing/styling a {{HTMLElement("meter")}} element in a paraticular state (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=660238" title="https://bugzilla.mozilla.org/show_bug.cgi?id=660238">bug 660238</a>).</li> + <li>The {{cssxref("-moz-appearance")}} property gains two new values: <code>meterbar</code> and <code>meterchunk</code>. They represent components inside the {{HTMLElement("meter")}} element (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=659999" title="https://bugzilla.mozilla.org/show_bug.cgi?id=659999">bug 659999</a>).</li> + <li>The {{cssxref("min-width")}} and {{cssxref("min-height")}} now supports the <code>auto</code>keyword for flex items (and resolves to <code>0</code> for other items) ({{bug("763689")}}).</li> +</ul> + +<h3 id="APIDOM">API/DOM</h3> + +<ul> + <li>在{{ domxref("HTMLInputElement") }} 接口上添加了两个新的 <code>width</code> 和 <code>height</code>属性 . (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=683855">bug 683855</a>)</li> + <li>IndexedDB 属性和方法取消前缀. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=726378">bug 726378</a>)</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/DOM/window.navigator.battery" title="DOM/window.navigator.battery">Battery API</a> is now unprefixed.</li> + <li>The Vibration API has been unprefixed.</li> + <li>The non-standard <code>Keyboard</code> interface, prefixed as <code>mozKeyboard</code>, now has the <code>Keyboard.setSelectedOption()</code> and <code>Keyboard.setValue()</code> methods, as well as the <code>Keyboard.onfocuschange</code>. <em>This interface, only available for Firefox OS, has been removed in Firefox 31.</em></li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/LiveConnect_Reference/java" title="/en-US/docs/LiveConnect_Reference/java"><code>java</code></a> and <a href="https://developer.mozilla.org/en-US/docs/LiveConnect_Reference/Packages" title="/en-US/docs/LiveConnect_Reference/Packages"><code>Packages</code></a> global objects have been removed. See <a href="https://developer.mozilla.org/en-US/docs/LiveConnect" title="/en-US/docs/LiveConnect">LiveConnect</a>.</li> + <li>The <code>CSSRule.type</code> associated with {{domxref("CSSNamespaceRule")}} has been updated from <code>UNKNOWN_RULE</code> (<code>0</code>) to <code>NAMESPACE_RULE</code> (<code>10</code>) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=765590" title="https://bugzilla.mozilla.org/show_bug.cgi?id=765590">bug 765590</a>).</li> + <li>WebSMS API: {{domxref("SmsRequest")}} has been superseded by the more general {{domxref("DOMRequest")}}.</li> + <li>The non-standard {{domxref("Element.scrollTopMax")}} and {{domxref("Element.scrollLeftMax")}} read-only properties have been added ({{bug(766937)}}).</li> + <li>The second parameter of {{domxref("Blob.blob", "Blob()")}}, when set to <code>null</code> or <code>undefined</code>, is now being handled as an empty dictionary ({{bug(7691119)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" title="JavaScript/Reference/Global_Objects/Number"><code>Number</code></a> objects now offer <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite">isFinite</a>()</code>, <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toInteger">toInteger</a>()</code>, and <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger">isInteger</a>()</code> methods. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=761480">bug 761480</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=761495">bug 761495</a>)</li> + <li>The Harmony <a href="http://wiki.ecmascript.org/doku.php?id=harmony:spread" title="http://wiki.ecmascript.org/doku.php?id=harmony:spread">spread operator</a> is now supported in <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array" title="JavaScript/Reference/Global_Objects/Array"><code>Array</code></a> initializers (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=574130">bug 574130</a>). Note it is not yet supported in calls (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=762363" title="https://bugzilla.mozilla.org/show_bug.cgi?id=762363">bug 762363</a>).</li> + <li>The experimental {{jsxref("TypedArray.prototype.move()")}} method has been added (available in Aurora and Nightly channels only) ({{bug(730873)}}).</li> +</ul> + +<h3 id="WebGL">WebGL</h3> + +<p><em>No change</em></p> + +<h3 id="SVG">SVG</h3> + +<p><em>No change</em></p> + +<h3 id="MathML">MathML</h3> + +<p> </p> + +<ul> + <li>The <code>lspace</code> and <code>rspace</code> attributes of {{MathMLElement("mo")}} now correctly default to <code>thickmathspace</code>.</li> +</ul> + +<p> </p> + +<h3 id="网络">网络</h3> + +<p> </p> + +<h3 id="Developer_tools">Developer tools</h3> + +<p> </p> + +<ul> + <li>There's now a handy developer toolbar you can access by going to Tools > Web Developer > Developer Toolbar, or by pressing Ctrl-Shift-V (Cmd-Opt-V on Mac OS X). This toolbar offers a command line interface as well as buttons for quickly accessing useful tools. The graphical command line interface (<a href="https://developer.mozilla.org/en-US/docs/Tools/GCLI" title="Tools/GCLI">GCLI</a>) is easy to expand and additional commands are expected in the future. Type "help" to get a list of supported commands.</li> + <li>The Web Console now displays an error count so you can quickly see how much work you have ahead of you.</li> + <li>The Scratchpad now offers a list of recently opened files.</li> +</ul> + +<p> </p> + +<p> </p> + +<h2 id="Changes_for_Open_Web_App_developers">Changes for Open Web App developers</h2> + +<ul> + <li>Initial <a href="https://developer.mozilla.org/en-US/docs/Apps/Getting_Started">Open Web App support</a> has been implemented in the desktop versions of Firefox (that is, on Windows, Mac OS X, and Linux).</li> +</ul> + +<h2 id="附加组件开发变更">附加组件开发变更</h2> + +<h3 id="修改接口">修改接口</h3> + +<p>{{interface("nsIPrivateDOMEvent")}} has been merged into {{interface("nsIDOMEvent")}}. ({{bug("761613")}})</p> + +<h4 id="新增接口">新增接口</h4> + +<h4 id="废弃接口">废弃接口</h4> diff --git a/files/zh-cn/mozilla/firefox/releases/17/index.html b/files/zh-cn/mozilla/firefox/releases/17/index.html new file mode 100644 index 0000000000..176604bdc7 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/17/index.html @@ -0,0 +1,146 @@ +--- +title: Firefox 17 for developers +slug: Mozilla/Firefox/Releases/17 +tags: + - Firefox + - Firefox 17 +translation_of: Mozilla/Firefox/Releases/17 +--- +<div>{{FirefoxSidebar}}</div> + +<p>Firefox 17 shipped on November 20, 2012. This article lists key changes that are useful for not only web developers, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="WEB开发者需要注意的变化">WEB开发者需要注意的变化</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>支持了{{HTMLElement("iframe")}}元素的{{htmlattrxref("sandbox", "iframe") }} 属性 ({{ bug("341604") }})</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>支持了定义在 <a href="http://dev.w3.org/csswg/css3-conditional/" title="http://dev.w3.org/csswg/css3-conditional/">CSS3 Conditional Rules specification</a>中的{{ cssxref("@supports") }} at-rule. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649740" title="https://bugzilla.mozilla.org/show_bug.cgi?id=649740">bug 649740</a>)</li> + <li>支持了CSS4级选择器中的{{ cssxref(":dir", ":dir()") }}伪类,该伪类允许基于元素的方向性来选择元素. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=562169" title="https://bugzilla.mozilla.org/show_bug.cgi?id=562169">bug 562169</a>)</li> + <li>支持了CSS {{ cssxref("unicode-bidi") }} 属性中新添加的<code>isolate-override</code> 属性值. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=774335" title="https://bugzilla.mozilla.org/show_bug.cgi?id=774335">bug 774335</a>)</li> + <li>我们的带前缀版本的{{ cssxref("box-sizing") }}现在考虑到了{{ cssxref("min-height") }}和{{ cssxref("max-height") }}的影响.马上就要去掉前缀了. ({{bug("308801")}})</li> +</ul> + +<h3 id="DOM">DOM</h3> + +<ul> + <li>支持了定义在 <a href="http://dev.w3.org/csswg/css3-conditional/" title="http://dev.w3.org/csswg/css3-conditional/">CSS3 Conditional Rules specification</a> 中的{{ domxref("CSSSupportsRule") }} 接口. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649740" title="https://bugzilla.mozilla.org/show_bug.cgi?id=649740">bug 649740</a>)</li> + <li>支持了 {{ domxref("WheelEvent") }} 对象和 <code>wheel</code>事件 ({{ bug("719320") }}).</li> + <li>在linux上又一次支持了DOM Meta 键 ({{bug("751749")}}).</li> + <li>On {{domxref("HTMLMediaElement")}}, a new method, <code>mozGetMetadata</code>, that returns a javascript object whose properties represent metadata from the playing media resource as {key: value} pairs ({{bug("763010")}}).</li> + <li>Support for {{domxref("Range.intersectsNode")}} has been added again; it has been removed in Gecko 1.9 ({{bug("579638")}}.</li> + <li>{{domxref("Range.compareBoundaryPoints()")}} now throws a {{domxref("DOMException")}} with the <code>NOT_SUPPORTED_ERR</code> value when the comparison method is invalid ({{bug("714279")}}) .</li> + <li>{{domxref("Event.initEvent()")}} has been adapted to the spec: it doesn't throw anymore if called after the dispatch of the event, it is only a no-op ({{bug(768310)}}).</li> + <li>The non-standard {{domxref("XMLHttpRequest", "XMLHttpRequest.onuploadrequest")}} property has been removed ({{bug(761278)}}).</li> + <li>The method {{domxref("XMLHttpRequest.getAllResponseHeaders()")}} now separates them with a CRLF (instead of a LF), as requested by the spec ({{bug(730925)}}).</li> +</ul> + +<p> </p> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>支持了Harmony中<a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/String"><code>String</code></a>对象的<code>startsWith</code>, <code>endsWith</code>, 以及 <code>contains</code> 方法. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=772733" title="https://bugzilla.mozilla.org/show_bug.cgi?id=772733">bug 772733</a>)</li> + <li>The String methods <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/link" title="JavaScript/Reference/Global_Objects/String/link">link</a> and <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/anchor" title="JavaScript/Reference/Global_Objects/String/anchor">anchor</a> now escape the <code>'<strong>"</strong>'</code> (quotation mark) ({{bug("352437")}}).</li> + <li>实验性的支持了strawman <a href="../../zh-cn/docs/JavaScript/Reference/Global_Objects/ParallelArray" title="/zh-cn/docs/JavaScript/Reference/Global_Objects/ParallelArray"><code>ParallelArray</code></a>对象. ({{ bug("778559") }})</li> + <li>支持了遍历 <code><a href="../../zh-cn/docs/JavaScript/Reference/Global_Objects/Map" title="/zh-cn/docs/JavaScript/Reference/Global_Objects/Map">Map</a></code>/<code><a href="../../zh-cn/docs/JavaScript/Reference/Global_Objects/Set" title="/zh-cn/docs/JavaScript/Reference/Global_Objects/Set">Set</a></code>. ({{ bug("725909") }})</li> + <li>在web页面上默认禁用<a href="../../zh-cn/docs/E4X" title="/zh-cn/docs/E4X">E4X</a>({{ bug("778851") }})</li> + <li><code>__exposedProps__</code> must now be set for Chrome JavaScript objects exposed to content. Attempts to access Chrome objects from content without <code>__exposedProps__</code> set will fail silently ({{bug("553102")}}).</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of"><code>for..of</code></a> loops now work in terms of <code>.iterator()</code> and <code>.next()</code> ({{bug(725907)}}).</li> +</ul> + +<h3 id="WebGL">WebGL</h3> + +<p> </p> + +<ul> + <li>The {{domxref("EXT_texture_filter_anisotropic")}} WebGL extension has been unprefixed. Using <code>"MOZ_EXT_texture_filter_anisotropic"</code> will present a warning from now on. The prefixed name is going to be removed in a future release ({{bug(776001)}}).</li> +</ul> + +<p> </p> + +<h3 id="SVG">SVG</h3> + +<p><em>No change.</em></p> + +<h3 id="MathML">MathML</h3> + +<p> </p> + +<ul> + <li>The parsing of the <code>align</code> attribute on {{MathMLElement("mtable")}} elements has been updated to treat optional spaces more correctly.</li> +</ul> + +<p> </p> + +<h3 id="XUL">XUL</h3> + +<ul> + <li>XUL <a href="/zh-CN/docs/XUL/key" title="/zh-CN/docs/XUL/key">key</a> 元素支持了 "os" 修饰符,也就是Win键(Super键或者Hyper键) ({{bug("751749")}}).</li> +</ul> + +<h3 id="网络">网络</h3> + +<p> </p> + +<ul> + <li>Removed the the non-standard feature <code>XMLHttpRequest.onuploadprogress</code> which was deprecaed in Firefox 14.</li> +</ul> + +<p> </p> + +<h3 id="开发者工具">开发者工具</h3> + +<p> </p> + +<ul> + <li>Change JSTerm's $ helper function from getElementById to querySelector() ({{bug("751749")}}).</li> +</ul> + +<h3 id="User_Agent">User Agent</h3> + +<p>The Gecko part of the user agent string changed. The build date (which hadn't been updated since 2010) was removed, and the Gecko version number was put in its place instead. So <code>Gecko/20100101</code> -> <code>Gecko/17.0</code>. This may affect you if you are doing user agent sniffing.</p> + +<h2 id="附加组件和Mozilla开发者需要注意的变化">附加组件和Mozilla开发者需要注意的变化</h2> + +<h3 id="接口变化">接口变化</h3> + +<dl> + <dt>{{ interface("nsIInputStream") }}</dt> + <dd><code>available()</code> 方法返回一个64位的长度而不是32位的. ({{bug("215450")}})</dd> + <dt>{{ interface("nsIDOMWindowUtils") }}</dt> + <dd><code>sendMouseScrollEvent()方法被</code><code>sendWheelEvent()替换</code>. ({{bug("719320")}})</dd> + <dt>{{interface("nsIFilePicker")}}</dt> + <dd>The <code>open()</code> method, to open the file dialog asynchronously, has been added and the <code>show()</code> method has been deprecated ({{bug("731307")}}).</dd> + <dt>{{interface("nsIScriptSecurityManager")}}</dt> + <dd>The <code>checkLoadURIStr()</code> and <code>checkLoadURI()</code> methods have been removed ({{bug("327244")}}).</dd> + <dt>{{interface("nsIRefreshURI")}}</dt> + <dd>The <code>setupRefreshURIFromHeader()</code> method has a added <code>principal</code> parameter ({{bug("327244")}}).</dd> +</dl> + +<h4 id="新增接口">新增接口</h4> + +<p><em>None.</em></p> + +<h4 id="移除接口">移除接口</h4> + +<p><em>None removed.</em></p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="http://www.mozilla.org/en-US/firefox/17.0/releasenotes/">Firefox 17 Release Notes</a></li> + <li><a href="https://hacks.mozilla.org/2012/08/aurora-17-is-out/">Aurora 17 it out, bringing better security and support for new standards</a> (Mozilla Hacks)</li> + <li><a href="https://www.fxsitecompat.com/en-US/versions/17/">Site Compatibility for Firefox 17</a></li> + <li><a href="https://blog.mozilla.org/addons/2012/11/08/compatibility-for-firefox-17/">Add-on Compatibility for Firefox 17</a> (Add-ons Blog)</li> +</ul> + +<h3 id="Older_versions">Older versions</h3> + +<p>{{Firefox_for_developers('16')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/18/index.html b/files/zh-cn/mozilla/firefox/releases/18/index.html new file mode 100644 index 0000000000..9854df7bf7 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/18/index.html @@ -0,0 +1,82 @@ +--- +title: Firefox 18 for developers +slug: Mozilla/Firefox/Releases/18 +translation_of: Mozilla/Firefox/Releases/18 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 18已于2013年1月8日发布.</p> +<h2 id="WEB开发者需要注意的变化">WEB开发者需要注意的变化</h2> +<h3 id="HTML">HTML</h3> +<ul> + <li>实现了{{HTMLElement("ol")}}元素上的{{htmlattrxref("reversed","ol")}}属性({{bug("601912")}}).</li> + <li>实现了{{HTMLElement("link")}}元素上的{{htmlattrxref("crossorigin","link")}}属性({{bug("786564")}}).</li> +</ul> +<h3 id="CSS">CSS</h3> +<ul> + <li>{{cssxref("min-width")}}和{{cssxref("min-height")}}属性使用<code>auto关键字作为初始值</code>(This has an effect only on flex items as it resolves to <code>0</code>, the previous initial value, for other items). ({{bug("763689")}})</li> + <li>The cascade has been updated: now author <code>!important</code> rules override <a href="/zh-CN/docs/CSS/Using_CSS_animations" title="/zh-CN/docs/CSS/Using_CSS_animations">CSS animations</a>. ({{bug("783714")}})</li> + <li>{{cssxref("background")}}简写属性可以包含CSS3中的{{cssxref("background-size")}}属性了. ({{bug("570326")}})</li> + <li>初步实现了Flexbox.默认禁用状态,可以通过设置<code>layout.css.flexbox.enabled</code>选项激活该特性.({{bug('666041')}})</li> +</ul> +<h3 id="DOM">DOM</h3> +<ul> + <li><code>实现了navigator.mozPay属性</code>({{bug("767818")}})</li> + <li><code>实现了window.devicePixelRatio属性</code>. ({{bug("564815")}})</li> + <li>在MacOS上实现了<code>window.navigator.battery属性</code>. ({{bug("696045")}})</li> + <li>删除了{{domxref("BlobBuilder", "MozBlobBuilder")}}.开发者们应该使用{{domxref("Blob")}}构造函数来创建<code>Blob对象</code>. ({{bug("744907")}})</li> + <li>{{event("visibilitychange")}}事件和<a href="/zh-CN/docs/DOM/Using_the_Page_Visibility_API" title="/zh-CN/docs/DOM/Using_the_Page_Visibility_API">页面可见性API</a>取消前缀{{bug("812086")}}).</li> + <li><code>实现了TextDecoder</code>和<code>TextEncoder</code> .({{bug("764234")}})</li> + <li><code>HTMLMediaElement</code><code>.src</code>被分成了两个属性:一个是标准的<code>src属性</code>,返回普通的字符串{{domxref("DOMString")}},另一个是带前缀的<code>mozSrcObject</code>属性,返回<a href="/zh-CN/docs/WebRTC/MediaStream_API" title="/zh-CN/docs/WebRTC/MediaStream_API">media streams</a> ({{bug("792665")}}).</li> +</ul> +<h3 id="JavaScript">JavaScript</h3> +<ul> + <li>实现了EcmaScript 6中的<a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Proxy">直接代理</a>({{bug("703537")}}).警告:该实现包含了一些已知的bug,以及未根据最新规范草案实现某些特性.不要在生产环境中使用它.</li> + <li>实现了ECMAScript 6中的字符串方法<code>contains()</code>.</li> +</ul> +<h3 id="WebGL">WebGL</h3> +<h3 id="SVG">SVG</h3> +<h3 id="MathML">MathML</h3> +<h3 id="XUL">XUL</h3> +<h3 id="网络">网络</h3> +<ul> + <li>HTTP请求头<code>Accept-Language可以使用两位数字的质量因子</code>("q-values")({{bug("672448")}}).</li> + <li>HTTP响应头支持了<a href="/zh-CN/docs/The_X-FRAME-OPTIONS_response_header" title="/zh-CN/docs/The_X-FRAME-OPTIONS_response_header"><code>X-FRAME-OPTIONS</code></a>中的<code>ALLOW-FROM</code>语法({{bug("690168")}}).</li> +</ul> +<h3 id="开发者工具">开发者工具</h3> +<h2 id="附加组件和Mozilla开发者需要注意的变化">附加组件和Mozilla开发者需要注意的变化</h2> +<h3 id="接口变更">接口变更</h3> +<dl> + <dt> + {{ interface("nsIStreamListener") }}</dt> + <dd> + <code>onDataAvailable()</code>方法的第四个参数(aOffset)类型改为无符号长整型. ({{bug("784912")}})</dd> + <dt> + {{ interface("nsIUploadChannel") }}</dt> + <dd> + <code>setUploadStream()支持了超过</code>2GB大小的content-length ({{bug("790617")}})</dd> + <dt> + {{ interface("nsIEditor") }}</dt> + <dd> + <code>删除了addEditorObserver()</code>,使用<code>setEditorObserver()</code>来替代, <code>removeEditorObserver()</code>不再需要一个{{ interface("nsIEditorObserver") }}参数({{bug("785091")}})</dd> +</dl> +<dl> + <dt> + {{ interface("nsIHttpProtocolHandler") }}</dt> + <dd> + <code>http-on-modify-request</code> observers are no longer guaranteed to be called synchronously during<br> + <code>nsIChannel.asyncOpen(). </code>For observers that need to be called during <code>asyncOpen</code>(), the new <code>http-on-opening-request</code> observer topic has been added. ({{bug("800799")}})</dd> +</dl> +<h4 id="新增接口">新增接口</h4> +<h4 id="移除接口">移除接口</h4> +<p>下面的接口已经被移除.</p> +<ul> + <li>{{ interface("nsIEditorObserver") }}</li> +</ul> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/18.0/releasenotes/">Firefox 18发行说明</a></li> + <li><a href="https://hacks.mozilla.org/2012/10/aurora-18-hidpi-touch-events/">Aurora 18: HiDPI & Touch Events</a> (Mozilla Hacks)</li> + <li><a href="/zh-CN/docs/Site_Compatibility_for_Firefox_18">Firefox 18网站兼容性</a></li> + <li><a href="https://blog.mozilla.org/addons/2012/12/28/compatibility-for-firefox-18/">Firefox 18附加组件兼容性</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('17')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/19/index.html b/files/zh-cn/mozilla/firefox/releases/19/index.html new file mode 100644 index 0000000000..670c6f9f18 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/19/index.html @@ -0,0 +1,76 @@ +--- +title: Firefox 19 for developers +slug: Mozilla/Firefox/Releases/19 +translation_of: Mozilla/Firefox/Releases/19 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 19已于2013年2月19日正式发布.</p> + +<h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li><code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Map" title="JavaScript/Reference/Global_Objects/Map">Map</a></code> 和 <code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Set" title="JavaScript/Reference/Global_Objects/Set">Set</a></code> 对象的 <code>size()</code> 方法变成了 <code>size</code> 属性. ({{bug("807001")}})</li> + <li><code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Map" title="JavaScript/Reference/Global_Objects/Map">Map</a></code> 和 <code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Set" title="JavaScript/Reference/Global_Objects/Set">Set</a></code> 对象新增了一个 clear() 方法. ({{bug("805003")}})</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>支持了几个 viewport-relative 的 {{cssxref("<length>")}} 单位: <code>vh</code>, <code>vw</code>, <code>vmin</code> 以及 <code>vmax</code> ({{bug("503720")}})</li> + <li>CSS Flexbox 脱前缀,但仍然被默认禁止 ({{bug("801098")}}).</li> + <li><code>-moz-initial</code> 脱前缀 ({{bug("806068")}}).不过 <code>-moz-initial</code> 仍然会作为别名保留一段时间,但仍然推荐你尽快改用 <code>initial</code>.</li> + <li>{{cssxref("text-transform")}} 属性现在支持了 <code>full-width</code> 关键字, which allows a more seamless inclusion of Latin characters in text using ideographic fixed-width characters, like Chinese or Japanese ({{bug("774560")}}).</li> + <li>实现了 {{cssxref("page-break-inside")}} ({{bug("685012")}}).</li> + <li>{{cssxref("calc", "calc()")}} 函数可以使用在 <code><color-stop></code> 上( {{cssxref("<gradient>")}}上的一个值).</li> + <li>实现了 {{cssxref("@page")}} @规则 ({{bug("115199")}}).但是 {{cssxref(":first")}}, {{cssxref(":right")}}, {{cssxref(":left")}} 仍没实现.</li> + <li>{{cssxref(":-moz-placeholder")}} 伪类替换成 {{cssxref("::-moz-placeholder")}} 伪元素 ({{bug("737786")}}).</li> +</ul> + +<h3 id="DOM">DOM</h3> + +<ul> + <li>{{domxref("element.getElementsByTagName")}} 方法开始返回 <code>HTMLCollection</code> 对象,而不是以前的<code> NodeList 对象</code>. ({{bug("799464")}}).</li> + <li>实现了 {{domxref("File")}} 对象的 <code>mozLastModifiedDate</code> 属性. ({{bug("793955")}})</li> + <li>当 {{domxref("File")}} 对象的最后修改时间无法获取到时,它的 lastModifiedDate 属性会返回当前日期. ({{bug("793459")}}</li> + <li>实现了 {{domxref("CanvasRenderingContext2D")}}对象的 <code>isPointInStroke</code> 方法. ({{bug("803124")}}).</li> + <li>实现了 {{domxref("HTMLCanvasElement")}} 对象的 <code>toBlob</code> 方法 ({{bug("648610")}}).</li> + <li>{{domxref("Node.isSupported")}} 和 {{domxref("document.implementation", "document.implementation.hasFeature()")}} 方法会总是放回 <code>true</code> ({{bug("801425")}}).</li> + <li>当调用 <code>document.createElement(null)时</code>, <code>null</code> 会被转换成字符串,就像执行了 <code>document.createElement("null")</code>.</li> +</ul> + +<h3 id="XForms">XForms</h3> + +<p><a href="http://www.philipp-wagner.com/blog/2011/07/the-future-of-mozilla-xforms/" title="http://www.philipp-wagner.com/blog/2011/07/the-future-of-mozilla-xforms/"><strong>删除</strong></a>了对<a href="/zh-CN/docs/XForms" title="XForms">XForms</a>的支持.</p> + +<h2 id="附加组件和Mozilla开发者需要注意的变化">附加组件和Mozilla开发者需要注意的变化</h2> + +<div class="note"> +<p><strong>注:</strong> A key change in Firefox 19 is that <a href="/zh-CN/docs/XPCOM_API_Reference/nsresult" title="XPCOM_API_Reference/nsresult"><code>nsresult</code></a> is now strongly typed. This will help make it easier to detect bugs that are caused by mishandling of return values, but may cause existing code to break if it's making incorrect assumptions in this regard.</p> +</div> + +<ul> + <li><code>getBrowserSelection()</code> now returns the selected text in a text input field. As a result, <code>gContextMenu.isTextSelected</code> will be <code>true</code> when the user selects text in a text input field that is not a password field. ({{bug("565717")}})</li> + <li><a href="/zh-CN/docs/Mozilla/JavaScript_code_modules/Dict.jsm" title="Mozilla/JavaScript_code_modules/Dict.jsm">Dict.jsm</a>: <a href="/zh-CN/docs/Mozilla/JavaScript_code_modules/Dict.jsm#Creating_a_dictionary" title="Mozilla/JavaScript_code_modules/Dict.jsm#Creating_a_dictionary"><code>Dict()</code></a> now takes a JSON String. <a href="/zh-CN/docs/Mozilla/JavaScript_code_modules/Dict.jsm#toJSON()" title="Mozilla/JavaScript_code_modules/Dict.jsm#toJSON()"><code>Dict.toJSON()</code></a> was added, and it returns a JSON String. ({{bug("727967")}})</li> +</ul> + +<h3 id="接口变化">接口变化</h3> + +<dl> + <dt>{{interface("nsIImgLoadingContent")}}</dt> + <dd>The parameter (aObserver) of <code>addObserver()</code> method changes from {{interface("imgIDecoderObserver")}} to {{interface("imgINotificationObserver")}}. The <code>notify()</code> method of {{interface("imgINotificationObserver")}} is not scriptable, so you need to use <code>createScriptedObserver()</code> from {{interface("imgITools")}}.</dd> + <dt>{{interface("nsIChannel")}}</dt> + <dd> <code>contentLength</code> 属性的类型由<code> long</code> 改成 <code>int64_t</code>.</dd> +</dl> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/19.0/releasenotes/">Firefox 19 发行说明</a></li> + <li><a href="/zh-CN/docs/Site_Compatibility_for_Firefox_19">Firefox 19 网站兼容性</a></li> + <li><a href="https://blog.mozilla.org/addons/2013/02/07/compatibility-for-firefox-19/">Firefox 19 附加组件兼容性</a></li> +</ul> + +<h3 id="更早版本">更早版本</h3> + +<div>{{Firefox_for_developers('18')}}</div> diff --git a/files/zh-cn/mozilla/firefox/releases/20/index.html b/files/zh-cn/mozilla/firefox/releases/20/index.html new file mode 100644 index 0000000000..117426208d --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/20/index.html @@ -0,0 +1,47 @@ +--- +title: Firefox 20 for developers +slug: Mozilla/Firefox/Releases/20 +translation_of: Mozilla/Firefox/Releases/20 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 20正式版发布于<time datetime="2013-04-02">2013年4月2日.</time></p> +<h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> +<h3 id="HTML">HTML</h3> +<ul> + <li>实现了{{HTMLElement("a")}}和{{HTMLElement("area")}}元素上的{{htmlattrxref("download", "a") }}属性({{bug("676619")}}).</li> + <li><a href="/zh-CN/docs/HTML/Global_attributes" title="/zh-CN/docs/HTML/Global_attributes">全局属性</a> <a href="/zh-CN/docs/HTML/Global_attributes#attr-dir" title="/zh-CN/docs/HTML/Global_attributes"><code>dir</code></a> 的值开始支持 <code>auto</code> ({{bug("548206")}}).</li> +</ul> +<h3 id="JavaScript">JavaScript</h3> +<ul> + <li>实现了<code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/WeakMap" title="/zh-CN/docs/JavaScript/Reference/Global_Objects/WeakMap">Weakmap</a>.prototype.clear()</code>方法 ({{bug("814562")}}).</li> + <li>实现了<code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Math/imul" title="/zh-CN/docs/JavaScript/Reference/Global_Objects/Math/imul">Math.imul()</a></code>方法,可以进行C风格的32位整数乘法运算.还不属于harmony (EcmaScript 6)提案,所以是非标准的({{bug("808148")}}).</li> + <li>Web apps using draggable text with Kinetic 3.x are working, even when using the Cairo canvas backend. ({{bug("835064")}})</li> + <li>E4X规范中的<a href="/zh-CN/docs/JavaScript/Reference/Statements/for_each...in" title="/zh-CN/docs/JavaScript/Reference/Statements/for_each...in">for each...in</a>语句被废弃,请使用ES6中的<a href="/zh-CN/docs/JavaScript/Reference/Statements/for...of" title="/zh-CN/docs/JavaScript/Reference/Statements/for...of">for...of</a>语句代替 ({{Bug("804834")}}).</li> +</ul> +<h3 id="CSS">CSS</h3> +<ul> + <li><a href="/zh-CN/docs/CSS/Using_CSS_flexible_boxes" title="/zh-CN/docs/CSS/Using_CSS_flexible_boxes">CSS Flexbox</a>默认开启,不需要设置about:config.</li> + <li>实现了<a href="https://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html" title="https://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html">CSS Masking specification</a>中的<code>mask-type属性</code>({{bug("793617")}}).</li> +</ul> +<h3 id="DOM">DOM</h3> +<ul> + <li>{{domxref("HTMLMediaElement")}}支持可<code>playbackRate</code>属性(both read and write), with pitch correction. Pitch correction can be controlled using the property <code>mozPreservesPitch</code> ({{bug('495040')}}).</li> + <li>CSSOM: 实现了新的{{domxref("CSSGroupingRule")}}和{{domxref("CSSConditionRule")}} ({{bug("814907")}}).</li> + <li>CSSOM:{{domxref("CSSRule")}}上的常量<span id="summary_alias_container"><span id="short_desc_nonedit_display">CSSRule.MOZ_KEYFRAME_RULE</span></span>和<span id="summary_alias_container"><span id="short_desc_nonedit_display">CSSRule.MOZ_KEYFRAMES_RULE</span></span>去掉前缀成为了<span id="summary_alias_container"><span id="short_desc_nonedit_display">CSSRule.KEYFRAME_RULE</span></span>和<span id="summary_alias_container"><span id="short_desc_nonedit_display">CSSRule.KEYFRAMES_RULE</span></span>.带前缀的版本仍暂时保留让开发者过度他们的代码{{bug("816431")}}).</li> + <li>CSSOM: 现在可以设置{{domxref("CSSMediaRule")}}上的<code>conditionText属性的值</code> ({{bug("815021")}}).</li> + <li>{{domxref("DOMParser")}}上的 <code>parseFromStream和</code><code>parseFromBuffer</code>方法在web页面上被禁用.({{bug('816410')}}).</li> + <li><code><a href="/zh-CN/docs/XMLSerializer">XMLSerializer</a></code>上的<code>serializeToStream</code>方法在web页面上被禁用.({{bug('816410')}}).</li> + <li><code>TextDecoder</code>和<code>TextEncoder</code>接口可以在Worker中使用 ({{bug('795542')}}).</li> + <li>实现了<code>CSS.supports()方法</code>({{bug("779917")}}).</li> + <li>实现了<code>UndoManager</code>({{bug("617532")}}).</li> +</ul> +<h2 id="附加组件和Mozilla开发者需要注意的变化">附加组件和Mozilla开发者需要注意的变化</h2> +<ul> + <li>移除了nsIDOMParserJS接口{{bug('816410')}}.使用<a href="/zh-CN/docs/nsIDOMParser" title="/zh-CN/docs/nsIDOMParser">nsIDOMParser</a>来代替.</li> +</ul> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/20.0a1/nightlynotes/">Firefox 20 Aurora Release Notes</a></li> + <li><a href="/zh-CN/docs/Site_Compatibility_for_Firefox_20">Site Compatibility for Firefox 20</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('19')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/21/index.html b/files/zh-cn/mozilla/firefox/releases/21/index.html new file mode 100644 index 0000000000..9d0788dfa6 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/21/index.html @@ -0,0 +1,107 @@ +--- +title: Firefox 21 for developers +slug: Mozilla/Firefox/Releases/21 +translation_of: Mozilla/Firefox/Releases/21 +--- +<div>{{FirefoxSidebar}}</div><h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> +<h3 id="HTML">HTML</h3> +<ul> + <li>实现了{{HTMLElement("style")}}元素上的{{htmlattrxref("scoped", "style")}}属性.拥有该属性的{{HTMLElement("style")}}元素可以通过在Firefox 20中实现的CSS伪类{{cssxref(":scope")}}选择器选择到.({{bug("508725")}}).</li> + <li>实现了新的{{HTMLElement("main")}}元素({{bug("820508")}}).</li> +</ul> +<h3 id="JavaScript">JavaScript</h3> +<ul> + <li><a href="/zh-CN/docs/E4X" title="/zh-CN/docs/E4X">E4X</a>,一个古老的JavaScript扩展(ECMA-357),已经被删除.因为一直以来,只有Gecko支持它.({{bug("788293")}}).</li> + <li><a href="https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Global_Objects/parseInt" title="/zh-CN/docs/">parseInt</a>不再将以"0"开头的字符串作为8进制数字来解析({{bug("786135")}}).</li> +</ul> +<h3 id="CSS">CSS</h3> +<ul> + <li>{{cssxref("user-select", "-moz-user-select")}}属性的属性值在设置为<code>none时和设置为</code><code>-moz-none时</code><code>效果等同于</code>,这样才能让Gecko和其他内核WebKit(Chrome, Safari),Presto (Opera)以及Trident(Internet Explorer)中的表现相同({{bug("816298")}}).</li> + <li>On XHTML content, the <code>auto</code> value of {{cssxref("hyphens", "-moz-hyphens")}} incorrectly applied hyphenation rules when the language was not explicitly declared. This is fixed by ({{bug("702121")}}).</li> + <li>CSS属性{{cssxref("-moz-orient")}}现在支持新的值<code>auto</code>.当应用到一个{{HTMLElement("meter")}}元素或者{{HTMLElement("progress")}}元素上时,<code>auto就等同于</code><code>horizontal</code>({{bug("835883")}}).</li> +</ul> +<h3 id="DOM">DOM</h3> +<ul> + <li>实现了{{domxref("window.location")}}上的<code>origin</code>属性 ({{bug("828261")}}).</li> + <li><code>实现了</code><code><input type="time"></code>对象上的<code>valueAsDate</code>和<code>valueAsNumber</code>方法({{bug("781570")}}).</li> + <li>实现了<code><input type="time"></code>对象上的<code>min</code>和<code>max</code>属性({{bug("781572")}}).</li> + <li>Some new keyCodes for volume control are supported ({{bug("674739")}}).</li> + <li>Some new keyCodes for ancient keyboard layout such as AS/400 are now supported on Windows and Linux ({{bug("833719")}}).</li> + <li>Various keyCode values for OEM sepecific keys on Windows are now supported again ({{bug("833719")}}).</li> + <li>实现了<a href="../../../../../zh-CN/docs/DOM/window.crypto.getRandomValues" title="DOM/window.crypto.getRandomValues"><code>window.crypto.getRandomValues</code></a>函数({{bug("440046")}}).</li> +</ul> +<h3 id="SVG">SVG</h3> +<ul> + <li>实现了{{cssxref("paint-order")}}属性({{bug("828805")}}).</li> +</ul> +<h3 id="网络">网络</h3> +<ul> + <li>更新CSP实现到最新的CSP规范1.0(CR): + <ul> + <li>Support for the spec-compliant <span id="summary_alias_container"><span id="short_desc_nonedit_display"><code>Content-Security-Policy</code> HTTP header (in addition to the experimental </span></span><span id="summary_alias_container"><span id="short_desc_nonedit_display"><code>X-Content-Security-Policy</code>) has been added ({{bug("783049")}}). <strong>Note</strong>: the patch for this new header landed in Firefox 21, it is disabled on builds</span></span> ({{bug("842657")}}).</li> + </ul> + </li> +</ul> +<h2 id="附加组件和Mozilla开发者需要注意的变化">附加组件和Mozilla开发者需要注意的变化</h2> +<ul> + <li>FUEL applications cannot use the Livemarks service anymore ({{bug("834492")}}). The Livemarks service is deprecated and phased out in favor of the new async interface.</li> + <li>History API saw numerous deprecated API being removed: + <ul> + <li>Replaced by <code>mozIAsyncFavicons</code>: + <ul> + <li><code>nsIFaviconService::setFaviconUrlForPage</code></li> + <li><code>nsIFaviconService::setFaviconData</code></li> + <li><code>nsIFaviconService::getFaviconData</code></li> + <li><code>nsIFaviconService::getFaviconForPage</code></li> + <li><code>nsIFaviconService::setAndLoadFaviconForPage</code></li> + <li><code>nsIFaviconService::getFaviconImageForPage</code></li> + <li><code>nsIFaviconService::getFaviconDataAsDataURL</code></li> + </ul> + </li> + <li>Replaced by <code>mozIAsyncLivemarks</code>: + <ul> + <li><code>nsILivemarkService::*</code></li> + <li><code>PlacesUtils.itemIsLivemark</code></li> + <li><code>PlacesUtils.nodeIsLivemarkContainer</code></li> + <li><code>PlacesUtils.nodeIsLivemarkItem</code></li> + </ul> + </li> + <li>Removed only third argument: + <ul> + <li><code>PlacesUIUtils.showBookmarkDialog</code></li> + </ul> + </li> + <li>No more implemented by Places, use <code>mozIAsyncHistory</code> instead: + <ul> + <li><code>nsIGlobalHistory2::addURI</code></li> + <li><code>nsIGlobalHistory2::isVisited</code></li> + <li><code>nsIGlobalHistory2::setPageTitle</code></li> + </ul> + </li> + <li>No more needed, use <code>onDeleteURI</code> or <code>onItemRemoved</code>: + <ul> + <li><code>nsINavHistoryObserver::OnBeforeDeleteURI</code></li> + <li><code>nsINavBookmarkObserver::OnBeforeItemRemoved</code></li> + </ul> + </li> + <li>Never implemented properly: + <ul> + <li><code>nsINavHistoryFullVisitResultNode</code></li> + </ul> + </li> + <li>Deprecated, use<code> mozIAsyncHistory::updatePlaces</code> instead: + <ul> + <li><code>nsINavHistoryService::AddVisit</code></li> + </ul> + </li> + </ul> + </li> +</ul> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/21.0/releasenotes/">Firefox 21发行说明</a></li> + <li><a href="../../../../../zh-CN/docs/Site_Compatibility_for_Firefox_21">Firefox 21网站兼容性</a></li> + <li><a href="https://blog.mozilla.org/addons/2013/04/26/compatibility-for-firefox-21/">Firefox 21附加组件兼容性</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('20')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/22/index.html b/files/zh-cn/mozilla/firefox/releases/22/index.html new file mode 100644 index 0000000000..32177c38da --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/22/index.html @@ -0,0 +1,89 @@ +--- +title: Firefox 22 for developers +slug: Mozilla/Firefox/Releases/22 +tags: + - Firefox + - Firefox 22 +translation_of: Mozilla/Firefox/Releases/22 +--- +<div>{{FirefoxSidebar}}</div><h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>实现了HTML5中的{{HTMLElement("data")}}元素({{bug(839371)}}).</li> + <li>The HTML5 {{HTMLElement("time")}} element has been implemented ({{bug(629801)}}).</li> + <li>The <code style="font-style: normal;">range</code> state of the {{HTMLElement("input")}} element (<code style="font-style: normal;"><input type="range"></code>) has been implemented, behind the preference <code style="font-style: normal;">dom.experimental_forms_range</code>, only enabled by default on Nightly and Aurora channel ({{bug(841948)}}).</li> + <li>The support for the {{HTMLElement("template")}} element, part of the Web component specification has been implemented ({{bug(818976)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li><a href="http://asmjs.org/spec/latest/" title="http://asmjs.org/spec/latest/">Asm.js </a>optimizations are enabled, making it possible to compile C/C++ applications to a subset of JavaScript for better performance.</li> + <li>实现了ES6中的<a href="/zh-CN/docs/Web/JavaScript/Reference/Functions/Arrow_functions">箭头函数</a>({{bug(846406)}}).</li> + <li>The new <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is">Object.is</a> function has been added ({{bug(839979)}}).</li> + <li><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a></code> in generator expressions is now inherited from enclosing lexical scope ({{bug(848051)}}).</li> + <li>The ES2015 Proxy {{jsxref("Global_Objects/Proxy/handler/preventExtensions", "preventExtensions")}} trap have been implemented ({{bug(789897)}}).</li> +</ul> + +<h3 id="DOM">DOM</h3> + +<ul> + <li>不再支持<code>XMLHttpRequest中的</code><code>multipart属性和</code><code>multipart/x-mixed-replac</code>响应.这是一个Gecko独有的特性,从来没被标准化过.你可以使用<a href="/en-US/docs/Server-sent_events" title="/en-US/docs/Server-sent_events">Server-Sent Events</a>, <a href="/en-US/docs/WebSockets" title="/en-US/docs/WebSockets">Web Sockets</a>或者在progress事件中查看<code>responseText</code>属性的变化来实现同样的效果.</li> + <li>实现了<a href="http://notifications.spec.whatwg.org/" title="http://notifications.spec.whatwg.org/">Web Notifications</a> ({{bug(782211)}}).</li> + <li>{{domxref("XMLHttpRequest/FormData", "FormData")}}对象的<code>append</code>方法现在开始接受第三个参数<code>filename</code>({{bug(690659)}}).</li> + <li>移除了{{domxref("Node.isSupported")}}方法({{bug(801562)}}).</li> + <li>{{domxref("Node.setUserData")}} and {{domxref("Node.getUserData")}} has been removed for web content and are deprecated for chrome content ({{bug(842372)}}).</li> + <li>The {{domxref("Element.attributes")}} property has been moved there from {{domxref("Node")}} as required by the spec ({{bug("844134")}}).</li> + <li>实现了Mac OS X中的{{domxref("DeviceLightEvent", "Ambient Light Events")}}后端.</li> + <li>Elements in the HTML namespace with local names {{HTMLElement("bgsound")}}, {{HTMLElement("multicol")}}, and {{HTMLElement("image")}} no longer implement the {{domxref("HTMLSpanElement")}} interface. {{HTMLElement("bgsound")}} and {{HTMLElement("bgsound")}} implement {{domxref("HTMLUnknownElement")}} and {{HTMLElement("image")}} implements {{domxref("HTMLElement")}}.</li> + <li>The {{ domxref("NodeIterator.detach") }} method has been changed to do nothing ({{bug("823549")}}).</li> + <li>The {{domxref("BlobEvent")}} interface has been implemented ({{bug("834165")}}).</li> + <li>The properties <code>HTMLMediaElement.crossorigin</code> and <code>HTMLInputElement.inputmode</code> has been removed to match the spec in {{domxref("HTMLMediaElement.crossOrigin")}} and <code>HTMLInputElement.inputMode</code>, respectively ({{bug("847370")}} and {{bug("850346")}}).</li> + <li>WebRTC: the Media Stream API and Peer Connection API are now supported by default.</li> + <li>Web Components: the {{domxref("Document.register")}} method has been implemented ({{bug("783129")}}).</li> + <li>The {{domxref("ProgressEvent.initProgressEvent()")}} constructor method has been removed. Uses the standard constructor, {{domxref("ProgressEvent.ProgressEvent", "ProgressEvent()")}} to construc and initialize {{domxref("ProgressEvent")}} ({{bug("843489")}}).</li> + <li>Manipulated data associated with a {{event("cut")}}, {{event("copy")}}, or {{event("paste")}} event can now be accessed via the {{domxref("ClipboardEvent.clipboardData")}} property ({{bug("407983")}}).</li> + <li>The {{domxref("HTMLTimeElement")}} interface has been implemented ({{bug("629801")}}).</li> + <li>When a {{domxref("Worker")}} constructor is passed an invalid URL, it now throws {{domxref("DOMException")}} of type <code>SECURITY_ERR</code> ({{bug("587251")}}).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>Support for <a href="https://developer.mozilla.org/en-US/docs/CSS/Tutorials/Using_CSS_flexible_boxes" title="CSS/Tutorials/Using_CSS_flexible_boxes">CSS Flexbox layout</a> has been enabled by default ({{bug("841876")}}).</li> + <li>Following a spec change, the initial value for {{cssxref("min-width")}} and {{cssxref("min-height")}} has been changed back to <code>0</code>, even on flex items ({{bug("848539")}}).</li> + <li>Support for CSS Conditionals ({{cssxref("@supports")}} and {{domxref("CSS.supports")}}) has been enabled by default ({{bug("855455")}}).</li> + <li>Support for {{cssxref("background-clip")}} and {{cssxref("background-origin")}} properties in the {{cssxref("background")}} shorthand has been implemented ({{bug("570896")}}).</li> +</ul> + +<h2 id="附加组件和Mozilla开发者需要注意的变化">附加组件和Mozilla开发者需要注意的变化</h2> + +<ul> + <li>移除了下面这些方法中的<code>properties</code>参数: {{ifmethod('nsITreeView','getCellProperties')}}, {{ifmethod('nsITreeView','getColumnProperties')}} and {{ifmethod('nsITreeView','getRowProperties')}} methods of {{interface('nsITreeView')}}. These methods should now return a string of space-separated property names. ({{bug('407956')}})</li> + <li>The {{ifmethod('inIDOMUtils', 'getCSSPropertyNames')}} method has been implemented and will return all supported <a href="https://developer.mozilla.org/en-US/docs/CSS/CSS_Reference" title="/en-US/docs/CSS/CSS_Reference">CSS property</a> names.</li> + <li>See <a href="https://blog.mozilla.org/addons/2013/06/03/compatibility-for-firefox-22/" title="https://blog.mozilla.org/addons/2013/06/03/compatibility-for-firefox-22/">here </a>for more changes.</li> +</ul> + +<h3 id="Firefox_Developer_Tools">Firefox Developer Tools</h3> + +<ul> + <li><a href="https://hacks.mozilla.org/2013/04/developer-tools-update-firefox-22/" title="https://hacks.mozilla.org/2013/04/developer-tools-update-firefox-22/">Font inspector</a> shows which fonts on your computer are applied to the page.</li> + <li>Visual paint feedback mode shows when and where a page is repainted.</li> + <li>The dev tools may now be docked to the right side, not just the bottom of the browser.</li> + <li>Some panes within the dev tools have switched from <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=875727" title="https://bugzilla.mozilla.org/show_bug.cgi?id=875727">XUL to HTML</a>. For example, the css rule viewer is now chrome://browser/content/devtools/cssruleview.xhtml, not <code>cssruleview.xul</code>. Instead of adding an overlay directly to extend features of these panes, you may add an overlay and script to the outer xul document, to add load listeners and change these html documents.</li> + <li>The stack trace is now shown as a breadcrumb near the top, and the script listing is now at the left panel of the debugger.</li> +</ul> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li><a href="http://www.mozilla.org/en-US/firefox/22.0a1/auroranotes/">Firefox 22 Aurora Release Notes</a></li> + <li><a href="/en-US/docs/Site_Compatibility_for_Firefox_22">Site Compatibility for Firefox 22</a></li> + <li><a href="https://blog.mozilla.org/addons/2013/06/03/compatibility-for-firefox-22/">Add-on Compatibility for Firefox 22</a></li> +</ul> + +<h3 id="Older_versions">Older versions</h3> + +<p>{{Firefox_for_developers('21')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/23/index.html b/files/zh-cn/mozilla/firefox/releases/23/index.html new file mode 100644 index 0000000000..adaf75356f --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/23/index.html @@ -0,0 +1,94 @@ +--- +title: Firefox 23 for developers +slug: Mozilla/Firefox/Releases/23 +tags: + - Firefox + - Firefox 23 +translation_of: Mozilla/Firefox/Releases/23 +--- +<div>{{FirefoxSidebar}}</div><h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>Mixed content blocking. Firefox will no longer load non-secure (http) resources on secure (https) pages ({{bug(834836)}}).</li> + <li>The standard syntax of <a href="https://developer.mozilla.org/en-US/docs/Security/CSP" title="/en-US/docs/Security/CSP">CSP</a> 1.0 policies are now implemented and enforced by default.</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<p> </p> + +<ul> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty"><code>Object.defineProperty</code></a> method can now be used to redefine the <code>length</code>property of an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"><code>Array</code></a> object.</li> + <li>The option to disable JavaScript, including the options to allow moving windows/replace context menu, have been removed. You may still disable JavaScript by double clicking the "javascript.enabled" option in about:config.</li> +</ul> + +<h3 id="HTML_2">HTML</h3> + +<ul> + <li>The {{HTMLElement("blink")}} element support is now completely dropped. The <code><blink></code> tag now implements the {{domxref("HTMLUnknownElement")}} interface ({{bug(857820)}}).</li> + <li>The <code>range</code> type of the {{HTMLElement("input")}} element (<code><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range"><input type="range"></a></code>) has been switched on by default ({{bug(841950)}}).</li> +</ul> + +<p> </p> + +<h3 id="DOM">DOM</h3> + +<ul> + <li>D3E <a href="/en-US/docs/DOM/KeyboardEvent#Key_names_and_Char_values" title="/en-US/docs/DOM/KeyboardEvent#Key_names_and_Char_values"><code>KeyboardEvent.key</code></a> 现在只支持不可打印字符所在的键({{bug(842927)}}).</li> + <li>{{domxref("DOMImplementation.createHTMLDocument")}}方法的<code>title参数成为可选的</code>(根据最新规范).</li> + <li>The ability to add a sidebar panel (<code>window.sidebar.addPanel</code>) has been dropped ({{bug(691647)}}).</li> + <li>The unprefixed {{domxref("Window.requestAnimationFrame")}} and {{domxref("Window.cancelAnimationFrame")}} methods has been added ({{bug(704063)}}). The unprefixed {{domxref("Window.requestAnimationFrame")}} receives a {{domxref("DOMHighResTimeStamp")}} as argument; the prefixed version did, and still is, received a {{domxref("DOMTimeStamp")}}({{bug(753453)}}).</li> + <li>The text argument for {{domxref("window.alert")}} and {{domxref("window.confirm")}} is now optional ({{bug(861605)}}).</li> + <li>The {{domxref("HTMLMediaElement.initialTime")}} property, removed from the spec, is no more supported ({{bug(742537)}}).</li> + <li>The {{domxref("AnimationEvent.AnimationEvent", "AnimationEvent()")}} constructor has been added ({{bug(848293)}}).</li> + <li>The {{domxref("AnimationEvent.pseudoElement")}} property has been implemented ({{bug(848293)}}).</li> + <li>The {{domxref("TransitionEvent.TransitionEvent", "TransitionEvent()")}} constructor has been added ({{bug(848291)}}).</li> + <li>The {{domxref("TransitionEvent.pseudoElement")}} property has been implemented ({{bug(848291)}}).</li> + <li>The non-standard {{domxref("TransitionEvent.initTransitionEvent()")}} and {{domxref("AnimationEvent.initAnimationEvent()")}} have been removed ({{bug(868751)}}).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>CSS属性<code><a href="/en-US/docs/CSS/text-decoration" title="/en-US/docs/CSS/text-decoration">text-decoration</a>: blink;带来的闪烁效果被删除</code>({{bug(857820)}}).</li> + <li>In-flow {{cssxref("::after")}} and {{cssxref("::before")}} pseudo-elements are now flex items ({{bug(867454)}}).</li> + <li>The way to compute <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length#Viewport-percentage_lengths">viewport units</a> has been changed. In conjunction with <code>overflow:auto</code>, space taken by eventual scrollbars is not substracted from the viewport, whereas in the case of <code>overflow:scroll</code>, it is. ({{bug(811403)}})</li> +</ul> + +<h3 id="WebRTC">WebRTC</h3> + +<ul> + <li>Instead of including usernames in the {{domxref("RTCIceServer.url")}} property (such as stun:username@stunserver.example.com), you now need to use the new {{domxref("RTCIceServer.username")}} property.</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<ul> + <li>{{MathMLElement("mspace")}}元素开始支持负数宽度 ({{bug(717546)}}).</li> + <li>The {{MathMLElement("semantics")}} element now determines the visible child as described in the MathML3 specification.</li> +</ul> + +<h2 id="Changes_for_addon_and_Mozilla_developers">Changes for addon and Mozilla developers</h2> + +<h3 id="Firefox_developer_tools">Firefox developer tools</h3> + +<p>Addons that overlay chrome://browser/content/debugger.xul must now overlay chrome://browser/content/devtools/debugger.xul. You may add references to both these files in chrome.manifest for compatibility.</p> + +<p> </p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="http://www.mozilla.org/en-US/firefox/23.0a2/auroranotes/">Firefox 23 Aurora Notes</a></li> + <li><a href="https://www.fxsitecompat.com/en-US/versions/23/">Site Compatibility for Firefox 23</a></li> +</ul> + +<p> </p> + +<p> </p> + +<h3 id="之前版本">之前版本</h3> + +<p>{{Firefox_for_developers('22')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/24/index.html b/files/zh-cn/mozilla/firefox/releases/24/index.html new file mode 100644 index 0000000000..cd3dd112e2 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/24/index.html @@ -0,0 +1,22 @@ +--- +title: Firefox 24 for developers +slug: Mozilla/Firefox/Releases/24 +translation_of: Mozilla/Firefox/Releases/24 +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> +<h3 id="Developer_Tools">Developer Tools</h3> +<h3 id="HTML">HTML</h3> +<h3 id="JavaScript">JavaScript</h3> +<ul> + <li><a href="/zh-CN/docs/Web/JavaScript/Reference/arrow_functions" title="/zh-CN/docs/Web/JavaScript/Reference/arrow_functions">箭头函数</a>不再默认处于严格模式, 除非显示使用 <code>"use strict"</code>. ({{bug(852762)}})</li> +</ul> +<h3 id="DOM">DOM</h3> +<h3 id="MathML">MathML</h3> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/24.0a2/auroranotes/">Firefox 24 Aurora Notes</a></li> + <li><a href="/zh-CN/docs/Site_Compatibility_for_Firefox_24">Firefox 24 网站兼容性</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('23')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/25/index.html b/files/zh-cn/mozilla/firefox/releases/25/index.html new file mode 100644 index 0000000000..a23b1fd7c7 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/25/index.html @@ -0,0 +1,50 @@ +--- +title: Firefox 25 for developers +slug: Mozilla/Firefox/Releases/25 +translation_of: Mozilla/Firefox/Releases/25 +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<h2 id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> +<h3 id="CSS">CSS</h3> +<ul> + <li>新增了 {{cssxref("background-attachment")}} 属性值 <code>local</code> ({{bug("483446")}}).</li> + <li>新增了一个 Mozilla 私有的媒体查询属性: <code><a href="/zh-CN/docs/Web/Guide/CSS/Media_queries#-moz-os-version" title="/zh-CN/docs/Web/Guide/CSS/Media_queries#-moz-os-version">-moz-os-version</a></code>, 目前该属性只支持 Windows ({{bug("810399")}}).</li> + <li>实现了新的 {{cssxref("-moz-osx-font-smoothing")}} CSS 属性 ({{bug("857142")}})</li> +</ul> +<h3 id="HTML">HTML</h3> +<ul> + <li>实现了 {{HTMLElement("iframe")}} 元素的 {{htmlattrxref("srcdoc", "iframe")}} 属性, 可以用 HTML 代码来定义 {{HTMLElement("iframe")}} 元素的文档内容 ({{bug("802895")}}).</li> + <li style="padding: 0px;"><code style="font-style: inherit;">HTMLCanvasElement.toBlob</code> 方法, 当第二个参数指定为 <code style="font-style: inherit; font-size: 14px;">"image/jpeg"</code> 时, 会接受第三个参数, 用来指定 jpeg 图片质量. ({{bug("891884")}}).</li> +</ul> +<h3 id="JavaScript">JavaScript</h3> +<p>下面都是 <a href="/zh-CN/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla" title="/zh-CN/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla">ECMAScript 6</a> (Harmony) 中的新特性!</p> +<ul> + <li>实现了 <code>Array.of()</code> 方法 ({{bug("866849")}}).</li> + <li>实现了 <span id="summary_alias_container"><span id="short_desc_nonedit_display"><code>Number.parseInt()</code> 和 <code>Number.parseFloat()</code> 方法 ({{bug("886949")}})</span></span>.</li> + <li style="padding: 0px;">实现了 <span id="summary_alias_container"><code style="font-style: inherit;">Map.prototype.forEach()</code> 和 <code style="font-style: inherit;">Set.prototype.forEach()</code> 方法 ({{bug("866847")}})</span></li> + <li>实现了更多的数学函数: <code>Math.log10()</code>, <code>Math.log2()</code>, <code>Math.log1p()</code>, <code>Math.expm1()</code>, <code>Math.cosh()</code>, <code>Math.sinh()</code>, <code>Math.tanh()</code>, <code>Math.acosh()</code>, <code>Math.asinh()</code>, <code>Math.atanh()</code>, <code>Math.hypot()</code>, <code>Math.trunc()</code>, <code>Math.sign()</code> 以及 <code>Math.cbrt()</code> ({{bug("894026")}}).</li> + <li>实现了八进制整数字面量写法(比如<code>0o777</code>)和二进制整数字面量写法(比如<code>0b111</code>) ({{bug("717379")}}).</li> + <li>实现了 ECMAScript 国际化 API <span style="color: rgb(68, 68, 68); font-family: arial, sans-serif; font-size: small; line-height: 17.77777862548828px;">—</span><span style="color: rgb(68, 68, 68); font-family: arial, sans-serif; font-size: small; line-height: 17.77777862548828px;">— ECMA 402 </span>({{bug("853301")}})</li> +</ul> +<h3 id="DOM">DOM</h3> +<ul> + <li>在 Windows 上新增了<code> KeyboardEvent.key</code> 属性对几个与 IME 有关的键盘按键的支持 ({{bug("865565")}}), 查看 <a href="/zh-CN/docs/Web/API/KeyboardEvent#keyname_table_win" title="/zh-CN/docs/Web/API/KeyboardEvent#keyname_table_win">各按键对应的 key 属性列表</a> 了解详情.</li> + <li>Metrofox 的键盘事件和桌面版实现统一 ({{bug("843236")}}).</li> + <li>如果使用 <span style="font-family: monospace;">preventDefault() 阻止了 </span><span style="font-family: monospace;">keydown 事件的默认行为, 则后续的 </span><a href="https://developer.mozilla.org/zh-CN/docs/Web/Reference/Events/keydown#preventDefault()_of_keydown_event" title="https://developer.mozilla.org/zh-CN/docs/Web/Reference/Events/keydown#preventDefault()_of_keydown_event"><span style="font-family: monospace;">keypress 事件就不会触发</span></a> ({{bug("501496")}})</li> + <li>实现了 {{domxref("HTMLIFrameElement")}} 接口的 <code>srcDoc</code> 属性, 可以用 HTML 代码来定义 {{HTMLElement("iframe")}} 元素的文档内容 ({{bug("802895")}}).</li> + <li>实现了 {{domxref("HTMLTableElement")}} 接口的 <code>createTBody()</code> 方法, 可以用来获取 (创建) 表格的 {{HTMLElement("tbody")}} 子元素 ({{bug("813034")}}).</li> + <li>{{domxref("Range.collapse")}} 方法的 <code>toStart</code> 参数变为可选, 且默认值为 <code>false</code> ({{bug("891340")}}).</li> + <li><code style="font-size: 14px;">按照最新 DOM 规范, window.Future() <font face="Lucida Grande, Lucida Sans Unicode, DejaVu Sans, Lucida, Arial, Helvetica, sans-serif"><span style="line-height: 21px;">改名为</span></font></code><code style="font-size: 14px;"> window.Promise() </code>({{bug("884279")}}).</li> + <li>实现了 <span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">document.firstElementChild, </span><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">document.lastElementChild, </span><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">document.children, </span><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">document.childElementCount 以及 </span>DocumentFragment 的 <code>parentNode</code> 等属性<code style="font-size: 14px;"> </code>({{bug("895974")}}).</li> + <li style="padding: 0px;"><code style="font-style: inherit;">navigator.geolocation</code> 属性更新以符合最新规范. 它永远不会返回 <code style="font-style: inherit;">null</code>. 当 <code style="font-style: inherit;">geo.enabled</code> 偏好设置为 <code style="font-style: inherit;">false 时</code>, 它会返回 <code style="font-style: inherit;">undefined</code> ({{bug("884921")}}).</li> + <li style="padding: 0px;">{{domxref("ImageData")}} API 在 {{domxref("Worker")}} 内也可用 ({{bug("845545")}}).</li> +</ul> +<h3 id="MathML">MathML</h3> +<h3 id="SVG">SVG</h3> +<h2 id="相关链接">相关链接</h2> +<ul> + + <li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/25/Site_Compatibility">Firefox 25网站兼容性</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('24')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/25/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/25/site_compatibility/index.html new file mode 100644 index 0000000000..d808bf4007 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/25/site_compatibility/index.html @@ -0,0 +1,40 @@ +--- +title: Firefox 25网站兼容性 +slug: Mozilla/Firefox/Releases/25/Site_Compatibility +translation_of: Mozilla/Firefox/Releases/25/Site_Compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<section id="sect1"> + <h2 id="DOM">DOM</h2> + <section id="sect2"> + <h3 id="ImageDocument_属性被删除"><code>ImageDocument</code> 属性被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=885177">Bug 885177 – Make window.ImageDocument ChromeOnly</a></li> + </ul> + <p>非标准的 {{ domxref("ImageDocument") }} 接口在普通页面中不能访问了.</p> + </section> + <section id="sect3"> + <h3 id="worker_中的所有事件名都加上_Worker_前缀">worker 中的所有事件名都加上 <code>Worker 前缀</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=887236">Bug 887236 – prefix the current events in workers with "Worker"</a></li> + </ul> + <p>为了能让 <a href="/zh-CN/docs/Web/Reference/Events">普通的 DOM 事件</a> 能在 worker 中正常使用, 目前 worker 中的事件 {{domxref("Event") }}, {{ domxref("MessageEvent") }}, {{ domxref("ErrorEvent") }} and {{ domxref("ProgressEvent") }} 被重命名为了 {{ domxref("WorkerEvent") }}, {{ domxref("WorkerMessageEvent") }}, {{ domxref("WorkerErrorEvent") }} and {{ domxref("WorkerProgressEvent") }}.</p> + </section> +</section> +<section id="sect4"> + <h2 id="JavaScript">JavaScript</h2> + <section id="sect5"> + <h3 id="Proxy_全局变量从对象类型修正到函数类型"><code>Proxy</code> 全局变量从对象类型修正到函数类型</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=788172">Bug 788172 – Proxy is not a function (typeof Proxy should be 'function')</a></li> + </ul> + <p>以前, <a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy"><code>Proxy</code></a> 是一个对象类型的值. 现在 <code>typeof Proxy</code> 会返回 <code>function</code> ,且不需要在前面加 <a href="/zh-CN/docs/Web/JavaScript/Reference/Operators/new"><code>new</code></a> 运算符也可以正常调用了.</p> + </section> + <section id="sect6"> + <h3 id="yield_without_a_value_has_been_deprecated"><code>yield</code> without a value has been deprecated</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=885463">Bug 885463 – Warn about 'yield' without operand</a></li> + </ul> + <p><a href="/zh-CN/docs/Web/JavaScript/Reference/Operators/yield"><code>yield</code></a> 运算符不再需要一个操作数, 该变化遵循了 <a href="/zh-CN/docs/JavaScript/ECMAScript_6_support_in_Mozilla">ECMAScript 6</a> 规范草案.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/26/index.html b/files/zh-cn/mozilla/firefox/releases/26/index.html new file mode 100644 index 0000000000..621e9f87c9 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/26/index.html @@ -0,0 +1,41 @@ +--- +title: Firefox 26 for developers +slug: Mozilla/Firefox/Releases/26 +translation_of: Mozilla/Firefox/Releases/26 +--- +<div>{{FirefoxSidebar}}</div><h2 style="margin: 0px 0px 0.8em; padding: 0px;" id="Web开发者需要注意的变化">Web开发者需要注意的变化</h2> +<h3 id="CSS">CSS</h3> +<ul> + <li> <code><a href="/zh-CN/docs/Web/CSS/text-decoration-line">text-decoration-line</a> </code>属性仍然带有前缀, 不过现在它把 <code>'blink'</code> 也看看成了它的合法属性值, 虽然并不会真正的让内容产生闪烁效果 ({{bug("812995")}}).</li> + <li>非标准的 <code><a href="/zh-CN/docs/Web/CSS/-moz-text-blink">-moz-text-blink</a></code> 属性已被删除 ({{bug("812995")}}).</li> + <li>实现了 <a href="http://dev.w3.org/csswg/css-images-4/" title="http://dev.w3.org/csswg/css-images-4/">CSS Image Values Level 4</a> 中的 <a href="/zh-CN/docs/Web/CSS/image-orientation" title="/zh-CN/docs/Web/CSS/image-orientation"><code>image-orientation </code></a>属性, 比起 Level 3, Level 4 增加了对 <code>from-image</code> 关键字和 EXIF 的支持.</li> + <li>支持了 <code style="font-size: 14px;">position:sticky</code>, 需要开启 <code style="font-size: 14px;">layout.css.sticky.enabled</code> 选项({{bug(886646)}}).</li> +</ul> +<h3 id="HTML">HTML</h3> +<p><em>No change.</em></p> +<h3 id="JavaScript">JavaScript</h3> +<ul style="margin: 0px 0px 1.286em; padding: 0px; list-style-type: none;"> + <li style="padding: 0px;">实现了 ES6 中的 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math"><code style="font-style: inherit;">Math</code></a>: <code style="font-style: inherit;"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/fround" title="/en-US/docs/JavaScript/Reference/Global_Objects/Math/fround">Math.fround()</a>方法 </code>({{bug("900125")}}).</li> +</ul> +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> +<ul> + <li style="padding: 0px;">{{domxref("DOMImplementation.createDocument")}} 方法的第三个参数 <code>doctype </code>成为可选参数 ({{bug(909859)}}).</li> + <li>实现了新的 {{domxref("element.classList")}} 规范, 可以同时添加或删除多个类名, 比如 <code>element.classList.add("x", "y", "z")</code> ({{bug(814014)}}).</li> + <li style="padding: 0px;">实现了 {{domxref("URL.URL", "URL()")}} 构造函数 ({{bug("887364")}}).</li> + <li style="padding: 0px;">The properties {{domxref("URLUtils.origin")}}, {{domxref("URLUtils.password")}}, and {{domxref("URLUtils.username")}} are now available to all interfaces implementing {{domxref("URLUtils")}}: {{domxref("URL")}}, {{domxref("Location")}}, {{domxref("HTMLAnchorElement")}}, and {{domxref("HTMLAreaElement")}} ({{bug("887364")}}).</li> + <li style="padding: 0px;">The {{domxref("URL")}} interface is now accessible from Web Workers ({{bug("887364")}}).</li> + <li style="padding: 0px;">IndexedDB can now be used as a "optimistic" storage area so it doesn't require any prompts and data is stored in a pool with LRU eviction policy, in short temporary storage ({{bug("785884")}}).</li> + <li style="padding: 0px;">Path of the persistent storage has been changed from <profile>/indexedDB to <profile>/storage/persistent (on b2g from /data/local/indexedDB to /data/local/storage/persistent).</li> +</ul> +<h3 id="MathML">MathML</h3> +<ul> + <li>Inconsistent renderings of {{MathMLElement("mmultiscripts")}}, {{MathMLElement("msub")}}, {{MathMLElement("msup")}} and {{MathMLElement("msubsup")}} have been unified and the error handling of these elements has been improved ({{bug("827713")}}).</li> +</ul> +<h3 id="SVG">SVG</h3> +<p><em>No change.</em></p> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/26/Site_Compatibility">Firefox 26网站兼容性</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('25')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/26/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/26/site_compatibility/index.html new file mode 100644 index 0000000000..009959b5c0 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/26/site_compatibility/index.html @@ -0,0 +1,104 @@ +--- +title: Site Compatibility for Firefox 26 +slug: Mozilla/Firefox/Releases/26/Site_Compatibility +translation_of: Mozilla/Firefox/Releases/26/Site_Compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 26 <a href="http://www.mozilla.org/en-US/firefox/aurora/">Aurora</a> (pre-Beta) will be released on <time datetime="2013-09-20">September 20, 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="/en-US/docs/Mozilla/Firefox/Releases/26">Firefox 26 for developers</a></li> +</ul> +<p>This list may be updated until the release of the final version on <time datetime="2013-12-10">December 10, 2013</time>, so please check back later. Follow <a href="https://twitter.com/MozWebCompat">@MozWebCompat</a> on Twitter for further updates.</p> +<section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="-moz-text-blink_has_been_removed_in_favor_of_-moz-text-decoration-lineblink"><code>-moz-text-blink</code> has been removed in favor of <code>-moz-text-decoration-line:blink</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=812995">Bug 812995 – add 'blink' to -moz-text-decoration-line and drop -moz-text-blink</a></li> + </ul> + <p>The non-standard {{ cssxref("-moz-text-blink") }} property has been removed. Instead, the standard, still prefixed {{ cssxref("text-decoration-line") }} property now takes <code>blink</code> as a valid value. Actually it doesn't blink any content on Firefox though, from the perspective of <a href="/en-US/docs/Accessibility">accessibility</a>. Note that the blink effect with <code>text-decoration:blink</code> has been dropped with <a href="/en-US/docs/Site_Compatibility_for_Firefox_23">Firefox 23</a>.</p> + </section> +</section> +<section id="sect3"> + <h2 id="DOM">DOM</h2> + <section id="sect4"> + <h3 id="type_属性不是_image_的_HTMLInputElement_元素的_width_和_height_属性会返回_0">type 属性不是 image 的 HTMLInputElement 元素的 width 和 height 属性会返回 0</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=905240">Bug 905240 – HTMLInputElement.{width,height} getter should return 0 for type!='image'</a></li> + </ul> + <p>Previously, the <code>width</code> and <code>height</code> properties of an {{ HTMLElement("input") }} returned the dimension of the element. To comply with the spec, those properties now return <code>0</code> if the <code>type</code> property is not <code>image</code>.</p> + </section> + <section id="sect5"> + <h3 id="Setting_document.domain_in_a_sandboxed_iframe_is_no_longer_allowed">Setting <code>document.domain</code> in a sandboxed <code>iframe</code> is no longer allowed</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=907892">Bug 907892 – Disallow setting document.domain in sandboxed iframes</a></li> + </ul> + <p>Setting the {{ domxref("document.domain") }} property on a page embedded in an {{ HTMLElement("iframe") }} with the <code>sandbox</code> attribute will throw a security error from now on.</p> + </section> + <section id="sect6"> + <h3 id="元素的_id_改变后,旧_id_不再是_window_对象的属性"><code><font face="Georgia, Times, Times New Roman, serif">元素的 </font>id 改变后,旧 id 不再是 window 对象的属性</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=790601">Bug 790601 – Javascript element should not exist with old id</a></li> + </ul> + <p>An element with <code>id</code> is accessible through <code>window.<var><id></var></code>. Previously, the DOM object remained on {{ domxref("window") }} even after the <code>id</code> of the element is programmatically changed. This odd behavior has been fixed with Firefox 26. The {{ domxref("document.getElementById") }} method, which is recommended to use in general, is not affected by this change.</p> + </section> + <section id="sect7"> + <h3 id="MessageEvent_has_been_updated"><code>MessageEvent</code> has been updated</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848294">Bug 848294 – Update MessageEvent to be compatible with the spec</a></li> + </ul> + <p>The {{ domxref("MessageEvent") }} interface has been updated to comply with the latest spec. The <code>initMessageEvent</code> method has been removed while the interface is now a constructor.</p> + </section> + <section id="sect8"> + <h3 id="HTMLCanvasElement.mozGetAsFile_has_been_deprecated"><code>HTMLCanvasElement.mozGetAsFile</code> has been deprecated</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=803612">Bug 803612 – Add deprecation warnings for mozGetAsFile</a></li> + </ul> + <p>The non-standard <code>mozGetAsFile</code> method on the {{ domxref("HTMLCanvasElement") }} interface is now deprecated and will be removed soon. The standard <code>toBlob</code> method can be used instead.</p> + </section> + <section id="sect9"> + <h3 id="UserDataHandler_has_been_removed"><code>UserDataHandler</code> has been removed</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=910751">Bug 910751 – Hide UserDataHandler from content</a></li> + </ul> + <p>The deprecated {{ domxref("UserDataHandler") }} interface has been removed. The {{ domxref("Node.setUserData") }} and {{ domxref("Node.getUserData") }} methods have already been removed with <a href="/en-US/docs/Site_Compatibility_for_Firefox_22">Firefox 22</a>.</p> + </section> + <section id="sect10"> + <h3 id="XBL-related_methods_have_been_removed">XBL-related methods have been removed</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=912322">Bug 912322 – document.getAnonymous* should not be available to web content</a></li> + </ul> + <p>The following methods on the <a href="/en-US/docs/XBL/XBL_1.0_Reference/DOM_Interfaces">XBL DOM Interface</a> have been removed from the {{ domxref("Document") }} interface: <code>getAnonymousNodes</code>, <code>getAnonymousElementByAttribute</code>, <code>getBindingParent</code> and <code>loadBindingDocument</code>.</p> + </section> + <section id="sect11"> + <h3 id="Various_non-standard_interfaces_have_been_removed">Various non-standard interfaces have been removed</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=899388">Bug 899388 – Remove XUL-related interfaces and ChromeWindow from content</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=905739">Bug 905739 – Remove nsIDOMStorageIndexedDB</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=909340">Bug 909340 – Hide XULElement from content</a></li> + </ul> + <p>As part of the ongoing effort to standardize global objects, the following non-standard interfaces have been removed: <code>ChromeWindow</code>, <code>StorageIndexedDB</code>, <code>XULButtonElement</code>, <code>XULCheckboxElement</code>, <code>XULCommandDispatcher</code>, <code>XULCommandEvent</code>, <code>XULControlElement</code>, <code>XULDocument</code>, <code>XULElement</code>, <code>XULLabeledControlElement</code> and <code>XULPopupElement</code>.</p> + </section> +</section> +<section id="sect12"> + <h2 id="JavaScript">JavaScript</h2> + <section id="sect13"> + <h3 id="The_reserved_words_are_no_longer_allowed_as_function_names">The reserved words are no longer allowed as function names</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=907958">Bug 907958 – Restrict function names to non-keywords</a></li> + </ul> + <p>The <a href="/en-US/docs/Web/JavaScript/Reference/Reserved_Words">reserved words</a> cannot be used for function names. Starting with Firefox 26, such a usage will throw a <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError"><code>SyntaxError</code></a>. For example, <code>function delete() { ... }</code> is illegal.</p> + </section> +</section> +<section id="sect14"> + <h2 id="Plug-ins">Plug-ins</h2> + <section id="sect15"> + <h3 id="All_plug-ins_except_Flash_are_now_defaulted_to_Click-to-Play">All plug-ins except Flash are now defaulted to Click-to-Play</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=899080">Bug 899080 – Make plugins default to click-to-play</a></li> + </ul> + <p>Starting with Firefox 26, <a href="/en-US/docs/Plugins">plug-ins</a> require user interaction to be activated. With the exception of the popular Adobe Flash Player, all plug-in content embedded in a Web page is now disabled by default and enabled by user's click. This change has been made in order to improve security and performance of the browser. See the <a href="https://blog.mozilla.org/security/2013/01/29/putting-users-in-control-of-plugins/">Mozilla Security Blog</a> for details. Web developers are encouraged to leverage modern Web technologies, including <a href="/en-US/docs/Web/Guide/HTML/HTML5">HTML5</a>, to provide richer user experience.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/27/index.html b/files/zh-cn/mozilla/firefox/releases/27/index.html new file mode 100644 index 0000000000..7f9f6a9028 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/27/index.html @@ -0,0 +1,45 @@ +--- +title: Firefox 27 for developers +slug: Mozilla/Firefox/Releases/27 +translation_of: Mozilla/Firefox/Releases/27 +--- +<div>{{FirefoxSidebar}}</div><h2 id="Web_开发者需要注意的变化">Web 开发者需要注意的变化</h2> +<h3 id="开发者工具">开发者工具</h3> +<ul> + <li>可以在调试器中监控到 DOM 事件.</li> + <li>查看器可以直接编辑元素的 html 源码, 不再需要安装额外的扩展.</li> + <li>可以在查看器中直接预览背景图片和颜色值.</li> + <li>可以输出 reflow 日志.</li> +</ul> +<p>更多详情, 请看<a style="line-height: 1.572;" href="https://hacks.mozilla.org/2013/11/firefox-developer-tools-episode-27-edit-as-html-codemirror-more/">这篇文章</a>.</p> +<h3 id="CSS">CSS</h3> +<ul> + <li><code><span style="line-height: 21px;">CSS {{cssxref("cursor")}} 属性值中 </span>-moz-grab</code> 和 <code>-moz-grabbing</code> 关键字脱前缀, 成为 <code>grab</code> 和 <code>grabbing</code> ({{bug("880672")}}).</li> +</ul> +<h3 id="HTML">HTML</h3> +<ul> + <li>桌面浏览器上实现了<code><input type = "color"></code></li> +</ul> +<h3 id="JavaScript">JavaScript</h3> +<p><a href="/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla" title="/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla">EcmaScript 6</a> (Harmony) 实现了:</p> +<ul> + <li><a href="http://wiki.ecmascript.org/doku.php?id=harmony:spread" title="http://wiki.ecmascript.org/doku.php?id=harmony:spread">展开运算符</a>支持在函数调用时的实参左边位置使用 ({{bug("762363")}}).</li> + <li>实现了多个数学函数 {{jsxref("Global_Objects/Math/hypot", "Math.hypot()")}} ({{bug("896264")}}).</li> +</ul> +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> +<p><em>No change.</em></p> +<h3 id="MathML">MathML</h3> +<p><em>No change.</em></p> +<h3 id="SVG">SVG</h3> +<p><em>No change.</em></p> +<h2 id="附加组件和_Mozilla_开发者需要注意的变化">附加组件和 Mozilla 开发者需要注意的变化</h2> +<ul> + <li><code>移除了 downloads-indicator</code>, 你应该使用 <code>downloads-button</code> 元素来代替.</li> + <li>Firefox 不再使用 <code>chrome://browser/skin/downloads/indicator.css</code> 样式.</li> +</ul> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/27/Site_Compatibility">Site Compatibility for Firefox 27</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('26')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/28/index.html b/files/zh-cn/mozilla/firefox/releases/28/index.html new file mode 100644 index 0000000000..1e41a0b20d --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/28/index.html @@ -0,0 +1,117 @@ +--- +title: Firefox 28 for developers +slug: Mozilla/Firefox/Releases/28 +tags: + - Firefox + - Firefox 28 +translation_of: Mozilla/Firefox/Releases/28 +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 28 was released on March 18, 2014. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="Changes_for_Web_developers">Changes for Web developers</h2> + +<h3 id="Developer_Tools">Developer Tools</h3> + +<ul> + <li>The {{domxref("console.exception")}} property has been added ({{bug("922214")}}).</li> + <li>The {{domxref("console.assert")}} property has been added ({{bug("760193")}}).</li> + <li>App Manager: a new Manifest Editor was added.</li> + <li>App Manager: the toolbox used for debugging apps is now embedded in the app manager UI.</li> + <li>Web Console: added a "split console" mode - press Escape to quickly open the console in any other tool.</li> + <li>Web Console: added a dark theme for the output.</li> + <li>Debugger: pretty-print minified JavaScript.</li> + <li>Debugger: simply hover over any variable or click on it to bring up a pop-up that displays the current value.</li> + <li>Inspector: added a color picker in rules view and various tooltips.</li> + <li>Browser Toolbox: allows add-on and platform developers to use almost all of the developer tools while targeting the browser itself.</li> +</ul> + +<p>More details in <a href="https://hacks.mozilla.org/2013/12/split-console-pretty-print-minified-js-and-more-firefox-developer-tools-episode-28/" title="Split console, pretty-print minified JS and more – Firefox Developer Tools Episode 28">this post</a>.</p> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>Support for multi-line <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes">flexbox</a> has been added ({{bug("939901")}}).</li> + <li>Longhand East Asian <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type">counter styles</a> have been implemented ({{bug("934072")}}).</li> + <li>Experimental support for the {{cssxref("background-blend-mode")}} property has been added, but is disabled by default ({{bug("841601")}}).</li> + <li>The <code>none</code> value has been added to {{cssxref("font-variant-ligatures")}} ({{bug("913264")}}).</li> + <li>Support for the :hover user action pseudo-class on pseudo-elements({{bug("922669")}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li><code><input type=color></code> and <code><input type=number></code> have been implemented, disabled by default.</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla" title="/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla">ECMAScript 2015</a> implementation continues: + + <ul> + <li>New <code>Array</code> methods have been implemented: {{jsxref("Array.prototype.entries()")}} and {{jsxref("Array.prototype.keys()")}} ({{bug("894658")}}).</li> + </ul> + </li> + <li>A bug causing that {{jsxref("Object.getOwnPropertyNames()")}} did not see unresolved properties of {{jsxref("Error")}} objects has been fixed ({{bug("724768")}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<ul> + <li><code>HTMLVideoElement.canPlayType('video/webm')</code> now reports <code>maybe</code>.({{bug("884275")}}).</li> + <li>The {{domxref("DocumentFragment.getElementById()")}} method has been implemented. E.g. <code>document.createDocumentFragment().getElementById()</code>({{bug("933193")}}).</li> + <li>The {{domxref("KeyboardEvent.repeat")}} attribute has been implemented ({{bug("600117")}}).</li> + <li>The {{domxref("File")}} constructor, e.g. <code>new File(["foo"], "foo.txt")</code> has been implemented. ({{bug("819900")}}).</li> + <li>The {{domxref("NavigatorPlugins.plugins", "navigator.plugins")}} is no more enumerable, for privacy reasons ({{bug(757726)}}).</li> + <li>The two attributes {{domxref("Window.screenX")}} and {{domxref("Window.screenY")}} now return CSS pixels (and no more device pixels) ({{bug(943668)}}).</li> + <li>The two methods {{domxref("CanvasRenderingContext2D.drawSystemFocusRing()")}} and {{domxref("CanvasRenderingContext2D.drawCustomFocusRing()")}} have been implemented. The preference <code>canvas.focusring.enabled</code> must be set to <code>true</code> to activate both ({{bug(540456)}}).</li> + <li>The <code>willReadFrequently</code> context attribute for "<code>2d</code>" canvas contexts has been implemented (see {{domxref("HTMLCanvasElement.getContext()")}}) ({{bug(884226)}}).</li> + <li>The following attributes and methods of {{domxref("NavigatorID")}} have been implemented on {{domxref("WorkerNavigator")}} to allow their use in workers: {{domxref("NavigatorID.appCodeName", "appCodeName")}}, {{domxref("NavigatorID.product", "product")}}, and {{domxref("NavigatorID.taintEnabled", "taintEnabled()")}} ({{bug(925847)}}).</li> + <li>The {{domxref("NonDocumentTypeChildNode.previousElementSibling" , "previousElementSibling")}} and {domxref("NonDocumentTypeChildNode.nextElementSibling" , "nextElementSibling")}} properties has been removed from {{domxref("DocumentType")}}, because of compatibility problems ({{bug(932501)}}).</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<ul> + <li>Support of <span id="summary_alias_container"><span id="short_desc_nonedit_display">“</span></span>mathvariant<span id="summary_alias_container"><span id="short_desc_nonedit_display">”</span></span> attribute ({{bug("114365")}}).</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>No change.</em></p> + +<h3 id="AudioVideo">Audio/Video</h3> + +<ul> + <li><span id="summary_alias_container"><span id="short_desc_nonedit_display">Support Opus in WebM</span></span> ({{bug("887978")}}).</li> + <li><span id="summary_alias_container"><span id="short_desc_nonedit_display">Support VP9 video decoder</span></span> ({{bug("833023")}}).</li> +</ul> + +<h3 id="Network">Network</h3> + +<ul> + <li>Support of <code>SPDY/2</code> has been removed.</li> +</ul> + +<h2 id="Changes_for_addon_and_Mozilla_developers">Changes for addon and Mozilla developers</h2> + +<ul> + <li>The interface of <a href="https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/DeferredTask.jsm">DeferredTask.jsm</a> has been changed, and the <code>isPending()</code>, <code>start()</code>, <code>flush()</code>, and <code>cancel()</code> methods have been removed ({{bug("940408")}}).</li> +</ul> + +<h2 id="Security">Security</h2> + +<ul> + <li>CSP was not enforced in sandboxed iframes. This has been fixed ({{bug(886164)}}).</li> + <li>The CSP 1.1 experimental <code>script-nonce</code> directive has been implemented. The preference <code>security.csp.experimentalEnabled</code> should be set to <code>true</code> to enable this functionality ({{bug(855326)}}).</li> +</ul> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/28/Site_Compatibility">Site Compatibility for Firefox 28</a></li> +</ul> + +<h3 id="Older_versions">Older versions</h3> + +<p>{{Firefox_for_developers('27')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/28/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/28/site_compatibility/index.html new file mode 100644 index 0000000000..c2a74bad9f --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/28/site_compatibility/index.html @@ -0,0 +1,56 @@ +--- +title: Site Compatibility for Firefox 28 +slug: Mozilla/Firefox/Releases/28/Site_Compatibility +translation_of: Mozilla/Firefox/Releases/28/Site_Compatibility +--- +<div>{{FirefoxSidebar}}</div><p><span style="font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 30px;">DOM</span></p> +<section id="sect5"> + <section id="sect1"> + <h3 id="navigator.plugins_不再是可枚举的"><code>navigator.plugins</code> 不再是可枚举的</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=757726">Bug 757726 – disallow enumeration of navigator.plugins</a></li> + </ul> + <p>{{ domxref("PluginArray") }} 接口, 通常就是指 {{ domxref("window.navigator.plugins") }} 属性, 现在不再是可以枚举的了. 这么做主要是为了防止网站通过某些技术手段窃取用户隐私. 不过开发人员仍然可以使用 {{ domxref("window.navigator.mimeTypes") }} 接口来判断浏览器支持哪些 MIME 类型. 这一变更可能会给一些已有的代码<a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=934107">带来兼容性问题</a>.</p> + </section> + <section id="sect2"> + <h3 id="showModalDialog_has_been_deprecated"><code>showModalDialog</code> has been deprecated</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=933040">Bug 933040 – Warn for showModalDialog uses</a></li> + </ul> + <p>The {{ domxref("window.showModalDialog") }} method, originally from Internet Explorer, is now considered deprecated. The {{ domxref("window.open") }} method should be used instead.</p> + </section> + <section id="sect3"> + <h3 id="Make_sure_the_deep_argument_is_specified_for_cloneNode_and_importNode">Make sure the <code>deep</code> argument is specified for <code>cloneNode</code> and <code>importNode</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=937465">Bug 937465 – Add a warning when cloneNode/importNode is used without a boolean argument on a node with children</a></li> + </ul> + <p>The {{ domxref("Node.cloneNode") }} and {{ domxref("document.importNode") }} methods take the boolean <code>deep</code> argument. It's optional in the DOM4 specification, and if omitted, these methods acted as if the value of <code>deep</code> was <code>true</code>. But this behavior has been changed in the latest spec, and if omitted, the methods will act as if the value was <code>false</code>. Though It's still optional, Firefox now warns developers in console not to omit the argument for the forward compatibility.</p> + </section> + <section id="sect4"> + <h3 id="History_objects_now_throw_if_the_document_is_inactive"><code>History</code> objects now throw if the <code>document</code> is inactive</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=940783">Bug 940783 – History objects should unconditionally throw if their inner is not current</a></li> + </ul> + <p>The spec of the {{ domxref("History") }} interface has been updated, and the properties and methods now throw a <code>SecurityError</code> exception when those are called on an inactive {{ domxref("document") }}. It would be a problem if you are manipulating {{ domxref("window.history") }} in an {{ HTMLElement("iframe") }}.</p> + </section> +</section> +<section id="sect6"> + <h2 id="Networking">Networking</h2> + <section id="sect7"> + <h3 id="SPDY2_support_has_been_dropped">SPDY/2 support has been dropped</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=912550">Bug 912550 – remove spdy/2 support</a></li> + </ul> + <p>The support of SPDY Protocol Draft 2 has been removed. Web sites should upgrade to SPDY/3 or 3.1.</p> + </section> +</section> +<section id="sect8"> + <h2 id="VideoAudio">Video/Audio</h2> + <section id="sect9"> + <h3 id="canPlayType('videowebm')_now_returns_'maybe'"><code>canPlayType('video/webm')</code> now returns <code>'maybe'</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=884275">Bug 884275 – canPlayType('video/webm') should report 'maybe' instead of 'probably'</a></li> + </ul> + <p>The <code>canPlayType</code> method of the {{ domxref("HTMLMediaElement") }} interface has been updated to comply with the spec. <code>canPlayType('video/webm')</code> and <code>canPlayType('audio/webm')</code> now return <code>'maybe'</code> instead of <code>'probably'</code>, because media can be encoded with a codec that Firefox doesn't support. If a codec is specified in the <code>type</code> argument, the method returns <code>'probably'</code> or <code>''</code> (empty string) depending on the codec. For example, <code>canPlayType('video/webm; codecs=vp8')</code> returns <code>'probably'</code>.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/3.6/index.html b/files/zh-cn/mozilla/firefox/releases/3.6/index.html new file mode 100644 index 0000000000..8bc9182b45 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/3.6/index.html @@ -0,0 +1,305 @@ +--- +title: Firefox 3.6 for developers +slug: Mozilla/Firefox/Releases/3.6 +translation_of: Mozilla/Firefox/Releases/3.6 +--- +<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><a class="external" href="http://www.firefox.com/" title="http://www.firefox.com/">Firefox 3.6</a> offers support for new and developing web standards, increased performance, and an overall better experience for web users and developers. This page provides links to articles covering the new capabilities of Firefox 3.6.</p> + +<h2 id="For_web_site_and_application_developers">For web site and application developers</h2> + +<h3 id="CSS">CSS</h3> + +<dl> + <dt><a href="/zh-cn/CSS/Using_CSS_gradients" title="zh-cn/Using gradients">Using gradients</a></dt> + <dd>Firefox 3.6 adds support for the proposed <a href="/zh-CN/docs/Web/CSS/-moz-linear-gradient" title="此页面仍未被本地化, 期待您的翻译!"><code>-moz-linear-gradient</code></a> and <a href="/zh-CN/docs/Web/CSS/-moz-radial-gradient" title="此页面仍未被本地化, 期待您的翻译!"><code>-moz-radial-gradient</code></a> properties for <a href="/zh-CN/docs/Web/CSS/background" title="background 是一种 CSS 简写属性,用于一次性集中定义各种背景属性,包括 color, image, origin 与 size, repeat 方式等等。"><code>background</code></a>.</dd> + <dt><a href="/zh-cn/CSS/Multiple_backgrounds" title="zh-cn/CSS/Multiple backgrounds">Multiple backgrounds</a></dt> + <dd>The <a href="/zh-CN/docs/Web/CSS/background" title="background 是一种 CSS 简写属性,用于一次性集中定义各种背景属性,包括 color, image, origin 与 size, repeat 方式等等。"><code>background</code></a> property (as well as <a href="/zh-CN/docs/Web/CSS/background-color" title='CSS属性中的 background-color 会设置元素的背景色, 属性的值为颜色值或关键字"transparent"二者选其一.'><code>background-color</code></a>, <a href="/zh-CN/docs/Web/CSS/background-image" title="CSS background-image 属性用于为一个元素设置一个或者多个背景图像。图像在绘制时,以z方向堆叠的方式进行。先指定的图像会在之后指定的图像上面绘制。因此指定的第一个图像最接近用户。"><code>background-image</code></a>, <a href="/zh-CN/docs/Web/CSS/background-position" title="background-position 为每一个背景图片设置初始位置。 这个位置是相对于由 background-origin 定义的位置图层的。"><code>background-position</code></a>, <a href="/zh-CN/docs/Web/CSS/background-repeat" title="background-repeat CSS 属性定义背景图像的重复方式。背景图像可以沿着水平轴,垂直轴,两个轴重复,或者根本不重复。"><code>background-repeat</code></a>, and <a href="/zh-CN/docs/Web/CSS/background-attachment" title="如果指定了 background-image ,那么 background-attachment 决定背景是在视口中固定的还是随包含它的区块滚动的。"><code>background-attachment</code></a>) now supports multiple backgrounds. This lets you specify multiple backgrounds that are rendered atop one another in layers.</dd> + <dt><a href="/zh-cn/CSS/Media_queries#Mozilla-specific_media_features" title="zh-cn/CSS/Media queries#Mozilla-specific media features">Mozilla-specific media features</a></dt> + <dd>Media features have been added for Mozilla-specific system metrics, so that <a href="/zh-cn/CSS/Media_queries" title="zh-cn/CSS/Media queries">media queries</a> can be used to more safely check on the availability of features such as touch support.</dd> + <dt><a href="/zh-cn/CSS/Scaling_background_images" title="zh-cn/CSS/Scaling background images">Scaling background images</a></dt> + <dd>The <code>background-size </code>property from the <a class="external" href="http://dev.w3.org/csswg/css3-background/" title="http://dev.w3.org/csswg/css3-background/#the-background-size-property">CSS 3 Backgrounds and Borders draft</a> is now supported under the name <a href="/zh-CN/docs/Web/CSS/-moz-background-size" title="此页面仍未被本地化, 期待您的翻译!"><code>-moz-background-size</code></a>.</dd> + <dt><a href="/zh-cn/WOFF" title="zh-cn/About WOFF">WOFF font support</a></dt> + <dd><a href="/zh-CN/docs/Web/CSS/@font-face" title="这是一个叫做@font-face 的CSS @规则 ,它允许网页开发者为其网页指定在线字体。 通过这种作者自备字体的方式,@font-face 可以消除对用户电脑字体的依赖。 @font-face 不仅可以放在在CSS的最顶层, 也可以放在 @规则 的 条件规则组 中。"><code>@font-face</code></a> now supports the WOFF downloadable font file format.</dd> + <dt><a href="/zh-cn/CSS/pointer-events" title="zh-cn/CSS/pointer-events">Pointer events</a></dt> + <dd>The <a href="/zh-CN/docs/Web/CSS/pointer-events" title="pointer-events CSS 属性指定在什么情况下 (如果有) 某个特定的图形元素可以成为鼠标事件的 target。"><code>pointer-events</code></a> property lets content specify whether or not an element may be the target of mouse pointer events.</dd> +</dl> + +<h4 id="Miscellaneous_CSS_changes">Miscellaneous CSS changes</h4> + +<ul> + <li>The <a href="/zh-cn/CSS/length#Relative_length_units" title="zh-cn/CSS/length#Relative length units"><code>rem</code></a> length unit from <a class="external" href="http://www.w3.org/TR/css3-values/#lengths" title="http://www.w3.org/TR/css3-values/#lengths">CSS3 Values and Units</a> is now supported. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=472195" title="FIXED: support css3 root em ('rem' or 're') units">bug 472195</a></li> + <li><a href="/zh-CN/docs/Web/CSS/image-rendering" title="image-rendering CSS 属性决定浏览器对缩放图像采取的缩放算法.它适用于元素本身和有其他属性的图像.它对非缩放图像没有影响。"><code>image-rendering</code></a> is supported for images, background images, videos and canvases. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423756" title="FIXED: Request: Switch for authors to turn on/off bilinear filtering when enlarging images">bug 423756</a></li> + <li><a href="/zh-CN/docs/Web/CSS/text-align" title="text-align CSS属性定义行内内容(例如文字)如何相对它的块父元素对齐。text-align 并不控制块元素自己的对齐,只控制它的行内内容的对齐。"><code>text-align</code></a>:end is now supported. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=299837" title="FIXED: [FIX]add support for text-align: end">bug 299837</a></li> + <li>DOM changes to elements using the table <a href="/zh-CN/docs/Web/CSS/display" title="display CSS 属性指定了元素的显示类型,它包含两类基础特征,用于指定元素怎样生成盒模型——外部显示类型定义了元素怎样参与流式布局的处理,内部显示类型定义了元素内子元素的布局方式。"><code>display</code></a> types now work much better.</li> + <li>Added <a href="/zh-CN/docs/Web/CSS/:-moz-locale-dir(ltr)" title="此页面仍未被本地化, 期待您的翻译!"><code>:-moz-locale-dir(ltr)</code></a> and <a href="/zh-CN/docs/Web/CSS/:-moz-locale-dir(rtl)" title="此页面仍未被本地化, 期待您的翻译!"><code>:-moz-locale-dir(rtl)</code></a> to make it easier to customize layouts based on whether the user interface is being displayed using a left-to-right or a right-to-left locale. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=478416" title="FIXED: Replace chromedir with something more sane">bug 478416</a></li> + <li>Added support for the <a href="/zh-CN/docs/Web/CSS/:indeterminate" title=":indeterminate CSS 伪类 表示状态不确定的表单元素:"><code>:indeterminate</code></a> pseudo-class, which matches <code>checkbox</code> <a class="internal" href="/zh-cn/HTML/Element/Input" title="zh-cn/HTML/Element/input"><code>input</code></a> elements whose <code>indeterminate</code> attribute is <code>true</code>.</li> + <li>Windowed plugins are no longer displayed in CSS transforms, because they can't be transformed properly by the compositor.</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<dl> + <dt><a href="/zh-cn/Using_files_from_web_applications" title="zh-cn/Using files from web applications">Using files from web applications</a></dt> + <dd>Support for the new HTML5 File API has been added to Gecko, making it possible for web applications to access local files selected by the user. This includes support for selecting multiple files using the <code>input type="file"</code> HTML element's new <code>multiple</code> attribute.</dd> + <dt>HTML5 video supports poster frames</dt> + <dd>The <code>poster</code> attribute is now supported for the <a class="internal" href="/zh-cn/HTML/Element/Video" title="zh-cn/HTML/Element/Video"><code>video</code></a> element, allowing content to specify a poster frame to be displayed until the video begins to play.</dd> + <dt>Checkboxes and radio buttons support the <code>indeterminate</code> property</dt> + <dd>HTML <a class="internal" href="/zh-cn/HTML/Element/Input" title="zh-cn/HTML/Element/input"><code>input</code></a> elements of types <code>checkbox</code> and <code>radio</code> now support the indeterminate property, which allows a third, "indeterminate" state.</dd> + <dt>Canvas image smoothing can be controlled</dt> + <dd>The new <a class="internal" href="/zh-cn/Canvas_tutorial/Using_images#Controlling_image_scaling_behavior" title="zh-cn/Canvas tutorial/Using images#Controlling image scaling behavior"><code>mozImageSmoothingEnabled</code></a> property can be used to turn on and off image smoothing when scaling in <a class="internal" href="/zh-cn/HTML/Element/canvas" title="zh-cn/HTML/Element/canvas"><code>canvas</code></a> elements.</dd> + <dt>Asynchronous script execution</dt> + <dd>By setting the <code>async</code> attribute on a <a href="/zh-cn/HTML/Element/Script" title="zh-cn/HTML/Element/Script"><code>script</code></a> element, the <code>script</code> will not block loading or display of the rest of the page. Instead the <code>script</code> executes as soon as it is downloaded.</dd> +</dl> + +<h3 id="JavaScript">JavaScript</h3> + +<p>Gecko 1.9.2引入了JavaScript 1.8.2, 该版本的JavaScript添加了许多来自<a href="/zh-cn/JavaScript/ECMAScript_5_support_in_Mozilla" title="https://developer.mozilla.org/zh-cn/JavaScript/ECMAScript_5_support_in_Mozilla">ECMAScript 5</a>的新的语言特性:</p> + +<ul> + <li><a href="/zh-cn/JavaScript/Reference/Global_Objects/Date/parse" title="zh-cn/JavaScript/Reference/Global Objects/Date/parse"><code>Date.parse()</code></a>方法现在可以解析符合ISO 8601标准的日期格式字符串,像这样YYYY-MM-DD.</li> + <li> + <p>函数从原型链<a href="/zh-cn/JavaScript/Reference/Global_Objects/Function/prototype" title="zh-cn/JavaScript/Reference/Global Objects/Function/prototype"><code>prototype</code></a>上继承的属性不会再被遍历到.</p> + </li> +</ul> + +<dl> +</dl> + +<h3 id="DOM">DOM</h3> + +<dl> + <dt>Web workers可以自行终止</dt> + <dd><a href="/zh-cn/DOM/Using_web_workers" title="zh-cn/Using web workers">Workers</a> 开始支持<code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIWorkerScope#close()">nsIWorkerScope.close()</a></code>方法, 该方法允许它们终止自身的运行.</dd> + <dt>支持文件的拖放</dt> + <dd><a href="/zh-cn/DragDrop/DataTransfer" title="zh-cn/DragDrop/DataTransfer"><code>DataTransfer</code></a>对象提供的拖拽监听器现在可以包含一个被拖拽的文件列表.</dd> + <dt>Checking to see if an element matches a specified CSS selector</dt> + <dd>The new <a href="/zh-CN/docs/Web/API/Node/mozMatchesSelector" title="此页面仍未被本地化, 期待您的翻译!"><code>element.mozMatchesSelector</code></a> method lets you determine whether or not an element matches a specified CSS selector. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=518003" title="FIXED: implement function to check whether element matches a CSS selector">bug 518003</a>.</dd> + <dt><a href="/zh-cn/Detecting_device_orientation" title="zh-cn/Detecting device orientation">Detecting device orientation</a></dt> + <dd>Content can now detect the orientation of the device if it has a supported accelerometer, using the <a href="/zh-cn/DOM/MozOrientation" title="zh-cn/DOM/MozOrientation"><code>MozOrientation</code></a> event. Firefox 3.6 supports the accelerometer in Mac laptops.</dd> + <dt><a href="/zh-cn/DOM/Detecting_document_width_and_height_changes" title="zh-cn/DOM/Detecting document width and height changes">Detecting document width and height changes</a></dt> + <dd>The new <code>MozScrollAreaChanged</code> event is dispatched whenever the document's <code>scrollWidth</code> and/or <code>scrollHeight</code> properties change.</dd> +</dl> + +<h4 id="Miscellaneous_DOM_changes">Miscellaneous DOM changes</h4> + +<ul> + <li>The <code>getBoxObjectFor()</code> method has been <strong>removed</strong>, as it was non-standard and exposed even more non-standard stuff to the web. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=340571" title="FIXED: getBoxObjectFor leaking-onto-the-Web disaster">bug 340571</a>. Also affects <a class="external" href="http://mootools.net/" title="http://mootools.net/">MooTools</a> which uses this call for Gecko detection; this has been fixed in the latest version of MooTools, so be sure to update.</li> + <li>The new <a class="internal" href="/zh-cn/DOM/window.mozInnerScreenX" title="zh-cn/DOM/window.mozInnerScreenX"><code>mozInnerScreenX</code></a> and <a class="internal" href="/zh-cn/DOM/window.mozInnerScreenY" title="zh-cn/DOM/window.mozInnerScreenY"><code>mozInnerScreenY</code></a> properties on DOM windows have been added; these return the screen coordinates of the top-left corner of the window's viewport.</li> + <li>The new <code>mozScreenPixelsPerCSSPixel</code> attribute on the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindowUtils" title="">nsIDOMWindowUtils</a></code> interface, accessible only to chrome, provides a conversion factor between CSS pixels and screen pixels; this value can vary based on the zoom level of the content.</li> + <li>When the page's URI's document fragment identifier (the part after the "#" (hash) character) changes, a new <code>hashchange</code> event is sent to the page. See <a class="internal" href="/zh-cn/DOM/window.onhashchange" title="window.onhashchange">window.onhashchange</a> for more information. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=385434" title="FIXED: Add support for HTML5 onhashchange (event for named anchor changes)">bug 385434</a></li> + <li>The attribute <a class="internal" href="/zh-cn/DOM/document.readyState" title="zh-cn/DOM/document.readyState"><code>document.readyState</code></a> is now supported. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=347174" title='FIXED: Implement document.readystate == "complete"'>bug 347174</a></li> + <li>Support for HTML5's <code><a class="internal" href="/zh-cn/DOM/element.classList" title="element.classList">element.classList</a></code> to allow easier handling of the class attribute. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=501257" title="FIXED: Implement HTML 5's HTMLElement.classList property">bug 501257</a></li> + <li><code>localName</code> and <code>namespaceURI</code> in HTML documents now behave like they do in XHTML documents: <code>localName</code> returns in lower case and <code>namespaceURI</code> for HTML elements is <code>"<a class="external" href="http://www.w3.org/1999/xhtml" rel="freelink">http://www.w3.org/1999/xhtml</a>"</code>.</li> + <li><a href="/zh-cn/DOM/element.getElementsByTagNameNS" title="zh-cn/DOM/element.getElementsByTagNameNS"><code>element.getElementsByTagNameNS</code></a> no longer lowercases its argument, so upper-case ASCII letters in the argument make matches against HTML elements fail. The same is true for <a href="/zh-cn/DOM/document.getElementsByTagNameNS" title="zh-cn/DOM/document.getElementsByTagNameNS"><code>document.getElementsByTagNameNS</code></a>.</li> + <li>Support has been added for addresses in geolocation via the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMGeoPositionAddress" title="">nsIDOMGeoPositionAddress</a></code> interface and a new field added to <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMGeoPosition" title="">nsIDOMGeoPosition</a></code>.</li> + <li>The <a href="/zh-CN/docs/Web/API/Window/getComputedStyle" title="Window.getComputedStyle()方法返回一个对象,该对象在应用活动样式表并解析这些值可能包含的任何基本计算后报告元素的所有CSS属性的值。 私有的CSS属性值可以通过对象提供的API或通过简单地使用CSS属性名称进行索引来访问。"><code>window.getComputedStyle</code></a> function now returns quotes within <code>url()</code> values.</li> +</ul> + +<h3 id="XPath">XPath</h3> + +<dl> + <dt>支持choose()方法</dt> + <dd><a href="/zh-cn/XPath" title="zh-cn/XPath">XPath</a>开始支持<a href="/zh-cn/XPath/Functions/choose" title="zh-cn/XPath/Functions/choose"><code>choose()</code></a><code>方法</code>.</dd> +</dl> + +<h2 id="For_XUL_and_add-on_developers">For XUL and add-on developers</h2> + +<p>If you're an extension developer, you should start by reading <a class="internal" href="/zh-cn/Updating_extensions_for_Firefox_3.6" title="zh-cn/Updating extensions for Firefox 3.6">Updating extensions for Firefox 3.6</a>, which offers a helpful overview of what changes may affect your extension. Plug-in developers should read <a class="internal" href="/zh-cn/Updating_plug-ins_for_Firefox_3.6" title="zh-cn/Updating plug-ins for Firefox 3.6">Updating plug-ins for Firefox 3.6</a>.</p> + +<h3 id="New_features">New features</h3> + +<dl> + <dt><a href="/zh-cn/Detecting_device_orientation" title="zh-cn/Detecting device orientation">Detecting device orientation</a></dt> + <dd>Content can now detect the orientation of the device if it has a supported accelerometer, using the <a href="/zh-cn/DOM/MozOrientation" title="zh-cn/DOM/MozOrientation"><code>MozOrientation</code></a> event. Firefox 3.6 supports the accelerometer in Mac laptops.</dd> + <dt><a href="/zh-cn/Monitoring_HTTP_activity" title="zh-cn/Monitoring HTTP activity">Monitoring HTTP activity</a></dt> + <dd>You can now monitor HTTP transactions to observe requests and responses in real time.</dd> + <dt><a href="/zh-cn/Working_with_the_Windows_taskbar" title="zh-cn/Working with the Windows taskbar">Working with the Windows taskbar</a></dt> + <dd>It's now possible to customize the appearance of windows in the taskbar in Windows 7 or later. <em>This has been disabled by default in Firefox 3.6.</em></dd> +</dl> + +<h3 id="Places">Places</h3> + +<ul> + <li>Places queries can now use the <code>redirectsMode</code> attribute on the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsINavHistoryQueryOptions" title="">nsINavHistoryQueryOptions</a></code> interface to specify whether or not to include redirected pages in results.</li> + <li>Added the new <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIFaviconService#expireAllFavicons()">nsIFaviconService.expireAllFavicons()</a></code> method to the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFaviconService" title="">nsIFaviconService</a></code> interface.</li> +</ul> + +<h3 id="Storage">Storage</h3> + +<dl> + <dt><a href="/zh-cn/Storage#Collation_(sorting)" title="zh-cn/Storage#Collation (sorting)">Locale-aware collation of data is now supported by the Storage API</a></dt> + <dd>Gecko 1.9.2 added several new collation methods to provide optimized collation (sorting) of results using locale-aware techniques.</dd> + <dt><a href="/zh-cn/mozIStorageStatementParams#Enumeration_of_properties" title="zh-cn/mozIStorageStatementParams#Enumeration of properties">Properties on a statement can now be enumerated</a></dt> + <dd>You can now use a <code><a class="internal" href="/zh-cn/JavaScript/Reference/Statements/for...in" title="zh-cn/JavaScript/Reference/Statements/For...in">for..in</a></code> enumeration to enumerate all the properties on a statement.</dd> + <dt>mozIStorageStatement's getParameterIndex changed behavior between 3.5 and 3.6.</dt> + <dd>See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=528166" title="mozIStorageStatement getParameterIndex causes NS_ERROR_ILLEGAL_VALUE">bug 528166</a> for details.</dd> + <dt>Asynchronously bind multiple sets of parameters and execute a statement.</dt> + <dd>See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=490085" title="FIXED: Add ability to bind multiple sets of parameters and execute asynchronously">bug 490085</a> for details. Documentation coming soon.</dd> +</dl> + +<h3 id="Preferences">Preferences</h3> + +<ul> + <li>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPrefService" title="">nsIContentPrefService</a></code> interface has two new methods: <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIContentPrefService#getPrefsByName()">nsIContentPrefService.getPrefsByName()</a></code> and <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIContentPrefService#removePrefsByName()">nsIContentPrefService.removePrefsByName()</a></code>.</li> +</ul> + +<h3 id="Themes">Themes</h3> + +<p>See <a class="internal" href="/zh-cn/Updating_themes_for_Firefox_3.6" title="zh-cn/Updating themes for Firefox 3.6">Updating themes for Firefox 3.6</a> for a list of changes related to themes.</p> + +<dl> + <dt><a href="/zh-cn/Themes/Lightweight_themes" title="zh-cn/Themes/Lightweight themes">Lightweight themes</a></dt> + <dd>Firefox 3.6 supports lightweight themes; these are easy-to-create themes that simply apply a background to the top (URL bar and button bar) and bottom (status bar) of browser windows. This is an integration of the existing <a class="external" href="http://www.getpersonas.com/" title="http://www.getpersonas.com/">Personas</a> theme architecture into Firefox.</dd> +</dl> + +<h3 id="Miscellaneous">Miscellaneous</h3> + +<ul> + <li>Firefox will no longer load third-party components installed in its internal components directory. This helps to ensure stability by preventing buggy third-party components from being executed. Developers that install components this way must <a href="/zh-cn/Migrating_raw_components_to_add-ons" title="zh-cn/Migrating raw components to add-ons">repackage their components as XPI packages</a> so they can be installed as standard add-ons.</li> + <li><code>contents.rdf</code> is no longer supported for registering chrome in extensions. You must now use the <a class="internal" href="/zh-cn/Install_Manifests" title="zh-cn/Install manifests"><code>chrome.manifest</code></a> file instead. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=492008" title="FIXED: Drop support for contents.rdf chrome registrations">bug 492008</a>.</li> + <li>Added support for hiding the menu bar automatically. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=477256" title="FIXED: Implement menubar auto-hiding in toolkit">bug 477256</a>.</li> + <li>Added support for the <code>container-live-role</code> attribute to objects. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=391829" title="FIXED: Add support for container-live-role to object attributes">bug 391829</a>.</li> + <li>The <code>tabs-closebutton</code> binding has been removed. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=500971" title="FIXED: Remove obsolete tabs-closebutton binding">bug 500971</a>.</li> + <li>Added support to <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISound" title="">nsISound</a></code> for playing sounds based on events that have occurred. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=502799" title="FIXED: add new nsISound method for the event sounds">bug 502799</a>.</li> + <li>The syntax for the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeView" title="">nsITreeView</a></code> methods <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsITreeView#canDrop()">nsITreeView.canDrop()</a></code> and <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsITreeView#drop()">nsITreeView.drop()</a></code> has changed to support the new drag & drop API introduced in Gecko 1.9. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=455590" title="FIXED: Allow new dnd api with tree views">bug 455590</a>.</li> + <li>Added support to snap the mouse cursor to the default button of dialog or wizard on Windows, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=76053" title='FIXED: Windows mouse integration: "Snap to default button in dialog boxes"'>bug 76053</a>. This is processed automatically by dialog and wizard element. But if a XUL application creates a window using the <code>window</code> element and it has a default button, it needs to call <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIDOMChromeWindow#notifyDefaultButtonLoaded()">nsIDOMChromeWindow.notifyDefaultButtonLoaded()</a></code> during the window's <code>onload</code> event handler.</li> + <li>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFileMac" title="">nsILocalFileMac</a></code> interface has had two methods removed: <code>setFileTypeAndCreatorFromMIMEType()</code> and <code>setFileTypeAndCreatorFromExtension()</code>.</li> + <li>The new <a class="internal" href="/zh-cn/JavaScript_code_modules/NetUtil.jsm" title="zh-cn/JavaScript code modules/NetUtil.jsm"><code>NetUtils.jsm</code></a> code module provides an easy-to-use method for asynchronously copying data from an input stream to an output stream.</li> + <li>The new <a class="internal" href="/zh-cn/JavaScript_code_modules/openLocationLastURL.jsm" title="zh-cn/JavaScript code modules/openLocationLastURL.jsm"><code>openLocationLastURL.jsm</code></a> code module makes it easy to read and change the value of the "Open Location" dialog box's remembered URL while properly taking private browsing mode into account.</li> + <li>On Windows, the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScreen" title="">nsIScreen</a></code> interface now reports 24 bit per pixel color depths when the graphics driver claims 32 bits, since 24 more accurately represents the actual number of color pixels in use.</li> + <li>Menu bars can now be hidden on Windows, using the new <code id="a-autohide"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/autohide">autohide</a></code> attribute on the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code> XUL element.</li> + <li>The <span id="m-loadOneTab"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/loadOneTab">loadOneTab</a></code></span> and <span id="m-addTab"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/addTab">addTab</a></code></span> methods now accept a new <code>relatedToCurrent</code> parameter and, in addition, allow the parameters to be specified by name, since nearly all of the parameters are optional.</li> + <li>The "<a href="/zh-cn/Install_Manifests#hidden" title="zh-cn/Install Manifests#hidden">hidden</a>" property is no longer supported in install manifests; it's no longer possible to prevent the user from seeing add-ons in the add-on manager window.</li> + <li>The <code>@mozilla.org/webshell;1</code> component no longer exists; you need to use <code>@mozilla.org/docshell;1</code> instead.</li> + <li>You can now register with the update-timer category to schedule timer events without having to instantiate the object that the timer will eventually call into; it will instead be instantiated when it's needed. See <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIUpdateTimerManager#registerTimer()">nsIUpdateTimerManager.registerTimer()</a></code> for details.</li> + <li>The <a href="/zh-cn/NPN_GetValue" title="zh-cn/NPN GetValue"><code>NPN_GetValue()</code></a> function no longer provides access to XPCOM through the variable values <code>NPNVserviceManager</code>, <code>NPNVDOMelement</code>, and <code>NPNVDOMWindow</code>. This is part of the work toward making plugins run in separate processes in a future version of Gecko.</li> + <li>Plugins are no longer scriptable through XPCOM (IDL) interfaces, <a href="/zh-cn/Gecko_Plugin_API_Reference/Scripting_plugins" title="zh-cn/Gecko Plugin API Reference:Scripting plugins">NPRuntime</a> is the API to use for making plugins scriptable, and <a href="/zh-cn/NPP_GetValue" title="zh-cn/NPP GetValue"><code>NPP_GetValue()</code></a> is no longer called to with the value <code>NPPVpluginScriptableInstance</code> or <code>NPPVpluginScriptableIID</code>. This is part of the work toward making plugins run in separate processes in a future version of Gecko.</li> +</ul> + +<h2 id="FirefoxGecko开发">Firefox/Gecko开发</h2> + +<p>Certain changes are only really interesting if you work on the internals of Firefox itself.</p> + +<h3 id="Interfaces_merged">Interfaces merged</h3> + +<p>The following interfaces have been combined together:</p> + +<ul> + <li><code>nsIPluginTagInfo2</code> has been merged into <code>nsIPluginTagInfo</code>.</li> + <li><code>nsIPluginInstanceInternal</code>, <code>nsIPPluginInstancePeer</code>, <code>nsIPluginInstancePeer1</code>, <code>nsIPluginInstancePeer2</code>, and <code>nsIPluginInstancePeer3</code> have all been merged into <code>nsIPluginInstance</code>.</li> + <li><code>nsIWindowlessPlugInstPeer</code> has been merged into <code>nsIPluginInstance</code>.</li> + <li><code>nsIPluginManager</code> and <code>nsIPluginManager2</code> have been merged into <code>nsIPluginHost</code>.</li> +</ul> + +<h3 id="Interfaces_removed">Interfaces removed</h3> + +<p>The following interfaces have been removed entirely because they were unused, unimplemented, or obsolete:</p> + +<ul> + <li><code>nsIFullScreen</code></li> + <li><code>nsIDOMSVGListener</code></li> + <li><code>nsIDOMSVGZoomListener</code></li> + <li><code>nsIInternetConfigService</code></li> + <li><code>nsIDKey</code></li> + <li><code>nsIEventHandler</code></li> + <li><code>nsIJRILiveConnectPIPeer</code></li> + <li><code>nsIJRILiveConnectPlugin</code></li> + <li><code>nsIScriptablePlugin</code></li> + <li><code>nsIClassicPluginFactory</code></li> + <li><code>nsIFileUtilities</code></li> +</ul> + +<h3 id="Interfaces_moved">Interfaces moved</h3> + +<p>The following interfaces have been relocated from their previous IDL files into new ones:</p> + +<ul> + <li><code>nsIDOMNSCSS2Properties</code> is now located in its own IDL file (<code>dom/interfaces/css/nsIDOMCSS2Properties.idl</code>).</li> + <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIUpdateTimerManager" title="">nsIUpdateTimerManager</a></code> is now located in its own IDL file.</li> +</ul> + +<p>A large number of interfaces have been moved. See <a href="/zh-cn/Interfaces_moved_in_Firefox_3.6" title="zh-cn/Interfaces moved in Firefox 3.6">Interfaces moved in Firefox 3.6</a> for a complete list.</p> + +<h3 id="Other_interface_changes">Other interface changes</h3> + +<p>The following assorted changes have been made:</p> + +<ul> + <li>The <code>nsIPlugin</code> interface now inherits from <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code> instead of <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFactory" title="">nsIFactory</a></code>.</li> + <li>The <code>nsIPluginHost</code> interface now inherits from <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code> instead of <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFactory" title="">nsIFactory</a></code>.</li> + <li>The <code>nsIFrame</code> interface now inherits from <code>nsQueryFrame</code> instead of <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>.</li> + <li>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceContext" title="">nsIDeviceContext</a></code> method <code>getPaletteInfo()</code> has been removed, as it was never implemented.</li> + <li>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptContext" title="">nsIScriptContext</a></code> method <code>reportPendingException()</code> has been removed, since it was no longer being used.</li> +</ul> + +<h3 id="Changes_in_accessibility_code">Changes in accessibility code</h3> + +<ul> + <li>The <span style="font-family: monospace;">EVENT</span><code>_REORDER</code> <a href="/zh-cn/XPCOM_Interface_Reference/nsIAccessibleEvent" title="zh-cn/XPCOM Interface Reference/nsIAccessibleEvent">accessibility event</a> is now sent when the children of frames and iframes change, as well as when the main document's children change. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=420845" title="FIXED: Fire event_reorder on any embedded frames/iframes whos document has just loaded.">bug 420845</a>.</li> + <li>The <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIAccessibleTable#selectRow()">nsIAccessibleTable.selectRow()</a></code> now correctly removes any current selection before selecting the specified row.</li> +</ul> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li><a href="/zh-cn/Firefox_5_for_developers" title="zh-cn/Firefox 5 for developers">Firefox 5 for developers</a></li> + <li><a href="/zh-cn/Firefox_4_for_developers" title="zh-cn/Firefox 4 for developers">Firefox 4 for developers</a></li> + <li><a class="internal" href="/zh-cn/Firefox_3.5_for_developers" title="zh-cn/Firefox 3.5 for developers">Firefox 3.5 for developers</a></li> + <li><a class="internal" href="/zh-cn/Firefox_3_for_developers" title="zh-cn/Firefox 3 for developers">Firefox 3 for developers</a></li> + <li><a class="internal" href="/zh-cn/Firefox_2_for_developers" title="zh-cn/Firefox 2 for developers">Firefox 2 for developers</a></li> + <li><a class="internal" href="/zh-cn/Firefox_1.5_for_developers" title="zh-cn/Firefox 1.5 for developers">Firefox 1.5 for developers</a></li> +</ul> diff --git a/files/zh-cn/mozilla/firefox/releases/3/index.html b/files/zh-cn/mozilla/firefox/releases/3/index.html new file mode 100644 index 0000000000..561c473cd3 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/3/index.html @@ -0,0 +1,310 @@ +--- +title: 致Firefox 3开发者 +slug: Mozilla/Firefox/Releases/3 +tags: + - Firefox 3 +translation_of: Mozilla/Firefox/Releases/3 +--- +<div>{{FirefoxSidebar}}</div><p>如果你是一个Web开发人员,并且希望了解Firefox 3中所有的新特性,这里是一个很好的起点。这篇文章提供了一个覆盖所有Firefox 3新特性的列表。虽然他并不是能够包括所有微小的改动,但他能够帮助你学习到最主要的更新。</p> +<p> </p> +<h3 id="Firefox_3_.E4.B8.AD.E6.96.B0.E7.9A.84.E5.BC.80.E5.8F.91.E4.BA.BA.E5.91.98.E7.89.B9.E6.80.A7" name="Firefox_3_.E4.B8.AD.E6.96.B0.E7.9A.84.E5.BC.80.E5.8F.91.E4.BA.BA.E5.91.98.E7.89.B9.E6.80.A7">Firefox 3 中新的开发人员特性</h3> +<h4 id=".E5.AF.B9.E7.BD.91.E7.AB.99.E5.92.8C.E7.A8.8B.E5.BA.8F.E5.BC.80.E5.8F.91.E8.80.85" name=".E5.AF.B9.E7.BD.91.E7.AB.99.E5.92.8C.E7.A8.8B.E5.BA.8F.E5.BC.80.E5.8F.91.E8.80.85">对网站和程序开发者</h4> +<dl> + <dt> + <a href="/cn/%E6%9B%B4%E6%96%B0WEB%E5%BA%94%E7%94%A8%E4%BB%A5%E9%80%82%E5%BA%94Firefox_3" title="cn/更新WEB应用以适应Firefox_3">更新WEB应用以适应Firefox 3</a></dt> + <dd> + 提供了您用于更新WEB应用以受益于Firefox 3新特性所需的信息。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E4%B8%8A%E7%BA%BF%E4%B8%8E%E7%A6%BB%E7%BA%BF%E4%BA%8B%E4%BB%B6" title="cn/上线与离线事件">上线与离线事件</a></dt> + <dd> + Firefox 3支持WHATWG的上线与离线事件,基于这一特性,程序可以检测当前是否有可用的互联网联接以及何时上线或下线。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E8%B7%A8%E5%9F%9F%E7%9A%84XMLHttpRequest%E8%AF%B7%E6%B1%82" title="cn/跨域的XMLHttpRequest请求">跨域的XMLHttpRequest请求</a></dt> + <dd> + Firefox 3支持<a class="external" href="http://www.w3.org/TR/access-control/">W3C Access Control</a>工作草案,使你有能够使用<a href="/cn/XMLHttpRequest" title="cn/XMLHttpRequest">XMLHttpRequests</a>检索和操作其他站点的数据;使你能够创造令人印象深刻的以浏览器为基础的交互式应用(mashups)。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E4%BA%A4%E9%94%99%E6%A0%BC%E5%BC%8F%E6%A0%B7%E8%A1%A8" title="cn/交错格式样表">交错格式样表</a></dt> + <dd> + Firefox 3 支持CSS 层叠式样式表 API.</dd> + <br> + <dd> + <a href="/cn/DOM/window.navigator.registerProtocolHandler" title="cn/DOM/window.navigator.registerProtocolHandler"><strong>基于web的协议处理</strong></a></dd> + <dd> + 你现在可以使用<code>navigator.registerProtocolHandler()方法</code>注册web应用</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E5%9C%A8%E7%94%BB%E7%94%BB%E5%B8%83%EF%BC%88canvas%EF%BC%89%E4%B8%AD%E2%80%9C%E7%BB%98%E2%80%9D%E5%87%BA%E6%96%87%E5%AD%97" title="cn/在画画布(canvas)中“绘”出文字">在画布(canvas)中“绘”出文字</a></dt> + <dd> + 您可以使用Firefox 3支持的非标准API在canvas上绘制文字。</dd> +</dl> +<dl> + <dt> + <a href="/cn/Canvas_tutorial/Transformations#Transforms" title="cn/Canvas_tutorial/Transformations#Transforms">支持画布变换</a></dt> + <dd> + Firefox现在的canvas支持<code>transform()</code><span style="font-family: monospace;">和</span><code>setTransform()方法。</code></dd> +</dl> +<dl> + <dt> + <a href="/cn/%E4%BD%BF%E7%94%A8%E5%BE%AE%E6%A0%BC%E5%BC%8F" title="cn/使用微格式">使用微格式</a></dt> + <dd> + Firefox现在有一组微格式的API。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E6%8B%96%E6%94%BE%E4%BA%8B%E4%BB%B6" title="cn/拖放事件">拖放事件</a></dt> + <dd> + Firefox 3 支持新的拖放事件,当拖放开始和结束时,该事件将会被发送至源节点。</dd> + <dd> + <a href="/cn/Focus_management_in_HTML" title="cn/Focus_management_in_HTML"><strong>HTML的焦点管理</strong></a></dd> +</dl> +<dl> + <dd> + 新的HTML 5 支持activeElement和hasFocus属性</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E7%A6%BB%E7%BA%BF%E6%B5%8F%E8%A7%88" title="cn/离线浏览">离线浏览</a></dt> + <dd> + 在Firefox中,WEB程序现在可以在离线时使用之前被缓存的资源。</dd> + <dt> + <a href="/cn/%E5%9C%A8Firefox_3%E4%B8%ADCSS%E7%9A%84%E6%94%B9%E8%BF%9B" title="cn/在Firefox_3中CSS的改进">在Firefox 3中CSS的改进</a></dt> + <dd> + Firefox 3 在支持CSS的功能上进行了一些完善。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E5%9C%A8Firefox_3%E4%B8%ADDOM%E7%9A%84%E6%94%B9%E8%BF%9B" title="cn/在Firefox_3中DOM的改进">在Firefox 3中DOM的改进</a></dt> + <dd> + Firefox 3 在Firefox3 DOM执行方面提供了一些新的功能,包括支持一些扩展的浏览器的DOM。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E5%AF%B9_JavaScript_1.8" title="cn/对_JavaScript_1.8">JavaScript 1.8 的支持</a></dt> + <dd> + Firefox 3 提供了 JavaScript 1.8 标准的支持。</dd> +</dl> +<dl> + <dt> + <a href="/cn/EXSLT" title="cn/EXSLT">EXSLT支持</a></dt> + <dd> + Firefox 3 提供了对 <a href="/cn/EXSLT" title="cn/EXSLT">EXSLT</a>( <a href="/cn/XSLT" title="cn/XSLT">XSLT</a>的扩展)一个基本子集个支持。</dd> +</dl> +<dl> + <dt> + <a href="/cn/Firefox_3%E4%B8%ADSVG%E7%9A%84%E6%94%B9%E8%BF%9B" title="cn/Firefox_3中SVG的改进">Firefox 3中SVG的改进</a></dt> + <dd> + Firefox 3 对SVG 的支持有了长足的改进:支持二十余个新透镜、一些新元素、一些新属性以及一些其他改进。</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E5%AF%B9PNG%E5%8A%A8%E7%94%BB%E7%9A%84%E6%94%AF%E6%8C%81" title="cn/对PNG动画的支持">对PNG动画的支持</a></dt> + <dd> + Firefox 3 提供了对色彩艳丽的 PNG (APNG) 图像格式的支持.</dd> +</dl> +<dl> + <dt> + <code><a href="/cn/HTML/Element/a" title="cn/HTML/Element/a"><a ping></a></code></dt> + <dd> + <code>现在可以使用 <a ping></code> 功能 ping 一个 URL ,并且此功能默认启用.</dd> +</dl> +<h4 id=".E5.AF.B9XUL.E5.92.8C.E6.89.A9.E5.B1.95.E6.8F.92.E4.BB.B6.E7.9A.84.E5.BC.80.E5.8F.91.E8.80.85" name=".E5.AF.B9XUL.E5.92.8C.E6.89.A9.E5.B1.95.E6.8F.92.E4.BB.B6.E7.9A.84.E5.BC.80.E5.8F.91.E8.80.85">对XUL和扩展插件的开发者</h4> +<p> </p> +<dl> +</dl> +<p> 提供了你需要做的事情的向导,更新您的Firefox 3 扩展。</p> +<dl> + <dt> + <a href="/cn/%E6%9B%B4%E6%96%B0%E6%89%A9%E5%B1%95%E4%BB%A5%E5%85%BC%E5%AE%B9Firefox_3" title="cn/更新扩展以兼容Firefox_3">更新扩展以兼容Firefox 3</a></dt> +</dl> +<p><a href="/cn/FUEL" title="cn/FUEL"><strong>FUEL 知识库</strong></a></p> +<dl> + <dd> + FUEL 使扩展开发者完成更有成效,更精悍的 XPCOM 规范代码并获得一些 "模式" JavaScript 思想。</dd> +</dl> +<p> Firefox 3的提供了一些新的XUL元素,包括新的缩放法,日期和时间获取,以及旋转按钮。</p> +<dl> + <dt> + <a href="/cn/XUL_improvements_in_Firefox_3" title="cn/XUL_improvements_in_Firefox_3">Firefox 3在 </a><a href="/cn/XUL_improvements_in_Firefox_3" title="cn/XUL_improvements_in_Firefox_3">XUL 上的改进</a> </dt> +</dl> +<dl> + <dt> + <a href="/cn/Templates_in_Firefox_3" title="cn/Templates_in_Firefox_3">Firefox 3的模板</a></dt> + <dd> + Firefox 3的模板已显着改善 。关键的改进是,允许使用自定义查询处理器,除数据源之外还可以使用RDF。 </dd> +</dl> +<p><a href="/cn/XBL/XBL_1.0_Reference/Elements#binding" title="cn/XBL/XBL_1.0_Reference/Elements#binding"><strong>嵌入的XBL绑定</strong></a></p> +<dl> + <dd> + 现在,您可以使用 data: 网络协议直接嵌入XBL绑定,而不是在单独的XML文件中使用他们。 + <p> </p> + </dd> + <dt> + <a href="/cn/Localizing_extension_descriptions" title="cn/Localizing_extension_descriptions">本地化扩展描述</a></dt> + <dd> + 这可让本地化的详细信息在附加组件被下载时或被禁用即时生效。 </dd> +</dl> +<dl> + <dt> + <a href="/cn/Extension_Versioning,_Update_and_Compatibility#Securing_Updates" title="cn/Extension_Versioning,_Update_and_Compatibility#Securing_Updates">可靠更新</a></dt> +</dl> +<p>In order to provide a more secure add-on upgrade path for users, add-ons are now required to provide a secure method for obtaining updates before they can be installed. Add-ons hosted at</p> +<p><a class="external" href="http://addons.mozilla.org/" rel="external nofollow" title="http://addons.mozilla.org">AMO</a></p> +<p>automatically provide this. Any add-ons installed that do not provide a secure update method when the user upgrades to Firefox 3 will be automatically disabled. Firefox will however continue to check for updates to the extension over the insecure path and attempt to install any update offered (installation will fail if the update also fails to provide a secure update method).</p> +<dl> + <dt> + <a href="/cn/NsIIdleService" title="cn/NsIIdleService">Idle service</a></dt> +</dl> +<dl> + <dd> + Firefox 3 offers the new {{ Interface("nsIIdleService") }} interface, which lets extensions determine how long it's been since the user last pressed a key or moved their mouse.</dd> +</dl> +<dl> + <dt> + <a href="/cn/%E5%85%A8%E5%B1%8F%E7%BC%A9%E6%94%BE" title="cn/全屏缩放">全屏缩放</a></dt> +</dl> +<dl> + <dd> + Firefox 3 improves the user experience by offering full page zoom in addition to text-only zoom.</dd> +</dl> +<dl> + <dt> + <a href="/cn/Interfacing_with_the_XPCOM_cycle_collector" title="cn/Interfacing_with_the_XPCOM_cycle_collector">Interfacing with the XPCOM cycle collector</a></dt> +</dl> +<dl> + <dd> + XPCOM code can now take advantage of the cycle collector, which helps ensure that unused memory gets released instead of leaking.</dd> +</dl> +<dl> + <dt> + <a href="/cn/The_Thread_Manager" title="cn/The_Thread_Manager">The Thread Manager</a></dt> +</dl> +<dl> + <dd> + Firefox 3 provides the new {{ Interface("nsIThreadManager") }} interface, along with new interfaces for threads and thread events, which provides a convenient way to create and manage threads in your code.</dd> +</dl> +<dl> + <dt> + <a href="/cn/JavaScript%E6%A8%A1%E5%9D%97" title="cn/JavaScript模块">JavaScript模块</a></dt> +</dl> +<dl> + <dd> + Firefox 3 now offers a new shared code module mechanism that lets you easily create modules in JavaScript that can be loaded by extensions and applications for use, much like shared libraries.</dd> +</dl> +<dl> + <dt> + <a href="/cn/Places" title="cn/Places">Places</a></dt> +</dl> +<dl> + <dd> + The history and bookmarks APIs have been completely replaced by the new <a href="/cn/Places" title="cn/Places">Places</a> API.</dd> +</dl> +<dl> + <dt> + <a href="/cn/Making_the_transition_to_Places" title="cn/Making_the_transition_to_Places">Making the transition to Places</a></dt> +</dl> +<dl> + <dd> + An article about how to update an existing extension to use the Places API.</dd> +</dl> +<dl> + <dt> + <a href="/cn/Firefox_3%E4%B8%AD%E4%B8%8B%E8%BD%BD%E7%AE%A1%E7%90%86%E5%99%A8%E7%9A%84%E6%94%B9%E8%BF%9B" title="cn/Firefox_3中下载管理器的改进">Firefox 3中下载管理器的改进</a></dt> +</dl> +<dl> + <dd> + The Firefox 3 Download Manager features new and improved APIs, including support for multiple progress listeners.</dd> +</dl> +<dl> + <dt> + <a href="/cn/Using_nsILoginManager" title="cn/Using_nsILoginManager">Using nsILoginManager</a></dt> +</dl> +<dl> + <dd> + 密码管理已经被新的登录管理所代替。</dd> +</dl> +<dl> + <dt> + <a href="/cn/Using_content_preferences" title="cn/Using_content_preferences">Using content preferences</a></dt> +</dl> +<dl> + <dd> + Firefox 3 includes a new service for getting and setting arbitrary site-specific preferences that extensions as well as core code can use to keep track of their users' preferences for individual sites.</dd> +</dl> +<dl> + <dt> + <a href="/cn/Notable_bugs_fixed_in_Firefox_3" title="cn/Notable_bugs_fixed_in_Firefox_3">Notable bugs fixed in Firefox 3</a></dt> +</dl> +<dl> + <dd> + 文章中所提供的相关Bug信息,已经在Firefox 3中进行了修改。</dd> +</dl> +<dl> + <dt> + <a href="/cn/Firefox_3_%E7%9A%84%E7%95%8C%E9%9D%A2%E6%94%B9%E5%8A%A8" title="cn/Firefox_3_的界面改动">Firefox 3 的界面改动</a></dt> +</dl> +<dl> + <dd> + Notes and information of use to people who want to create themes for Firefox 3.</dd> +</dl> +<h3 id=".E6.9C.80.E7.BB.88.E7.94.A8.E6.88.B7.E5.B0.86.E8.83.BD.E4.BD.93.E9.AA.8C.E5.88.B0.E7.9A.84.E6.96.B0.E7.89.B9.E6.80.A7" name=".E6.9C.80.E7.BB.88.E7.94.A8.E6.88.B7.E5.B0.86.E8.83.BD.E4.BD.93.E9.AA.8C.E5.88.B0.E7.9A.84.E6.96.B0.E7.89.B9.E6.80.A7">最终用户将能体验到的新特性</h3> +<h4 id=".E7.94.A8.E6.88.B7.E4.BD.93.E9.AA.8C" name=".E7.94.A8.E6.88.B7.E4.BD.93.E9.AA.8C">用户体验</h4> +<ul> + <li><strong>更轻松的密码管理.</strong> 当你成功登陆之后在浏览器顶端会出现一个信息栏,提示你是否保存此口令。</li> + <li><strong>附件组件安装更简便.</strong> 你可以更容易的通过第三方下载附件组件并安装它。</li> + <li><strong>新的下载管理器.</strong> 新的下载管理器使你更容易的定位下载文件。</li> + <li><strong>断点下载.</strong> 现在可以在重启浏览器或重新获得网络连接时继续尚未完成的下载任务。</li> + <li><strong>全屏缩放.</strong> 今后,你可以使用菜单或快捷键, 可以缩放整个网页的内容 -- 这个比例取决除了文字排版,还取决于更合适的图片排版 .</li> + <li><strong>标签滚动和快捷菜单.</strong> 通过新的标签滚动和标签快捷菜单可以更容易的定位标签。</li> + <li><strong>保存您当前的浏览内容.</strong> 当你退出Firefox 3 时,Firefox 3 会提示你是否保存当前标签。</li> + <li><strong>优化的标签打开方式.</strong> 在标签中打开一个书签文件夹时,会创建一个新标签二不是覆盖现有的。</li> + <li><strong>轻松更改搜索引挚工具框的大小和位置.</strong> 你可以简单的通过一个拖动鼠标改变搜索引擎工具栏和地址栏的分布。</li> + <li><strong>改进了文本选择.</strong> 使用 Crtl (Macintosh的Command)键选择多块文本. 双击可以选中个词(中文为一句)三击选中一段。</li> + <li><strong>查找工具.</strong> 查找工具以当前选中内容为默认查找内容.</li> + <li><strong>扩展管理.</strong> 用户可以在附件组件管理器中单独显示插件.</li> + <li><strong>与Windows Vista的整合.</strong> 火狐菜单用一个Vista本地主题显示.</li> + <li><strong>与</strong><strong>Mac OS X</strong><strong>的整合</strong><strong>.</strong> Firefox 现在使用Mac OS X 拼写检查器并使用 <a class="external" href="http://growl.info/">Growl</a> 来通知下载完成或有可用更新。</li> + <li><strong>星按钮.</strong> 地址栏上的“星”按钮使你通过一个点击添加一个新书签。一次双击保存并编辑你的新书签。</li> + <li><strong>标签.</strong> 可以为你的书签指定关键词,并按主题排序。</li> + <li><strong>地址栏和自动地址补全.</strong> 在地址栏键入页面标题或标签可以快速找到你在书签中的或是历史页面。图标、书签、标签可以帮助你判断结果的来源。</li> + <li><strong>智能书签菜单.</strong> Firefox 的智能书签会按照最新,访问频率来排序书签。</li> + <li><strong>书签和历史管理器.</strong> 书签和历史管理统一起来,让你可以通过多视图、按照频率组织的智能分组方便的同时检索书签及历史。</li> + <li><strong>基于Web的协议处理.</strong> 网络应用, 比如你最喜欢的电子邮件提供商可以代替本地邮件应用来处理<code> mailto:</code> 链接。对于其他也提供相似的支持。 (注意网络应用需要向火狐注册)</li> + <li><strong>易于使用的下载.</strong> 一个新的引用界面提供高级选项来配置对不同文件类型及协议策略的处理方案。</li> + <li><strong>改进的浏览器外观.</strong> 新的图形及字体处理方案使网页在你的屏幕上显示的更漂亮。包括清晰的文字渲染、连体字、复杂文字的更好支持。另外Mac 及 Linux (Gnome) 用户会发现 Firefox 感觉起来更像他们本地的应用或平台一样。</li> + <li><strong>支持颜色设置.</strong> 通过设置 <code>在{{ mediawiki.external('about:config') }} 的 </code><code>gfx.color_management.enabled</code> 优先级,您可以要求Firefox的按照新的配置文件中对图像的颜色进行调整,以符合您电脑的显示器。</li> + <li><strong>支持离线浏览.</strong>即使您没有Internet连接,Web应用程序仍可使用。</li> +</ul> +<h4 id=".E5.AE.89.E5.85.A8.E5.92.8C.E9.9A.90.E7.A7.81" name=".E5.AE.89.E5.85.A8.E5.92.8C.E9.9A.90.E7.A7.81">安全和隐私</h4> +<ul> + <li><strong>一键网站信息.</strong> 想知道更多关于您所访问网站的信息?点击该网站的图标,在地址栏中看看是谁拥有它。信息更易理解。</li> + <li><strong>恶意软件防护.</strong>如果你访问了一个已知的安装病毒,间谍软件,木马,或其他危险软件(也称为恶意软件)的网站 Firefox 3 会警告你 。你可以<a class="link-https" href="https://www.mozilla.com/firefox/its-an-attack.html">点这里</a>看看警告是怎样的。</li> + <li><strong>伪造网站保护加强.</strong> 现在,当您访问的网站被怀疑是伪造时,会出现一个特殊的网页。<a class="link-https" href="https://www.mozilla.com/firefox/its-a-trap.html">点击这里</a>看看是什么样子。</li> +</ul> +<ul> + <li><strong>更容易理解的SSL错误</strong><strong>.</strong>遇到无效的SSL证书时会包含清楚的错误描述,使其更易于理解是哪里发生了问题。</li> + <li><strong>过期附件组件防护.</strong> 现在Firefox 3的自动检查插件和插件版本并禁用过时的,不安全的版本。</li> + <li><strong>安全附件更新</strong><strong>.</strong> 附件更新安全性提高了,不允许使用不安全的更新机制。</li> + <li><strong>防病毒一体化。</strong> Firefox 3 在下载文件的同时通知的反病毒软件。</li> + <li><strong>Windows Vista的家长控制功能的支持。 </strong>Firefox 3的支持Vista的全系统家长控制,禁用文件下载。</li> +</ul> +<h4 id=".E6.80.A7.E8.83.BD" name=".E6.80.A7.E8.83.BD">性能</h4> +<ul> + <li><strong>可靠性.</strong>Firefox 3 使用安全的数据库格式保存书签,历史记录, cookies ,及偏好。这意味着,即使系统崩溃,您的数据也免受损失。</li> + <li><strong>速度.</strong> Firefox 3有了较大的性能提升,完全取代了部分软件:包括图形屏幕处理,以及页面布局工作的处理等。</li> + <li><strong>更少的内存占用.</strong> Firefox 3的内存使用比以往任何时候都有效,有超过300个内存“泄漏”漏洞得以修复,以及可帮助自动查找和处置泄漏内存的新功能被添加进来。</li> +</ul> +<h3 id=".E5.8F.82.E8.A7.81" name=".E5.8F.82.E8.A7.81">参见</h3> +<ul> + <li><a href="/cn/Updating_extensions_for_Firefox_3" title="cn/Updating_extensions_for_Firefox_3">对Firefox 3的扩展进行更新</a></li> + <li><a href="/cn/Updating_web_applications_for_Firefox_3" title="cn/Updating_web_applications_for_Firefox_3">对Firefox 3的Web应用进行更新</a></li> + <li><a href="/cn/Firefox_2_for_developers" title="cn/Firefox_2_for_developers">Firefox 2 for developers</a></li> + <li><a href="/cn/Firefox_1.5_for_developers" title="cn/Firefox_1.5_for_developers">Firefox 1.5 for developers</a></li> +</ul> +<p>{{ languages( { "es": "es/Firefox_3_para_desarrolladores", "fr": "fr/Firefox_3_pour_les_d\u00e9veloppeurs", "ja": "ja/Firefox_3_for_developers", "zh-tw": "zh_tw/Firefox_3_for_developers", "zh-cn": "cn/Firefox_3_for_developers", "ko": "ko/Firefox_3_for_developers", "pl": "pl/Firefox_3_dla_programist\u00f3w", "pt": "pt/Firefox_3_para_desenvolvedores" } ) }}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/3/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/3/site_compatibility/index.html new file mode 100644 index 0000000000..b8b2678b12 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/3/site_compatibility/index.html @@ -0,0 +1,26 @@ +--- +title: Gecko 1.9 Changes affecting websites +slug: Mozilla/Firefox/Releases/3/Site_compatibility +translation_of: Mozilla/Firefox/Releases/3/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>此页设法提供在 <a href="cn/Gecko">Gecko</a> 1.8 和 Gecko 1.9 之间的变动概要,这些变动可能会影响某些网站的行为或网页渲染。</p> +<p>参见 <a href="cn/Firefox_3_for_developers">Firefox 3 开发者参考</a></p> +<h2 id=".E4.BA.8B.E4.BB.B6" name=".E4.BA.8B.E4.BB.B6">事件</h2> +<h3 id=".E6.8D.95.E8.8E.B7_load_.E4.BA.8B.E4.BB.B6.E7.9B.91.E5.90.AC" name=".E6.8D.95.E8.8E.B7_load_.E4.BA.8B.E4.BB.B6.E7.9B.91.E5.90.AC">捕获 load 事件监听</h3> +<p>在 Gecko 1.8 中,不能在图片上设置 load 事件监听。 在 Gecko 1.9 中,已在 {{ Bug(234455) }} 中修复。 但是在某些网站中,由于捕获 load 事件的事件监听器不正确而导致问题。参见 {{ Bug(335251) }} 中的讨论。 要修复这个问题,出错的页面不再需要设置事件监听器。</p> +<p>例如,如下:</p> +<pre class="eval">window.addEventListener('load', yourFunction, true); +</pre> +<p>应该更改为:</p> +<pre class="eval">window.addEventListener('load', yourFunction, false); +</pre> +<p>事件捕获如何工作的解释,参见 <a class="external" href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture">DOM Level 2 事件捕获</a></p> +<h3 id="preventBubble_.E5.B7.B2.E8.A2.AB.E7.A7.BB.E5.87.BA" name="preventBubble_.E5.B7.B2.E8.A2.AB.E7.A7.BB.E5.87.BA">preventBubble 已被移出</h3> +<h3 id=".E5.B0.91.E8.AE.B8.E6.97.A7.E7.9A.84.E4.BA.8B.E4.BB.B6_API_.E4.B8.8D.E5.86.8D.E8.A2.AB.E6.94.AF.E6.8C.81" name=".E5.B0.91.E8.AE.B8.E6.97.A7.E7.9A.84.E4.BA.8B.E4.BB.B6_API_.E4.B8.8D.E5.86.8D.E8.A2.AB.E6.94.AF.E6.8C.81">少许旧的事件 API 不再被支持</h3> +<h2 id="DOM" name="DOM">DOM</h2> +<h3 id="WRONG_DOCUMENT_ERR" name="WRONG_DOCUMENT_ERR">WRONG_DOCUMENT_ERR</h3> +<h2 id=".E8.8C.83.E5.9B.B4" name=".E8.8C.83.E5.9B.B4">范围</h2> +<h3 id="intersectsNode_.E5.B7.B2.E8.A2.AB.E7.A7.BB.E5.87.BA" name="intersectsNode_.E5.B7.B2.E8.A2.AB.E7.A7.BB.E5.87.BA">intersectsNode 已被移出</h3> +<h3 id="compareNode_.E5.B7.B2.E8.A2.AB.E7.A7.BB.E5.87.BA" name="compareNode_.E5.B7.B2.E8.A2.AB.E7.A7.BB.E5.87.BA">compareNode 已被移出</h3> +<h2 id="HTML" name="HTML">HTML</h2> +<h3 id=".3Cobject.3E_.E4.B8.AD.E7.9A.84.E8.AE.B8.E5.A4.9A_bug_.E5.B7.B2.E7.BB.8F.E4.BF.AE.E5.A4.8D" name=".3Cobject.3E_.E4.B8.AD.E7.9A.84.E8.AE.B8.E5.A4.9A_bug_.E5.B7.B2.E7.BB.8F.E4.BF.AE.E5.A4.8D"><object> 中的许多 bug 已经修复</h3> diff --git a/files/zh-cn/mozilla/firefox/releases/31/index.html b/files/zh-cn/mozilla/firefox/releases/31/index.html new file mode 100644 index 0000000000..a22131fe8c --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/31/index.html @@ -0,0 +1,46 @@ +--- +title: Firefox 31 for developers +slug: Mozilla/Firefox/Releases/31 +translation_of: Mozilla/Firefox/Releases/31 +--- +<div>{{FirefoxSidebar}}</div><p><span style="font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 30px;">Web 开发者需要关注的变化</span></p> +<h3 id="Developer_Tools">Developer Tools</h3> +<p><em>No change.</em></p> +<h3 id="CSS">CSS</h3> +<ul> + <li>CSS变量的语法从旧的 "var-" 前缀更新为新的 "--" 前缀.({{Bug(985838)}})</li> + <li>Unwanted white space for multiple of 10,000 in Korean counte.({{Bug(985186)}})</li> +</ul> +<h3 id="HTML">HTML</h3> +<p><em>No change.</em></p> +<h3 id="JavaScript">JavaScript</h3> +<p>实现了如下 ECMAScript 6 新特性:</p> +<ul> + <li><code>Array</code> 方法: {{jsxref("Array.prototype.fill()")}} ({{Bug(911147)}})</li> + <li><code>Math</code> 函数: {{jsxref("Math.clz32()")}} ({{Bug(925123)}})</li> + <li><code>String</code> 方法: {{jsxref("String.prototype.normalize()")}} ({{Bug(918987)}}).</li> +</ul> +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> +<ul> + <li>Constructor of <code>KeyboardEvent</code> has been implemented ({{Bug(930893)}}).</li> + <li><code>KeyboardEvent.initKeyboardEvent()</code> has been implemented ({{Bug(930893)}}).</li> + <li><code>KeyboardEvent.isComposing</code> attribute has been implemented ({{Bug(993234)}}).</li> + <li><code>InputEvent</code> interface has been implemented ({{Bug(993253)}}).</li> + <li><code>InputEvent.isComposing</code> attribute has been implemented ({{Bug(993253)}}).</li> +</ul> +<h3 id="MathML">MathML</h3> +<p><em>No change.</em></p> +<h3 id="SVG">SVG</h3> +<p><em>No change.</em></p> +<h3 id="AudioVideo">Audio/Video</h3> +<p><em>No change.</em></p> +<h2 id="Security">Security</h2> +<p><em>No change.</em></p> +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> +<p><em>No change.</em></p> +<h2 id="See_also">See also</h2> +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/31/Site_Compatibility">Site Compatibility for Firefox 31</a></li> +</ul> +<h3 id="Older_versions">Older versions</h3> +<p>{{Firefox_for_developers('30')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/32/index.html b/files/zh-cn/mozilla/firefox/releases/32/index.html new file mode 100644 index 0000000000..b2bfbc3fd9 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/32/index.html @@ -0,0 +1,154 @@ +--- +title: Firefox 32 for developers +slug: Mozilla/Firefox/Releases/32 +tags: + - Firefox + - Firefox 31 +translation_of: Mozilla/Firefox/Releases/32 +--- +<div>{{FirefoxSidebar}}</div><h2 id="普通_Web_开发者应该注意的变化">普通 Web 开发者应该注意的变化</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<p>Highlights:</p> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Web_Audio_Editor">Web Audio Editor</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Scratchpad#Code_completion_and_inline_documentation">Code completion and inline documentation in Scratchpad</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector#Rules_view">User agent styles in the Inspector's Rules view</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector#Firefox_32_onwards_2">Element picker button has moved</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector#Firefox_32_onwards">Node dimensions added to the Inspector's infobar</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Tools_Toolbox#Extra_tools">Full page screenshot button added</a></li> + <li>HiDPI images added to the tools</li> + <li>Nodes that have <code>display:none</code> are shown differently in the Inspector</li> +</ul> + +<p><a href="https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Client%20Software&chfieldto=2014-06-09&chfield=resolution&query_format=advanced&chfieldfrom=2014-04-28&chfieldvalue=FIXED&bug_status=RESOLVED&bug_status=VERIFIED&component=Developer%20Tools&component=Developer%20Tools%3A%203D%20View&component=Developer%20Tools%3A%20App%20Manager&component=Developer%20Tools%3A%20Canvas%20Debugger&component=Developer%20Tools%3A%20Console&component=Developer%20Tools%3A%20Debugger&component=Developer%20Tools%3A%20Framework&component=Developer%20Tools%3A%20Graphic%20Commandline%20and%20Toolbar&component=Developer%20Tools%3A%20Inspector&component=Developer%20Tools%3A%20Memory&component=Developer%20Tools%3A%20Netmonitor&component=Developer%20Tools%3A%20Object%20Inspector&component=Developer%20Tools%3A%20Profiler&component=Developer%20Tools%3A%20Responsive%20Mode&component=Developer%20Tools%3A%20Scratchpad&component=Developer%20Tools%3A%20Source%20Editor&component=Developer%20Tools%3A%20Style%20Editor&component=Developer%20Tools%3A%20User%20Stories&component=Developer%20Tools%3A%20WebGL%20Shader%20Editor&product=Firefox">All devtools bugs fixed between Firefox 31 and Firefox 32</a>.</p> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>默认开启 {{cssxref("mix-blend-mode")}} ({{Bug(952643)}})。</li> + <li>在正式版本中默认开启 <code>position:sticky</code> (之前只在 Nightly 和 Aurora 版本中才会开启) ({{Bug(916315)}})。</li> + <li>implement box-decoration-break: Left/right part of a box-shadow should only be drawn on the first/last continuation of an inline box ({{Bug(613659)}}).</li> + <li>允许 {{cssxref("flex-grow")}} / {{cssxref("flex-shrink")}} 在 0 和非 0 值之间作 transition , like 'flex-grow: 0.6'({{Bug(996945)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>Experimentally implemented, behind a pref, {{HTMLElement("img")}} {{HTMLattrxref("srcset", "img")}} property, To activate it set <code>dom.image.srcset.enable</code> to <code>true</code> ({{Bug(870021)}}).</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id"><strong>id</strong></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class"><strong>class</strong></a> are now true <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes">global attributes</a> and also apply to XML elements, in a namespace or not ({{bug(741295)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>The following new ECMAScript 2015 built-in methods got implemented:</li> + <li>{{jsxref("Array.from()")}} ({{bug(904723)}}),</li> + <li>{{jsxref("Array.prototype.copyWithin()")}} ({{bug(934423)}}),</li> + <li>{{jsxref("Number.isSafeInteger()")}} ({{bug(1003764)}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<ul> + <li>实现了 {{domxref("NavigatorLanguage.languages", "navigator.languages")}} 属性和 <a href="/zh-CN/docs/Web/Reference/Events/languagechange">languagechange</a> 事件。 ({{Bug(889335)}})。</li> + <li>The {{domxref("Navigator.vibrate()")}} method behavior has been adapted to the latest specification: too long vibrations are now truncated ({{bug(1014581)}}).</li> + <li>{{domxref("KeyboardEvent.getModifierState")}}() 和 {{domxref("MouseEvent.getModifierState")}}() 支持了 "Accel" 虚拟修饰符 ({{Bug(1009388)}})。</li> + <li>实现了 {{domxref("KeyboardEvent.code")}} 属性,不过目前在正式版本中还是禁用状态 ({{Bug(865649)}})。</li> + <li>Scoped selectors for {{domxref("Document.querySelector()")}} and {{domxref("Document.querySelectorAll()")}}, for example <code>querySelector(":scope > li")</code>have been implemented ({{Bug(528456)}}).</li> + <li>The experimental implementation of the {{domxref("Document.timeline")}} interface, related to the <a href="http://dev.w3.org/fxtf/web-animations/">Web Animation API</a>, has been added ({{bug("998246")}}). It is controlled by <code>layout.web-animations.api.enabled</code> preference, enabled only on Nightly and Aurora for the moment.</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Data_Store_API">Data Store API</a> has been made available to <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers">Web Workers</a> ({{bug("949325")}}). It still is only activated for certified applications.</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker</a> {{domxref("InstallPhaseEvent")}} and {{domxref("InstallEvent")}} interfaces have been implemented ({{ Bug("967264") }}).</li> + <li> The <a href="https://developer.mozilla.org/en-US/docs/Web/API/MSISDN_Verification_API">MSISDN Verification API</a>, only activated for privileged apps, has been added ({{ Bug("988469") }}).</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API">Gamepad API</a> is now supported on Firefox for Android ({{bug(852935)}}).</li> + <li>To match the spec and the evolution of the CSS syntax, minor changes have been done to {{domxref("CSS.escape()")}}. The identifier now can begins with <code>'--'</code> and the second dash must not be escaped. Also vendor identifier are no more escaped. ({{bug(1008719)}})</li> + <li>To complete our Hit Regions implementation, {{domxref("MouseEvent.region")}} has been implemented ({{bug(979692)}}).</li> + <li>The {{domxref("CanvasRenderingContext2D.drawFocusIfNeeded()")}} method is now enabled by default ({{bug(1004579)}}).</li> + <li>The {{domxref("Navigator.doNotTrack")}} properties now returns <code>'1'</code> or <code>'0'</code>, reflecting the HTTP value, instead of <code>'yes'</code> or <code>'no'</code> ({{bug(887703)}}).</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL">XMLHttpRequest.responseURL</a> was implemented ({{bug(998076)}}).</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<ul> + <li>实现了 menclose 标记 <code>phasorangle</code>。</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>No change.</em></p> + +<h3 id="WebRTC">WebRTC</h3> + +<ul> + <li>New constraints for <a href="https://developer.mozilla.org/en-US/docs/Glossary/WebRTC">WebRTC</a>'s {{domxref("NavigatorUserMedia.getUserMedia", "getUserMedia()")}}, <code>width</code>, <code>height</code>, and <code>framerate</code>, have been added, to limit stream dimensions and frame rate ({{bug("907352")}}): + + <pre>{ + mandatory: { + width: { min: 640 }, + height: { min: 480 } + }, + optional: [ + { width: 650 }, + { width: { min: 650 }}, + { frameRate: 60 }, + { width: { max: 800 }}, + ] +}</pre> + </li> + <li>WebRTC methods which previously used callback functions as input parameters are now also available using JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promises</a>.</li> +</ul> + +<h3 id="AudioVideo">Audio/Video</h3> + +<p><em>No change.</em></p> + +<h2 id="Security">Security</h2> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Xray_vision#Xray_semantics_for_Object_and_Array">Privileged code now gets Xray vision for JavaScript <code>Object</code> and <code>Array</code> instances</a>.</li> +</ul> + +<h2 id="附加组件_和_Mozilla_开发者应该注意的变化">附加组件 和 Mozilla 开发者应该注意的变化</h2> + +<p>Xray vision is now applied to JavaScript objects that are not themselves DOM objects: <a href="https://developer.mozilla.org/en-US/docs/Xray_vision#Xrays_for_JavaScript_objects">Xrays for JavaScript objects</a>.</p> + +<p>A <code><a href="https://developer.mozilla.org/en-US/Add-ons/Add-on_Manager/Addon#getDataDirectory()">getDataDirectory()</a></code> method has been added to <code><a href="https://developer.mozilla.org/en-US/Add-ons/Add-on_Manager/Addon">Addon</a></code> instances. This method returns the preferred location, within the current profile, for add-ons to store data.</p> + +<p> </p> + +<h3 id="Add-on_SDK">Add-on SDK</h3> + +<h4 id="Highlights">Highlights</h4> + +<ul> + <li>Added <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/page-mod#PageMod%28options%29"><code>exclude</code></a> option to <code>PageMod</code>.</li> + <li>Added <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/request#Request%28options%29"><code>anonymous</code></a> option to <code>Request</code>.</li> + <li><a href="https://developer.mozilla.org/en-US/Add-ons/Add-on_Debugger">Add-on Debugger</a> now includes a Console and a Scratchpad.</li> +</ul> + +<h4 id="Details">Details</h4> + +<p><a href="https://github.com/mozilla/addon-sdk/compare/firefox31...firefox32">GitHub commits made between Firefox 31 and Firefox 32</a>. This will not include any uplifts made after this release entered Aurora.</p> + +<p><a href="https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&chfieldto=2014-06-09&chfield=resolution&query_format=advanced&chfieldfrom=2014-04-28&chfieldvalue=FIXED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&product=Add-on%20SDK&list_id=10493962">Bugs fixed between Firefox 31 and Firefox 32</a>. This will not include any uplifts made after this release entered Aurora.</p> + +<h3 id="XPCOM">XPCOM</h3> + +<ul> + <li>The {{interface("nsIUDPSocket")}} interface now provides multicast support through the addition of the new {{ifattribute("nsIUDPSocket", "multicastLoopback")}}, {{ifattribute("nsIUDPSocket", "multicastInterface")}}, and {{ifattribute("nsIUDPSocket", "multicastInterfaceAddr")}} attributes, as well as the {{ifmethod("nsIUDPSocket", "joinMulticast")}} and {{ifmethod("nsIUDPSocket", "leaveMulticast")}} methods.</li> +</ul> + +<p> </p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/32/Site_Compatibility">Site Compatibility for Firefox 32</a></li> +</ul> + +<h3 id="Older_versions">Older versions</h3> + +<p>{{Firefox_for_developers('31')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/33/index.html b/files/zh-cn/mozilla/firefox/releases/33/index.html new file mode 100644 index 0000000000..accca764bf --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/33/index.html @@ -0,0 +1,38 @@ +--- +title: Firefox 33 for developers +slug: Mozilla/Firefox/Releases/33 +translation_of: Mozilla/Firefox/Releases/33 +--- +<div>{{FirefoxSidebar}}</div><h2 id="普通_Web_开发者应该注意的变化">普通 Web 开发者应该注意的变化</h2> +<h3 id="Developer_Tools">Developer Tools</h3> +<p><em>No change.</em></p> +<h3 id="CSS">CSS</h3> +<ul> + <li>实现了 @counter-style 规则 ({{bug(966166)}})。</li> + <li><strong>-moz-ethiopic-numeric </strong>去除前缀({{bug(985825)}})。</li> + <li>支持了<strong>disclosure-open/disclosure-closed </strong>计数器样式({{bug(982355)}})。</li> +</ul> +<h3 id="HTML">HTML</h3> +<p><em>No change.</em></p> +<h3 id="JavaScript">JavaScript</h3> +<ul> + <li>移除了非标准的 {{jsxref("Number.toInteger()")}} 方法 ({{bug(1022396)}}).</li> +</ul> +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> +<p><em>No change.</em></p> +<h3 id="MathML">MathML</h3> +<p><em>No change.</em></p> +<h3 id="SVG">SVG</h3> +<p><em>No change.</em></p> +<h3 id="AudioVideo">Audio/Video</h3> +<p><em>No change.</em></p> +<h2 id="Security">Security</h2> +<p><em>No change.</em></p> +<h2 id="附加组件_和_Mozilla_开发者应该注意的变化">附加组件 和 Mozilla 开发者应该注意的变化</h2> +<p><em>No change.</em></p> +<h2 id="相关链接">相关链接</h2> +<ul> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/33/Site_Compatibility">Site Compatibility for Firefox 33</a></li> +</ul> +<h3 id="更早版本">更早版本</h3> +<p>{{Firefox_for_developers('32')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/35/index.html b/files/zh-cn/mozilla/firefox/releases/35/index.html new file mode 100644 index 0000000000..c7d75e5f94 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/35/index.html @@ -0,0 +1,213 @@ +--- +title: Firefox 35 开发者相关变更清单 +slug: Mozilla/Firefox/Releases/35 +tags: + - Firefox + - Firefox 35 +translation_of: Mozilla/Firefox/Releases/35 +--- +<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><div>Firefox 35 was released on January 13th, 2015. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.</div> + +<h2 id="Web_开发者相关变更">Web 开发者相关变更</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<p>Highlights:</p> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector#.3A.3Abefore_and_.3A.3Aafter">See ::before and ::after pseudo elements in the Page Inspector</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Style_Editor#Source_map_support">CSS source maps are now enabled by default</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector#Element_popup_menu_2">"Show DOM Properties" from the Page Inspector</a></li> +</ul> + +<p><a class="external-icon external" href="https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&chfieldto=2014-10-13&chfield=resolution&query_format=advanced&chfieldfrom=2014-09-02&chfieldvalue=FIXED&component=Developer%20Tools&component=Developer%20Tools%3A%203D%20View&component=Developer%20Tools%3A%20Canvas%20Debugger&component=Developer%20Tools%3A%20Console&component=Developer%20Tools%3A%20Debugger&component=Developer%20Tools%3A%20Framework&component=Developer%20Tools%3A%20Graphic%20Commandline%20and%20Toolbar&component=Developer%20Tools%3A%20Inspector&component=Developer%20Tools%3A%20Memory&component=Developer%20Tools%3A%20Netmonitor&component=Developer%20Tools%3A%20Object%20Inspector&component=Developer%20Tools%3A%20Profiler&component=Developer%20Tools%3A%20Responsive%20Mode&component=Developer%20Tools%3A%20Scratchpad&component=Developer%20Tools%3A%20Source%20Editor&component=Developer%20Tools%3A%20Storage%20Inspector&component=Developer%20Tools%3A%20Style%20Editor&component=Developer%20Tools%3A%20Timeline&component=Developer%20Tools%3A%20User%20Stories&component=Developer%20Tools%3A%20Web%20Audio%20Editor&component=Developer%20Tools%3A%20WebGL%20Shader%20Editor&component=Developer%20Tools%3A%20WebIDE&component=Simulator&product=Firefox&product=Firefox%20OS&list_id=11184176">All devtools bugs fixed between Firefox 34 and Firefox 35</a>.</p> + +<h3 id="CSS">CSS</h3> + +<ul> + <li><a href="/zh-CN/docs/Web/CSS/mask-type" title="此页面仍未被本地化, 期待您的翻译!"><code>mask-type</code></a> 属性默认启用 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1058519" title="FIXED: Ship mask-type CSS property">bug 1058519</a>)。</li> + <li><a href="/zh-CN/docs/Web/CSS/filter" title="CSS滤镜(filter)属提供的图形特效,像模糊,锐化或元素变色。过滤器通常被用于调整图片,背景和边界的渲染。"><code>filter</code></a> 属性默认启用 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1057180" title="FIXED: Turn on CSS Filters by default (by enabling about:config pref)">bug 1057180</a>)。</li> + <li><a href="/zh-CN/docs/Web/CSS/@font-face" title="这是一个叫做@font-face 的CSS @规则 ,它允许网页开发者为其网页指定在线字体。 通过这种作者自备字体的方式,@font-face 可以消除对用户电脑字体的依赖。 @font-face 不仅可以放在在CSS的最顶层, 也可以放在 @规则 的 条件规则组 中。"><code>@font-face</code></a> at-rule 支持 WOFF2 字体 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1064737" title="FIXED: support WOFF2 fonts via @font-face">bug 1064737</a>)。</li> + <li>支持 <a href="/zh-CN/docs/Web/CSS/symbol()" title="此页面仍未被本地化, 期待您的翻译!"><code>symbol()</code></a> 函数注解 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=966168" title="FIXED: Implement symbols() CSS function">bug 966168</a>)。</li> + <li>实现 CSS Font Loading API (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1028497" title="FIXED: implement the CSS Font Loading API">bug 1028497</a>)。</li> + <li><span id="summary_alias_container"><span id="short_desc_nonedit_display">在下拉框上设置 <a href="/zh-CN/docs/Web/CSS/appearance" title="此页面仍未被本地化, 期待您的翻译!"><code>-moz-appearance</code></a> 为 <code>none</code> 值,会移除下拉按钮</span></span> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649849" title="FIXED: Make -moz-appearance:none on a combobox remove the dropdown button">bug 649849</a>)。</li> + <li>The property accessor <code>element.style["css-property-name"]</code> has been added to match other browsers (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=958887" title='FIXED: Add support for element.style["css-property-name"] non-standard extension'>bug 958887</a>).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>The obsolete and non-conforming <code>bottommargin</code>, <code>leftmargin</code>, <code>rightmargin</code> and <code>topmargin</code> attributes of the <code><a href="/zh-CN/docs/Web/HTML/Element/body" title="HTML body 元素表示文档的内容。document.body 属性提供了可以轻松访问文档的 body 元素的脚本。"><code><body></code></a> element</code> have been activated in non-quirks mode (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=95530" title="FIXED: topmargin and leftmargin attributes on the BODY element should be honored in all modes (not just Quirks mode)">bug 95530</a>).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>The "<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone_and_errors_with_let">temporal dead zone</a>" for <a href="/en-US/docs/Web/JavaScript/Reference/Statements/let"><code>let</code></a> declarations has been implemented. In conformance with ES6 <code>let</code> semantics, the following situations<br> + now throw errors. See also this<a href="https://groups.google.com/forum/#!topic/mozilla.dev.platform/tezdW299Zds"> newsgroup announcement</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1001090" title='FIXED: Implement ES6 "temporal dead zone" for let'>bug 1001090</a>. + + <ul> + <li>Redeclaring existing variables or arguments using <code>let</code> within the same scope in function bodies is now a syntax error.</li> + <li>Using a variable declared using <code>let</code> in function bodies before the declaration is reached and evaluated is now a runtime error.</li> + </ul> + </li> + <li>ES6 <a href="/zh-CN/docs/Web/JavaScript/Reference/Symbols" title="此页面仍未被本地化, 期待您的翻译!"><code>Symbols</code></a> (only available in the Nightly channel) have been updated to conform with recent specification changes: + <ul> + <li><code>String(Symbol("1"))</code> now no longer throws a <a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/TypeError" title="TypeError(类型错误) 对象用来表示值的类型非预期类型时发生的错误。"><code>TypeError</code></a>; instead a string (<code>"Symbol(1)"</code>) gets returned (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1058396" title="FIXED: String(aSymbol) now returns the symbol’s description in ES6 draft rev 27">bug 1058396</a>).</li> + </ul> + </li> + <li>The various <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects"><em>TypedArray</em> constructors</a> now have as their <code>[[Prototype]]</code> a single function, denoted <code>%TypedArray%</code> in ES6 (but otherwise not directly exposed). Each typed array prototype now inherits from <code>%TypedArray%.prototype</code>. (<code>%TypedArray%</code> and <code>%TypedArray%.prototype</code> inherit from <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/prototype"><code>Function.prototype</code></a> and <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype"><code>Object.prototype</code></a>, respectively, so that typed array constructors and instances still have the properties found on those objects.) Typed array function properties now reside on <code>%TypedArray%.prototype</code> and work on any typed array. See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#Description"><em>TypedArray</em></a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=896116" title="FIXED: Implement ES6 %TypedArray% superclass that all ArrayBufferViews inherit from">bug 896116</a> for more information.</li> + <li>ES6 semantics for <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Prototype_mutation">prototype mutations using object literals</a> have been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061853" title="FIXED: Implement ES6 object-literal __proto__ restrictions/semantics">bug 1061853</a>). + <ul> + <li>Now only a single member notated as <code>__proto__:value</code> will mutate the <code>[[Prototype]]</code> in the object literal syntax.</li> + <li>Method members like <code>__proto__() {}</code> will not overwrite the <code>[[Prototype]]</code> anymore.</li> + </ul> + </li> +</ul> + +<h3 id="接口APIsDOM">接口/APIs/DOM</h3> + +<ul> + <li>The <a href="/zh-CN/docs/Web/API/NavigatorLanguage" title="NavigatorLanguage 包含涉及导航(Navigator)的语言特性的方法和属性。"><code>NavigatorLanguage</code></a> interface is now available to workers on <a href="/zh-CN/docs/Web/API/WorkerNavigator" title="此页面仍未被本地化, 期待您的翻译!"><code>WorkerNavigator</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=925849" title="FIXED: WorkerNavigator does not implement NavigatorLanguage">bug 925849</a>).</li> + <li>The <a href="/zh-CN/docs/Web/API/Element/closest" title="Element.closest() 方法用来获取:匹配特定选择器且离当前元素最近的祖先元素(也可以是当前元素本身)。如果匹配不到,则返回 null。"><code>Element.closest()</code></a> method returns the closest ancestor of the current element (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1055533" title="FIXED: Implement Element.closest()">bug 1055533</a>).</li> + <li>Experimental support for the <a href="/zh-CN/docs/Web/API/CanvasRenderingContext2D/filter" title="CanvasRenderingContext2D.filter 是Canvas 2D API 提供模糊、灰度等过滤效果的属性 。它类似于 CSS filter 属性,并且接受相同的函数。"><code>CanvasRenderingContext2D.filter</code></a> property has been added behind the <code>canvas.filters.enabled</code> flag (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=927892" title="FIXED: Exposing the CSS/SVG Filters as Canvas APIs">bug 927892</a>).</li> + <li>Our experimental implementation of Web Animations progresses with the landing of the <a href="/zh-CN/docs/Web/API/Animation/target" title="此页面仍未被本地化, 期待您的翻译!"><code>Animation.target</code></a> property. This always is behind the <code>dom.animations-api.core.enabled</code> pref, off by default (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1067701" title="FIXED: Implement Animation.target">bug 1067701</a>).</li> + <li>The <a href="/zh-CN/docs/Web/API/Element/hasAttributes" title="hasAttributes属性返回一个布尔值true或false,来表明当前元素节点是否有至少一个的属性(attribute)."><code>hasAttributes()</code></a> method has been moved from <a href="/zh-CN/docs/Web/API/Node" title="Node是一个接口,许多DOM类型从这个接口继承,并允许类似地处理(或测试)这些各种类型。"><code>Node</code></a> to <a href="/zh-CN/docs/Web/API/Element" title="Element是非常通用的基类,所有 Document对象下的对象都继承它. 这个接口描述了所有相同种类的元素所普遍具有的方法和属性。 这些继承自Element并且增加了一些额外功能的接口描述了具体的行为. 例如, HTMLElement 接口是所有HTML元素的基础接口, 而 SVGElement 接口是所有SVG元素的基本接口.大多数功能在类的层次中进一步制定."><code>Element</code></a> as required by the spec (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1055773" title="FIXED: Move hasAttributes() to Element">bug 1055773</a>).</li> + <li>The <code>crossOrigin</code> reflected attribute of <a href="/zh-CN/docs/Web/API/HTMLImageElement" title="HTMLImageElement 接口提供了特别的属性和方法 (在常规的 HTMLElement之外,它也能通过继承使用)来操纵 <img> 元素的布局和图像."><code>HTMLImageElement</code></a>, <a href="/zh-CN/docs/Web/API/HTMLLinkElement" title="The HTMLLinkElement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa. This object inherits all of the properties and methods of the HTMLElement interface."><code>HTMLLinkElement</code></a>, <a href="/zh-CN/docs/Web/API/HTMLMediaElement" title="从父级元素 HTML 元素继承属性"><code>HTMLMediaElement</code></a>, <a href="/zh-CN/docs/Web/API/HTMLScriptElement" title="HTML script elements expose the HTMLScriptElement interface, which provides special properties and methods (beyond the regular HTMLElement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <script> elements."><code>HTMLScriptElement</code></a>, and <a href="/zh-CN/docs/Web/API/SVGScriptElement" title="此页面仍未被本地化, 期待您的翻译!"><code>SVGScriptElement</code></a> only accepts valid values, and <code>""</code> isn't, <code>null</code> has to be used instead (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=880997" title="FIXED: Reflect crossOrigin as a limited enumerated attribute">bug 880997</a>).</li> + <li>The Resource Timing API has been activated by default (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1002855" title="FIXED: Turn on Resource Timing">bug 1002855</a>).</li> + <li>To match the spec, the first argument of <a href="/zh-CN/docs/Web/API/Selection/containsNode" title="Selection.containsNode() 判断指定的节点是否包含在Selection中(是否被选中)."><code>Selection.containsNode()</code></a> cannot be <code>null</code> anymore (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1068058" title="FIXED: Update Selection.containsNode according to the spec">bug 1068058</a>).</li> + <li>The new <a href="/zh-CN/docs/Web/API/ImageCapture" title="此页面仍未被本地化, 期待您的翻译!"><code>ImageCapture</code></a> API has been implemented: <a href="/zh-CN/docs/Web/API/ImageCapture/takePhoto" title="此页面仍未被本地化, 期待您的翻译!"><code>ImageCapture.takePhoto()</code></a> is available (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=916643" title="FIXED: ImageCapture - Implement WebIDL and takePhoto()">bug 916643</a>).</li> + <li>Non-HTTP <a href="/zh-CN/docs/Web/API/XMLHttpRequest" title="使用XMLHttpRequest (XHR)对象可以与服务器交互。您可以从URL获取数据,而无需让整个的页面刷新。这使得Web页面可以只更新页面的局部,而不影响用户的操作。XMLHttpRequest在 Ajax 编程中被大量使用。"><code>XMLHttpRequest</code></a> requests now return <code>200</code> in case of success (instead of the erroneous <code>0</code>) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=716491" title="FIXED: Investigate the status code for non-HTTP XHR.">bug 716491</a>).</li> + <li><a href="/zh-CN/docs/Web/API/XMLHttpRequest/responseURL" title="如果URL为空,只读的XMLHttpRequest.responseURL属性返回响应的序列化URL或空字符串。当URL被返回的时候,任何包含在URL # 后面的fragment都会被删除。 responseURL 的值将会是经过任意多次重定向后的最终 URL 。"><code>XMLHttpRequest.responseURL</code></a> has been adapted to the latest spec and doesn't include the fragment (<code>'#xyz'</code>) of the URL, if relevant (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1073882" title="FIXED: XMLHttpRequest.prototype.responseURL should not have fragment per latest spec">bug 1073882</a>).</li> + <li>The internal, non-standard, <a href="/zh-CN/docs/Web/API/File/mozFullPath" title="此页面仍未被本地化, 期待您的翻译!"><code>File.mozFullPath</code></a> property is no more visible from content (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1048293" title="FIXED: File::mozFullPath attribute should not be exposed to content.">bug 1048293</a>).</li> + <li>The constructor of <a href="/zh-CN/docs/Web/API/File" title="文件(File) 接口提供有关文件的信息,并允许网页中的 JavaScript 访问其内容。"><code>File</code></a> has been extended to match the specification (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1047483" title="FIXED: Porting DOMFile/DOMBlob to WebIDL">bug 1047483</a>).</li> + <li>An experimental implementation of <a href="/zh-CN/docs/Web/API/AbortablePromise" title="此页面仍未被本地化, 期待您的翻译!"><code>AbortablePromise</code></a>, a promise that can be aborted by a different entity that the one who created it, has been added. It is prefixed with <code>Moz</code> and controlled by the <code>dom.abortablepromise.enabled </code>property, defaulting to <code>false</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1035060" title="FIXED: Implement AbortablePromise">bug 1035060</a>).</li> + <li>The non-standard <a href="/zh-CN/docs/Web/API/Navigator/mozIsLocallyAvailable" title="查询某个URI上的资源是否是本地可用的."><code>Navigator.mozIsLocallyAvailable</code></a> property has been removed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1066826" title="FIXED: Remove Navigator::MozisLocallyAvailable API">bug 1066826</a>).</li> + <li>The preference <code>network.websocket.enabled,</code> <code>true</code> by default, has been removed; <a href="https://developer.mozilla.org/en-US/docs/WebSockets">Websocket</a> API cannot be deactivated anymore (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1091016" title="FIXED: Pref network.websocket.enabled is no longer reasonable">bug 1091016</a>).</li> + <li>The non-standard methods and properties of <a href="/zh-CN/docs/Web/API/Window/crypto" title="Window.crypto只读属性返回与全局对象关联的 Crypto对象。 此对象允许网页访问某些加密相关服务。"><code>Window.crypto</code></a> have been removed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1030963" title="FIXED: remove proprietary window.crypto functions/properties">bug 1030963</a>). Only methods and properties defined in the standard WebCrypto API are left.</li> + <li>Our experimental implementation of WebGL 2.0 is going forward! + <ul> + <li>The <a href="/zh-CN/docs/Web/API/WebGL2RenderingContext/copyBufferSubData" title="此页面仍未被本地化, 期待您的翻译!"><code>WebGL2RenderingContext.copyBufferSubData()</code></a> method has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1048668" title="FIXED: WebGL2 - Implement CopyBufferSubData">bug 1048668</a>).</li> + </ul> + </li> +</ul> + +<h3 id="MathML"> MathML</h3> + +<ul> + <li>The <code>dtls</code> OpenType feature (via the CSS <a href="/zh-CN/docs/Web/CSS/font-feature-settings" title="font-feature-settings CSS属性可让您控制OpenType字体中的高级印刷功能。"><code>font-feature-settings</code></a> on the default stylesheet) is now applied automatically to MathML elements when positioning scripts over it (e.g. dotless i with mathematical hat).</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>无变化。</em></p> + +<h3 id="音频视频">音频/视频</h3> + +<p><em>无变化。</em></p> + +<h2 id="网络_安全">网络 & 安全</h2> + +<ul> + <li>HTTP/2 has been implemented and activated, with AEAD ciphers only (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1027720" title="FIXED: Restrict HTTP/2 connections to AEAD ciphers only">bug 1027720</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1047594" title="FIXED: Enable http/2 (and alpn) by default">bug 1047594</a>).</li> + <li>支持 HTTP/2 <code>alt-svc</code> header (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1003448" title="FIXED: http/2 alt-svc support">bug 1003448</a>)。</li> + <li>实现 HTTP (HPKP) 的 <a href="/en-US/docs/Web/Security/Public_Key_Pinning">Public Key Pinning</a> 扩展 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=787133" title="FIXED: Implement Public Key Pinning Extension for HTTP (HPKP)">bug 787133</a>)。</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP">CSP</a> 1.1 <code>base-uri</code> <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives">directive</a> is now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1045897" title="FIXED: Implement CSP 1.1 base-uri directive">bug 1045897</a>).</li> + <li>Path of the source is now considered too when host-source matching happens in <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP">CSP</a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=808292" title="FIXED: Implement path-level host-source matching to CSP">bug 808292</a>).</li> +</ul> + +<h2 id="附加组件和_Mozilla_开发者相关的变更">附加组件和 Mozilla 开发者相关的变更</h2> + +<h3 id="XUL_附加组件">XUL & 附加组件</h3> + +<ul> + <li>The private <code>_getTabForBrowser()</code> method on the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabbrowser" title="tabbrowser">tabbrowser</a></code> element has been deprecated. In its place, we've added a new, public, method called <span id="m-getTabForBrowser"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getTabForBrowser">getTabForBrowser</a></code></span>. This returns, predictably, the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tab" title="tab">tab</a></code> element that contains the specified <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code>.</li> + <li><code>Components.utils.now()</code>, matching <a href="/zh-CN/docs/Web/API/Performance/now" title="performance.now()方法返回一个精确到毫秒的 DOMHighResTimeStamp 。"><code>Performance.now()</code></a> has been implemented for non-window chrome code (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=969490" title="FIXED: Implement Components.utils.now() to match Performance.now() for non-window chrome code">bug 969490</a>).</li> +</ul> + +<h3 id="Add-on_SDK">Add-on SDK</h3> + +<h4 id="Highlights">Highlights</h4> + +<ul> + <li>增加 <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Add_a_Context_Menu_Item#Adding_an_access_key">上下文菜单的快捷键</a>。</li> + <li>移除 <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/windows#BrowserWindow"><code>BrowserWindow</code></a> 的 <code>isPrivateBrowsing</code></li> + <li>added <code><a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/url#toJSON%28%29">toJSON</a> </code>method to <code>URL</code> instances from <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/url">sdk/url</a></li> +</ul> + +<h4 id="明细">明细</h4> + +<p><a class="external external-icon" href="https://github.com/mozilla/addon-sdk/compare/firefox34...firefox35">Firefox 34 到 Firefox 35 的</a><a class="external external-icon" href="https://github.com/mozilla/addon-sdk/compare/firefox34...firefox35"> GitHub 提交</a>. This will not include any uplifts made after this release entered Aurora.</p> + +<p><a class="external external-icon" href="https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&chfieldto=2014-10-13&chfield=resolution&query_format=advanced&chfieldfrom=2014-09-02&chfieldvalue=FIXED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&product=Add-on%20SDK&list_id=11562840">Bugs fixed between Firefox 34 and Firefox 35</a>. This will not include any uplifts made after this release entered Aurora.</p> + +<p> </p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-US/versions/35/">Site Compatibility for Firefox 35</a></li> +</ul> + +<p> </p> + +<h2 id="以往版本">以往版本</h2> + +<div class="multiColumnList"> +<ul> +<li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/34">Firefox 34 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/33">Firefox 33 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/32">Firefox 32 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/31">Firefox 31 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/30">Firefox 30 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/29">Firefox 29 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/28">Firefox 28 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/27">Firefox 27 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/26">Firefox 26 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/25">Firefox 25 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/24">Firefox 24 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/23">Firefox 23 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/22">Firefox 22 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/21">Firefox 21 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/20">Firefox 20 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/19">Firefox 19 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/18">Firefox 18 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/17">Firefox 17 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/16">Firefox 16 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/15">Firefox 15 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/14">Firefox 14 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/13">Firefox 13 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/12">Firefox 12 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/11">Firefox 11 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/10">Firefox 10 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/9">Firefox 9 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/8">Firefox 8 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/7">Firefox 7 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/6">Firefox 6 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/5">Firefox 5 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/4">Firefox 4 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/3.6">Firefox 3.6 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/3">Firefox 3 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/2">Firefox 2 for developers</a></li><li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/1.5">Firefox 1.5 for developers</a></li></ul> +</div> diff --git a/files/zh-cn/mozilla/firefox/releases/41/index.html b/files/zh-cn/mozilla/firefox/releases/41/index.html new file mode 100644 index 0000000000..9e373c6bf7 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/41/index.html @@ -0,0 +1,209 @@ +--- +title: Firefox 41 for developers +slug: Mozilla/Firefox/Releases/41 +tags: + - Firefox + - Firefox 41 +translation_of: Mozilla/Firefox/Releases/41 +--- +<div>{{FirefoxSidebar}}</div><div class="column-container zone-callout"><a style="float: right; margin-bottom: 20px; padding: 10px; text-align: center; border-radius: 4px; display: inline-block; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;" href="https://nightly.mozilla.org/">To test the latest developer features of Firefox,<br> +install Firefox Developer Edition</a> Firefox 41 was released on September 22, 2015. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.</div> + +<h2 id="Changes_for_Web_developers">Changes for Web developers</h2> + +<h3 id="开发工具">开发工具</h3> + +<p>Highlights:</p> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_HTML#Element_popup_menu">Take a screenshot of a DOM node</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor#CopySave_All_As_HAR">Copy as HAR/save as HAR</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Add_rules">"Add Rule" button in the Rules view</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/View_source">View source in a tab</a> (Disabled by default)</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Copy_rules">More options to copy CSS rules</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/View_background_images">Copy image as data: URI in the Rules view</a></li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/GCLI/Display_security_information">Added command to GCLI to display CSP info</a></li> +</ul> + +<p><a href="https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Client%20Software&chfieldto=2015-06-29&query_format=advanced&chfield=resolution&chfieldfrom=2015-05-11&chfieldvalue=FIXED&bug_status=RESOLVED&bug_status=VERIFIED&component=Developer%20Tools&component=Developer%20Tools%3A%203D%20View&component=Developer%20Tools%3A%20Canvas%20Debugger&component=Developer%20Tools%3A%20Console&component=Developer%20Tools%3A%20Debugger&component=Developer%20Tools%3A%20Framework&component=Developer%20Tools%3A%20Graphic%20Commandline%20and%20Toolbar&component=Developer%20Tools%3A%20Inspector&component=Developer%20Tools%3A%20Memory&component=Developer%20Tools%3A%20Netmonitor&component=Developer%20Tools%3A%20Object%20Inspector&component=Developer%20Tools%3A%20Performance%20Tools%20%28Profiler%2FTimeline%29&component=Developer%20Tools%3A%20Responsive%20Mode&component=Developer%20Tools%3A%20Scratchpad&component=Developer%20Tools%3A%20Source%20Editor&component=Developer%20Tools%3A%20Storage%20Inspector&component=Developer%20Tools%3A%20Style%20Editor&component=Developer%20Tools%3A%20User%20Stories&component=Developer%20Tools%3A%20Web%20Audio%20Editor&component=Developer%20Tools%3A%20WebGL%20Shader%20Editor&component=Developer%20Tools%3A%20WebIDE&product=Firefox&list_id=12283503">All devtools bugs fixed between Firefox 40 and Firefox 41</a>: note that many of these bugs, especially those relating to the performance tools, were uplifted to Firefox 40.</p> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>Support for laying out vertical scripts has been activated by default ({{bug(1138384)}}). That means that the following CSS properties are now available: + <ul> + <li>Choosing the direction of writing: {{cssxref("writing-mode")}}.</li> + <li>Controlling orientation of characters: {{cssxref("text-orientation")}}.</li> + <li>Direction-independent equivalents of {{cssxref("width")}} and {{cssxref("height")}}: {{cssxref("block-size")}} and {{cssxref("inline-size")}}.</li> + <li>Direction-independent equivalents of {{cssxref("min-width")}} and {{cssxref("min-height")}}: {{cssxref("min-block-size")}} and {{cssxref("min-inline-size")}}.</li> + <li>Direction-independent equivalents of {{cssxref("max-width")}} and {{cssxref("max-height")}}: {{cssxref("max-block-size")}} and {{cssxref("max-block-size")}}.</li> + <li>Direction-independent equivalents of {{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-bottom")}} and {{cssxref("margin-left")}}: {{cssxref("margin-block-start")}}, {{cssxref("margin-block-end")}}, {{cssxref("margin-inline-start")}} and {{cssxref("margin-inline-end")}}.</li> + <li>Direction-independent equivalents of {{cssxref("padding-top")}}, {{cssxref("padding-right")}}, {{cssxref("padding-bottom")}} and {{cssxref("padding-left")}}: {{cssxref("padding-block-start")}}, {{cssxref("padding-block-end")}}, {{cssxref("padding-inline-start")}} and {{cssxref("padding-inline-end")}}.</li> + <li>Direction-independent equivalents of {{cssxref("border-top")}}, {{cssxref("border-right")}}, {{cssxref("border-bottom")}} and {{cssxref("border-left")}} and their longhands for width, style and color: {{cssxref("border-block-start")}}, {{cssxref("border-block-start-width")}}, {{cssxref("border-block-start-style")}}, {{cssxref("border-block-start-color")}}, {{cssxref("border-block-end")}}, {{cssxref("border-block-end-width")}}, {{cssxref("border-block-end-style")}}, {{cssxref("border-block-end-color")}}, {{cssxref("border-inline-start")}}, {{cssxref("border-inline-start-width")}}, {{cssxref("border-inline-start-style")}}, {{cssxref("border-inline-start-color")}}, {{cssxref("border-inline-end")}}, {{cssxref("border-inline-end-width")}}, {{cssxref("border-inline-end-style")}} and {{cssxref("border-inline-end-color")}}.</li> + <li>Direction-independent equivalents of {{cssxref("top")}}, {{cssxref("right")}}, {{cssxref("bottom")}} and {{cssxref("left")}}: {{cssxref("offset-block-start")}}, {{cssxref("offset-block-end")}}, {{cssxref("offset-inline-start")}} and {{cssxref("offset-inline-end")}}.</li> + </ul> + </li> + <li>Support the {{cssxref("transform-origin")}} property in SVG and implement the {{cssxref("transform-box")}} property ({{bug(923193)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>{{HTMLElement("a")}} 没有 <code>href</code> 属性,并且不再被分类为交互内容. 点击 {{HTMLElement("label")}} 将会激活标签内容({{bug(1167816)}}).</li> + <li>SVG 图标现在支持站点图标(偏爱图标和快捷方式图标)({{bug(366324)}}).</li> + <li>The {{htmlattrxref('crossorigin', 'link')}} attribute is now supported for <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link"><link rel='preconnect'></a> ({{bug(1174152)}}).</li> + <li> The picture element does not react to resize/viewport changes ({{bug(1135812)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>{{jsxref("Date.prototype")}}现在是一个普通对象, 不再是一个 {{jsxref("Date")}} 实例 ({{bug(861219)}}).</li> + <li>{{jsxref("Date.prototype.toString")}} 现在是一般方法({{bug(861219)}}).</li> + <li>{{jsxref("Symbol.species")}}被增加到({{bug(1131043)}}).</li> + <li>{{jsxref("Map.@@species", "Map[@@species]")}} 和{{jsxref("Set.@@species", "Set[@@species]")}} 获取已经被增加 ({{bug(1131043)}}).</li> + <li>非标准 {{jsxref("Statements/let", "let expression", "#let_expressions", 1)}} 支持已经被废弃({{bug(1023609)}}).</li> + <li>{{jsxref("Functions/Default_parameters", "Destructured parameters with default value assignment","#Destructured_parameter_with_default_value_assignment", 1)}} 现在已经被支持 ({{bug(1018628)}}).</li> + <li>Per ES2015, <a href="/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions">方法定义</a> 需要尖括号. 从现在开始语法没有尖括号将会失败({{bug(1150855)}}).</li> + <li><a href="/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions">方法定义</a> (除了生成方法) 已经不再可构造 ({{bug(1059908)}} 和{{bug(1166950)}}).</li> + <li>As part of ES2015 specification compliance, parenthesized <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">destructuring</a> patterns, like <code>([a, b]) = [1, 2]</code> or <code>({a, b}) = { a: 1, b: 2 }</code>, are now considered invalid and will throw a {{jsxref("SyntaxError")}}. See <a href="http://whereswalden.com/2015/06/20/new-changes-to-make-spidermonkeys-and-firefoxs-parsing-of-destructuring-patterns-more-spec-compliant/">Jeff Walden's blog post</a> for more details.</li> + <li>The <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target">new.target</a></code> syntax has been added ({{bug(1141865)}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<ul> + <li>剪切、复制和粘贴命令处理已经被重新编码,并且现在允许JS编程实现网页内容复制和剪切。 + <ul> + <li>使用 <code>'paste'</code>名利作为参数, {{domxref("Document.queryCommandSupported()")}}现在会返回<span style="font-family: courier,andale mono,monospace;">false如果不充分的权限被执行</span>({{bug(1161721)}}).</li> + <li>使用<code>'cut'</code> 或 <code>'copy'</code> 命令作为参数, {{domxref("Document.queryCommandSupported()")}} 现在返回<code style="font-style: normal;">true</code> 如果调用的上下文中包括用户发起的或特权代码({{bug(1162952)}}).</li> + <li>使用 <code>'cut'</code> 或<code>'copy' 命令作为参数</code>, {{domxref("Document.execCommand()")}} 将会执行, 但是仅仅在用户发起的或特权代码的上下文下({{bug(1012662)}}).</li> + </ul> + </li> +</ul> + +<h4 id="Events">Events</h4> + +<ul> + <li>非标准的{{domxref("CloseEvent.initCloseEvent()")}} 方法和创建 {{domxref("CloseEvent")}} 使用 {{domxref("Event.createEvent", "Event.createEvent('CloseEvent')")}} 方法已经被移除. 相反可以使用标准的构造器{{domxref("CloseEvent.CloseEvent", "CloseEvent()")}} . ({{bug(1161950)}}).</li> + <li>On Desktop, {{domxref("PointerEvent")}} is now activated by default in Nightly; it is not activated in Developer Edition, Beta or Release and won't be for at least some versions ({{bug(1166347)}}).</li> + <li>The unprefixed version of {{domxref("MouseEvent.movementX")}} and {{domxref("MouseEvent.movementY")}}}} have been added; the prefixed versions are deprecated and will be removed at some point in the future ({{bug(1164981)}}).</li> +</ul> + +<h4 id="Web_Crypto">Web Crypto</h4> + +<ul> + <li>{{domxref("SubtleCrypto.importKey()")}} 和{{domxref("SubtleCrypto.exportKey()")}} 现在支持 <code>ECDH</code> keys ({{bug(1050175)}}).</li> +</ul> + +<h4 id="Canvas_API">Canvas API</h4> + +<ul> + <li>{{domxref("HTMLCanvasElement.captureStream()")}} and {{domxref("CanvasCaptureMediaStream")}} have been added and allow to stream the display of a {{HTMLElement("canvas")}} in real-time ({{bug(1032848)}}).</li> + <li>{{domxref("MediaStream.id")}} now returns the unique id of a stream ({{bug(1089798)}}).</li> + <li>The initial value of {{domxref("CanvasRenderingContext2D.filter")}} is now correctly set to <code>none</code> ({{bug(1163124)}}).</li> +</ul> + +<h4 id="Service_Workers">Service Workers</h4> + +<ul> + <li>Improvement to our experimental <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API">Service Worker</a> implementation: + + <ul> + <li>{{domxref("ServiceWorkerGlobalScope.skipWaiting()")}} has been implemented ({{bug(1131352)}}).</li> + <li>{{domxref("Clients.claim()")}} has been added ({{bug(1130684)}}).</li> + <li>The other functional events of Service Workers have been made to inherit from {{domxref("ExtendableEvent")}}, giving them access to the {{domxref("ExtendableEvent.waitUntil","waitUntil()")}} method ({{bug("1160527")}}).</li> + </ul> + </li> + <li>The {{domxref("CacheStorage")}} and {{domxref("Cache")}} interfaces are now supported ({{bug("1110144")}}).</li> +</ul> + +<h4 id="WebGL">WebGL</h4> + +<ul> + <li>The <code>failIfMajorPerformanceCaveat</code> WebGL context attribute has been added and can be set when creating a WebGL context with {{domxref("HTMLCanvasElement.getContext()")}} to indicate if a context creation should fail if the system performance is low ({{bug(1164970)}}).</li> +</ul> + +<h4 id="WebRTC">WebRTC</h4> + +<ul> + <li>Firefox no longer offers a default STUN server to be used if none are specified when constructing a new {{domxref("RTCPeerConnection")}}. You'll need to provide one in order to successfully establish a WebRTC connection.</li> +</ul> + +<h4 id="Miscellaneous">Miscellaneous</h4> + +<ul> + <li>On OS X and Windows, {{domxref("NavigatorOnLine.onLine", "Navigator.onLine")}} now changes regarding network connectivity (it always returned <code>true</code>, , unless "Work offline" mode was selected) before ({{bug(654579)}}).</li> + <li>{{domxref("MessagePort")}} and {{domxref("MessageChannel")}} now available in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API">Web workers</a>, and are enabled by default in all contexts ({{bug(952139)}}) and ({{bug(911972)}}).</li> + <li>The User Timing API is now available in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API">Web workers</a> ({{bug(1155761)}}).</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API">Notifications API</a> is now available in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API">Web workers</a> ({{bug(916893)}}).</li> + <li>{{domxref("DOMRequest")}} and {{domxref("DOMCursor")}} are now available in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API">Web workers</a> ({{bug(1167650)}}).</li> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/CSSFontLoading_API">CSS Font Loading API</a> has been completely implemented and is now enabled by default ({{bug(1149381)}}).</li> + <li>Shared workers can no longer be shared between private (i.e. browsing in a private window) and non-private documents (see {{bug(1177621)}}).</li> + <li>The {{domxref("URLUtilsSearchParams.searchParams")}} property is now read-only ({{bug(1174731)}}).</li> + <li> + <p>The {{domxref('URLUtils.hash')}} property no longer decodes URL fragment ({{bug(1093611)}}).</p> + </li> +</ul> + +<h3 id="MathML">MathML</h3> + +<h4 id="新的默认、支持字体处理">新的默认、支持字体处理</h4> + +<p>数学公式需要特殊的字体. 到目前为止, 这些字体被硬编码在用户默认样式 <code>mathml.css</code> (使用{{MathMLElement("math")}} 标志设置字体组) 和偏好选项<code>font.mathfont-family</code> (为拉伸和大操作数设置支持字体). Firefox 41 引入一个能够自动设置<span style="font-family: courier,andale mono,monospace;"><math>标志和相应偏好选项的</span>内置<code>x-math</code> 语言 (例如<code>font.name.serif.x-math</code>). 用户默认样式现在将<span style="font-family: courier,andale mono,monospace;"><math>标志字体</span>设置为serif 并且<code>font.mathfont-family</code> 被替换为 <code>font.name.serif.x-math</code>. 所有平台现在基本使用相同列表的支持字体, "Latin Modern Math" 是首选.在标准的 per-language字体偏好菜单中,默认支持字体能够被设置. 更多细节,请参照{{bug(947654)}} 和 {{bug(1160456)}}.</p> + +<h3 id="SVG">SVG</h3> + +<ul> + <li>站点图片(偏爱图标,快捷方式图标) 现在支持SVG({{bug(366324)}})</li> +</ul> + +<h3 id="音频视频">音频/视频</h3> + +<ul> + <li>The <code>media.autoplay.enabled</code> preference now also apply to untrusted {{domxref("HTMLMediaElement.play()")}} invocations too, that is calls from non-users activated scripts ({{bug(659285)}}).</li> +</ul> + +<h2 id="Networking">Networking</h2> + +<ul> + <li>The <code>X-Content-Duration</code> header is no longer supported ({{Bug(1160695)}}).</li> + <li>Draft versions of the HTTP/2 protocol are no more supported ({{bug(1132357)}}).</li> +</ul> + +<h2 id="Security">Security</h2> + +<ul> + <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP">CSP</a> 1.1 <code>manifest-src</code> <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives">directive</a> 已经被支持 ({{bug(1089255)}}).</li> + <li>Previous versions of Firefox incorrectly expected the <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP">Content Security Policy</a> <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#referrer">referrer</a>directive's value <code>origin-when-cross-origin</code> to be spelled <code>origin-when-crossorigin</code>. This has been corrected to include the missing dash character.</li> +</ul> + +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> + +<h3 id="XUL">XUL</h3> + +<p><em>没有变化。</em></p> + +<h3 id="JavaScript_code_modules">JavaScript code modules</h3> + +<p><em>没有变化。</em></p> + +<h3 id="XPCOM">XPCOM</h3> + +<p><em>没有变化。</em></p> + +<h3 id="其他">其他</h3> + +<ul> + <li>A new, internal, and chrome-context-only API to render the root widget of a window into a {{HTMLElement("canvas")}} has been added: {{domxref("CanvasRenderingContext2D.drawWidgetAsOnScreen()")}}. This API uses the operating system to snapshot the widget on-screen. For more details see {{bug(1167477)}}.</li> +</ul> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/41/Site_Compatibility">Site Compatibility for Firefox 41</a></li> +</ul> + +<h2 id="之前版本">之前版本</h2> + +<p>{{Firefox_for_developers('40')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/43/index.html b/files/zh-cn/mozilla/firefox/releases/43/index.html new file mode 100644 index 0000000000..81566a6373 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/43/index.html @@ -0,0 +1,173 @@ +--- +title: Firefox 43 for developers +slug: Mozilla/Firefox/Releases/43 +tags: + - Firefox +translation_of: Mozilla/Firefox/Releases/43 +--- +<div>{{FirefoxSidebar}}</div><p><a href="https://www.mozilla.org/firefox/developer/" style="float: right; margin-bottom: 20px; padding: 10px; text-align: center; border-radius: 4px; display: inline-block; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;">To test the latest developer features of Firefox,<br> + install Firefox Developer Edition</a> Firefox 43 was released on December 15, 2015. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="Changes_for_Web_developers">Changes for Web developers</h2> + +<h3 id="Developer_Tools">Developer Tools</h3> + +<p>Highlights:</p> + +<ul> + <li><a href="/en-US/docs/Tools/Web_Console/Console_messages#Server">Server logging in the Web Console</a></li> + <li><a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Overridden_declarations">Quickly find the rule that overrode a CSS declaration</a></li> + <li><a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_HTML#Element_popup_menu">"Use in Console" context menu item in Inspector</a></li> + <li><a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Strict_search">"Strict" option for filtering in the Rules view</a></li> + <li><a href="/en-US/docs/Tools/Web_Console/Console_messages#Network">Network entries in the Console now link to the Network Monitor</a></li> + <li><a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Setting_hover_active_focus">Markup view shows indicators for pseudo-classes locked for elements</a></li> + <li><span class="author-g-1scq3ywqbljc5puc">New sidebar UI for WebIDE</span></li> +</ul> + +<p><a class="external external-icon" href="https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&classification=Client%20Software&chfieldto=2015-09-19&query_format=advanced&chfield=resolution&chfieldfrom=2015-08-10&chfieldvalue=FIXED&bug_status=RESOLVED&bug_status=VERIFIED&component=Developer%20Tools&component=Developer%20Tools%3A%203D%20View&component=Developer%20Tools%3A%20Canvas%20Debugger&component=Developer%20Tools%3A%20Console&component=Developer%20Tools%3A%20Debugger&component=Developer%20Tools%3A%20Framework&component=Developer%20Tools%3A%20Graphic%20Commandline%20and%20Toolbar&component=Developer%20Tools%3A%20Inspector&component=Developer%20Tools%3A%20Memory&component=Developer%20Tools%3A%20Netmonitor&component=Developer%20Tools%3A%20Object%20Inspector&component=Developer%20Tools%3A%20Performance%20Tools%20%28Profiler%2FTimeline%29&component=Developer%20Tools%3A%20Responsive%20Mode&component=Developer%20Tools%3A%20Scratchpad&component=Developer%20Tools%3A%20Source%20Editor&component=Developer%20Tools%3A%20Storage%20Inspector&component=Developer%20Tools%3A%20Style%20Editor&component=Developer%20Tools%3A%20User%20Stories&component=Developer%20Tools%3A%20Web%20Audio%20Editor&component=Developer%20Tools%3A%20WebGL%20Shader%20Editor&component=Developer%20Tools%3A%20WebIDE&product=Firefox&list_id=12582678">All devtools bugs fixed between Firefox 42 and Firefox 43</a>.</p> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>Support for the standard, unprefixed version of {{Cssxref("hyphens")}} has been landed ({{bug(953408)}}).</li> + <li>The shorthand property {{cssxref("font")}} has been updated to accept {{cssxref("font-stretch")}} values ({{bug(1057680)}}).</li> + <li>To match a latest evolution of the specification, the {{cssxref(":fullscreen")}} pseudo-class now selects the whole stack of elements in full screen, and not only the top-level one ({{bug(1199522)}}).</li> + <li>The deprecated SVG values for the {{cssxref("writing-mode")}}, <code>lr</code>, <code>lr-tb</code>, <code>rl</code>, <code>tb</code>, and <code>tb-rl</code>, have been added in CSS as aliases to standard properties ({{bug(1205787)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>For {{htmlelement("img")}} with ICO image containing multiple frames, the intrinsic dimension of the image is set to the one of the largest frame, and no more of the smallest frame {{bug(1201796)}}.</li> + <li>The value of the document's viewport (defined with <code><<a href="/en-US/docs/Web/HTML/Element/meta">meta</a> name="viewport></code>)can now dynamically be changed via JavaScript ({{bug(976616)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<h4 id="New_APIs">New APIs</h4> + +<ul> + <li>The new ES2016 methods {{jsxref("Array.prototype.includes()")}} and {{jsxref("TypedArray.prototype.includes()")}} are now enabled by default ({{bug(1070767)}}).</li> +</ul> + +<h4 id="Changes_regarding_the_arguments_object">Changes regarding the <code>arguments</code> object</h4> + +<ul> + <li>To match the ES2015 specification, <a href="/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions">arrow functions</a> no longer have their own <code><a href="/en-US/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a></code> object. The <code>arguments</code> object is now lexically bound (inherited from the outer function). In most cases, <a href="/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters">rest parameters</a> are a good alternative <code>(...args) => args[i]</code>, see {{bug(889158)}}.</li> + <li>The <a href="/en-US/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a> object is now allowed in conjunction with <a href="/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters">rest parameters</a> ({{bug(1133298)}}).</li> + <li>From now on, a mapped <code><a href="/en-US/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a></code> object in non-strict functions is only provided if the function does <strong>not</strong> contain any <a href="/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters">rest parameters</a>, any <a href="/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters">default parameters</a> or any <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">destructured parameters</a> ({{bug(1175394)}}).</li> +</ul> + +<h4 id="Other_changes">Other changes</h4> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*">Generators</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions">generator methods</a> are no longer constructable as per ES2016 ({{bug(1191486)}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<h4 id="DOM_HTML_DOM">DOM & HTML DOM</h4> + +<p><em>No change.</em></p> + +<h4 id="IndexedDB">IndexedDB</h4> + +<ul> + <li>A new feature called <a href="/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB#Locale-aware_sorting">locale-aware sorting</a> has been added allowing for the creation of indexes with a locale specified, which can then then be used to sort data according to the rules of that locale ({{bug(871846)}}). This is a non-standard Firefox-specific feature.</li> +</ul> + +<h4 id="Service_Workers">Service Workers</h4> + +<ul> + <li>As per the specification, if {{domxref("ExtendableEvent.waitUntil()")}} is called outside of the {{domxref("ExtendableEvent")}} handler, Firefox will now throw an <code>InvalidStateError</code>; in addition, multiple calls to {{domxref("ExtendableEvent.waitUntil","waitUntil()")}} will now stack up, and the resulting promises will be added to the list of <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#dfn-extend-lifetime-promises">extend lifetime promises</a> ({{bug(1180274)}}).</li> + <li>{{domxref("PushMessageData")}} methods have been implemented ({{bug(1149195)}}).</li> +</ul> + +<h4 id="WebRTC">WebRTC</h4> + +<ul> + <li>The {{domxref("HTMLCanvasElement.captureStream()")}} method has been activated by default ({{bug(1177276)}}).</li> + <li>The non-standard constraint style option list for {{domxref("RTCOfferOptions")}} has been deprecated and will be removed entirely in Firefox 44; see <a href="https://www.fxsitecompat.com/en-USdocs/2015/constraint-like-rtcofferoptions-are-no-longer-supported/">this post on the site compatibility blog</a> for details.</li> +</ul> + +<h4 id="Miscellaneous">Miscellaneous</h4> + +<ul> + <li>The <a href="/en-US/docs/Web/API/Battery_Status_API">Battery Status API</a> now uses the new promise syntax for {{domxref("Navigator.getBattery()")}}, as specified in the recent evolution of the specificiation ({{bug(1050749)}}).</li> + <li>The <code>User-Agent</code> header is no longer in the list of {{Glossary("Forbidden_header_name", "forbidden header names", 1)}} so it can now be set in a <a href="/en-US/docs/Web/API/Fetch_API">Fetch</a> {{domxref("Headers")}} object, via XHR {{domxref("XMLHttpRequest.setRequestHeader()")}},… ({{bug(1188932)}}).</li> + <li>The {{domxref("MediaRecorder.MediaRecorder()")}} constructor can now accept an options dictionary as a parameter, which allows you to set custom bitrates for the audio/video to be recorded ({{bug("1161276")}}).</li> + <li>The {{domxref("PerformanceObserver")}} interface, belonging to the <a href="/en-US/docs/Web/API/Performance_Timeline_API">Performance Timeline API</a> has been implemented ({{bug(1165796)}}).</li> + <li>The <a href="/en-US/docs/Web/API/Frame Timing API">Frame Timing API</a> has been added: the {{domxref("PerformanceRenderTiming")}} and {{domxref("PerformanceCompositeTiming")}} interfaces are now availble ({{bug(1191178)}}).</li> + <li>The modern <a href="/en-US/docs/Web/API/Screen_Orientation_API">Screen Orientation API</a> has been implemented: unprefixed {{domxref("Screen.orientation")}} and the {{domxref("ScreenOrientation")}} interface are now available ({{bug("1131470")}}). The non-standard {{domxref("Screen.mozOrientation")}}, {{domxref("Screen.onmozorientationchange")}}, {{domxref("Screen.mozLockOrientation()")}}, and {{domxref("Screen.mozUnlockOrientation()")}} will be removed in the future.</li> + <li>Under Linux, like under Windows, {{domxref("Event.timeStamp")}} now returns a {{domxref("DOMHighResTimeStamp")}} ({{bug(1026803)}}).</li> + <li>Experimental support for {{domxref("Selection")}} events {{event("selectionchange")}} and {{event("selectstart")}}, as well as the {{domxref("Document.onselectionchange")}} and {{domxref("GlobalEventHandlers.onselectstart")}} event handlers property has been added ({{bug(571294)}}). This feature is controlled by the <code>dom.select_events.enabled</code> preference, that defaults to <code>false</code>.</li> + <li>Support for {{domxref("MouseEvent.offsetX")}} and {{domxref("MouseEvent.offsetY")}} have been activated on Firefox for Android and Firefox OS ({{bug(1204841)}}).</li> + <li>The {{domxref("HTMLCanvasElement.mozFetchAsStream()")}} method has been removed ({{bug(1206030)}}).</li> + <li>The constructor {{domxref("Request.Request", "Request()")}} as well as {{domxref("Window.fetch", "fetch()")}} will now raise a {{exception("TypeError")}} exception when used with a URL containing a username and password ({{bug(1195820)}}).</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<p><em>No change.</em></p> + +<h3 id="SVG">SVG</h3> + +<p><em>No change.</em></p> + +<h3 id="AudioVideo">Audio/Video</h3> + +<p><em>No change.</em></p> + +<h2 id="HTTP">HTTP</h2> + +<p><em>No change.</em></p> + +<h2 id="Networking">Networking</h2> + +<p><em>No change.</em></p> + +<h2 id="Security">Security</h2> + +<ul> + <li>Access to Web Storage (i.e. <code>localStorage</code> and <code>sessionStorage</code>) from third-party IFrames is now denied if the user has <a href="https://support.mozilla.org/en-US/kb/disable-third-party-cookies">disabled third-party cookies</a> ({{bug("536509")}}).</li> + <li>This whitelist has even been removed in Nightly and Aurora/Dev Edition of the browser ({{bug(1201023)}}). It is currently scheduled that this removal will also happen for Beta and Release versions for the next version (Firefox 44).</li> + <li>Subresource integrity has been implemented for {{htmlelement("script")}} and {{htmlelement("link")}} that doesn't link to stylesheets ({{bug("992096")}}).</li> +</ul> + +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> + +<h3 id="Interfaces">Interfaces</h3> + +<p><em>No change</em></p> + +<h3 id="XUL">XUL</h3> + +<p><em>No change.</em></p> + +<h3 id="JavaScript_code_modules">JavaScript code modules</h3> + +<p><em>No change.</em></p> + +<h3 id="XPCOM">XPCOM</h3> + +<p><em>No change.</em></p> + +<h3 id="Plugins">Plugins</h3> + +<ul> + <li>In preparation for future releases to switch over to multi-process content, <a href="https://developer.mozilla.org/en-US/Add-ons/Plugins">NPAPI</a>plugins can no longer be run in the same process as the page content. The preferences starting with <code>dom.ipc.plugins</code> are no longer used.</li> +</ul> + +<h3 id="Other">Other</h3> + +<p><em>No change.</em></p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-US/versions/43/">Site Compatibility for Firefox 43</a></li> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers('42')}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/44/index.html b/files/zh-cn/mozilla/firefox/releases/44/index.html new file mode 100644 index 0000000000..d18ac693ac --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/44/index.html @@ -0,0 +1,222 @@ +--- +title: Firefox 44 for developers +slug: Mozilla/Firefox/Releases/44 +translation_of: Mozilla/Firefox/Releases/44 +--- +<div>{{FirefoxSidebar}}</div><p><a style="float: right; margin-bottom: 20px; padding: 10px; text-align: center; border-radius: 4px; display: inline-block; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;" href="https://www.mozilla.org/firefox/developer/">为了测试火狐最新的开发人员特性,请安装火狐开发人员版(Firefox Developer Edition )</a>Firefox 44 于2016年1月26号发布。这个页面列出了对开发人员有用的关键变化。</p> + +<h2 id="对于Web开发人员的变化">对于Web开发人员的变化</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<p>{{page('/en-US/docs/Tools/Release_notes', 'Firefox_44')}}</p> + +<h3 id="HTML">HTML</h3> + +<ul> + <li><code><a href="/en-US/docs/Web/HTTP/Link_prefetching_FAQ"><link rel="prefetch"></a></code> 现在服从 {{htmlattrxref("crossorigin", "link")}} 属性 ({{bug(1214819)}}).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li><code>position:</code> <code>fixed;</code> 现在会创建一个新的层叠上下文 ({{bug(1179288)}}).</li> + <li>默认支持 {{cssxref('unicode-range')}} ({{bug(1119062)}}).</li> + <li>Our experimental implementation of CSS Writing Modes has been updated to reflect the latest specification: + <ul> + <li>The value <code>sideways</code> of the {{cssxref("text-orientation")}} property has been implemented and <code>sideways-right</code> has been made an alias of it ({{bug(1193488)}}).</li> + <li>The value <code>sideways-rl</code> and <code>sideways-lr</code> of the {{cssxref("writing-mode")}} property ({{bug(1193488)}} and {{bug(1193519)}}).</li> + </ul> + </li> + <li>The non-standard properties {{cssxref("-moz-math-display")}} and {{cssxref("-moz-window-shadow")}} are no more available from Web content ({{bug(1207002)}}, {{bug(1211040)}}, and {{bug(1212607)}}).</li> + <li>The {{cssxref("font-style")}} property now distinguishes between <code>oblique</code> and <code>italic</code> when both variants are available ({{bug(543715)}}).</li> + <li>Though not supported, the properties {{cssxref("marks")}}, {{cssxref("orphans")}}, {{cssxref("page")}}, {{cssxref("size")}}, and {{cssxref("widows")}}, were parsed and {{cssxref("@supports")}} was incorrectly reporting them as supported; this has been fixed and the properties are not parsed anymore, nor marked as supported ({{bug(1215702)}}).</li> + <li>The internal value <code>-moz-mac-unified-toolbar</code> has been removed from the possible values for the {{cssxref("-moz-appearance")}} property ({{bug(1206468)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<h4 id="New_APIs">New APIs</h4> + +<ul> + <li>{{jsxref("Symbol.toPrimitive")}}, {{jsxref("Symbol.prototype.@@toPrimitive", "Symbol.prototype[@@toPrimitive]")}}, and {{jsxref("Date.prototype.@@toPrimitive", "Date.prototype[@@toPrimitive]")}} have been implemented ({{bug(1054756)}}).</li> +</ul> + +<h4 id="Changes">Changes</h4> + +<ul> + <li>The <code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/let">let</a></code> and <code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/const">const</a></code> bindings in the global level have been made compliant with ES2015 semantics. See {{bug(589199)}} and the blog post <a href="https://blog.mozilla.org/addons/2015/10/14/breaking-changes-let-const-firefox-nightly-44/">"Breaking changes in let and const in Firefox Nightly 44"</a>. In addition, <code>let</code> is now available to default Web JavaScript (strict and non-strict) and does not require a version opt-in anymore ({{bug(932517)}}).</li> + <li>If <a href="/en-US/docs/Web/JavaScript/Typed_arrays">typed arrays'</a> (like {{jsxref("Int8Array", "Int8Array")}}) and {{jsxref("ArrayBuffer", "ArrayBuffer")}}) constructors are called as a function without the {{jsxref("Operators/new", "new")}} operator, a {{jsxref("TypeError")}} is now thrown as per the ES6 specification ({{bug(980945)}}, {{bug(1214936)}}).</li> + <li>The {{jsxref("RegExp")}} sticky flag now follows the ES2015 standard for<a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky#Anchored_sticky_flag"> anchored sticky regular expressions</a> ({{bug(773687)}}).</li> + <li>The <a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell">JavaScript shell</a> (SpiderMonkey's REPL) now defaults to the default, Web-compatible JS version (and not JS1.7+ anymore) ({{bug(1192329)}}).</li> +</ul> + +<h4 id="Removals">Removals</h4> + +<ul> + <li>Support for the non-standard <a href="/en-US/docs/Web/JavaScript/Reference/Statements/let#let_blocks"><code>let</code> blocks</a> has been dropped ({{bug(1167029)}}.</li> + <li>The non-standard and deprecated property {{jsxref("Object.noSuchMethod", "Object.prototype.__noSuchMethod__")}} has been removed ({{bug(683218)}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<h4 id="DOM_HTML_DOM">DOM & HTML DOM</h4> + +<ul> + <li>For compatibility with specific existing sites, the property {{domxref("Document.charset")}} has been implemented as an alias of {{domxref("Document.characterSet")}} ({{bug(647621)}}).</li> + <li>Support for the <code><a href="https://developer.mozilla.org/en-US/docs/Adding_search_engines_from_web_pages#Installing_Sherlock_plugins">window.sidebar.addSearchEngine()</a></code> method, which allowed Web pages to invoke an installation of a Sherlock plugin, has been dropped and now it just logs a warning in the Web Console ({{bug(862148)}}).</li> + <li>To fight unwanted pop-ups, prompts requested in {{domxref("Window.onbeforeunload")}} of pages that have not been interacted with are no more displayed ({{bug(636905)}}).</li> + <li>The deprecated method {{domxref("MessageEvent.initMessageEvent()")}} has been reimplemented for backward compatibility ({{bug(949376)}}).</li> + <li>The obsolete property <code>DocumentType.internalSubset</code> has been removed ({{bug(801545)}}).</li> + <li>For compatibility with existing sites, the properties {{domxref("Window.orientation")}} and {{domxref("Window.onorientationchange")}}, as well as the {{event("orientationchange")}} event have been implemented ({{bug(920734)}}).</li> + <li>An {{HTMLElement("iframe")}} with explicit fullscreen request should not exit fullscreen implicitly ({{bug(1187801)}}).</li> + <li>The events {{event("mouseover")}}, {{event("mouseout")}}, {{event("mouseenter")}}, {{event("mouseleave")}}, {{event("pointermove")}}, {{event("pointerover")}}, {{event("pointerout")}}, {{event("pointerenter")}} and {{event("pointerleave")}} are now triggered for disabled form elements ({{bug(218093)}}).</li> + <li>The method {{domxref("Element.webkitMatchesSelector()")}} has been added ({{bug(1216193)}}) to improve interoperability.</li> + <li>To match the spec, the method {{domxref("Document.createAttribute()")}} now converts the input to lower case ({{bug(1176313)}}).</li> + <li>The non-standard <code>dialog</code> feature for {{domxref("Window.open()")}} is no longer available to Web content. It is still available to extensions and other code with chrome privileges ({{bug(1095236)}}.</li> +</ul> + +<h4 id="Canvas">Canvas</h4> + +<ul> + <li>A new experimental {{domxref("OffscreenCanvas")}} API that allows rendering contexts (such as <a href="/en-US/docs/Web/API/WebGL_API">WebGL</a>) to run in <a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a> has been implemented. To use this experimental API set <code>gfx.offscreencanvas.enabled</code> to <code>true</code> in about:config ({{bug(709490)}}). This API includes: + + <ul> + <li>The {{domxref("OffscreenCanvas")}} interface,</li> + <li>{{domxref("HTMLCanvasElement.transferControlToOffscreen()")}}, and</li> + <li>{{domxref("WebGLRenderingContext.commit()")}}.</li> + <li>Several WebGL interfaces are now also available in a worker context when this API is enabled.</li> + </ul> + </li> +</ul> + +<h4 id="WebGL">WebGL</h4> + +<ul> + <li>Uniform Buffer Objects have been implemented ({{bug(1048747)}}).</li> +</ul> + +<h4 id="IndexedDB">IndexedDB</h4> + +<ul> + <li>The {{domxref("IDBIndex.getAll()")}} and {{domxref("IDBIndex.getAllKeys()")}} are now available by default ({{bug(1196841)}}).</li> +</ul> + +<h4 id="Service_Workers">Service Workers</h4> + +<ul> + <li>The {{domxref("ServiceWorkerMessageEvent")}} and {{domxref("ExtendableMessageEvent")}} interfaces have been implemented ({{bug(1143717)}} and {{bug(1207068)}}).</li> + <li>{{domxref("Headers")}} objects now support a pair iterator, meaning that the methods {{domxref("Headers.entries()")}}, {{domxref("Headers.keys()")}}, and {{domxref("Headers.values()")}} are now available; {{jsxref("Symbol.iterator")}} now also returns the default iterator for them ({{bug(1108181)}}).</li> + <li>The {{domxref('XMLHttpRequest')}} API has been disabled on Service Workers ({{bug(931243)}}).</li> + <li>The interface {{domxref("FetchEvent")}} now extends {{domxref("ExtendableEvent")}}, giving it access to the {{domxref("ExtendableEvent.waitUntil()")}} method. ({{bug(1214772)}}).</li> + <li>Following a recent change in the specification, {{domxref("FetchEvent.client")}} has been removed ({{bug(1218135)}}).</li> + <li>To match the latest specification, the {{domxref("ServiceWorkerContainer.onreloadpage")}} has been removed ({{bug(1218139)}}).</li> + <li>The event handlers {{domxref("ServiceWorkerGlobalScope.onbeforeevicted")}} and {{domxref("ServiceWorkerGlobalScope.onevicted")}} have been removed as they weren't following the spec. They will be reintroduced in the future, but their removal will allow feature detection to work as expected ({{bug(1218142)}}).</li> + <li>In the {{domxref("FetchEvent.FetchEvent", "FetchEvent()")}} constructor, if the <code>isReload</code> member is not present in the options dictionary, it now defaults to <code>false</code> ({{bug(1216401)}}).</li> + <li>The {{domxref("Client.frameType")}} property is now implemented on the right interface; it was on {{domxref("WindowClient")}} before ({{bug(1218146)}}).</li> + <li>When <a href="/en-US/docs/Web/HTML/Using_the_application_cache">AppCache</a> is used to provide offline support for a page, a warning message is now displayed in the console advising developers to use <a href="/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers">Service workers</a> instead ({{bug("1204581")}}.)</li> + <li>Service workers have been enabled by default in Gecko.</li> +</ul> + +<h4 id="WebRTC">WebRTC</h4> + +<ul> + <li>WebRTC interfaces have been <em>unprefixed</em> ({{bug(1155923)}}). In particular: + + <ul> + <li><code>mozRTCPeerConnection</code> is now {{domxref("RTCPeerConnection")}}.</li> + <li><code>mozRTCIceCandidate</code> is now {{domxref("RTCIceCandidate")}}.</li> + <li><code>mozRTCSessionDescription</code> is now {{domxref("RTCSessionDescription")}}.</li> + </ul> + </li> + <li>The {{domxref("RTCDataChannel.bufferedAmountLowThreshold")}} and {{domxref("RTCDataChannel.onbufferedamountlow")}} properties, as well as the {{event("bufferedamountlow")}} event, have been implemented ({{bug(1178091)}}).</li> + <li>The attribute {{domxref("RTCPeerConnection.canTrickleIceCandidates")}} has been added, the non-standard method {{domxref("RTCPeerConnection.updateIce()")}} removed ({{bug(1209744)}}).</li> + <li>The {{domxref("MediaStream")}} interface now supports the {{domxref("MediaStream.addTrack()")}} and {{domxref("MediaStream.removeTrack()")}} methods ({{bug(1103188)}}).</li> + <li>The constructor {{domxref("MediaStream.MediaStream", "MediaStream()")}} has been implemented ({{bug(1070216)}}).</li> + <li>Support for the non-standard constraint style option list for {{domxref("RTCOfferOptions")}} has been removed; see <a href="https://www.fxsitecompat.com/en-USdocs/2015/constraint-like-rtcofferoptions-are-no-longer-supported/">this post on the site compatibility blog</a> for details.</li> +</ul> + +<h4 id="New_APIs_2">New APIs</h4> + +<ul> + <li>An experimental implementation of the Canvas API in Workers has landed: {{domxref("OfflineCanvas")}} and {{domxref("HTMLCanvasElement.transferControlToOffscreen()")}} are available behind the <code>gfx.offscreencanvas.enabled</code> preference, currently disabled by default ({{bug(709490)}}).</li> + <li>The Text2Speech API, part of Web Speech API, has now an OS X backend. But this is disabled by default ({{bug(1003452)}}).</li> +</ul> + +<h4 id="Miscellaneous">Miscellaneous</h4> + +<ul> + <li>{{domxref("URLSearchParams")}} objects now support a pair iterator, meaning that the methods {{domxref("URLSearchParams.entries()")}}, {{domxref("URLSearchParams.keys()")}}, and {{domxref("URLSearchParams.values()")}} are now available; {{jsxref("Symbol.iterator")}} now also returns the default iterator for them ({{bug(1085284)}}).</li> + <li>{{domxref("FormData")}} objects now support a pair iterator, meaning that the methods {{domxref("FormData.entries()")}}, {{domxref("FormData.keys")}}, and {{domxref("FormData.values()")}} are now available; {{jsxref("Symbol.iterator")}} now also returns the default iterator for them ({{bug(1127703)}}).</li> + <li>When {{domxref("XMLHttpRequest.send()")}} is used with an HTML document, it now uses <code>text/html</code> instead of <code>application/xml</code> ({{bug(918771)}}).</li> + <li>Speech synthesis (text-to-speech) has been implemented in Firefox Desktop for Mac and Linux, hidden behind the <code>media.webspeech.synth.enabled</code> flag in <code>about:config</code> ({{bug("1003452")}}, {{bug("1003464")}}.) See <a href="/en-US/docs/Web/API/Web_Speech_API">Web Speech API</a> for more information.</li> + <li>Elements inside a {{HTMLElement("frame")}} or an {{HTMLElement('object')}} can't be set full-screen anymore ({{bug(1212299)}}).</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<p><em>No change.</em></p> + +<h3 id="SVG">SVG</h3> + +<p><em>No change.</em></p> + +<h3 id="AudioVideo">Audio/Video</h3> + +<p><em>No change.</em></p> + +<h2 id="HTTP">HTTP</h2> + +<ul> + <li>Support for the <a href="https://en.wikipedia.org/wiki/Brotli">Brotli</a> algorithm has been added and both <code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-Encoding_header">Accept-Encoding</a></code> and <code><a href="/en-US/docs/Web/HTTP/Headers/Content-Encoding">Content-Encoding </a></code>headers now support the <code>br</code> value ({{bug(366559)}} and {{bug(1211916)}}).</li> + <li>Incorrect support of HTTP/2 headers containing line breaks (<code>'/n'</code>) have been removed as the spec doesn't allow it, unlike HTTP/1 ({{bug(1197847)}}).</li> +</ul> + +<h2 id="Networking">Networking</h2> + +<p><em>No change.</em></p> + +<h2 id="Security">Security</h2> + +<ul> + <li>RC4 is now also disabled by default on Beta and Release versions of the browser ({{bug(1201025)}}) and the whitelist is now empty by default ({{bug(1215796)}}).</li> +</ul> + +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> + +<h3 id="Interfaces">Interfaces</h3> + +<p><em>No change</em></p> + +<h3 id="XUL">XUL</h3> + +<p><em>No change.</em></p> + +<h3 id="JavaScript_code_modules">JavaScript code modules</h3> + +<ul> + <li>Added <code>LIKE</code> support to {JSM("Sqlite.jsm")}} ({{bug(1188760)}}).</li> + <li>Added <a href="/en-US/docs/Mozilla/Add-ons/Firefox_for_Android/API/Snackbars.jsm">Snackbars.jsm</a> module to <a href="/en-US/docs/Mozilla/Firefox_for_Android" title="/en/docs/Mozilla/Firefox_for_Android">Firefox for Android</a> ({{bug(1215026)}})</li> +</ul> + +<h3 id="XPCOM">XPCOM</h3> + +<ul> + <li>The {{interface("nsIDOMWindow")}} interface is now empty. Its contents were either no longer used, had moved elsewhere, or were only used from C++. The items available from C++ code now reside in the <code>{{source("dom/base/nsPIDOMWindow.h", "nsPIDOMWindow")}}</code> interface ({{bug(1216401)}}).</li> +</ul> + +<h3 id="Other">Other</h3> + +<ul> + <li>Due to breaking changes in Firefox 44 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1202902">bug 1202902</a>), add-ons packed with <a href="/en-US/docs/Mozilla/Add-ons/SDK/Tools/cfx">cfx</a> will not work any longer. To make your add-on compatible again, please use <a href="/en-US/docs/Mozilla/Add-ons/SDK/Tools/jpm">jpm</a>. You can find steps to migrate from <em>cfx</em> to <em>jpm</em> <a href="/en-US/docs/Mozilla/Add-ons/SDK/Tools/cfx_to_jpm">here</a>.</li> +</ul> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-US/versions/44/">Site compatibility for Firefox 44</a></li> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers(43)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/45/index.html b/files/zh-cn/mozilla/firefox/releases/45/index.html new file mode 100644 index 0000000000..e288cbacc6 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/45/index.html @@ -0,0 +1,187 @@ +--- +title: Firefox 45 for developers +slug: Mozilla/Firefox/Releases/45 +tags: + - Firefox + - Firefox 45 +translation_of: Mozilla/Firefox/Releases/45 +--- +<div>{{FirefoxSidebar}}</div><p><a style="float: right; margin-bottom: 20px; padding: 10px; text-align: center; border-radius: 4px; display: inline-block; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;" href="https://www.mozilla.org/firefox/developer/">安装Firefox开发者版本,<br> + 以便测试Firefox最新的功能</a> Firefox 45 was released on March 8, 2016. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="针对网络开发者的功能更新">针对网络开发者的功能更新</h2> + +<h3 id="开发工具">开发工具</h3> + +<p>{{page('/en-US/docs/Tools/Release_notes', 'Firefox_45')}}</p> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>现在可以在{{HTMLElement("meta")}}上直接设置内容安全策略(Content Security Policy)。 ({{bug(663570)}}).</li> + <li>The attribute <code>referrer</code> has been renamed into <code>referrerpolicy</code> on {{HTMLElement("image")}}, {{HTMLElement("area")}}, {{HTMLElement("a")}}, and {{HTMLElement("iframe")}} ({{bug(1187357)}}).</li> + <li>Changes in the viewport, or a resize, now trigger the reselection of responsive images for <code><img srcset></code> ({{bug(1166138)}}).<br> + </li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>{{cssxref("word-spacing")}} now allows percentage values ({{bug(1038663)}}).</li> + <li>Our implementation of CSS Grids has been improved and is no more considered experimental; it is now activated by default in nightly and developer edition, but not for beta and release ({{bug(1000592)}}): + <ul> + <li>Gutters, that is the {{cssxref("grid-column-gap")}}, {{cssxref("grid-row-gap")}}, and {{cssxref("grid-gap")}} properties are now supported ({{bug(1176792)}}).</li> + <li>The implied minimum size of grid Items, that is the special {{cssxref("min-width")}} and {{cssxref("min-height")}} <code>auto</code> behavior has been implemented ({{bug(1176775)}}).</li> + <li>{{cssxref("align-self")}} and {{cssxref("justify-self")}} are now supported on grid layouts ({{bug(1151213)}}).</li> + <li>{{cssxref("align-content")}} and {{cssxref("justify-content")}} are now supported on grid layouts ({{bug(1151214)}}).</li> + <li>Resolved value of grid-template-columns,grid-template-rows in px units ({{bug(978212)}}).</li> + <li>The related feature {{cssxref("display")}}: contents has been supported since <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/37">Firefox 37</a></li> + </ul> + </li> + <li>Implement full support for CSS Box Alignment for CSS Grid, support the missing values: <code>start,</code> <code>end,</code> <code>self-start,</code> <code>self-end,</code> <code>left,</code> <code>right,last-baseline,space-evenly </code>({{bug(1176782)}}). CSS Box Alignment currently applies only to CSS Flexbox and CSS Grid.</li> + <li> [css-grid][css-flexbox] Implement grid/flex layout for <fieldset> ({{bug(1230207)}}).</li> + <li>The <code>inline-start</code> and <code>inline-end</code> values have been added to {{cssxref("float")}} and {{cssxref("clear")}} ({{bug(1122918)}}). They are enabled by default on Nightly and Aurora (Dev edition), as well as on Firefox OS; to activate it on a release or beta version, you need to flip the <code>layout.css.float-logical-values.enabled</code> to <code>true</code>.</li> + <li>The {{cssxref("text-emphasis")}}, {{cssxref("text-emphasis-style")}}, {{cssxref("text-emphasis-color")}}, and {{cssxref("text-emphasis-position")}} have been implemented; they are disabled by default (set <code>layout.css.text-emphasis.enabled</code> to true to activate them ({{bug(1040668)}}).</li> + <li>Several <code>-webkit</code> prefixed properties and values have been added for web compatibility, behind the preference <code>layout.css.prefixes.webkit</code>, defaulting to <code>false</code>: + <ul> + <li>Added {{cssxref("-webkit-backface-visibility")}}, {{cssxref("-webkit-perspective")}} and {{cssxref("-webkit-perspective-origin")}} for web compatibility, behind the preference <code>layout.css.prefixes.webkit</code>, defaulting to <code>false</code> ({{bug(1179444)}}).</li> + </ul> + </li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>ES2015 (ES6) <a href="/en-US/docs/Web/JavaScript/Reference/Classes">Classes</a> are now enabled by default ({{bug(1197932)}}).</li> + <li>{{jsxref("Operators/Expression_closures", "Expression closures", "", 1)}} are deprecated and will now present a warning in the console ({{bug(995610)}}).</li> + <li>{{jsxref("String.prototype.replace")}} does not restore {{jsxref("Global_Objects/RegExp/n", "RegExp static properties", "", 1)}} after executing function parameter anymore ({{bug(1226936)}}).</li> + <li>{{jsxref("Math.random()")}} has been updated to the better XorShift128+ algorithm ({{bug(322529)}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<h4 id="DOM_HTML_DOM">DOM & HTML DOM</h4> + +<ul> + <li>For compatibility, the non-standard property <code><a href="https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText">Node.innerText</a></code> has been implemented ({{bug(264412)}}).</li> + <li>The {{domxref("HTMLImageElement.srcset")}} attribute now reacts to resize/viewport changes ({{bug(1166138)}}).</li> + <li>{{domxref("Element.getAttributeNames()")}} has been implemented ({{bug(1228634)}}).</li> +</ul> + +<h4 id="WebGL">WebGL</h4> + +<p>Our implementation of WebGL2 have been extended:</p> + +<ul> + <li>Support of programs and shaders has been added ({{bug(1048743)}}).</li> + <li>Support for uniforms and attributes has been added ({{bug(1048745)}}).</li> + <li>Framebuffer objects have been implemented ({{bug(1048732)}}).</li> + <li>Renderbuffer objects have been implemented ({{bug(1048733)}}).</li> +</ul> + +<h4 id="IndexedDB">IndexedDB</h4> + +<p><em>No change.</em></p> + +<h4 id="Service_Workers">Service Workers</h4> + +<ul> + <li>{{domxref("Clients.get()")}} and {{domxref("FetchEvent.clientId")}} have been implemented ({{bug(1222464)}}.)</li> + <li>{{domxref("Clients.openWindow()")}} has been implemented ({{bug(1172870)}}.)</li> + <li>The options object that can be passed as a parameter when invoking {{domxref("Clients.matchAll()")}} can now include an <code>includeUncontrolled</code> property. This is a {{domxref("Boolean")}} — if set to <code>true</code>, the matching operation will return all service worker clients who share the same origin as the current service worker. Otherwise, it returns only the service worker clients controlled by the current service worker. The default is <code>false</code>.</li> +</ul> + +<h4 id="WebRTC">WebRTC</h4> + +<p><em>No change.</em></p> + +<h4 id="New_APIs">New APIs</h4> + +<p><em>No change.</em></p> + +<h4 id="Miscellaneous">Miscellaneous</h4> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API">Web Speech Synthesis API</a> has been implemented on Firefox Desktop ({{bug(1003439)}}).</li> + <li>The {{domxref("Window.onstorage")}} event handler property has been added.</li> + <li>The interface {{domxref("ComputedTiming")}} have been added to our experimental implementation of <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API">Web Animations API</a> ({{bug(1108055)}}).</li> + <li>The {{domxref("Document.onselectionchange")}} event handler property has been added ({{bug(1231193)}}).</li> + <li>After removing a video track from a media stream by calling {{domxref("MediaStream.removeTrack()")}} you can nowadd another video track later using {{domxref("MediaStream.addTrack()")}} and have it played ({{bug(1223696)}}).</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<p> </p> + +<p><em>No change.</em></p> + +<h3 id="SVG">SVG</h3> + +<ul> + <li>SVG stroke hit-testing is buggy when cairo is the Moz2D backend ({{bug(676001)}}).</li> + <li>Unable to interact with elements who have large transform / translate values ({{bug(1217012)}}).</li> +</ul> + +<h3 id="AudioVideo">Audio/Video</h3> + +<ul> + <li>Fixed: Regression (since Firefox 41) whereby audio playback was stuttering due to duration time rounding errors ({{bug(1222866)}}.)</li> +</ul> + +<h2 id="HTTP">HTTP</h2> + +<ul> + <li>The <code>jar:</code> protocol has been disabled by default when accessed from Web content; you may enable this if necessary by setting the {{pref("network.jar.block-remote-files")}} preference to <code>false</code> ({{bug(1215235)}}).</li> +</ul> + +<h2 id="Security">Security</h2> + +<ul> + <li>A {{HTTPHeader("Content-Security-Policy")}} can now be specified using a {{HTMLElement("meta")}} element ({{bug(663570)}}).</li> + <li>Support of the {{CSP("child-src")}} CSP policy directive has been implemented ({{bug(1045891)}}).</li> + <li>EV certificates with a validity greater than 27 months are now considered and handled as DV certificates ({{bug(1222903)}}).</li> +</ul> + +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> + +<h3 id="Interfaces">Interfaces</h3> + +<p><em>No change.</em></p> + +<h3 id="XUL">XUL</h3> + +<ul> + <li>Tab Groups <a href="https://support.mozilla.org/kb/tab-groups-removal">have been removed</a>.</li> +</ul> + +<h3 id="JavaScript_code_modules">JavaScript code modules</h3> + +<p><em>No change.</em></p> + +<h3 id="XPCOM">XPCOM</h3> + +<p><em>No change.</em></p> + +<h3 id="Search_plugins">Search plugins</h3> + +<p>Starting in Firefox 45, search plugins located in the user's profile's <code>searchplugins</code>directory are no longer automatically loaded on startup. Instead, a list of user-installed plugins is maintained and only those plugins are loaded. In effect, this means that the only ways to install new search plugins are for the user to do so in the Firefox UX (via <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Creating_OpenSearch_plugins_for_Firefox">OpenSearch discovery</a>, for instance) or for an add-on to install it. Also, when a new search plugin is installed, more information is recorded about where it came from, for future use by profile debugging and cleaning tools.</p> + +<p> </p> + +<h3 id="Other">Other</h3> + +<ul> + <li>WebIDL constructors could be called without the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new"><code>new</code></a> operator in chrome context. Now such code will raise a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError"><code>TypeError</code></a> as in Web content since Firefox 30. For example, <code>var req = XMLHttpRequest();</code> needs to be <code>var req = new XMLHttpRequest();</code>.</li> +</ul> + +<p> </p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-US/versions/45/">Site Compatibility for Firefox 45</a></li> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers(44)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/49/index.html b/files/zh-cn/mozilla/firefox/releases/49/index.html new file mode 100644 index 0000000000..d1afa7f9a6 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/49/index.html @@ -0,0 +1,348 @@ +--- +title: Firefox 49 for developers +slug: Mozilla/Firefox/Releases/49 +tags: + - Firefox + - Firefox 49 +translation_of: Mozilla/Firefox/Releases/49 +--- +<div>{{FirefoxSidebar}}</div><p><a style="float: right; margin-bottom: 20px; padding: 10px; text-align: center; border-radius: 4px; display: inline-block; background-color: #81BC2E; white-space: nowrap; color: white; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25); box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.2), 0px -1px 0px 0px rgba(0, 0, 0, 0.3) inset;" href="https://www.mozilla.org/firefox/developer/">To test the latest developer features of Firefox,<br> + install Firefox Developer Edition</a> Firefox 49 was released on September 20, 2016. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.</p> + +<h2 id="对于Web开发者的改变">对于Web开发者的改变</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<ul> + <li>控制台记录的JavaScript错误信息 <a href="https://hacks.mozilla.org/2016/06/helping-web-developers-with-javascript-errors/">现在提供了一个 [Learn more] 链接</a> 为了额外的调试帮助({{bug("1179876")}}).</li> + <li>CSS 自动完成: 显示更多的建议在自动完成弹窗 ({{bug("1260419")}}).</li> + <li>动画查看器现在 <a href="/en-US/docs/Tools/Page_Inspector/How_to/Work_with_animations#Further_information_about_animation_compositing">暴露出动画的性能信息</a> 在开发工具中 ({{bug("1254408")}}).</li> + <li><a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_HTML#Element_popup_context_menu">查看器的上下文菜单</a>被重组的更清楚并且更加容易的使用 ({{bug("1211613")}}).</li> + <li>查看器现在支持 <code>#RRGGBBAA</code> 和 <code>#RGBA</code> 语法对于颜色的值 ({{bug("1271191")}}).</li> + <li>开发工具不在显示自关闭标签 (比如 {{HTMLElement("br")}} 和 {{HTMLElement("img")}} 好像它们在HTML页面拥有关闭标签; 这个行文在XHTML页面上没有改变 ({{bug("820926")}}).</li> + <li>可用性的提高! + <ul> + <li>工具可以做更好的工作去确保键盘聚焦的地方更加明显 ({{bug(1242851)}}).</li> + <li>Accessibility labels have been added to unlabeled controls ({{bug(1242715)}}).</li> + <li>增加合适的语义化的树状图和键盘导航到查看器的标记视图 ({{bug(1242694)}}).</li> + </ul> + </li> + <li><a href="/en-US/docs/Tools/Network_Monitor">网络监视器</a> 现在显示一个原因列, 该列提供导致每一个详细的网络请求的踪迹 ({{bug(1134073)}}).</li> + <li>在 <em>about:debugging</em> 附加组件页面, Reload 按钮现在只能在临时的附加组件开启. 这将禁用在其他的所有附加组件 ({{bug(1273184)}}).</li> + <li>在 <em>about:debugging</em> Workers 页面, 如果 <a href="/en-US/docs/Tools/about:debugging#Service_workers_not_compatible">service workers are incompatible</a> 在现在的浏览器上配置一个温馨的提示将会显示在 Service Workers 部分 ({{bug(1266415)}}).</li> + <li><em>about:debugging</em> 现在有一个 <a href="/en-US/docs/Tools/about:debugging#Tabs">新的标签页</a> 可用, 这个标签页提供一个完整的列表包含所有的在FireFox实例中打开的所有的调试标签 ({{bug(1266128)}}).</li> + <li><em>Disable Cache</em> 选项 在 <a href="/en-US/docs/Tools/Settings#Advanced_settings">工具箱高级设置</a> 已经被重命名成 Disable HTTP Cache, 来使它更加的清晰得标明这个选项影响 HTTP cache, 而不是 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API">Service Workers</a>/the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Cache">Cache API</a> (bug(1253018)).</li> + <li><a href="/en-US/docs/Tools/Storage_Inspector#IndexedDB">存储查看器现在允许 IndexedDB 数据库可以被删除</a> 通过它们的上下文菜单 ({{bug("1205123")}}), 并且将显示一个温馨的提示如果 indexedDB因为一些原因没有被删除 (比如它们仍然有活动的链接) ({{bug(1268460)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>增加支持 {{HTMLElement("details")}} 和 {{HTMLElement("summary")}} 元素 ({{bug(1226455)}}).</li> + <li>{{htmlattrxref("pattern", "input")}} 属性对于 {{HTMLElement("input")}} 元素现在使用 <code>'u'</code> 参数在潜在的 JavaScript {{jsxref("RegExp")}} ({{bug(1227906)}}).</li> + <li>为了匹配规范的变化, {{HTMLElement("track")}}的属性值{{htmlattrxref("kind", "track")}}现在已经无效,现在用 "metadata" 代替 "subtitles" ({{bug(1269712)}}).</li> + <li>{{HTMLElement("iframe")}} 元素的 {{htmlattrxref("sandbox", "iframe")}} 属性现在已经支持 <code>'allow-popups-to-escape-sandbox'</code> <code>和 'allow-modals'</code> 值({{bug(1190641)}}).</li> + <li>支持 microdata 属性并且已经移除了 Microdata API ({{bug(909633)}}).</li> + <li>{{htmlattrxref("referrerpolicy", "a")}} 属性在 {{HTMLElement("a")}} 元素现在已经支持 <code>'no-referrer-when-downgrade</code>' 和 <code>'origin-when-cross-origin'</code> ({{bug(1178337)}}).</li> + <li>{{HTMLElement("label")}}的属于某一个Form的属性{{htmlattrxref("form", "label")}} 现在已经被移除. 但是The {{domxref("HTMLLabelElement.form")}} 属性依旧存在, 但是现在返回的form是与label的控制权相关联的, 如果有控制(或者是与控制权相关联的form) ({{bug(1268852)}}).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>增加{{cssxref("background-position-x")}} 和 {{cssxref("background-position-y")}}, 这允许去分别的指定水平和垂直偏移量来去绘画一个背景图片; 这两个属性是 {{cssxref("background-position")}} 的组件 ({{bug("550426")}}).</li> + <li>在 {{cssxref("background-repeat")}} 增加支持 <code>round</code> 和 <code>space</code> 关键字 ({{bug("548372")}}).</li> + <li>On {{cssxref("background-clip")}}, the keyword <code>text</code> is now activated by default ({{bug(1264905)}}).</li> + <li>增加支持去指定颜色的时候使用alpha通道,使用 4-或者是8-位的 CSS十六进制值 (#RRGGBBAA 或者是 #RGBA) ({{bug("567283")}}).</li> + <li>伪类选择器 {{cssxref(":dir()")}} 已经去除了浏览器前缀 ({{bug(859301)}}).</li> + <li>在我们的实验实现 (还没有在默认的情况下被激活) CSS属性 {{cssxref("clip-path")}}, 我们现在可以在 {{cssxref("<basic-shape>")}} 中间插入值 ({{bug(1110460)}}).</li> + <li>增加 <a href="/en-US/docs/Web/CSS/length#q"><code>q</code> 长度单位</a> ({{bug(1274526)}}).</li> + <li>属性值 {{cssxref("text-align-last")}} 已经去除里浏览器前缀 ({{bug(1039541)}}).</li> + <li>增加支持 {{cssxref("overflow-wrap")}}, 来替换replacing {{cssxref("word-wrap")}} ,但是现在被替换的依旧可用来作为一个可以替换的名字 ({{bug(955857)}}).</li> + <li>我们的实验 <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grids</a> 实现已经被增强: + <ul> + <li>实现{{cssxref("<percentage>")}} 支持对于 {{cssxref("grid-gap")}}, {{cssxref("grid-row-gap")}}, and {{cssxref("grid-column-gap")}} 属性 ({{bug(1266268)}}).</li> + <li>实现网格布局支持对于 {{cssxref("align")}}, {{cssxref("justify-self")}}<code>:baseline</code> 和 <code>last-baseline</code> (也称 "baseline self-alignment") ({{bug(1221525)}}).</li> + <li>实现网格子项目基线内容对齐 ({{bug(1256429)}}).</li> + </ul> + </li> + <li>我们的实验 <a href="/en-US/docs/Web/CSS/CSS_Masks">CSS Masks</a> 实现已经被增强: + <ul> + <li>{{cssxref("mask-origin")}} 属性现在使用 <code>border-box</code> 代替 of <code>padding-box</code> 作为初始值, 为了匹配规范 ({{bug(1258286)}}).</li> + <li>{{cssxref("mask-repeat")}} 属性现在支持 <code>space</code> 和 <code>round</code> 值 ({{bug(1258626)}}).</li> + <li>Fixed an issue preventing the {{cssxref("mask-position")}} attribute from being animated ({{bug(1273804)}}).</li> + </ul> + </li> + <li>偏好控制 {{cssxref("text-emphasis")}} 已经被移除. 所以支持该属性可以不再被禁用 ({{bug(1229609)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>ES2015 (ES6) {{jsxref("Global_Objects/Proxy/handler/getPrototypeOf", "getPrototypeOf()")}} 和 {{jsxref("Global_Objects/Proxy/handler/setPrototypeOf", "setPrototypeOf()")}} {{jsxref("Proxy")}} traps属性已经被实现 ({{bug(888969)}}).</li> + <li>ES2015 (ES6) {{jsxref("RegExp.prototype.@@match()", "RegExp.prototype[@@match]()")}}, {{jsxref("RegExp.prototype.@@replace()", "RegExp.prototype[@@replace]()")}}, {{jsxref("RegExp.prototype.@@search()", "RegExp.prototype[@@search]()")}}, and {{jsxref("RegExp.prototype.@@split()", "RegExp.prototype[@@split]()")}} 方法, 和 {{jsxref("RegExp.@@species", "RegExp[@@species]")}} getter方法已经被实现 ({{bug(887016)}}).</li> + <li>不被赞成的, 非标准的标记参数 <code>String.prototype.</code>{{jsxref("String.prototype.match", "match")}}/{{jsxref("String.prototype.search", "search")}}/{{jsxref("String.prototype.replace", "replace")}} 已经被移除 ({{bug(1108382)}}).</li> + <li>{{jsxref("Date.parse()")}}方法在解析2位数年份的行为已经被改变为了更好地和 Google Chrome browser 更好地协作 ({{bug(1265136)}}).</li> +</ul> + +<h3 id="InterfacesAPIsDOM">Interfaces/APIs/DOM</h3> + +<h4 id="DOM_HTML_DOM">DOM & HTML DOM</h4> + +<ul> + <li>方法 {{domxref("DOMTokenList.supports()")}} 已经被增加 ({{bug(1257849)}}).</li> + <li>{{domxref("DOMTokenList.replace()")}} 方法已经被增加 ({{bug(1224186)}}).</li> + <li>第一位的 <code>'?'</code> 字符现在已经被忽视当作为参数在{{domxref("URLSearchParams.URLSearchParams", "URLSearchParams()")}} 构造器 ({{bug(1268361)}}).</li> + <li>The value returned by {{domxref("URL.origin")}}, {{domxref("HTMLAnchorElement.origin")}}, and {{domxref("HTMLAreaElement.origin")}} for URL using the <code>blob:</code> scheme is no longer incorrectly <code>null</code> but is instead the origin of the URL formed by removing the leading <code>blob:</code> ({{bug(1270451)}}).</li> + <li>在预渲染模式, {{domxref('Document.visibilityState')}} 属性现在返回 <code>'prerender'</code> ({{bug(1069772)}}).</li> + <li>{{domxref("Window.isSecureContext")}} 属性已经被实现 ({{bug(1162772)}}).</li> + <li>DOM4 {{domxref("ChildNode.before()")}}, {{domxref("ChildNode.after()")}}, {{domxref("ChildNode.replaceWith()")}}, {{domxref("ParentNode.append()")}} and {{domxref("ParentNode.prepend()")}} 方法已经被实现 ({{bug(911477)}}).</li> + <li>{{domxref("TouchList.identifiedTouch()")}} 方法已经被移除 ({{bug(1188539)}}).</li> + <li>在默认的情况下, <code>scrollbars</code> {{domxref("Window")}} 特性是开启的当调用{{domxref("Window.open()")}}. 在过去, 这种情况下被强烈推荐开启但却不是默认开启的 ({{bug(1257887)}}).</li> + <li>增加实验性并且非标准的 {{domxref("HTMLMediaElement.seekToNextFrame()")}} 方法, 它允许你which allows seeking frame-by-frame through video content ({{bug(1235301)}}). While you're encouraged to experiment with this method to help us understand how useful it is, <em>do not use it in production code!</em></li> + <li>The {{domxref("HTMLLabelElement.form")}} property now returns the form with which the label's control is associated, if there is a control (and if that control is associated with a form). Previously, labels were directly associated with forms using this property ({{bug(1268852)}}).</li> + <li>Support for the third parameter of {{domxref("EventTarget.addEventListener()")}}, either a {{jsxref("Boolean")}} or an {{interface("EventListenerOptions")}} has been added ({{bug(1266164)}} and {{bug(1266066)}}).</li> + <li>The audio volume related values for {{domxref("KeyboardEvent.key")}} have been renamed. <code>"VolumeDown"</code> is now <code>"AudioVolumeDown"</code>, <code>"VolumeUp"</code> is now <code>"AudioVolumeUp"</code>, and <code>"VolumeMute"</code> is now <code>"AudioVolumeMute".</code> This brings Firefox into alignment with the latest draft of the UI Events specification ({{bug(1272578)}}). See {{SectionOnPage("/en-US/docs/Web/API/KeyboardEvent/code", "Code values")}} for a full list of available key codes.</li> + <li>The keys previously referred to as <code>"MozHomeScreen"</code>, <code>"MozCameraFocusAdjust"</code>, and <code>"MozPhoneCall"</code> now have official names in the UI Events specification: <code>"GoHome"</code>, <code>"CameraFocus"</code>, and <code>"Call"</code>. Firefox 49 has been updated to use the new names ({{bug(1272599)}}). See {{SectionOnPage("/en-US/docs/Web/API/KeyboardEvent/code", "Code values")}} for a full list of available key codes.</li> + <li>The key values <code>"Separator"</code> and <code>"MediaSkip"</code> have been removed, as they were deprecated and unused ({{bug(1232919)}}).</li> + <li>Key values and the corresponding key codes <code>"Hyper"</code> and <code>"Super"</code> have been added to represent these legacy modifier keys ({{bug(1232919)}}).</li> + <li>两个键值为了多媒体数字小键盘已经被增加: <code>"Key11"</code> and <code>"Key12"</code> ({{bug(1232919)}}).</li> + <li>下面的心键值被增加为了音频控制按键: <code>"AudioBassBoostToggle"</code>, <code>"AudioTrebleDown"</code>, and <code>"AudioTrebleUp"</code> ({{bug(123919)}}).</li> + <li>键值被增加为了麦克风控制按键: <code>"</code><code>MicrophoneToggle"</code>, <code>"</code><code>MicrophoneVolumeDown"</code>, <code>"</code><code>MicrophoneVolumeUp"</code>, and <code>"</code><code>MicrophoneVolumeMute"</code> ({{bug(123919)}}).</li> + <li>新的键值被增加为了支持语音识别设备: "<code>SpeechCorrectionList"</code> and <code>"</code><code>SpeechInputToggle"</code> ({{bug(1232919)}}).</li> + <li>新的键值已经被增加去支持手机上的特别的按键: <code>"</code><code>AppSwitch"</code>, <code>"</code><code>Call"</code>, <code>"</code><code>CameraFocus"</code>, <code>"</code><code>EndCall"</code>, <code>"</code><code>GoBack"</code>, <code>"</code><code>GoHome"</code>, <code>"</code><code>HeadsetHook"</code>, <code>"</code><code>LastNumberRedial"</code>, <code>"</code><code>Notification"</code>, <code>"</code><code>MannerMode"</code>, and <code>"</code><code>VoiceDial"</code> ({{bug(1232919)}}).</li> + <li>这些新的应用程序键值已经被增加: <code>"</code><code>LaunchContacts"</code> and <code>"</code><code>LaunchPhone"</code> ({{bug(1232919)}}).</li> + <li>新的键值被增加去支持电视设备: <code>"</code><code>TV3DMode"</code>, <code>"</code><code>TVAntennaCable"</code>, <code>"</code><code>TVAudioDescription"</code>, <code>"</code><code>TVAudioDescriptionMixDown"</code>, <code>"</code><code>TVAudioDescriptionMixUp"</code>, <code>"</code><code>TVContentsMenu"</code>, <code>"</code><code>TVDataService"</code>, <code>"</code><code>TVInput"</code>, <code>"</code><code>TVInputComponent1"</code>, <code>"</code><code>TVInputComponent2"</code>, <code>"</code><code>TVInputComposite1"</code>, <code>"</code><code>TVInputComposite2"</code>, <code>"</code><code>TVInputHDMI1"</code>, <code>"</code><code>TVInputHDMI2"</code>, <code>"</code><code>TVInputHDMI3"</code>, <code>"</code><code>TVInputHDMI4"</code>, <code>"</code><code>TVInputVGA1"</code>, <code>"</code><code>TVMediaContext"</code>, <code>"</code><code>TVNetwork"</code>, <code>"</code><code>TVNumberEntry"</code>, <code>"</code><code>TVRadioService"</code>, <code>"</code><code>TVSatellite"</code>, <code>"</code><code>TVSatelliteBS"</code>, <code>"</code><code>TVSatelliteCS"</code>, <code>"</code><code>TVSatelliteToggle"</code>, <code>"</code><code>TVTerrestrialAnalog"</code>, <code>"</code><code>TVTerrestrialDigital"</code>, <code>"</code><code>TVTimer"</code>, and <code>"</code><code>DVR"</code> ({{bug(1232919)}}).</li> + <li>键值 <code>"</code><code>MediaSelect"</code> 已经被替换成标准的 <code>"</code><code>LaunchMediaPlayer"</code> 键值 ({{bug(1272592)}}).</li> + <li>Additional media player key values have been added as well. These are <code>"</code><code>MediaAudioTrack"</code>, <code>"</code><code>MediaSkipBackward"</code>, <code>"</code><code>MediaSkipForward"</code>, <code>"</code><code>MediaStepBackward"</code>, <code>"</code><code>MediaStepForward"</code>, <code>"</code><code>MediaTopMenu"</code>, <code>"</code><code>NavigateIn"</code>, <code>"</code><code>NavigateNext"</code>, <code>"</code><code>NavigateOut"</code>, and <code>"</code><code>NavigatePrevious"</code> ({{bug(1232919)}}).</li> +</ul> + +<h4 id="Canvas">Canvas</h4> + +<ul> + <li>{{domxref("CanvasRenderingContext2D.filter")}} 属性, 它提供支持去增加滤镜在canvas中, 现在是默认被激活的并且不再需要去偏好选项中去开启 ({{bug(1173545)}}).</li> +</ul> + +<h4 id="WebGL">WebGL</h4> + +<ul> + <li>{{domxref("EXT_color_buffer_float")}} {{domxref("WebGL2RenderingContext", "WebGL 2", "", 1)}} 扩展已经被实现 ({{bug(1129332)}}).</li> + <li>{{Event("webglcontextcreationerror")}} 事件, 它会被发送当 WebGL context 尝试创建但是失败的时候, 已经被实现 ({{bug(1271478)}}). 使用这个来帮助理解什么导致了错误, 可以用来调试代码和生产中的错误处理.</li> +</ul> + +<h4 id="IndexedDB">IndexedDB</h4> + +<ul> + <li>现在你可以重命名 IndexedDB 索引; the {{domxref("IDBIndex.name")}} 属性不再是只读的 ({{bug(1118028)}}).</li> + <li>现在你可以重命名 {{domxref("IDBObjectStore")}}s; {{domxref("IDBObjectStore.name")}} 属性不再是只读的 ({{bug(1118028)}}).</li> +</ul> + +<h4 id="Service_Workers_and_related">Service Workers and related</h4> + +<ul> + <li>The <a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a>'s {{domxref("Response")}} object now implements the {{domxref("Response.redirected", "redirected")}} property, which indicates whether or not the response is for a request which was redirected. Please review the security related notes in the documentation before using this property ({{bug(1243792)}}).</li> + <li>In the <a href="/en-US/docs/Web/API/Permissions_API">Permissions API</a>, Firefox no longer supports the 'push' <code>PermissionDescriptor</code> dictionary type (referred to in the spec as <code>PushPermissionDescriptor</code>); this is because Firefox relies on a quota system for controlling the <code>userVisibleOnly</code> status instead, and was throwing an error when it encountered a <code>PushPermissionDescriptor</code> instance ({{bug(1266821)}}). With this dictionary removed, Firefox now simply ignores it.</li> +</ul> + +<h4 id="Media_Streams">Media Streams</h4> + +<ul> + <li>In the past, it was possible for a call to {{domxref("MediaDevices.getUserMedia()")}} which requests both audio and video to succeed in cases where the user has only one of the two types of hardware available. This has been fixed ({{bug(802326)}}).</li> + <li>In prior versions of Firefox, it was possible for a call to {{domxref("MediaDevices.getUserMedia()")}} which requests both audio and video to succeed even though the user denied access to one but not both of the matching devices. This has been fixed ({{bug(802326)}}). This involves minor user interface changes as well, to remove the options to choose "No audio" or "No video" when the user is prompted for permissions.</li> + <li>The {{domxref("MediaStream.getTrackById()")}} method has been implemented ({{bug(1208390)}}).</li> +</ul> + +<h4 id="WebRTC">WebRTC</h4> + +<ul> + <li>The {{domxref("RTCPeerConnection.addTrack()")}} method has been updated to allow tracks which are not components of the specified streams to be added to the connection. Instead, the streams are used to group tracks on the receiving end of the connection ({{bug(1271669)}}).</li> +</ul> + +<h4 id="New_APIs">New APIs</h4> + +<ul> + <li>{{domxref("PerformanceObserver")}} API 现在在默认是被激活的在 Nightly. 这在其他版本的Firefox 49 在默认下是无效的 ({{bug(1271487)}}).</li> +</ul> + +<h4 id="Others">Others</h4> + +<ul> + <li>{{domxref("XMLHttpRequest.getResponseHeader()")}} 和 {{domxref("XMLHttpRequest.getAllResponseHeaders()")}} 返回空头部在偏好选项中 <code>network.http.keep_empty_response_headers_as_empty_string</code> 被设置成 <code>true</code> ({{bug(669259)}}).</li> + <li>Firefox OS-only <a href="/en-US/docs/Archive/Firefox_OS/API/Data_Store_API">Data Store API</a> 已经被移除 ({{bug(1261009)}}).</li> + <li>The <a href="/en-US/docs/Web/API/Fullscreen_API">Fullscreen API</a> event handlers {{domxref("Document.onfullscreenchange")}} and {{domxref("Document.onfullscreenerror")}} have been removed from {{domxref("Element")}} as they were never fired there; the prefixed versions of these event handlers have been kept there for compatibility purposes, however ({{bug(1270386)}}). Note that this is not yet activated by default, but is behind the <code>full-screen-api.unprefix.enabled</code> preference ({{bug(1268749)}}).</li> + <li>The obsolete {{domxref("Document.mozFullScreen")}} property has been unprefixed to {{domxref("Document.fullscreen")}} {{bug(1269157)}}}. Note that this is not yet activated by default by behind the <code>full-screen-api.unprefix.enabled</code> preference ({{bug(1268749)}}).</li> + <li>The read-only properties {{domxref("Document.fullscreenElement")}} and {{domxref("Document.fullscreenEnabled")}} no longer throw an exception if an attempt is made to change their values; instead, the new value is silently ignored and the setter function is a no-op ({{bug(1269798)}}).</li> + <li>Any kind of data can now be retrieved from the clipboard using {{domxref("DataTransfer.getData()")}}: previously, only data of certain MIME types were supported {{bug(860857)}}.</li> + <li>Our implementation of the <a href="/en-US/docs/Web/API/Frame_Timing_API">Frame Timing API</a>, consisting of the two interfaces <code>PerformanceCompositeTiming</code> and <code>PerformanceRenderTiming</code>, has been removed as the spec has been completely rewritten ({{bug(1271846)}}).</li> + <li>To match the spec, the {{domxref("VTTCue.positionAlign")}} property now returns a <code>PositionAlign</code> enum instead of an <code>Align</code> enum ({{bug(1276129)}}).</li> + <li>The speech synthesis part of <a href="/en-US/docs/Web/API/Web_Speech_API#Speech_synthesis">Web Speech API</a> is now activated by default ({{bug(1268633)}}).</li> + <li>The <a href="/en-US/docs/Web/API/Performance_Timeline">Performance Timeline API</a> is now available by default in Nightly (though not in Aurora, Beta or Release).</li> + <li>The {{event("install")}} event, and the {{domxref("Window.oninstall")}} event handler, are now supported for <a href="/en-US/docs/Web/Manifest">Web Manifests</a> ({{bug(1265279)}}).</li> + <li>When using the {{domxref("AudioContext.createPeriodicWave()")}} method of the <a href="/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a>, you can now specify whether the resulting periodic wave should be normalized by including a dictionary object as the third parameter, which includes a single parameter — <code>{disableNormalization: true}</code> ({{bug(1265405)}}).</li> + <li>In the WebVTT API, {{domxref("VTTCue.positionAlign")}} now correctly returns a <code>PositionAlignSetting</code> enum as per spec; previously it returned an <code>AlignSetting</code> enum ({{bug(1276129)}}).</li> + <li>The Speech Synthesis part of the Web Speech API is now enabled by default across all desktop browsers ({{bug(1268633)}}).</li> + <li>The {{domxref("Animation.Animation()", "Animation()")}} constructor of the <a href="/en-US/docs/Web/API/Web_Animations_API">Web Animations API</a> now accepts a null timeline ({{bug(1096776)}}).</li> +</ul> + +<h3 id="MathML">MathML</h3> + +<p><em>No change.</em></p> + +<h3 id="SVG">SVG</h3> + +<ul> + <li>移除支持不被赞成的 {{SVGElement('altGlyph')}}, {{SVGElement('altGlyphDef')}} 和 {{SVGElement('altGlyphItem')}} 元素 ({{bug(1260032)}}).</li> +</ul> + +<h3 id="AudioVideo">Audio/Video</h3> + +<p><em>没有改变.</em></p> + +<h3 id="Plugins_and_Flash">Plugins and Flash</h3> + +<p>Beginning in Firefox 49, Firefox, by default, blocks certain kinds of Flash content that aren't necessary for sites to function well. This behavior, controlled by the preference <code>browser.safebrowsing.blockedURIs.enabled</code>, helps to improve the performance of sites and Firefox in general without having significant impact on site usability. It also helps improve stability of the browsing experience by elminating a major cause of crashes. The blocked Flash modules include several used just for fingerprinting purposes, as well as a number of "supercookie" modules, and in the future may be expanded to include more types of blocked modules. See {{bug(1275591)}} for details.</p> + +<p>This marks the next step in the journey toward a plugin-free future. HTML is very close to the point where plugins will no longer be needed to get the job done.</p> + +<h2 id="HTTP">HTTP</h2> + +<ul> + <li><code><a href="/en-US/docs/Web/HTTP/Headers/Cache-Control">Cache-Control: immutable</a></code> 指令现在已经被实现 ({{bug(1267474)}}). 另见这篇文章 <a href="https://bitsup.blogspot.de/2016/05/cache-control-immutable.html">blog post</a> 得到更多信息.</li> + <li>The {{CSP("require-sri-for")}} {{HTTPHeader("Content-Security-Policy")}} has been implemented ({{bug(1265318)}}).</li> +</ul> + +<h2 id="Networking">Networking</h2> + +<ul> + <li>The <a href="/en-US/docs/Mozilla/Projects/Necko/Proxy_Auto-Configuration_(PAC)_file">Proxy Auto-Configuration (PAC)</a> implementation has been updated. Now <code>weekdayRange</code>, <code>dateRange</code>, and <code>timeRange</code> support "reversed ranges", for example, <code>weekdayRange("SAT", "MON")</code> will evaluate <code>true</code> if the current day is Saturday, Sunday, or Monday ({{bug(1251332)}}).</li> +</ul> + +<h2 id="Security">Security</h2> + +<ul> + <li>The {{domxref("Window.isSecureContext")}} property, indicating whether a context is capable of using features that require <a href="/en-US/docs/Web/Security/Secure_Contexts">secure contexts</a>, has been implemented ({{bug(1162772)}}).</li> +</ul> + +<h2 id="Compatibility">Compatibility</h2> + +<p>为了增强兼容性对于现在已经存在的内容, Firefox 现在接受一些 webkit 前缀 properties and attributes.</p> + +<ul> + <li> 接下来的 properties 现在依旧工作在前缀 -webkit下: + <ul> + <li>{{cssxref("-webkit-align-items")}}</li> + <li>{{cssxref("-webkit-align-content")}}</li> + <li>{{cssxref("-webkit-align-self")}}</li> + <li>{{cssxref("-webkit-animation")}}</li> + <li>{{cssxref("-webkit-animation-delay")}}</li> + <li>{{cssxref("-webkit-animation-direction")}}</li> + <li>{{cssxref("-webkit-animation-duration")}}</li> + <li>{{cssxref("-webkit-animation-fill-mode")}}</li> + <li>{{cssxref("-webkit-animation-iteration-count")}}</li> + <li>{{cssxref("-webkit-animation-name")}}</li> + <li>{{cssxref("-webkit-animation-play-state")}}</li> + <li>{{cssxref("-webkit-animation-timing-function")}}</li> + <li>{{cssxref("-webkit-backface-visibility")}}</li> + <li>{{cssxref("-webkit-background-clip")}}</li> + <li>{{cssxref("-webkit-background-origin")}}</li> + <li>{{cssxref("-webkit-background-size")}}</li> + <li>{{cssxref("-webkit-border-bottom-left-radius")}}</li> + <li>{{cssxref("-webkit-border-bottom-right-radius")}}</li> + <li>{{cssxref("-webkit-border-image")}}</li> + <li>{{cssxref("-webkit-border-top-left-radius")}}</li> + <li>{{cssxref("-webkit-border-top-right-radius")}}</li> + <li>{{cssxref("-webkit-border-radius")}}</li> + <li>{{cssxref("-webkit-box-shadow")}}</li> + <li>{{cssxref("-webkit-filter")}}</li> + <li>{{cssxref("-webkit-flex")}}</li> + <li>{{cssxref("-webkit-flex-basis")}}</li> + <li>{{cssxref("-webkit-flex-direction")}}</li> + <li>{{cssxref("-webkit-flex-flow")}}</li> + <li>{{cssxref("-webkit-flex-grow")}}</li> + <li>{{cssxref("-webkit-flex-shrink")}}</li> + <li>{{cssxref("-webkit-flex-wrap")}}</li> + <li>{{cssxref("-webkit-justify-content")}}</li> + <li>{{cssxref("-webkit-order")}}</li> + <li>{{cssxref("-webkit-perspective")}}</li> + <li>{{cssxref("-webkit-perspective-origin")}}</li> + <li>{{cssxref("-webkit-text-size-adjust")}}</li> + <li>{{cssxref("-webkit-transform")}}</li> + <li>{{cssxref("-webkit-transform-origin")}}</li> + <li>{{cssxref("-webkit-transform-style")}}</li> + <li>{{cssxref("-webkit-transition")}}</li> + <li>{{cssxref("-webkit-transition-delay")}}</li> + <li>{{cssxref("-webkit-transition-duration")}}</li> + <li>{{cssxref("-webkit-transition-property")}}</li> + <li>{{cssxref("-webkit-transition-timing-function")}}</li> + <li>{{cssxref("-webkit-user-select")}}</li> + </ul> + </li> + <li>接下来的 properties 映射到(根据猜测,这里应该是没有前缀的属性,但是很奇怪这里的prefixed没有un) the equivalent prefixed property + <ul> + <li>{{cssxref("-webkit-box-flex")}}</li> + <li>{{cssxref("-webkit-box-ordinal-group")}}</li> + <li>{{cssxref("-webkit-box-orient")}}</li> + <li>{{cssxref("-webkit-box-align")}}</li> + <li>{{cssxref("-webkit-box-pack")}}</li> + </ul> + </li> + <li>对于{{cssxref("<image>")}} 值: + <ul> + <li>接下来的功能映射到它们的没有前缀的事物: {{cssxref("-webkit-linear-gradient", "-webkit-linear-gradient()")}}, {{cssxref("-webkit-radial-gradient", "-webkit-radial-gradient()")}}, {{cssxref("-webkit-repeating-linear-gradient", "-webkit-repeating-linear-gradient()")}}, and {{cssxref("-webkit-repeating-radial-gradient","-webkit-repeating-radial-gradient()")}}.</li> + <li>The outdated <code>-webkit-gradient</code> is supported (and translated to a regular gradient)</li> + </ul> + </li> + <li>接下来的 {{cssxref("display")}} 值被转换: + <ul> + <li><code>-webkit-box</code> to <code>-moz-box</code></li> + <li><code>-webkit-flex</code> to <code>flex</code></li> + <li><code>-webkit-inline-box</code> to <code>inline-flex</code></li> + <li><code>-webkit-inline-flex</code> to <code>-moz-inline-flex</code></li> + </ul> + </li> + <li> 接下来的属性被支持 (并且不会映射到任何没有前缀的事物and don't map to any unprefixed equivalent): + <ul> + <li>{{cssxref("-webkit-text-fill-color")}}</li> + <li>{{cssxref("-webkit-text-stroke-color")}}</li> + <li>{{cssxref("-webkit-text-stroke-width")}}</li> + <li>{{cssxref("-webkit-text-stroke")}}</li> + </ul> + </li> + <li>{{domxref("WebKitCSSMatrix")}} 接口是 {{domxref("DOMMatrix")}} 的别名</li> + <li>接下来的媒体查询功能已经被实现: + <ul> + <li><code>-webkit-min-device-pixel-ratio</code> as an alias of <code><a href="/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#resolution">min-resolution</a></code> with the same value (in <code>dppx)</code>, though this feature is <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1237720">disabled by default</a> (behind about:config pref <code>layout.css.prefixes.device-pixel-ratio-webkit</code>)</li> + <li><code>-webkit-max-device-pixel-ratio</code> as an alias of <code><a href="/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#resolution">max-resolution</a></code> of the same value (in <code>dppx</code>); this feature is also disabled by default, behind the same about:config pref.</li> + <li><code><a href="/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#-webkit-transform-3d">-webkit-transform-3d</a></code> always matching, indicating 3d transform support.</li> + </ul> + </li> +</ul> + +<h2 id="改变对于_add-on_and_Mozilla_developers">改变对于 add-on and Mozilla developers</h2> + +<h3 id="WebExtensions">WebExtensions</h3> + +<ul> + <li>Support for the {{WebExtAPIRef("history")}} has been added. This provides access to the browser history, with methods available for searching the history, getting information about previously-visited pages, and adding and removing history entries.</li> + <li>Added the {{WebExtAPIRef("tabs.removeCSS()")}} method to the tabs API. This method lets you remove CSS which was previously injected by calling {{WebExtAPIRef("tabs.insertCSS()")}}.</li> +</ul> + +<h3 id="Interfaces">Interfaces</h3> + +<ul> + <li>In {{domxref("EventTarget.addEventListener()")}}, the value <code>mozSystemGroup</code>, active only in code running in XBL or in Firefox's chrome, is a {{jsxref("Boolean")}} which indicates if the listener is added to the system group. ({{bug(1274520)}})</li> +</ul> + +<h3 id="Other">Other</h3> + +<p><em>没有改变.</em></p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-US/versions/49">Site Compatibility for Firefox 49</a></li> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers(48)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/56/index.html b/files/zh-cn/mozilla/firefox/releases/56/index.html new file mode 100644 index 0000000000..e7e2870e37 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/56/index.html @@ -0,0 +1,129 @@ +--- +title: Firefox 56 for developers +slug: Mozilla/Firefox/Releases/56 +translation_of: Mozilla/Firefox/Releases/56 +--- +<div>{{FirefoxSidebar}}</div><article class="text-content" id="wikiArticle"> +<p>本文介绍了一些在Firefox 56中的一些改进,这些改进会对开发者们产生影响。Firefox 56是当前Firefox的Beta版,预计在2017年9月26日正式发布。</p> + +<article class="text-content" id="wikiArticle"> +<h2 id="针对网页开发者们的若干改变">针对网页开发者们的若干改变</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<ul> + <li>在CSS格检查器中显示以负号开始的行号({{bug(1369942)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>在打标签的窗体控件中采用<code>labels</code> 属性,比如 {{domxref("HTMLInputElement.labels")}} ({{bug(556743)}}).</li> + <li>实现了 <code><link rel="preload"></code>; 更详细的内容,可以参见 <a href="/en-US/docs/Web/HTML/Preloading_content">Preloading content with rel="preload"</a> ({{bug(1222633)}}). 需要注意的是,当前的Firefox只支持对可缓存的资源进行预加载。</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>实现了Mozilla自有的属性 {{cssxref("<color>")}} 值为 <code>-moz-win-accentcolor</code> 以及 <code>-moz-win-accentcolortext</code> (可以参见 {{bug(1344910)}}), 以及专用的媒体查询语句 <code><a href="/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#-moz-windows-accent-color-in-titlebar">-moz-windows-accent-color-in-titlebar</a></code> (参见{{bug(1379938)}}).</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>无修改.</em></p> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>The <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl">Intl API</a> has been enabled on Firefox for Android ({{bug(1344625)}}).</li> +</ul> + +<h3 id="APIs">APIs</h3> + +<h4 id="New_APIs">New APIs</h4> + +<p><em>No changes.</em></p> + +<h4 id="DOM">DOM</h4> + +<ul> + <li>On Mac, {{domxref("Document.hidden")}} is now true when the window is behind another non-translucent application {{bug(1236512)}}.</li> + <li>The {{domxref("Gamepad.displayId")}} property has been implemented ({{bug(1375816)}}).</li> + <li>The {{domxref("PerformanceTiming.secureConnectionStart")}} property has been implemented ({{bug(772589)}}).</li> + <li>Firefox used to accept <code>iso-2022-jp-2</code> sequences silently when an <code>iso-2022-jp</code> {{domxref("TextDecoder.TextDecoder","TextDecoder()")}} was instantiated, however this has now been removed to simplify the API, as no other browsers support it and no pages seem to use it. ({{bug(715833)}}).</li> + <li>The 4ms clamping behaviour of {{domxref("WindowOrWorkerGlobalScope.setTimeout","setTimeout()")}} and {{domxref("WindowOrWorkerGlobalScope.setInterval","setInterval()")}} has been updated to be more in line with other browsers, as described in <a href="/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout#Timeouts_throttled_to_%3E4ms">Timeouts throttled to >=4ms</a> ({{bug(1378586)}}).</li> + <li>The <a href="/en-US/docs/Web/API/Page_Visibility_API">Page Visibility API's</a> {{domxref("Document.onvisibilitychange")}} handler has been added ({{bug("1333912")}}).</li> + <li>The {{domxref("Window.showModalDialog()")}} method has been removed ({{bug(981796)}}).</li> +</ul> + +<h4 id="DOM_events">DOM events</h4> + +<ul> + <li>{{domxref("GlobalEventHandlers.onwheel")}} is now available on {{domxref("HTMLElement")}} — it wasn't before ({{bug(1370550)}}).</li> +</ul> + +<h4 id="WebRTC">WebRTC</h4> + +<ul> + <li>Firefox now supports the {{domxref("RTCPeerConnection")}} properties which let you examine the current and pending configurations of the local and remote ends of the connection, to help manage changes in configuration: {{domxref("RTCPeerConnection.currentLocalDescription", "currentLocalDescription")}}, {{domxref("RTCPeerConnection.pendingLocalDescription", "pendingLocalDescription")}}, {{domxref("RTCPeerConnection.currentRemoteDescription", "currentRemoteDescription")}}, and {{domxref("RTCPeerConnection.pendingRemoteDescription", "pendingRemoteDescription")}}.</li> +</ul> + +<h4 id="Canvas_and_WebGL">Canvas and WebGL</h4> + +<ul> + <li>The {{domxref("CanvasRenderingContext2D.drawImage()")}} method has been updated so that smoothing occurs when downscaling even if <code>imageSmoothingEnabled</code> is <code>false</code>. This is not mandatory as per spec, but follows Chrome's behaviour. See {{bug(1360415)}}.</li> + <li>An {{domxref("SVGImageElement")}} can now be used as a {{domxref("CanvasImageSource")}}, e.g. as the image source in a {{domxref("CanvasRenderingContext2D.drawImage","drawImage()")}} call ({{bug(1382027)}}).</li> +</ul> + +<h3 id="Security">Security</h3> + +<p><em>No changes.</em></p> + +<h3 id="Plugins">Plugins</h3> + +<p><em>No changes.</em></p> + +<h3 id="Other">Other</h3> + +<ul> + <li>Gecko now encodes URLs internally as <a href="https://en.wikipedia.org/wiki/Punycode">punycode</a>, to avoid URL encoding problems (see {{bug("945240")}}, also see discussion in {{bug("942074")}}).</li> + <li>Firefox on Windows and Mac OS X can now be made to run in <a href="/en-US/docs/Mozilla/Firefox/Headless_mode">headless mode</a> using the <code>-headless</code> flag (see {{bug(1355150)}} and {{bug(1355147)}}).</li> +</ul> + +<h2 id="Removals_from_the_web_platform">Removals from the web platform</h2> + +<h3 id="HTML_2">HTML</h3> + +<ul> + <li>The {{htmlelement("isindex")}} element has been removed from the HTML parser, and from form submission ({{bug(1266495)}}).</li> + <li>The {{htmlelement("applet")}} element has been removed ({{bug(1279218)}}).</li> +</ul> + +<h3 id="APIs_2">APIs</h3> + +<p><em>No changes.</em></p> + +<h3 id="SVG_2">SVG</h3> + +<p><em>No changes.</em></p> + +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> + +<h3 id="WebExtensions">WebExtensions</h3> + +<p><em>No changes.</em></p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-US/versions/56">Site Compatibility for Firefox 56</a></li> +</ul> +</article> + +<ul> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers(55)}}</p> +</article> diff --git a/files/zh-cn/mozilla/firefox/releases/59/index.html b/files/zh-cn/mozilla/firefox/releases/59/index.html new file mode 100644 index 0000000000..aca2ace7c6 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/59/index.html @@ -0,0 +1,130 @@ +--- +title: Firefox 59 for developers +slug: Mozilla/Firefox/Releases/59 +tags: + - '29' + - 发布说明 + - 火狐 +translation_of: Mozilla/Firefox/Releases/59 +--- +<div>{{FirefoxSidebar}}</div><div>{{draft}}</div> + +<p class="summary">本文提供了有关Firefox 59中会影响开发人员的更改的信息。 Firefox 59已于2018年3月13日发布。</p> + +<article class="text-content" id="wikiArticle"> +<h2 id="Web开发者应该注意的变化">Web开发者应该注意的变化</h2> + +<h3 id="开发工具">开发工具</h3> + +<ul> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor">网络监视器</a> 响应标签现在显示一个 <a href="https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor#HTML_preview">已渲染网页的预览</a> — 如果响应是一个HTML的话 ({{bug(1353319)}}).</li> + <li>存储探查器显示的 Cookie信息 (见 <a href="https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector#Cookies">Cookies</a>) 现在包括一列 <em>“同站”</em> 显示每个cookie的同站状态 ({{bug(1298370)}})。</li> + <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Rulers">标尺</a> 工具 现在包含了一个 readout 来显示当前视角的维度 ({{bug(1402633)}})。</li> + <li>在<a href="https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode">响应式设计模式 </a>, 您现在可以使用光标键设置屏幕尺寸({{bug(1421663)}})。详见 <a href="https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode#Setting_screen_size">Setting screen size</a> 。</li> + <li>The <em>Raw headers</em> display in the <a href="https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor">Network Monitor</a> <em>Headers</em> tab now includes the response's status code ({{bug(1419401)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>实现了{{HTMLElement("textarea")}} 元素的 {{htmlattrxref("autocomplete", "textarea")}}属性 . 这使得你可以启用或禁用元素的表单自动填写。</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<p><em>无变化。</em></p> + +<h3 id="SVG">SVG</h3> + +<p><em>无变化。</em></p> + +<h3 id="JavaScript">JavaScript</h3> + +<p><em>无变化。</em></p> + +<h3 id="APIs">APIs</h3> + +<h4 id="新增API">新增API</h4> + +<ul> + <li>在nightly中默认启用 <a href="/en-US/docs/Web/Web_Components/Custom_Elements">Custom elements</a> v1 ({{bug(1406825)}}).</li> +</ul> + +<h4 id="DOM">DOM</h4> + +<p><em>无变化。</em></p> + +<h4 id="DOM_事件">DOM 事件</h4> + +<ul> + <li>实现了 {{domxref("EventTarget.EventTarget()")}} 构造函数({{bug(1379688)}}).</li> +</ul> + +<h4 id="多媒体_和_WebRTC">多媒体 和 WebRTC</h4> + +<p><em>无变化。</em></p> + +<h4 id="Canvas_和_WebGL">Canvas 和 WebGL</h4> + +<p><em>无变化。</em></p> + +<h3 id="HTTP">HTTP</h3> + +<p><em>无变化。</em></p> + +<h3 id="安全">安全</h3> + +<ul> + <li>顶部导航URI <code>data://</code> 已经被屏蔽了 {{bug(1401895)}}. 更多细节参见 <span><a href="https://www.fxsitecompat.com/en-CA/docs/2017/data-url-navigations-on-top-level-window-will-now-be-blocked/">Data URL navigations on top level window will now be blocked</a> 。</span></li> + <li>修改了 {{httpheader("X-Frame-Options")}} 报头的 <code>SAMEORIGIN</code> 指令,现在它不仅会检查顶级 IFrame 是否来自同一来源 , 也会检查它的祖先。 ({{bug(725490)}}).</li> +</ul> + +<h3 id="插件">插件</h3> + +<p><em>无变化。</em></p> + +<h3 id="其他">其他</h3> + +<p><em>无变化。</em></p> + +<h2 id="Web平台的删减">Web平台的删减</h2> + +<h3 id="HTML_2">HTML</h3> + +<p><em>无变化。</em></p> + +<h3 id="CSS_2">CSS</h3> + +<p><em>无变化。</em></p> + +<h3 id="APIs_2">APIs</h3> + +<ul> + <li>不标准的方法 <code>Event.getPreventDefault()</code> 已经被移除了. 请使用 {{domxref("Event.defaultPrevented")}} 来决定在{{domxref("Event")}}中是否要调用{{domxref("Event.preventDefault", "preventDefault()")}} 。</li> + <li>专用属性 <code><a href="/en-US/docs/Archive/API/Navigator/mozNotification">Navigator.mozNotification</a></code> 和 <code>DesktopNotification</code> 接口已被移除 , 推荐使用标准的 <a href="/en-US/docs/Web/API/Notifications_API">Notifications API</a> ({{bug(952453)}}).</li> + <li>专用方法 <code>window.external.addSearchEngine()</code>已被移除 ({{bug("862147")}})。欲了解更多细节,参见 {{domxref("Window.sidebar")}} 。</li> +</ul> + +<h3 id="SVG_2">SVG</h3> + +<p><em>无变化</em></p> + +<h2 id="Mozilla和附加组件开发者应该注意的变化">Mozilla和附加组件开发者应该注意的变化</h2> + +<h3 id="WebExtensions">WebExtensions</h3> + +<p><em>无变化</em></p> + +<h2 id="参见">参见</h2> + +<ul> + <li>Firefox 59 的站点兼容性</li> +</ul> +</article> + +<ul> +</ul> + +<h2 id="历史版本">历史版本</h2> + +<p>{{Firefox_for_developers(58)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/62/index.html b/files/zh-cn/mozilla/firefox/releases/62/index.html new file mode 100644 index 0000000000..10a5c5423a --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/62/index.html @@ -0,0 +1,187 @@ +--- +title: Firefox 62 for developers +slug: Mozilla/Firefox/Releases/62 +translation_of: Mozilla/Firefox/Releases/62 +--- +<div>{{FirefoxSidebar}}</div><div>{{FirefoxSidebar}}</div> + +<div>{{draft}}</div> + +<p class="summary">This article provides information about the changes in Firefox 62 that will affect developers. Firefox 62 is the current <a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#beta">Beta version of Firefox</a>, and will ship on <a href="https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates">September 5, 2018</a>.</p> + +<h2 id="Changes_for_web_developers">Changes for web developers</h2> + +<h3 id="Developer_tools">Developer tools</h3> + +<ul> + <li>You now have four options for the location of the Developer Tools. In addition to the default location on the bottom of the window, you can choose to locate the tools on either the left or right sides of the main window or in a separate window.</li> + <li>You can now split the Rules view out into its own pane, separate from the other tabs on the CSS pane. See <a href="/en-US/docs/Tools/Page_Inspector/3-pane_mode">Page inspector 3-pane mode</a> for more details.</li> + <li>The Grid inspector has updated features, and all new documentation — see <a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_grid_layouts">CSS Grid Inspector: Examine grid layouts</a>.</li> + <li>The <a href="/en-US/docs/Tools/Accessibility_inspector">Accessibility inspector</a> has had a couple of minor updates: + <ul> + <li>It no longer exposes the <code>help</code> property, which isn't properly implemented in Gecko ({{bug(1467643)}}).</li> + <li>The <code>keyboardShortcut</code> property now correctly exposes any keyboard shortcut available to activate the currently inspected node ({{bug(1467381)}}).</li> + </ul> + </li> +</ul> + +<h3 id="HTML">HTML</h3> + +<p><em>没有变化。</em></p> + +<h3 id="CSS">CSS</h3> + +<ul> + <li><code>:-moz-selection</code> has been unprefixed ({{bug(509958)}}).</li> + <li><code>x</code> is now supported as a unit for the <code><a href="/en-US/docs/Web/CSS/resolution"><resolution></a></code> type ({{bug(1460655)}}).</li> + <li><code><a href="/en-US/docs/Web/CSS/shape-margin">shape-margin</a></code>, <code><a href="/en-US/docs/Web/CSS/shape-outside">shape-outside</a></code>, and <code><a href="/en-US/docs/Web/CSS/shape-image-threshold">shape-image-threshold</a></code> are now enabled by default ({{bug(1457297)}}).</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>No changes.</em></p> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>The {{jsxref("Array.prototype.flat()")}} and {{jsxref("Array.prototype.flatMap()")}} methods are now enabled by default ({{bug(1435813)}}).</li> + <li>The <code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/import.meta">import.meta</a></code> property has been implemented to expose context-specific metadata to a JavaScript module ({{bug(1427610)}}).</li> + <li>JavaScript <a href="/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#String_literals">string literals</a> may now directly contain U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR. As a consequence, {{jsxref("JSON")}} syntax is now a subset of JavaScript literal syntax (see {{bug(1435828)}} and the tc39 proposal <a href="https://github.com/tc39/proposal-json-superset">json-superset</a>).</li> + <li>For out-of-bounds <a href="/en-US/docs/Web/JavaScript/Typed_arrays">typed array</a> indexes, {{jsxref("Reflect.defineProperty()")}} and {{jsxref("Reflect.set()")}} will now return <code>false</code> instead of <code>true</code> ({{bug(1308735)}}).</li> +</ul> + +<h3 id="APIs">APIs</h3> + +<h4 id="New_APIs">New APIs</h4> + +<ul> + <li>The <a href="/en-US/docs/Web/API/Web_Speech_API">Speech Synthesis API (Text-to-Speech)</a> is now enabled by default on Firefox for Android ({{bug(1463496)}}).</li> +</ul> + +<h4 id="DOM">DOM</h4> + +<ul> + <li>The {{domxref("DOMPointReadOnly")}} interface now supports the static function {{domxref("DOMPointReadOnly.fromPoint()")}}, which creates a new point object from a dictionary that's compatible with {{domxref("DOMPointInit")}}. This function is also available on {{domxref("DOMPoint")}} ({{bug(1186265)}}).</li> + <li>Related to the previous item, the <code>DOMPoint</code> and <code>DOMPointReadOnly</code> constructors no longer support an input parameter of type <code>DOMPointInit</code>; the values of the properties must be specified using the <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code> parameters ({{bug(1186265)}}).</li> + <li>The {{domxref("URL.createObjectURL()")}} method no longer supports creating object URLs to represent a {{domxref("MediaStream")}}. This capability has been obsolete for some time now, since you can simply set {{domxref("HTMLMediaElement.srcObject")}} to the <code>MediaStream</code> directly now ({{bug(1454889)}}).</li> + <li>For compatibility purposes, the {{domxref("Event.srcElement")}} property is now supported. It is an alias for {{domxref("Event.target")}} ({{bug(453968)}}).</li> + <li>{{domxref("Navigator.registerProtocolHandler()")}} now must only be called from a secure context ({{bug(1460506)}}).</li> + <li>The {{domxref("Navigator.registerContentHandler()")}} method has been disabled by default in preparation for being removed entirely, as it's been obsolete for some time ({{bug(1460481)}}).</li> +</ul> + +<h4 id="DOM_events">DOM events</h4> + +<p><em>No changes.</em></p> + +<h4 id="Service_workers">Service workers</h4> + +<p><em>No changes.</em></p> + +<h4 id="Media_Web_Audio_and_WebRTC">Media, Web Audio, and WebRTC</h4> + +<ul> + <li>The <code>"media.autoplay.enabled"</code> preference now controls automatic playback of both audio and video media, instead of just video media ({{bug(1413098)}}).</li> + <li>The {{domxref("ChannelSplitterNode")}} has been fixed to correctly default to having 6 channels with the <code>channelInterpretation</code> set to <code>"discrete"</code> and the <code>channelCountMode</code> set to <code>"explicit"</code> per the specification ({{bug(1456265)}}).</li> +</ul> + +<h4 id="Canvas_and_WebGL">Canvas and WebGL</h4> + +<p><em>No changes.</em></p> + +<ul> +</ul> + +<h3 id="CSSOM">CSSOM</h3> + +<ul> + <li>Support for <code><a href="/en-US/docs/Web/API/CSSStyleDeclaration/getPropertyCSSValue">CSSStyleDeclaration.getPropertyCSSValue()</a></code> has been removed ({{bug(1408301)}}).</li> + <li>Support for <code><a href="/en-US/docs/Web/API/CSSValue">CSSValue</a></code>, <code><a href="/en-US/docs/Web/API/CSSPrimitiveValue">CSSPrimitiveValue</a></code>, and <code><a href="/en-US/docs/Web/API/CSSValueList">CSSValueList</a></code> has been removed ({{bug()}}).</li> + <li><code><a href="/en-US/docs/Web/API/Window/getComputedStyle">window.getComputedStyle()</a></code> no longer returns <code>null</code> when called on a <code>Window</code> which has no presentation ({{bug(1467722)}}).</li> +</ul> + +<h3 id="HTTP">HTTP</h3> + +<ul> + <li>The deprecated CSP {{CSP("referrer")}} directive has been removed. Please use the {{HTTPHeader("Referrer-Policy")}} header instead ({{bug(1302449)}}).</li> +</ul> + +<h3 id="Security">Security</h3> + +<p><em>No changes.</em></p> + +<h3 id="Plugins">Plugins</h3> + +<p><em>No changes.</em></p> + +<h3 id="Other">Other</h3> + +<p><em>No changes.</em></p> + +<h2 id="Removals_from_the_web_platform">Removals from the web platform</h2> + +<h3 id="HTML_2">HTML</h3> + +<p><em>No changes.</em></p> + +<h3 id="CSS_2">CSS</h3> + +<p><em>No changes.</em></p> + +<h3 id="APIs_2">APIs</h3> + +<p><em>No changes.</em></p> + +<h3 id="SVG_2">SVG</h3> + +<p><em>No changes.</em></p> + +<h3 id="Other_2">Other</h3> + +<p><em>No changes.</em></p> + +<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2> + +<h3 id="WebExtensions">WebExtensions</h3> + +<h4 id="API_changes">API changes</h4> + +<ul> + <li><code><a href="/en-US/Add-ons/WebExtensions/API/webRequest/getSecurityInfo">webRequest.getSecurityInfo()</a></code> API to examine details of TLS connections ({{bug(1322748)}}).</li> + <li><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserSettings/newTabPosition">browserSettings.newTabPosition</a></code> to customize where new tabs open ({{bug(1344749)}}).</li> + <li><code>windowTypes</code> has been deprecated in <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/get">windows.get()</a></code>, <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/getCurrent">windows.getCurrent()</a></code> and <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/getLastFocused">windows.getLastFocused()</a></code> ({{bug(1419132)}}).</li> + <li>It's now possible to modify a browser action on a per-window basis ({{bug(1419893)}}).</li> +</ul> + +<h4 id="Manifest_changes">Manifest changes</h4> + +<ul> + <li>New <code>open_at_install</code> property of the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/sidebar_action">sidebar_action</a></code> manifest key enables extensions to control whether their sidebars should open automatically on install or not ({{bug(1460910)}}).</li> + <li>Changed to the <code>browser_style</code> property of various manifest keys: + <ul> + <li>in <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a></code> and <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> it defaults to false</li> + <li>in <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/sidebar_action">sidebar_action</a></code> and <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_ui">options_ui</a></code> it defaults to true.</li> + </ul> + </li> +</ul> + +<h4 id="Theme_changes">Theme changes</h4> + +<ul> + <li>New <code>tab_background_separator</code> property of the <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/theme">theme</a></code> manifest key enables extensions to change the color of the tab separator.</li> +</ul> + +<h4 id="Other_changes">Other changes</h4> + +<ul> + <li>Support for unpacked sideloaded extensions has been removed ({{bug(1385057)}}).</li> +</ul> + +<h2 id="See_also">See also</h2> + +<ul> + <li>Site compatibility for Firefox 62</li> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers(61)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/65/index.html b/files/zh-cn/mozilla/firefox/releases/65/index.html new file mode 100644 index 0000000000..548193494e --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/65/index.html @@ -0,0 +1,128 @@ +--- +title: Firefox 65 for developers +slug: Mozilla/Firefox/Releases/65 +tags: + - '65' +translation_of: Mozilla/Firefox/Releases/65 +--- +<div>{{FirefoxSidebar}}{{Draft}}</div> + +<p class="summary">本文提供了有关 Firefox 65 中将影响开发者的更改信息。 Firefox 65 是当前的 <a href="https://www.mozilla.org/en-US/firefox/channel/desktop/#beta" rel="noopener">Nightly 版本</a>, 将于2019年1月29日发布。</p> + +<h2 id="为网页开发者带来的改变">为网页开发者带来的改变</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<h4 id="移除">移除</h4> + +<h3 id="HTML">HTML</h3> + +<p>事件现在可以在禁用状态下的 HTML 元素上进行分发,如设置了 <code>disabled</code> 属性的 {{htmlelement("button")}}, {{htmlelement("fieldset")}}, {{htmlelement("input")}}, {{htmlelement("select")}},和 {{htmlelement("textarea")}} ({{bug(329509)}})。</p> + +<h4 id="移除_2">移除</h4> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>已去除 {{cssxref("image-rendering")}} 属性的 <code>crisp-edges</code> 值的前缀({{bug(1496617)}}) 。</li> + <li>{{cssxref("scrollbar-color")}} 的 <code>auto</code> 值现在现在被解析为 <code>auto</code>,而不是两种颜色 ({{bug(1501418)}})。</li> +</ul> + +<h4 id="移除_3">移除</h4> + +<ul> + <li><code>layout.css.shape-outside.enabled</code> 设置已被移除;{{cssxref("shape-outside")}}, {{cssxref("shape-margin")}},和 {{cssxref("shape-image-threshold")}} 不再支持关闭 ({{bug(1504387)}})。</li> + <li> + <div class="textpanel-target-textblock"><span class="text-dst">Firefox 用户</span>{{cssxref("user-select")}}<span class="text-dst">的几个仅限的属性已被删除-</span></div> + — <code>-moz-all</code>, <code>tri-state</code>, <code>element</code>, <code>elements</code>, 和 <code>toggle</code>. Firefox<span class="text-dst"> 仅限</span> <code>-moz-text</code> <span class="text-dst">属性仍在内部使用,故只是在Web内容中禁用</span> <span class="text-dst">参见</span> {{bug(1492958)}}.</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>无变化。</em></p> + +<h4 id="移除_4">移除</h4> + +<h3 id="JavaScript">JavaScript</h3> + +<h4 id="移除_5">移除</h4> + +<h3 id="APIs">APIs</h3> + +<p><em>无变化。</em></p> + +<h4 id="新的_APIs">新的 APIs</h4> + +<h4 id="DOM">DOM</h4> + +<ul> + <li>{{domxref("Performance.toJSON()")}} has been exposed to <a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a> ({{bug(1504958)}}).</li> + <li>{{domxref("XMLHttpRequest")}} requests will now throw a <code>NetworkError</code> if the requested content type is a <code>Blob</code>, and the request method is not <code>GET</code> ({{bug(1502599)}}).</li> +</ul> + +<h4 id="DOM_events">DOM events</h4> + +<ul> + <li>Going forward, only one {{domxref("Window.open()")}} call is allowed per event ({{bug(675574)}}).</li> +</ul> + +<h4 id="Service_workers">Service workers</h4> + +<ul> + <li>The {{domxref("Response.redirect()")}} method now correctly throws a <code>TypeError</code> if a non-valid URL is specified as the first parameter ({{bug(1503276)}}).</li> + <li>The {{domxref("ServiceWorkerContainer.register()")}} and {{domxref("WorkerGlobalScope.importScripts()")}} (when used by a service worker) methods will now accept any files with a valid <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#JavaScript_types">JavaScript MIME type</a> ({{bug(1354577)}}).</li> +</ul> + +<h4 id="Media_Web_Audio_和_WebRTC">Media, Web Audio, 和 WebRTC</h4> + +<ul> + <li>增加了对 <a href="/en-US/docs/Glossary/webp">WebP</a> Google压缩图像文件的支持 (<a class="external external-icon" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1294490" rel="noopener" title="FIXED: Implement WebP image support">bug 1294490</a>) 。</li> +</ul> + +<h4 id="Canvas_和_WebGL">Canvas 和 WebGL</h4> + +<h4 id="移除_6">移除</h4> + +<ul> + <li><a href="/en-US/docs/Web/Guide/Events/Mutation_events">Mutation events</a> 在shadow trees上已经被禁用 ({{bug(1489858)}}).</li> + <li>The non-standard {{domxref("MediaStream")}} property <code>currentTime</code> has been removed ({{bug(1502927)}}).</li> + <li>The obsolete {{domxref("BasicCardRequest.supportedTypes")}} property is no longer supported by the Payment Request API; instead of requiring the web app or site to figure out what type of card is being used, it's now the server's job to deal with it ({{bug(1504032)}}).</li> +</ul> + +<h3 id="安全">安全</h3> + +<p><em>无变化。</em></p> + +<h4 id="移除_7">移除</h4> + +<h3 id="插件">插件</h3> + +<p><em>无变化。</em></p> + +<h4 id="移除_8">移除</h4> + +<h3 id="其他">其他</h3> + +<p><em>无变化。</em></p> + +<h4 id="移除_9">移除</h4> + +<h2 id="为附加组件开发者带来的改变">为附加组件开发者带来的改变</h2> + +<h3 id="API_变化">API 变化</h3> + +<h4 id="移除_10">移除</h4> + +<h3 id="Manifest_变化">Manifest 变化</h3> + +<h4 id="移除_11">移除</h4> + +<h2 id="参阅">参阅</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-CA/versions/65/">Site compatibility for Firefox 65</a></li> +</ul> + +<h2 id="更早期的版本">更早期的版本</h2> + +<p>{{Firefox_for_developers(65)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/68/index.html b/files/zh-cn/mozilla/firefox/releases/68/index.html new file mode 100644 index 0000000000..621bd205fb --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/68/index.html @@ -0,0 +1,240 @@ +--- +title: 为开发者的 Firefox 68 文档 +slug: Mozilla/Firefox/Releases/68 +translation_of: Mozilla/Firefox/Releases/68 +--- +<p>{{FirefoxSidebar}}</p> + +<p class="summary">本篇文章将提供关于在Firefox 68版本中,会影响到开发人员的更新的信息。Firefox 68版本发布于2019年7月9日。</p> + +<h2 id="面向开发者的变更">面向开发者的变更</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<h4 id="浏览器网页控制台">浏览器/网页控制台</h4> + +<ul> + <li>现在网页控制台会展现更多关于CSS警告的信息, 其中包括使用该规则的DOM元素的节点列表 ({{bug(1093953)}})。</li> + <li>您可以在网页控制台中使用常规的表达式来过滤内容({{bug(1441079)}})。</li> + <li>现在浏览器控制台允许您通过设置勾选或不勾选名为“显示内容消息”的复选框来显示或隐藏来自内容进程的消息({{bug(1260877)}})。</li> +</ul> + +<h4 id="JavaScript_调试器">JavaScript 调试器</h4> + +<ul> + <li>您现在可以在调试器中通过点击 <kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>F</kbd> (Windows or Linux) 或 <kbd>Shift</kbd> + <kbd>Cmd</kbd> + <kbd>F</kbd> (macOS)在当前项目的所有文件进行 <a href="/en-US/docs/Tools/Debugger/How_to/Search#Searching_in_all_files">搜索</a> ({{bug(1320325)}})。</li> +</ul> + +<h4 id="网络监视器">网络监视器</h4> + +<ul> + <li>网络监视器的 <a href="/en-US/docs/Tools/Network_Monitor/request_list#Filtering_requests">请求列表(request list)</a> 现在允许您封锁特定的URL地址 ({{bug(1151368)}})。</li> + <li>您现在不需要通过编辑方法、URL、参数和页眉的方式,而是可以通过使用在内容目录的 <a href="/en-US/docs/Tools/Network_Monitor/request_list#Context_menu">“重新发送(Resend)”</a> 命令,来重新发送一个网络请求 ({{bug(1422014)}})。</li> + <li>网络监视器内容目录里的 <a href="https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_details#Headers">“页眉(Headers)”</a> 标签现在允许您以JSON格式,复制全部或部分页眉信息到剪切板 ({{bug(1442249)}})。</li> +</ul> + +<h4 id="页面查看器">页面查看器</h4> + +<ul> + <li>一个允许您切换任何打印媒体查询 (print media queries) 显示的按钮已被添加页面查看器的<a href="/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_CSS#Examine_CSS_rules"> “规则仪表盘(rules panel)”</a> ({{bug(1534984)}})。</li> + <li> <a href="/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts">“字体仪表盘(fonts panel)”</a> 现在已包括一个可以调整<code>字母间距</code>的滑条 ({{bug(1536237)}}).</li> + <li>一个警告标志会出现在包含无效值的、不被支持的CSS属性或规则, 以帮助您了解为何某个特定的风格没有被渲染 ({{bug(1306054)}})。</li> +</ul> + +<h4 id="存储查看器">存储查看器</h4> + +<ul> + <li>您现在可以通过选中在存储查看器的项目并点击退格键来 <a href="/en-US/docs/Tools/Storage_Inspector#Local_storage_Session_storage">删除本地和对话期存储</a> 词目 ({{bug(1522893)}})。</li> +</ul> + +<h4 id="其它">其它</h4> + +<ul> + <li><a href="/en-US/docs/Tools/Accessibility_inspector">访问性查看器</a> 现在包含了一个新的 “<em>检查问题(Check for issues</em>)” 的特性, 其中包括很多可以高亮显示您的网页的访问性问题的检查工具。第一个可用的检查是<em>对比 (contrast)</em>, 用于突出颜色对比问题。</li> + <li>在 <a href="/en-US/docs/Tools/about:debugging">about:debugging</a> 页面的控制内部拓展可视性(系统附加组件和隐藏拓展)的偏好已由 <code>devtools.aboutdebugging.showSystemAddons</code> 变为 <code>devtools.aboutdebugging.showHiddenAddons</code> ({{bug(1544372)}}).</li> + <li><a href="/en-US/docs/Tools/Responsive_Design_Mode">响应设计模式(Responsive design mode</a>)已被重新设计— <em>设备设置</em> 对话框 (device selection menu > <em>Edit List...</em>) 现在使用起来更加直观简单 ({{bug(1487857)}})。</li> +</ul> + +<h4 id="移除">移除</h4> + +<ul> + <li>"Enable add-on debugging" 复选框已从 <a href="/en-US/docs/Tools/about:debugging">about:debugging</a> 页面移除 ({{bug(1544813)}})。</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>如果文本轨迹包含媒体元素,那么{{HTMLElement("track")}} 元素 — 由 {{domxref("HTMLTrackElement")}} 展现— 现在会收到除了{{domxref("TextTrack")}} 它本身外,{{domxref("HTMLTrackElement.cuechange_event", "cuechange")}} 事件({{bug(1548731)}})。</li> + <li>尽管有不同的表现,{{htmlelement("link")}} 元素已重新支持 <code>disabled</code> 属性。 当 <code>disabled</code> 被设定在一个连同<code>rel="stylesheet"</code> 的 <code><link></code> 元素 , 引用的样式表不会在页面加载时被加载, 当 <code>disabled</code> 属性被改变为 <code>false</code> 或移除时,该样表会被加载 ({{bug(1281135)}})。</li> +</ul> + +<h4 id="移除_2"> 移除</h4> + +<ul> + <li>不再支持 <code><a href="/en-US/docs/Web/HTML/Element/meta"><meta http-equiv="set-cookie"></a></code> ({{bug(1457503)}})。</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li><a href="/en-US/docs/Web/CSS/CSS_Scroll_Snap">CSS Scroll Snapping</a> has been updated to the latest version of the specification ({{bug(1312163)}}) and ({{bug(1544136)}}), this includes: + + <ul> + <li>The <code>scroll-padding</code> properties ({{bug(1373832)}})</li> + <li>The <code>scroll-margin</code> properties ({{bug(1373833)}})</li> + <li>{{CSSxRef("scroll-snap-align")}} ({{bug(1373835)}})</li> + </ul> + </li> + <li>The {{CSSxRef("-webkit-line-clamp")}} property has been implemented for compatibility with other browsers ({{bug(866102)}}).</li> + <li>Support has been added for the {{CSSxRef("::marker")}} pseudo-element ({{bug(205202)}}) and animation for <code>::marker</code> pseudos ({{bug(1538618)}})</li> + <li>We changed {{CSSxRef("currentColor")}} to be a computed value (except for the {{cssxref("color")}} property) ({{bug(760345)}}).</li> + <li>Support has been fixed for the <code>ch</code> length unit so it now matches the spec (fallback for no '0' glyph, vertical metrics) ({{bug(282126)}})</li> + <li>The {{CSSxRef("counter-set")}} property has been implemented. ({{bug(1518201)}}).</li> + <li>We now implement list numbering using a built-in "list-item" counter; this fixes list numbering bugs ({{bug(288704)}}).</li> + <li>Selector matching and parsing support has been implemented for <code><a href="/en-US/docs/Web/CSS/::part">::part()</a></code> ({{bug(1545430)}}) and ({{bug(1545425)}}).</li> + <li><a href="/en-US/docs/Web/CSS/CSS_Transforms">CSS Transforms</a> are now supported in indirectly rendered things e.g.) {{SVGElement("mask")}}, {{SVGElement("marker")}}, {{SVGElement("pattern")}}, {{SVGElement("clipPath")}} ({{bug(1323962)}}).</li> + <li> + <p>While we're keeping the prefixed versions of the various gradient properties ({{cssxref("linear-gradient")}}, {{cssxref("radial-gradient")}}, and {{cssxref("repeating-radial-gradient")}} available for compatibility reasons, we have revised how they're parsed so that they're handled much more like the non-prefixed versions. This means that certain existing styles won't work correctly.</p> + + <p>In particular, the complicated syntax taking both an angle and a position will no longer work, and the <code>to</code> keyword in the <code><side-or-corner></code> parameter is not required for the prefixed gradient properties. You are encouraged to use the standard, non-prefixed gradient properties instead, as they're now widely supported ({{bug(1547939)}}).</p> + </li> +</ul> + +<h4 id="Removals">Removals</h4> + +<ul> + <li>{{CSSxRef("scroll-snap-coordinate")}}, {{CSSxRef("scroll-snap-destination")}}, {{CSSxRef("scroll-snap-type-x")}} and {{CSSxRef("scroll-snap-type-y")}} have been removed.</li> + <li>The {{CSSxRef("scroll-snap-type")}} property has become a longhand, so the old shorthand syntax like <code>scroll-snap-type:mandatory</code> will stop working. See the <a href="https://www.fxsitecompat.com/en-CA/docs/2019/legacy-css-scroll-snap-syntax-support-has-been-dropped/">Firefox Site Compatability</a> note.</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<p><em>No changes.</em></p> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>The new {{jsxref("BigInt")}} primitive is enabled by default ({{bug(1527902)}}).</li> + <li>String generic methods have been removed ({{bug(1222552)}}). See the <a href="/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_String_generics">deprecation warning</a> for more information.</li> +</ul> + +<h3 id="APIs">APIs</h3> + +<h4 id="CSS_Object_Model_CSSOM">CSS Object Model (CSSOM)</h4> + +<ul> + <li>The legacy {{domxref("CSSStyleSheet.rules", "rules")}} property and {{domxref("CSSStyleSheet.addRule", "addRule()")}} and {{domxref("CSSStyleSheet.removeRule", "removeRule()")}} methods have been added to the {{domxref("CSSStyleSheet")}} interface. These were introduced by Internet Explorer 9 and have never managed to quite be stamped out, so they have been added to improve compatibility with the small percentage of sites that still use them ({{bug(1545823)}}).</li> +</ul> + +<h4 id="DOM">DOM</h4> + +<ul> + <li>The <a href="/en-US/docs/Web/API/Visual_Viewport_API">Visual Viewport API</a> has now been enabled by default on Android ({{bug(1512813)}}). Adding this API to desktop versions of Firefox is being tracked in {{bug(1551302)}}.</li> + <li>The {{domxref("Window")}} feature <code><a href="/en-US/docs/Web/API/Window/open#noreferrer">noreferrer</a></code> is now supported; if specified, the new window's content is loaded without sharing the hostname, IP address, URL, or other identifying information about the host device ({{bug(1527287)}}).</li> + <li>The {{domxref("HTMLImageElement.decode", "decode()")}} method on <code>HTMLImageElement</code> is now implemented. This can be used to trigger loading and decoding of an image prior to adding it to the DOM ({{bug(1501794)}}).</li> + <li>{{domxref("XMLHttpRequest")}} has been updated to no longer accept the non-standard <code>moz-chunked-arraybuffer</code> value for {{domxref("XMLHttpRequest.responseType", "responseType")}}. Code still using it should be updated to <a href="/en-US/docs/Web/API/Streams_API/Using_readable_streams#Consuming_a_fetch_as_a_stream">use the Fetch API as a stream</a> ({{bug(1120171)}}).</li> + <li><code>XMLHttpRequest</code> now outputs a warning to console if you perform a synchronous request while handling an {{domxref("Window.unload_event", "unload")}}, {{domxref("Window.beforeunload_event", "beforeunload")}}, or {{domxref("Window.pagehide_event", "pagehide")}} event ({{bug(980902)}}).</li> + <li>The {{domxref("Document.cookie", "cookie")}} property has moved from the {{domxref("HTMLDocument")}} interface to the {{domxref("Document")}} interface, allowing documents other than {{Glossary("HTML")}} to use cookies ({{bug(144795)}}).</li> + <li>The {{domxref("HTMLElement.focus()")}} and {{domxref("SVGElement.focus()")}} methods now accept an optional object that may contain a boolean <code>preventScroll</code> option specifying whether or not to block the browser from scrolling the newly-focused element into view ({{bug(1374045)}}).</li> +</ul> + +<h4 id="DOM_events">DOM events</h4> + +<ul> + <li><a href="/en-US/docs/Mozilla/Firefox_for_Android">Firefox for Android</a> no longer incorrectly sends a {{domxref("Window.resize_event", "resize")}} event until after the first frame is painted; this improves web compatibility with sites that don't expect this event to occur ({{bug(1528052)}}).</li> + <li>The dispatching of events for non-primary mouse buttons has been made to more closely follow the specification; the {{domxref("Element.click_event", "click")}} event is no longer sent when non-primary buttons are clicked, instead using {{domxref("Element.auxclick_event", "auxclick")}}. In addition, {{domxref("Element.dblclick_event", "dblclick")}} no longer fires for non-primary buttons ({{bug(1379466)}}).</li> + <li>The proprietary {{domxref("MouseEvent.mozPressure")}} property has been deprecated, and will now trigger a warning in the console ({{bug(1165211)}}).</li> +</ul> + +<h4 id="Media_Web_Audio_and_WebRTC">Media, Web Audio, and WebRTC</h4> + +<ul> + <li>Due to changes in the Google Play store's policies, starting with Firefox 68 for Android, the OpenH264 codec used to handle AVC/H.264 video in WebRTC connections can no longer be downloaded and installed. Therefore, fresh installs of Firefox on Android devices no longer support AVC in WebRTC calls. If you upgrade from earlier versions of Firefox and already have the codec downloaded, it will continue to work. This does <em>not</em> affect other platforms. For more details, see <a href="https://support.mozilla.org/en-US/kb/firefox-android-openh264">this article on SUMO</a> or {{bug(1548679)}}.</li> + <li>WebRTC has been updated to recognize that a <code>null</code> candidate passed into the {{domxref("RTCPeerConnection.icecandidate", "icecandidate")}} event handler, indicating the receipt of a candidate, instead indicates that there are no further candidates coming; when this happens the ICE gathering ({{domxref("RTCPeerConnection.iceGatheringState", "iceGatheringState")}}) state reaches <code>complete</code> ({{bug(1318167)}}).</li> + <li>The {{domxref("RTCRtpReceiver")}} methods {{domxref("RTCRtpReceiver.getContributingSources", "getContributingSources()")}} and {{domxref("RTCRtpReceiver.getSynchronizationSources", "getSynchronizationSources()")}} now support video tracks; previously they only worked on audio ({{bug(1534466)}}).</li> + <li>The Web Audio API {{domxref("MediaStreamTrackAudioSourceNode")}} interface is now supported, as is the method {{domxref("AudioContext.createMediaStreamTrackSource()")}} ({{bug(1324548)}}).</li> + <li>{{domxref("RTCDataChannel.negotiated")}} is now implemented ({{bug(1529695)}}).</li> + <li>The {{domxref("MediaStreamAudioSourceNode.MediaStreamAudioSourceNode", "MediaStreamAudioSourceNode()")}} constructor has been updated to match the current specification's definition that the "first audio track" in the stream is the track whose ID comes first in lexicographical order ({{bug(1324548)}}).</li> + <li> + <p>{{domxref("MediaDevices.getUserMedia", "getUserMedia()")}} may no longer be used from a non-secure context; attempting to do so now throws a <code>NotAllowedError</code> exception. Secure contexts are those loaded using HTTPS, those located using the <code>file:///</code> scheme, and those loaded from <code>localhost</code>. For now, if you must, you can re-enable the ability to perform insecure calls to <code>getUserMedia()</code> by setting the preference <code>media.getusermedia.insecure.enabled</code> to <code>true</code> ({{bug(1335740)}}).</p> + + <div class="blockIndicator note"> + <p><strong>Note:</strong> In the future, Firefox will also remove the {{domxref("navigator.mediaDevices")}} property on insecure contexts, preventing all access to the {{domxref("MediaDevices")}} APIs. <strong>This is already the case in Nightly builds.</strong></p> + </div> + </li> +</ul> + +<h4 id="Removals_2">Removals</h4> + +<ul> + <li>Removed the non-standard {{DOMxRef("XMLDocument.load()")}} method ({{bug(332175)}}).</li> + <li>Removed the non-standard {{DOMxRef("XMLDocument.async")}} property ({{bug(1328138)}}).</li> + <li>The {{domxref("RTCIceCredentialType")}} <code>token</code> value has been removed ({{bug(1529595)}}).</li> +</ul> + +<h3 id="HTTP">HTTP</h3> + +<ul> + <li>The <a href="/en-US/docs/Web/HTTP">HTTP</a> {{HTTPHeader("Clear-Site-Data")}} header no longer supports the <code>executionContexts</code> directive. This was removed due to problems with interactions between interconnections among different kinds of data at different points in the navigation process and the way the specification is designed. It <a href="https://github.com/w3c/webappsec-clear-site-data/issues/59">has been proposed</a> that this directive be removed from the specification for this reason, among others ({{bug(1548034)}}).</li> +</ul> + +<h4 id="Removals_3">Removals</h4> + +<ul> + <li>The {{HTTPHeader("Content-Security-Policy")}} directive <code>require-sri-for</code> is no longer supported due to concerns about its standardization status. It was previously available only behind a preference, which was off by default ({{bug(1386214)}}).</li> +</ul> + +<h3 id="Security">Security</h3> + +<ul> + <li>Due to <a href="https://www.mozilla.org/en-US/security/advisories/mfsa2019-21/#CVE-2019-11730">CVE-2019-11730: Same-origin policy treats all files in a directory as having the same-origin</a>, changes have been made so that Firefox now treats files in the same directory as being from different origins. This has a number of side-effects on what will work in documents loaded via file:// URLs (see {{bug("file-fallout")}} for useful background research). For example, workers can no longer be loaded.</li> +</ul> + +<h3 id="WebDriver_conformance_Marionette">WebDriver conformance (Marionette)</h3> + +<h4 id="Bug_fixes">Bug fixes</h4> + +<ul> + <li>If <code>WebDriver:SwitchToWindow</code> changes the selection to a different window it now waits for its <code>focus</code> and <code>activate</code> events before returning ({{bug(1335085)}}).</li> + <li>Fixed the <code>TypeError: this.tabModal is null</code> failure, which sometimes appeared when interacting with modal dialogs or user prompts ({{bug(1538782)}})</li> +</ul> + +<h4 id="Other">Other</h4> + +<ul> + <li>Disabled the feature to force unloading background tabs on low memory conditions, to prevent top-level browser contexts from magically disappearing ({{bug(1553748)}}).</li> + <li>Disabled priviledged content processes that caused HTTP authentication dialogs not to appear when navigating to a website after opening a new tab ({{bug(1558763)}}).</li> +</ul> + +<h3 id="Plugins">Plugins</h3> + +<p><em>No changes.</em></p> + +<h2 id="Changes_for_add-on_developers">Changes for add-on developers</h2> + +<h3 id="API_changes">API changes</h3> + +<ul> + <li>The The <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/register">proxy.register()</a></code> and <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/unregister">proxy.unregister()</a></code> functions have been deprecated and will be removed from Firefox 71 ({{bug(1545811)}}).</li> + <li>A <code>boolean</code> flag, <code>incognito</code>, has been added to the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/RequestDetails">proxy.RequestDetails</a>. object. When <code>true</code>, it indicates that this was a private browsing request ({{bug(1545163)}}).</li> + <li>The <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/RequestFilter">webRequest.RequestFilter</a> parameters can include an incognito parameter. If provided, requests that do not match the incognito state (<code>true</code> or <code>false</code>) will be filtered out ({{bug(1548177)}}).</li> + <li>A <code>string</code> value, <code>cookieStoreId</code>, representing the cookie store ID of the current context, has been added to the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/RequestDetails">proxy.RequestDetails</a>. object ({{bug(1545420)}}).</li> + <li>When an add-on attempts to add a bookmark folder to the root folder, the resulting error message is now much more intuitive ({{bug(1512171)}}).</li> + <li>The promise returned by <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/duplicate">browser.tabs.duplicate()</a></code> now resolves immediately, before the tabs are completely loaded ({{bug(1394376)}}).</li> + <li>Support has been added for chrome.storage.managed, allowing web extension settings to be implemented via enterprise policy ({{bug(1230802)}}).</li> + <li>There is now a Group Policy option to blacklist <em>all</em> extensions except the ones that have been whitelisted ({{bug(1522823)}}).</li> +</ul> + +<h3 id="显著变更">显著变更</h3> + +<p><em>无变更。</em></p> + +<h2 id="还可以看看">还可以看看</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-CA/versions/68/">Site compatibility for Firefox 68</a></li> +</ul> + +<h2 id="更早的版本">更早的版本</h2> + +<p>{{Firefox_for_developers(67)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/69/index.html b/files/zh-cn/mozilla/firefox/releases/69/index.html new file mode 100644 index 0000000000..88f1c741aa --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/69/index.html @@ -0,0 +1,185 @@ +--- +title: 面向开发者的Firefox 69 +slug: Mozilla/Firefox/Releases/69 +translation_of: Mozilla/Firefox/Releases/69 +--- +<p>{{FirefoxSidebar}}</p> + +<p class="summary">这篇文章将会围绕Firefox 69对于开发者产生的影响展开。</p> + +<p class="summary">Firefox 69 发布于2019年9月3日。</p> + +<h2 id="对于web开发者的变化">对于web开发者的变化</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<h4 id="Debugger调试器">Debugger(调试器)</h4> + +<ul> + <li><a href="/en-US/docs/Tools/Debugger/Set_event_listener_breakpoints">Event Listener Breakpoints(事件监听断点)</a> 让你诊断中的代码执行的页面响应浏览器事件。你可以选择特殊的类型,比如 <code>click(点击)</code> 或者 <code>keydown(按下键盘)</code>, 亦或所有类型的事件,诸如所有的鼠标输入事件。 ({{bug(1526082)}}).</li> + <li>调试其中的 <a href="https://developer.mozilla.org/en-US/docs/Tools/Debugger/UI_Tour#Source_list_pane">源列表窗格</a> 所显示的脚本可以通过 <em>Download file(下载文件)</em> 内容菜单选项来完成保存。 ({{bug(888161)}}).</li> + <li>在调试期的源列表窗格中,被加载的扩展会根据他们的名字被逐一罗列出来,而非是他们的UUID {bug(1486416)}}),使它更为容易地找你你要调试的扩展代码</li> + <li>通过延迟加载脚本,调试器的加载速率得到了明显地改善{{bug(1527488)}}).</li> +</ul> + +<h4 id="Console控制台">Console(控制台)</h4> + +<ul> + <li><a href="/en-US/docs/Tools/Browser_Console">浏览器控制台</a> 的消息来自于 <a href="/en-US/docs/Mozilla/Firefox/Privacy/Tracking_Protection">tracking protection errors(跟踪保护错误)</a>, <a href="/en-US/docs/Web/HTTP/CSP">CSP errors( ContentSecurityPolicy 内容安全策略错误 )</a>, and <a href="/en-US/docs/Web/HTTP/CORS/Errors">CORS errors( CrossOriginResourceShring 跨域资源共享错误 )</a> 他们会被自动分组以此可以减少来自重复的阻塞资源和存储访问的警告。 ({{bug(1522396)}}).</li> + <li>所有在控制台可见的日志都可以通过<strong>内容菜单列表(鼠标右击可见)</strong>被保存成一份文件或者复制到剪贴板后经由新的<em>消息可视化界面</em> (复制到文本编辑器查看)。({{bug(1517728)}}).</li> + <li>控制栏的高度现在调整到了在垂直方向上一行就可以完成。({{bug(972530)}}).</li> + <li>我们可以在控制台隐藏来自内容的消息以便更多的关注Firefox的用户界面日志({{bug(1523842)}}).</li> +</ul> + +<h4 id="Network网络">Network(网络)</h4> + +<ul> + <li>由于<a href="/en-US/docs/Web/HTTP/CSP">CSP</a> 或者 <a href="/en-US/docs/Web/Security/Mixed_content">Mixed Content</a> 所阻塞的资源现在可以在<strong>网络面板</strong>上得到显示,并且对其缘由有着细节展示。 ({{bug(1556451)}}).</li> + <li>在<strong>网络面板</strong>上,一个新的且可选择的<em>URL</em>栏能够为我们展示你资源所有的全部的URL ({{bug(1341155)}}).</li> +</ul> + +<h4 id="Inspector查看器">Inspector(查看器)</h4> + +<ul> + <li>当你的光标悬停在<a href="/en-US/docs/Tools/Page_Inspector">页面选择器</a>中的某个元素,现在信息栏将会显示这个元素是一个弹性容器还是一个弹性项目的事实。 ({{bug(1521188)}}).</li> +</ul> + +<h4 id="Remote_debugging远程调试">Remote debugging(远程调试)</h4> + +<ul> + <li>对于我们的移动端web开发者,我们已经将远程调试从旧的WebIDE迁移到了重新设计的 <a href="/en-US/docs/Tools/about:debugging">about:debugging</a>上, 这样会使得通过USB调试远程设备上的 <a href="https://hacks.mozilla.org/2019/06/geckoview-in-2019/">GeckoView</a> 的体验得到改善。 ({{bug(1462208)}}).</li> +</ul> + +<h4 id="General日常">General(日常)</h4> + +<ul> + <li>开发工具的面板布局已经为了迎合流行元素而做出了改动。{{bug(1558630)}}).</li> +</ul> + +<h3 id="HTML">HTML</h3> + +<ul> + <li>In order to align more closely to the specification, the text track associated with a {{HTMLElement("track")}} element no longer loads the WebVTT file containing the text cues if the element is created in its default <code>disabled</code> {{domxref("TextTrack.mode", "mode")}}. To access or manipulate the cues when the <code>mode</code> is <code>disabled</code>, change the <code>mode</code> to either <code>started</code> or <code>hidden</code>; this will trigger loading of the WebVTT data ({{bug(1550633)}}).</li> +</ul> + +<h4 id="Removals"> Removals</h4> + +<ul> + <li>The HTML {{HTMLElement("keygen")}} element has been removed from Firefox. It was deprecated some time ago, and its purpose has generally been supplanted by other technologies ({{bug(1315460)}}).</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>We implemented the <code>break-spaces</code> value of the {{cssxref("white-space")}} property ({{bug(1351432)}}).</li> + <li>The SVG geometry attributes (such as {{SVGAttr("width")}} and {{SVGAttr("height")}}) can now also be defined as CSS properties ({{bug(1383650)}}).</li> + <li>The {{cssxref("::cue")}} selector — used to style the captions ("cues") displayed by <a href="/en-US/docs/Web/API/WebVTT_API">WebVTT</a> — now enforces the limitations on which CSS properties may be used within cues, as per the specification ({{bug(1321488)}}).</li> + <li>We've restricted the properties that may apply to {{cssxref("::marker")}} as per the specification ({{bug(1552578)}})</li> + <li>The {{cssxref("overflow-block")}} and {{cssxref("overflow-inline")}} properties have been implemented ({{bug(1470695)}}).</li> + <li>We added the ability to test for support of a selector when using CSS Feature Queries ({{cssxref("@supports")}}), with the <code>selector()</code> method ({{bug(1513643)}}).</li> + <li>The {{cssxref("user-select")}} property — which specifies whether or not the user is able to select text in the affected element — has been unprefixed ({{bug(1492739)}}).</li> + <li>We implemented local-specific casing behavior for Lithuanian ({{bug(1322992)}}), <a href="/en-US/docs/Web/CSS/text-transform#lowercase_lithuanian">as seen in this example</a>.</li> + <li>We've implemented the {{cssxref("line-break")}} property of CSS Text ({{bug(1011369)}} and {{bug(1531715)}}).</li> + <li>The {{cssxref("contain")}} property — which allows developers to define that an element and its contents are mostly independent of the rest of the DOM tree — got implemented {{bug(1487493)}}.</li> +</ul> + +<h3 id="SVG">SVG</h3> + +<ul> + <li>We've added support for gzip-compressed SVG-in-OpenType ({{bug(1359240)}}).</li> + <li>The {{domxref("SVGGeometryElement.isPointInFill()")}} and {{domxref("SVGGeometryElement.isPointInStroke()")}} methods have been implemented ({{bug(1325319)}}).</li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li><a href="/en-US/docs/Web/JavaScript/Reference/Classes#Field_declarations">Public class fields</a> are enabled by default ({{bug(1555464)}}). See also <a href="/en-US/docs/Web/JavaScript/Reference/Classes/Class_fields">Class fields</a> for more information.</li> + <li>The promise rejection events <code><a href="/en-US/docs/Web/API/Window/unhandledrejection_event">unhandledrejection</a></code> and <code><a href="/en-US/docs/Web/API/Window/rejectionhandled_event">rejectionhandled</a></code> are now enabled by default ({{bug(1362272)}}). To learn more about how these work, see {{SectionOnPage("/en-US/docs/Web/JavaScript/Guide/Using_promises", "Promise rejection events")}}.</li> +</ul> + +<h3 id="HTTP">HTTP</h3> + +<ul> + <li>The HTTP headers {{HTTPHeader("Access-Control-Expose-Headers")}}, {{HTTPHeader("Access-Control-Allow-Methods")}}, and {{HTTPHeader("Access-Control-Allow-Headers")}} now accept a wildcard value "<code>*</code>" for requests without credentials ({{bug(1309358)}}). This change has also been uplifted to Firefox 68 ESR.</li> +</ul> + +<h3 id="APIs">APIs</h3> + +<h4 id="New_APIs">New APIs</h4> + +<ul> + <li>The <a href="/en-US/docs/Web/API/Resize_Observer_API">Resize Observer API</a> is supported by default ({{bug(1543839)}}).</li> + <li>The Microtask API ({{domxref("WindowOrWorkerGlobalScope.queueMicrotask()")}}) has been implemented ({{bug(1480236)}}).</li> +</ul> + +<h4 id="DOM">DOM</h4> + +<ul> + <li>The {{domxref("DOMMatrix")}}, {{domxref("DOMPoint")}}, and related objects are now supported in workers ({{bug(1420580)}}).</li> + <li>The <code>pageX</code> and <code>pageY</code> properties have been moved from {{domxref("UIEvent")}} to {{domxref("MouseEvent")}}, for better spec compliance ({{bug(1178763)}}). These properties are no longer exposed to the {{domxref("CompositionEvent")}}, {{domxref("FocusEvent")}}, {{domxref("InputEvent")}}, {{domxref("KeyboardEvent")}}, and {{domxref("TouchEvent")}} interfaces, which all inherit from <code>UIEvent</code>.</li> + <li>The {{domxref("Blob.text()")}}, {{domxref("Blob.arrayBuffer()")}}, and {{domxref("Blob.stream()")}} methods are now implemented ({{bug(1557121)}}).</li> + <li>{{domxref("DOMMatrix.fromMatrix()")}} has been implemented ({{bug(1560462)}}).</li> + <li>We now support the six-parameter version of the {{domxref("DOMMatrix.scale()")}} method ({{bug(1397945)}}).</li> + <li>The arguments for {{domxref("DOMMatrix.translate()")}}, {{domxref("DOMMatrix.skewX()")}}, and {{domxref("DOMMatrix.skewY()")}} are now all optional, as per spec ({{bug(1397949)}}).</li> + <li>The {{domxref("navigator.userAgent")}}, {{domxref("navigator.platform")}}, and {{domxref("navigator.oscpu")}} properties no longer reveal whether a user is running 32-bit Firefox on a 64-bit OS ({{bug(1559747)}}). They now say <code>Linux x86_64</code> instead of <code>Linux i686 on x86_64</code>, and <code>Win64</code> instead of <code>WOW64</code>.</li> + <li>The remaining methods of {{domxref("HTMLDocument")}} have been moved to {{domxref("Document")}}. This should have no appreciable impact on your work in most cases. In particular, the {{domxref("document.close", "close()")}}, {{domxref("document.open", "open()")}}, and {{domxref("document.write", "write()")}} methods have been moved. So have the various editor related methods, including {{domxref("document.execCommand", "execCommand()")}} as well as various properties ({{bug(1549560)}}).</li> + <li> + <p>We have implemented {{domxref("AbstractRange")}} and {{domxref("StaticRange")}} ({{bug(1444847)}}).</p> + </li> +</ul> + +<h4 id="Media_Web_Audio_and_WebRTC">Media, Web Audio, and WebRTC</h4> + +<ul> + <li>For improved user security, and in-keeping with the latest versions of the <a href="/en-US/docs/Web/API/Media_Streams_API">Media Capture and Streams</a> specification, the {{domxref("navigator.mediaDevices")}} property is no longer present if the context is insecure. To use {{domxref("MediaDevices.getUserMedia", "getUserMedia()")}}, {{domxref("MediaDevices.getDisplayMedia", "getDisplayMedia()")}}, {{domxref("MediaDevices.enumerateDevices", "enumerateDevices()")}}, and so forth, be sure your content is loaded using {{Glossary("HTTPS")}} ({{bug(1528031)}}).</li> + <li>The Web Audio API's {{domxref("AudioParam.value")}} property now returns the actual value of the property at the current time, taking into account all scheduled or gradiated value changes. Previously, Firefox only returned the most recent explicitly-set value (as through using the <code>value</code> setter) ({{bug(893020)}}).</li> + <li>We've updated {{domxref("MediaStreamAudioSourceNode")}} to use the new, lexicographical, ordering for tracks. Previously, track ordering was up to the individual browser, and could even change arbitrarily. In addition, attempting to create a <code>MediaStreamAudioSourceNode</code> using a stream that has no audio tracks now throws an <code>InvalidStateError</code> exception ({{bug(1553215)}}).</li> + <li>The {{domxref("MediaTrackSettings.facingMode", "facingMode")}}, {{domxref("MediaTrackSettings.deviceId", "deviceId")}}, and {{domxref("MediaTrackSettings.groupId", "groupId")}} settings are now included as members of the {{domxref("MediaTrackSettings")}} object returned by calls to {{domxref("MediaStreamTrack.getSettings()")}} ({{bug(1537986)}}).</li> +</ul> + +<h4 id="Removals_2">Removals</h4> + +<ul> + <li>The {{domxref("DOMMatrix.scaleNonUniformSelf()")}} method has been removed ({{bug(1560119)}}).</li> +</ul> + +<h3 id="WebDriver_conformance_Marionette">WebDriver conformance (Marionette)</h3> + +<h4 id="Other">Other</h4> + +<ul> + <li> + <p>Marionette now dynamically handles the opening and closing of modal dialogs and user prompts ({{bug(1477977)}}), which also means that multiple open prompts will be handled ({{bug(1487358)}}).</p> + </li> + <li> + <p>Tracking protection and DOM push features are now disabled by default to avoid the removal of parts of the DOM, and extra notifications ({{bug(1542244)}}).</p> + </li> + <li> + <p>Automatic unloading of background tabs if Firefox runs into a low memory condition is now disabled — this badly interacts with automation when switching between tabs ({{bug(1553748)}}).</p> + </li> +</ul> + +<h2 id="Changes_for_add-on_developers">Changes for add-on developers</h2> + +<h3 id="API_changes">API changes</h3> + +<ul> + <li>The <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/userScripts">UserScripts API</a> is now enabled by default.</li> + <li>The <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/topSites/get">topSites.get()</a></code> method now has new options available — <code>includePinned</code> and <code>includeSearchShortcuts</code> ({{bug(1547669)}}).</li> +</ul> + +<h3 id="Other_changes">Other changes</h3> + +<ul> + <li>There are now <a href="https://github.com/mozilla/policy-templates/blob/master/README.md#extensionsettings">Group Policy options</a> to blacklist all extensions except the ones that have been whitelisted ({{bug(1522823)}}).</li> +</ul> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-CA/versions/69/">Site compatibility for Firefox 69</a></li> +</ul> + +<h2 id="Older_versions">Older versions</h2> + +<p>{{Firefox_for_developers(68)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/78/index.html b/files/zh-cn/mozilla/firefox/releases/78/index.html new file mode 100644 index 0000000000..1c28b03a7a --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/78/index.html @@ -0,0 +1,116 @@ +--- +title: 对于开发人员的Firefox 78 +slug: Mozilla/Firefox/Releases/78 +translation_of: Mozilla/Firefox/Releases/78 +--- +<p>{{FirefoxSidebar}}</p> + +<p class="summary">本文提供了有关Firefox 78中将影响开发人员的更改的信息。 Firefox 78发布于<a href="https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates/docs/">2020年6月30日</a>.</p> + +<p class="summary">另请参阅Firefox 78中的新增功能:<a href="https://hacks.mozilla.org/2020/06/new-in-firefox-78/">DevTools的改进,新的正则表达式引擎以及Mozilla hacks上大量的Web平台更新。</a></p> + +<h2 id="对于Web开发人员的更改">对于Web开发人员的更改</h2> + +<h3 id="开发者工具">开发者工具</h3> + +<h4 id="调试器">调试器</h4> + +<ul> + <li><span class="tlid-translation translation" lang="zh-CN"><span title="">现在,您可以从</span></span><a href="/en-US/docs/Tools/about:debugging#Connecting_to_a_remote_device">关于:调试</a><span class="tlid-translation translation" lang="zh-CN"><span title="">面板更改远程设备访问的URL。</span></span>({{bug("1617237")}})</li> + <li><span class="tlid-translation translation" lang="zh-CN"><span title="">现在,<a href="/en-US/docs/Tools/Debugger/UI_Tour">调试器</a>中的</span></span> <strong>禁用JavaScript</strong> <span class="tlid-translation translation" lang="zh-CN"><span title="">菜单项仅影响当前选项卡</span></span>,<span class="tlid-translation translation" lang="zh-CN"><span title="">并且在关闭“开发人员工具”后会重置。</span></span>({{bug("1640318")}})</li> + <li>如果在<a href="/en-US/docs/Tools/Debugger/UI_Tour#Scopes">作用域</a>中启用<strong>映射</strong>,则<a href="/en-US/docs/Tools/Debugger/Set_a_logpoint">日志点</a>可以将源映射代码中的变量名称映射回其原始名称。({{bug("1536857")}})</li> +</ul> + +<h4 id="网络监控器">网络监控器</h4> + +<ul> + <li>In the <a href="/en-US/docs/Tools/Network_Monitor/request_list#Network_request_columns">Network Monitor</a>, you can now resize the columns of the request list by dragging the column borders anywhere in the table. ({{bug("1618409")}})</li> + <li>The <a href="/en-US/docs/Tools/Network_Monitor/request_details">request details panel</a> in the Network Monitor has some UX improvements. ({{bug("1631302")}}, {{bug("1631295")}})</li> + <li>If a request was blocked, the <a href="/en-US/docs/Tools/Network_Monitor/request_list">request list</a> now shows the reason, such as an add-on, CSP, CORS, or Enhanced Tracking Protection. ({{bug("1555057")}}, {{bug("1445637")}}, {{bug("1556451")}})</li> +</ul> + +<h4 id="其他工具">其他工具</h4> + +<ul> + <li>The <a href="/en-US/docs/Tools/Accessibility_inspector">Accessibility</a> inspector is out of beta. You can use it to check for various accessibility issues on your site. ({{bug("1602075")}})</li> + <li>Uncaught promise errors now provide all details in the Console, including their name and stack. ({{bug("1636590")}})</li> +</ul> + +<h3 id="CSS">CSS</h3> + +<ul> + <li>The {{CSSxRef(":is", ":is()")}} and {{CSSxRef(":where", ":where()")}} pseudo-classes are now enabled by default ({{bug(1632646)}}).</li> + <li>The {{CSSxRef(":read-only")}} and {{CSSxRef(":read-write")}} pseudo-classes are now supported without prefixes ({{bug(312971)}}). + <ul> + <li>In addition, <code>:read-write</code> styles are no longer applied to disabled <code><a href="/en-US/docs/Web/HTML/Element/input"><input></a></code> and <code><a href="/en-US/docs/Web/HTML/Element/textarea"><textarea></a></code> elements, which was a violation of <a href="https://html.spec.whatwg.org/#selector-read-write">the HTML spec</a> ({{bug(888884)}}).</li> + </ul> + </li> +</ul> + +<h3 id="JavaScript">JavaScript</h3> + +<ul> + <li>The <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat">Intl.ListFormat</a></code> API is now supported ({{bug(1589095)}}).</li> + <li>The <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat">Intl.NumberFormat()</a></code> constructor has been extended to support new options specified in the <a href="https://github.com/tc39/proposal-unified-intl-numberformat">Intl.NumberFormat Unified API Proposal</a> ({{bug(1633836)}}). This includes among other things: + <ul> + <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#Scientific_engineering_or_compact_notations">Support for scientific notations</a></li> + <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#Unit_formatting">Unit</a>, <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#Currency_formatting">currency</a> and <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#Displaying_signs">sign display</a> formatting</li> + </ul> + </li> + <li>The {{JSxRef("RegExp")}} engine <a href="https://hacks.mozilla.org/2020/06/a-new-regexp-engine-in-spidermonkey/">has been updated</a> and now supports all new features introduced in ECMAScript 2018: + <ul> + <li><a href="/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Assertions">Lookbehind assertions</a> ({{bug(1225665)}})</li> + <li>{{JSxRef("RegExp.prototype.dotAll")}} ({{bug(1361856)}})</li> + <li><a href="/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes">Unicode property escapes</a> ({{bug(1361876)}})</li> + <li><a href="/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Ranges">Named capture groups</a> ({{bug(1362154)}})</li> + </ul> + </li> + <li>Due to a <a href="https://github.com/heycam/webidl/pull/357">WebIDL spec change</a> in mid-2020, we've <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag#toStringTag_available_on_all_DOM_prototype_objects">added a <code>Symbol.toStringTag</code> property to all DOM prototype objects</a> ({{bug(1277799)}}).</li> + <li>The garbage collection of {{jsxref("WeakMap")}} objects has been improved. <code>WeakMaps</code> are now marked incrementally ({{bug(1167452)}}).</li> +</ul> + +<h3 id="一些API">一些API</h3> + +<h4 id="DOM">DOM</h4> + +<ul> + <li>The {{DOMxRef("ParentNode.replaceChildren()")}} method has been implemented ({{bug(1626015)}}).</li> +</ul> + +<h4 id="服务工作者">服务工作者</h4> + +<ul> + <li><a href="https://www.mozilla.org/en-US/firefox/organizations/">Extended Support Releases (ESR)</a>: Firefox 78 is the first ESR release that supports <a href="/en-US/docs/Web/API/Service_Worker_API">Service workers</a> (and the <a href="/en-US/docs/Web/API/Push_API">Push API</a>). Earlier ESR releases had no support ({{bug(1547023)}}).</li> +</ul> + +<h3 id="Web组装">Web组装</h3> + +<ul> + <li><a href="https://hacks.mozilla.org/2019/11/multi-value-all-the-wasm/">Wasm Multi-value</a> is now supported, meaning that WebAssembly functions can now return multiple values, and instruction sequences can consume and produce multiple stack values ({{bug(1628321)}}).</li> + <li>WebAssembly now supports import and export of 64-bit integer function parameters (i64) using <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</a></code> from JavaScript ({{bug(1608770)}}).</li> +</ul> + +<h3 id="TLS_1.0和1.1已被移除">TLS 1.0和1.1已被移除</h3> + +<ul> + <li><span class="tlid-translation translation" lang="zh-CN"><span title="">所有浏览器都不再支持</span></span><a href="/en-US/docs/Web/Security/Transport_Layer_Security">传输层安全</a> (TLS) <span class="tlid-translation translation" lang="zh-CN"><span title="">协议的1.0和1.1版本。阅读</span></span><a href="https://hacks.mozilla.org/2019/05/tls-1-0-and-1-1-removal-update/">TLS 1.0和1.1删除更新</a><span class="tlid-translation translation" lang="zh-CN"><span title="">以获取先前的公告,以及如果受到影响应采取的措施</span></span> ({{bug(1643229)}}).</li> +</ul> + +<h2 id="对于附加组件开发人员的更改">对于附加组件开发人员的更改</h2> + +<ul> + <li>{{WebExtAPIRef("browsingData.removeCache")}} 和 {{WebExtAPIRef("browsingData.removePluginData")}} 现在支持按主机名删除。({{bug(1636784)}}).</li> + <li><span class="tlid-translation translation" lang="zh-CN"><span title="">使用</span></span><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/onRequest">proxy.onRequest</a></code><span class="tlid-translation translation" lang="zh-CN"><span title="">时,现在可以正确应用基于选项卡ID或窗口ID限制的过滤器。</span> <span title="">这对于希望仅在一个窗口中提供代理功能的加载项很有用。</span></span></li> + <li><span class="tlid-translation translation" lang="zh-CN"><span title="">现在,从“所有选项卡”下拉菜单中</span></span><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/onClicked">单击上下文菜单</a><span class="tlid-translation translation" lang="zh-CN"><span title="">即可传递适当的选项卡对象。</span> <span title="">过去,活动选项卡被错误地传递了。</span></span></li> + <li><span class="tlid-translation translation" lang="zh-CN"><span title="">当使用带有另存为选项的</span></span><code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/download">downloads.download</a></code><span class="tlid-translation translation" lang="zh-CN"><span title="">时,可以记住最近使用的目录。</span> <span title="">尽管此信息对开发人员用处不大,但对用户而言却非常方便。</span></span></li> +</ul> + +<h2 id="参见">参见</h2> + +<ul> + <li><a href="https://www.fxsitecompat.com/en-CA/versions/78/">Firefox 78的网站兼容性</a></li> +</ul> + +<h2 id="旧版本">旧版本</h2> + +<p>{{Firefox_for_developers(77)}}</p> diff --git a/files/zh-cn/mozilla/firefox/releases/index.html b/files/zh-cn/mozilla/firefox/releases/index.html new file mode 100644 index 0000000000..9f16917cdc --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/index.html @@ -0,0 +1,12 @@ +--- +title: 与Firefox开发者相关的发行说明 +slug: Mozilla/Firefox/Releases +tags: + - Firefox + - NeedsTranslation + - TopicStub +translation_of: Mozilla/Firefox/Releases +--- +<div>{{FirefoxSidebar}}</div><p>本页提供每个Firefox的版本的“与Firefox开发者相关的发行说明”文章的链接。这些日志文章可以让你查看每个Firefox版本增加了哪些功能和修复的错误。</p> + +<div class="multiColumnList">{{ListSubpages("",1,1,1)}}</div> diff --git a/files/zh-cn/mozilla/firefox/the_about_protocol/index.html b/files/zh-cn/mozilla/firefox/the_about_protocol/index.html new file mode 100644 index 0000000000..9b889c3338 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/the_about_protocol/index.html @@ -0,0 +1,163 @@ +--- +title: Firefox 与 "about" 协议 +slug: Mozilla/Firefox/The_about_protocol +translation_of: Mozilla/Firefox/The_about_protocol +--- +<div>{{FirefoxSidebar}}</div><p>Firefox 在 <code>about:</code> URL 协议中藏有很多隐藏的功能和有用的信息。最常用的 URL 就是 <code>about:config</code>,它提供首选项的显示和修改功能。以下是 <code>about: </code>伪协议的完整列表:</p> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col"><code>about:</code> 页面</th> + <th scope="col">描述</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>about:</code></td> + <td>显示版本和构建信息,以及查阅贡献者、许可信息和构建配置的链接。</td> + </tr> + <tr> + <td><code>about:about</code></td> + <td>提供 about: 页面的完整列表</td> + </tr> + <tr> + <td><code>about:accounts</code></td> + <td><a href="https://www.mozilla.org/en-US/firefox/sync/">同步</a> 功能使用的页面</td> + </tr> + <tr> + <td><code>about:addons</code></td> + <td>附加组件管理器</td> + </tr> + <tr> + <td><code>about:app-manager</code></td> + <td>应用管理器</td> + </tr> + <tr> + <td><code>about:buildconfig</code></td> + <td>显示构建此 Firefox 所用的配置和平台</td> + </tr> + <tr> + <td><code>about:cache</code></td> + <td>显示有关内存、磁盘和应用缓存的信息</td> + </tr> + <tr> + <td><code>about:compartments</code></td> + <td>显示有关 <a href="/en-US/docs/SpiderMonkey/SpiderMonkey_compartments">compartments</a> 的信息。从 Firefox 26 开始,此信息可在 about:memory 的 "Other Measurements" 部分找到</td> + </tr> + <tr> + <td><code>about:config</code></td> + <td>允许查看和更改 Firefox 内部的首选项(偏好和设置)</td> + </tr> + <tr> + <td><code>about:crashes</code></td> + <td>列出所有崩溃报告</td> + </tr> + <tr> + <td><code>about:credits</code></td> + <td>列出所有参与 Firefox 产品的贡献者姓名</td> + </tr> + <tr> + <td><code>about:customizing</code></td> + <td>切换到“定制”模式,允许用户定制 Firefox 的用户界面</td> + </tr> + <tr> + <td><code>about:downloads</code></td> + <td>显示用 Firefox 进行的下载</td> + </tr> + <tr> + <td><code>about:healthreport</code></td> + <td>显示 Firefox 的性能信息(如果用户已启用“健康报告”功能)</td> + </tr> + <tr> + <td><code>about:home</code></td> + <td>Firefox 原生的开始页(新窗口的第一个页面)</td> + </tr> + <tr> + <td><code>about:license</code></td> + <td>显示许可信息</td> + </tr> + <tr> + <td><code>about:logo</code></td> + <td>Firefox 标志</td> + </tr> + <tr> + <td><code>about:memory</code></td> + <td>提供一种方法探查内存使用情况,以及保存为报告,还有运行 GC 和 CC</td> + </tr> + <tr> + <td><code>about:mozilla</code></td> + <td>一个特殊页面,显示“Mozilla 之书”摘录</td> + </tr> + <tr> + <td><code>about:networking</code></td> + <td>显示网络相关的信息</td> + </tr> + <tr> + <td><code>about:newtab</code></td> + <td>新建一个标签页时显示的页面</td> + </tr> + <tr> + <td><code>about:permissions</code></td> + <td>提供一种方法来显示和管理网站权限。在 Firefox 45 中已去除({{bug(933917)}})</td> + </tr> + <tr> + <td><code>about:plugins</code></td> + <td>显示已安装插件的信息</td> + </tr> + <tr> + <td><code>about:preferences</code></td> + <td>Firefox 设置(也可通过 Firefox > 选项 来打开)</td> + </tr> + <tr> + <td><code>about:privatebrowsing</code></td> + <td>打开新的隐私浏览窗口时显示的页面</td> + </tr> + <tr> + <td><code>about:reader</code></td> + <td>指示在一个页面上开启了阅读视图。 参见<a href="https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages">Firefox 排除干扰的阅读视图</a></td> + </tr> + <tr> + <td><code>about:rights</code></td> + <td>显示权利信息</td> + </tr> + <tr> + <td><code>about:robots</code></td> + <td>显示有关机器人的信息,一个特殊的页面</td> + </tr> + <tr> + <td><code>about:sessionrestore</code></td> + <td>会话恢复(Firefox 从崩溃恢复时显示)</td> + </tr> + <tr> + <td><code>about:support</code></td> + <td>故障排除信息(也称“疑难解答”信息)。也可通过 Firefox 菜单 > <em>? (问号)</em> ><em> 故障排除信息 </em>打开</td> + </tr> + <tr> + <td><code>about:sync-log</code></td> + <td>显示 <a href="https://www.mozilla.org/en-US/firefox/sync/">同步</a> 功能所用的同步协议的日志</td> + </tr> + <tr> + <td><code>about:sync-progress</code></td> + <td>这是 <a href="https://www.mozilla.org/en-US/firefox/sync/">同步</a> 功能设置完成后显示的页面</td> + </tr> + <tr> + <td><code>about:sync-tabs</code></td> + <td>列出 <a href="https://www.mozilla.org/en-US/firefox/sync/">同步</a> 功能同步的标签页</td> + </tr> + <tr> + <td><code>about:telemetry</code></td> + <td>显示在 Firefox 运行时已收集和将发送到 Mozilla 的遥测数据(如果用户已启用“遥测”功能)</td> + </tr> + <tr> + <td><code>about:webrtc</code></td> + <td>有关 WebRTC 的使用情况</td> + </tr> + <tr> + <td><code>about:welcomeback</code></td> + <td>在 Firefox 被重置后显示的信息页面</td> + </tr> + </tbody> +</table> + +<p>这些 URL 在 {{source("docshell/base/nsAboutRedirector.cpp")}} 中的 <code>kRedirMap</code> 数组定义。该数组映射大部分 URL,比如 <code>config</code> 指向 <code>chrome:</code> 伪协议,例如 <code>chrome://global/content/config.xul</code>。about 的位置信息在 {{source("docshell/build/nsDocShellModule.cpp")}} 也存有副本。</p> |