diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:56:40 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:56:40 +0100 |
commit | 310fd066e91f454b990372ffa30e803cc8120975 (patch) | |
tree | d5d900deb656a5da18e0b60d00f0db73f3a2e88e /files/zh-cn/mozilla | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.gz translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.bz2 translated-content-310fd066e91f454b990372ffa30e803cc8120975.zip |
unslug zh-cn: move
Diffstat (limited to 'files/zh-cn/mozilla')
20 files changed, 620 insertions, 521 deletions
diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/剪切板/index.html b/files/zh-cn/mozilla/add-ons/webextensions/api/clipboard/index.html index 5fecb4334f..5fecb4334f 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/剪切板/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/clipboard/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/剪切板/setimagedata/index.html b/files/zh-cn/mozilla/add-ons/webextensions/api/clipboard/setimagedata/index.html index 3cdaf45b08..3cdaf45b08 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/剪切板/setimagedata/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/clipboard/setimagedata/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/devtools.inspectedwindow/index.html b/files/zh-cn/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/index.html index d59f29ffde..d59f29ffde 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/devtools.inspectedwindow/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/contextmenus/index.html b/files/zh-cn/mozilla/add-ons/webextensions/api/menus/index.html index ffcb6ce7b7..ffcb6ce7b7 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/contextmenus/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/menus/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/api/tabs/查询/index.html b/files/zh-cn/mozilla/add-ons/webextensions/api/tabs/query/index.html index 9afe6e80a8..9afe6e80a8 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/api/tabs/查询/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/api/tabs/query/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/构建一个跨浏览器的扩展插件/index.html b/files/zh-cn/mozilla/add-ons/webextensions/build_a_cross_browser_extension/index.html index 6d1a21497c..6d1a21497c 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/构建一个跨浏览器的扩展插件/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/build_a_cross_browser_extension/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/实现一个设置页面/index.html b/files/zh-cn/mozilla/add-ons/webextensions/implement_a_settings_page/index.html index fe8ac2e0a7..fe8ac2e0a7 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/实现一个设置页面/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/implement_a_settings_page/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/manifest.json/主页地址/index.html b/files/zh-cn/mozilla/add-ons/webextensions/manifest.json/homepage_url/index.html index 01749d5ff3..01749d5ff3 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/manifest.json/主页地址/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/manifest.json/homepage_url/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/packaging_and_installation/index.html b/files/zh-cn/mozilla/add-ons/webextensions/packaging_and_installation/index.html deleted file mode 100644 index 654aaea253..0000000000 --- a/files/zh-cn/mozilla/add-ons/webextensions/packaging_and_installation/index.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: 打包和安装 -slug: Mozilla/Add-ons/WebExtensions/Packaging_and_installation -translation_of: Mozilla/Add-ons/WebExtensions/Temporary_Installation_in_Firefox -translation_of_original: Mozilla/Add-ons/WebExtensions/Packaging_and_installation ---- -<h2 id="打包你的扩展">打包你的扩展</h2> - -<p>Firefox 扩展应打包为 XPI 文件。它只是一个 ZIP 文件,但采用 <code>.xpi</code> 作为扩展名。</p> - -<p>最重要的一点,ZIP 文件必须是扩展文件的 ZIP 打包,<strong>不能</strong>包含一层根目录。</p> - -<h3 id="Windows">Windows</h3> - -<ol> - <li>打开你的扩展文件所在的文件夹。</li> - <li>选择所有文件。</li> - <li>右击并选择 发送到 → 压缩(zipped)文件夹。</li> - <li>将得到的文件从 <code>文件名.zip</code> 重命名为 <code>文件名.xpi</code>。</li> -</ol> - -<p><img alt="Screenshot of the Windows Explorer context menu showing Send to compressed (zipped) folder" src="https://mdn.mozillademos.org/files/11717/pUF1vnr.png" style="height: 641px; width: 904px;"></p> - -<h3 id="Mac_OS_X">Mac OS X</h3> - -<ol> - <li>打开你的扩展文件所在的文件夹。</li> - <li>选择所有文件。</li> - <li>右击并选择 压缩 <em>n</em> 项。</li> - <li>将得到的文件从 <code>Archive.zip</code> 重命名为 <code>文件名.xpi</code>。</li> -</ol> - -<p><img alt="Screenshot of the Finder context menu showing the Compress 15 Items option" src="https://mdn.mozillademos.org/files/11715/Screen%20Shot%202015-10-08%20at%2016.19.02.png" style="height: 460px; width: 850px;"></p> - -<h3 id="Linux_Mac_OS_X_终端">Linux / Mac OS X 终端</h3> - -<ol> - <li><code>cd path/to/my-extension/</code></li> - <li><code>zip -r ../my-extension.xpi *</code></li> -</ol> - -<h2 id="安装你的扩展">安装你的扩展</h2> - -<ol> - <li>导航到 <code>about:addons</code></li> - <li>拖拽 XPI 到页面上,或者打开齿轮菜单,选择“从文件安装附加组件...”</li> - <li>点击弹出的对话框中的“安装”</li> -</ol> - -<h2 id="在_Firefox_OS_上安装你的扩展">在 Firefox OS 上安装你的扩展</h2> - -<p><code>你可以使用 WebIDE 提供的 USB 或者 Wifi 进行安装</code></p> - -<h2 id="故障排除">故障排除</h2> - -<p>下面是几种你可能会遇到的常见问题:</p> - -<h3 id="此附加组件无法安装,因为它未经验证。">"此附加组件无法安装,因为它未经验证。"</h3> - -<ul> - <li>确保你正在使用 <a href="https://nightly.mozilla.org/">Nightly</a> ,并且已在 <code>about:config </code>中将 <code>xpinstall.signatures.required</code> 切换为 <code>false</code>。</li> - <li>在 <a href="/en-US/docs/Mozilla/Add-ons/Distribution">附加组件签名与分发</a> 了解更多信息。</li> -</ul> - -<h3 id="该附加组件无法安装,因为它似乎已损坏。">"该附加组件无法安装,因为它似乎已损坏。"</h3> - -<ul> - <li>确保你是直接压缩你的附加组件文件,<strong>而不是</strong>压缩它们所在的文件夹。你的 manifest.json 文件必须在 zip 文件的根目录中。</li> - <li>确保你正在使用 <a href="https://nightly.mozilla.org/">Nightly</a> 版本的 Firefox。</li> -</ul> - -<h3 id="完全没反应">完全没反应</h3> - -<ul> - <li>确保你的文件名称以 <code>.xpi</code> 结尾,因为某些操作系统可能会隐藏真实的文件扩展名。 - - <ul> - <li>在 Windows 上,选中 查看 → 显示 / 隐藏:文件扩展名。</li> - <li>在 Mac OS X 上,选中 文件 → 获取信息 → 名称和扩展名。</li> - </ul> - </li> - <li>还有一种可能,你不小心点击并因此驳回了安装提示。在 Nightly 中的后退按钮旁边找到一个拼图图标。点击它将重获这个弹出提示。</li> -</ul> diff --git a/files/zh-cn/mozilla/add-ons/webextensions/porting_from_google_chrome/index.html b/files/zh-cn/mozilla/add-ons/webextensions/porting_from_google_chrome/index.html deleted file mode 100644 index 496abe0bd3..0000000000 --- a/files/zh-cn/mozilla/add-ons/webextensions/porting_from_google_chrome/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: 从 Google Chrome 移植 -slug: Mozilla/Add-ons/WebExtensions/Porting_from_Google_Chrome -tags: - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/Porting_a_Google_Chrome_extension ---- -<div>{{AddonSidebar}}</div> - -<p>使用 WebExtension API 开发的扩展是专为跨浏览器兼容而设计的:很大程度上,该技术与 Google Chrome 和 Opera 支持的<a class="external external-icon" href="https://developer.chrome.com/extensions">扩展 API</a> 代码直接兼容。为这些浏览器编写的扩展,在大多数情况下,只需少数修改就能在 Firefox 中运行。几乎所有的<a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API">扩展 API</a> 都支持使用 <code>chrome</code> 命名空间下的回调函数,跟 Chrome 一样。那些仅有的 <code>chrome</code> 命名空间不支持的 API 是故意不与 Chrome 兼容的。这些情况下,API 文档页将明确声明它仅在 <code>browser</code> 命名空间中受支持。从 Chrome 或者 Opera 移植一个扩展的过程大概这样:</p> - -<ol> - <li>检查你 manifest.json 使用的功能并了解 WebExtension API 对应的 <a href="/en-US/Add-ons/WebExtensions/Chrome_incompatibilities">Chrome 不兼容参考表</a>。如果你在使用的功能或者 API 还未被 Firefox 支持,那你可能还不能移植你的扩展。Mozilla 提供了一个服务可助您自动执行此步:<a href="https://www.extensiontest.com/">https://www.extensiontest.com/</a>。</li> - <li><a href="/zh-CN/Add-ons/WebExtensions/Temporary_Installation_in_Firefox">安装你的扩展至 Firefox</a> 并对其进行测试。</li> - <li>如有任何问题,可通过 <a class="external external-icon" href="https://mail.mozilla.org/listinfo/dev-addons">dev-addons 邮件列表</a>或 <a class="external external-icon" href="https://wiki.mozilla.org/IRC">IRC</a> 上的 <a href="irc://irc.mozilla.org/webextensions">#webextensions</a> 联系我们。</li> - <li><a href="/zh-CN/Add-ons/WebExtensions/Publishing_your_WebExtension">提交您的附加组件至 AMO 以供签名及分发</a>。</li> -</ol> - -<p>如果您依赖 Chrome 命令行选项来加载解压的扩展,请参看 Firefox 中进行临时安装的 <a href="/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext">web-ext</a> 工具以便开发。</p> - -<ul> -</ul> diff --git a/files/zh-cn/mozilla/add-ons/webextensions/publishing_your_webextension/index.html b/files/zh-cn/mozilla/add-ons/webextensions/publishing_your_webextension/index.html deleted file mode 100644 index e7792b75d4..0000000000 --- a/files/zh-cn/mozilla/add-ons/webextensions/publishing_your_webextension/index.html +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: 发布你的附加组件 -slug: Mozilla/Add-ons/WebExtensions/Publishing_your_WebExtension -tags: - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/Package_your_extension_ ---- -<div>{{AddonSidebar}}</div> - -<p>一般当你完成了基于WebExtension技术的附加组件的代码编写和测试, 你可能会想与其他人分享这成果(不管出于什么目的...). Mozilla旗下有一个网站: <a class="external external-icon" href="https://addons.mozilla.org">addons.mozilla.org</a> (简称AMO), 开发者们可以在这里发布附加组件, 而其他用户可以在这里找到这些附加组件并安装使用, 通过在AMO上发布你的附加组件, 你可以加入到我们的社区里来, 这里有一群用户和创造者, 说不准会发现几个使用你的附加组件的人哦.</p> - -<p>你编写的附加组件并不一定需要发布在AMO上, 但是、即使你不打算在AMO上发布你的附加组件, 你也必须提交你的附加组件到AMO上来进行审核以获得签名。因为火狐浏览器会拒绝安装没有AMO签名的附加组件。</p> - -<p>所以发布一个附加组件的流程, 可概述为:</p> - -<ol> - <li>压缩你所创建的附加组件文件</li> - <li>在<a href="https://addons.mozilla.org/zh-CN/">AMO</a>上创建一个属于你的账户</li> - <li>上传你的压缩文件到AMO来进行签名和审核, 并选择是否在AMO上进行发布</li> - <li>修复在审核中发现的任何问题</li> - <li>如果你选择不在AMO上发布, 可以恢复已签名的附件组件, 并自行发布</li> -</ol> - -<p>当你准备发布附加组件的新版本时, 你可以访问 <a class="external external-icon" href="https://addons.mozilla.org">addons.mozilla.org </a>的附加组件页来更新它, 并上传新的版本.<br> - 需要注意的是: 你必须在这个附加组件页进行更新, 否则AMO没法知道你是要更新一个已经存在的附加组件呢, 还是要上传一个全新的附加组件呢.</p> - -<p>如果你选择在AMO上发布你的附加组件, 之后火狐浏览器会自动检查更新. 如果你选择自行发布, 你需要在你的manifest.json中手动设置一个<code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/applications">applications</a></code> 唯一标识, 并且需要手动设置<code>update_url属性指向你的</code><a href="/en-US/Add-ons/Updates">update manifest file</a>.</p> - -<div class="pull-aside"> -<div class="moreinfo"> -<p>火狐浏览器把附加组件包的后缀叫做或改为".xpi", 这只是".zip"的一个扩展.</p> - -<p>在上传附加组件到AMO的时候, 你不需要把压缩包的后缀改为".XPI".</p> -</div> -</div> - -<h2 id="1._使用zip压缩你的附加组件文件">1. 使用zip压缩你的附加组件文件</h2> - -<p>首先你的附加组件文件夹应该包含一个manifest.json和其他一些需要的文件 - javascript文件, icons文件, HTML文件等等. 你需要使用zip把它们压缩成一个文件以便上传到AMO.</p> - -<p>注意: 请将你的附加组件目录的的所有文件压缩为zip包,而 不要直接对附加组件根目录进行压缩(见下图所示).</p> - -<h3 id="Windows">Windows</h3> - -<ol> - <li>打开你的附加组件所在的文件夹.</li> - <li>选中所有文件.</li> - <li>右键并选择发送到 → 压缩到(zipped)文件夹.</li> -</ol> - -<p><img alt="" src="https://mdn.mozillademos.org/files/11949/install-windows.png" style="display: block; height: 576px; margin-left: auto; margin-right: auto; width: 800px;"></p> - -<h3 id="Mac_OS_X">Mac OS X</h3> - -<ol> - <li>打开你的附加组件所在的文件夹.</li> - <li>选中所有文件.</li> - <li>右键并选择压缩<em>n项</em>.</li> -</ol> - -<p><img alt="" src="https://mdn.mozillademos.org/files/11951/install-osx.png" style="display: block; height: 449px; margin-left: auto; margin-right: auto; width: 800px;"></p> - -<h3 id="Linux_Mac_OS_X_Terminal">Linux / Mac OS X Terminal</h3> - -<ol> - <li><code>cd path/to/my-addon/</code></li> - <li><code>zip -r ../my-addon.zip *</code></li> -</ol> - -<h2 id="2._在AMO上创建一个账户">2. 在AMO上创建一个账户</h2> - -<p>访问<a href="https://addons.mozilla.org/">https://addons.mozilla.org/</a>. 如果你已经有一个<a href="https://support.mozilla.org/zh-CN/kb/firefox-mozilla">火狐账户</a>, 你可以直接使用它来登录. 否则, 点击"注册"并按要求创建一个火狐账户.</p> - -<h2 id="3._上传你的zip压缩文件">3. 上传你的zip压缩文件</h2> - -<p>接下来, 上传压缩后的附加组件到AMO进行签名和审查, 并选择是否发布到AMO, 更多细节, 可查看<a href="/en-US/Add-ons/Distribution#Submitting_to_AMO">Submitting to AMO</a>.</p> - -<div class="note"> -<p>需要注意的是一旦你上传了你的附加组件(基于WebExtension技术)到AMO, 你不能使用Add-on SDK或过时的XUL/XPCOM技术来更新该附加组件. 如果你切换到了这些技术平台之一, 必须把它做为新的附加组件并重新提交.</p> - -<p>总而言之: 像Add-on SDK和XUL/XPCOM等过时的技术体系在不久的将来都将被淘汰, WebExtensions才是唯一.</p> - -<p>在上传你的附加组件之前,请再次检查你的zip包内没有包含其他不相关的文件.</p> -</div> - -<h2 id="4._修复审查中出现的问题">4. 修复审查中出现的问题</h2> - -<p>当你上传了附加组件, AMO服务器将运行一些基本的检查并立即通知你有关的一切问题. 这些问题分为2种类型: "错误"和"警告". 如果你有错误, 你必须修复它们并重新提交, 如果只是警告, 你最好也搞定它们(当可以也忽略警告): 然后可以继续提交.</p> - -<p>如果自动检查器没有报告任何错误, 该附件组件将进行更为详细的审核(复查). 你同样会收到审查结果并且需要修复所有问题, 然后重新提交.</p> - -<h2 id="5._发布你的附加组件">5. 发布你的附加组件</h2> - -<p>如果你选择了在AMO上托管你的附加组件, 这意味着发布过程的结束. AMO会对该附加组件进行签名和发布, 之后其他用户就能下载并安装使用了.</p> - -<p>如果你选择不在AMO上进行发布, 可以恢复已签名的附加组件, 并自行发布(比如把附件组件的压缩包直接发给别人).</p> - -<p> </p> diff --git a/files/zh-cn/mozilla/add-ons/webextensions/user_interface/侧边栏/index.html b/files/zh-cn/mozilla/add-ons/webextensions/user_interface/sidebars/index.html index 8d13bfaf2c..8d13bfaf2c 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/user_interface/侧边栏/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/user_interface/sidebars/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/walkthrough/index.html b/files/zh-cn/mozilla/add-ons/webextensions/your_second_webextension/index.html index 962e04d404..962e04d404 100644 --- a/files/zh-cn/mozilla/add-ons/webextensions/walkthrough/index.html +++ b/files/zh-cn/mozilla/add-ons/webextensions/your_second_webextension/index.html diff --git a/files/zh-cn/mozilla/add-ons/webextensions/用户界面元素/index.html b/files/zh-cn/mozilla/add-ons/webextensions/用户界面元素/index.html deleted file mode 100644 index 0aaec74b1f..0000000000 --- a/files/zh-cn/mozilla/add-ons/webextensions/用户界面元素/index.html +++ /dev/null @@ -1,163 +0,0 @@ ---- -title: 用户界面元素 -slug: Mozilla/Add-ons/WebExtensions/用户界面元素 -translation_of: Mozilla/Add-ons/WebExtensions/user_interface -translation_of_original: Mozilla/Add-ons/WebExtensions/User_interface_components ---- -<div>{{AddonSidebar}}</div> - -<p>该主题概括了所有你能用来创建你扩展的用户界面的组件。</p> - -<h2 id="浏览器行为">浏览器行为</h2> - -<p>浏览器行为是一个你能添加至浏览器工具栏的按钮,用户可以点击该按钮来与你的扩展交互。</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/12966/browser-action.png" style="display: block; height: 387px; margin-left: auto; margin-right: auto; width: 782px;"></p> - -<p>有两种方式定义一个浏览器行为: 有一个 <a href="#Popups">弹出菜单</a>, 或者没有弹出菜单。</p> - -<p>当你没有定义一个弹出菜单时,用户点击按钮会导致一个消息被分发至扩展,而你可以使用 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/BrowserAction/onClicked" title="Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup."><code>browserAction.onClicked</code></a> 来监听它:</p> - -<pre class="brush: js line-numbers language-js"><code class="language-js">browser<span class="punctuation token">.</span>browserAction<span class="punctuation token">.</span>onClicked<span class="punctuation token">.</span><span class="function token">addListener</span><span class="punctuation token">(</span>handleClick<span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre> - -<p>如果你定义了弹出菜单,点击事件就不会被分发取而代之的是弹出菜单会显示出来。用户可以跟弹出菜单交互而当用户点击菜单外的区域时它会自动关闭。</p> - -<p>值得注意的是你的扩展只能拥有一个浏览器行为。</p> - -<h3 id="定义浏览器行为">定义浏览器行为</h3> - -<p>你通过使用在manifest.json 文件中使用 <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> 关键字定义浏览器行为的属性 - 图标, 标题, 弹出菜单 :</p> - -<pre class="brush: json line-numbers language-json"><code class="language-json"><span class="key token">"browser_action":</span> <span class="punctuation token">{</span> - <span class="key token">"default_icon":</span> <span class="punctuation token">{</span> - <span class="key token">"19":</span> <span class="string token">"button/geo-19.png"</span><span class="punctuation token">,</span> - <span class="key token">"38":</span> <span class="string token">"button/geo-38.png"</span> - <span class="punctuation token">}</span><span class="punctuation token">,</span> - <span class="key token">"default_title":</span> <span class="string token">"Whereami?"</span><span class="punctuation token">,</span> - <span class="key token">"default_popup":</span> <span class="string token">"popup/geo.html"</span> -<span class="punctuation token">}</span></code></pre> - -<p>唯一必要的关键字是 <code>default_icon</code>.你可以使用 <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction">browserAction</a></code> API 修改任何属性.</p> - -<h3 id="例子">例子</h3> - -<p>在GITHUB上的 <a href="https://github.com/mdn/webextensions-examples">webextensions-examples</a> 资源包含了以下使用浏览行为的例子:</p> - -<ul> - <li><a href="https://github.com/mdn/webextensions-examples/blob/master/bookmark-it/">bookmark-it</a> 使用了没有弹出菜单的浏览器行为</li> - <li><a href="https://github.com/mdn/webextensions-examples/tree/master/beastify">beastify</a> 使用了由弹出菜单的浏览器行为</li> -</ul> - -<h2 id="页面行为">页面行为</h2> - -<p>页面行为在很多方面类似于 <a href="#Browser_actions">browser actions</a> , 除了:</p> - -<ul> - <li>浏览器行为按钮会一直显现,并且一直可用。</li> - <li>页面行为只会在几个页面并且该页面处于活动标签时显示。</li> -</ul> - -<p>为了强调页面行为只跟部分页面有联系,他们将其显示在地址栏内而不是工具栏:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/12960/page-action.png" style="display: block; height: 262px; margin-left: auto; margin-right: auto; width: 850px;"></p> - -<p>不像浏览器行为,页面行为默认是关闭的, 调用 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/PageAction/show" title="Shows the page action for a given tab. The page action is shown whenever the given tab is the active tab."><code>pageAction.show()</code></a> 和<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/PageAction/hide" title="Hides the page action for a given tab."><code>pageAction.hide()</code></a> 可以显示或隐藏页面行为。</p> - -<h3 id="定义页面行为">定义页面行为</h3> - -<p>通过在manifest.json中使用<code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a></code> 关键字来定义页面行为的属性 —— 图标, 标题, 弹出菜单:</p> - -<pre class="brush: json line-numbers language-json"><code class="language-json"><span class="key token">"page_action":</span> <span class="punctuation token">{</span> - <span class="key token">"browser_style":</span> <span class="keyword token">true</span><span class="punctuation token">,</span> - <span class="key token">"default_icon":</span> <span class="punctuation token">{</span> - <span class="key token">"19":</span> <span class="string token">"button/geo-19.png"</span><span class="punctuation token">,</span> - <span class="key token">"38":</span> <span class="string token">"button/geo-38.png"</span> - <span class="punctuation token">}</span><span class="punctuation token">,</span> - <span class="key token">"default_title":</span> <span class="string token">"Whereami?"</span><span class="punctuation token">,</span> - <span class="key token">"default_popup":</span> <span class="string token">"popup/geo.html"</span> -<span class="punctuation token">}</span></code></pre> - -<p><code>default_icon 是唯一强制要求的关键字</code>. 你可以使用 <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction">pageAction</a></code> API 修改所有的属性或现实或隐藏页面行为。</p> - -<h3 id="例子_2">例子</h3> - -<p> <a href="https://github.com/mdn/webextensions-examples/tree/master/chill-out">chill-out</a> 例子使用了一个页面行为。</p> - -<h2 id="弹出菜单">弹出菜单</h2> - -<p>一个弹出菜单是一个绑定至 <a href="#Browser_actions">browser action</a> 或者 <a href="#Page_actions">page action</a> 的对话框。</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/14039/popup-shadow.png" style="display: block; height: 545px; margin-left: auto; margin-right: auto; width: 700px;"></p> - -<p>当用户点击按钮弹出菜单显示,当用户点击弹出菜单外的任何区域弹出菜单关闭。可以使用 <code><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/close">window.close()</a></code> 来关闭弹出菜单。</p> - -<p>你可以使用专门的在manifest.json中使用"_execute_browser_action" 和 "_execute_page_action" 来定义一个快捷键打开浏览器行为或页面行为. 详情请看 <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands">commands</a></code> manifest.json 关键字。不过你不能在你的扩展脚本中通过编程打开弹出菜单 : 他只能通过用户的行为的被打开。</p> - -<p>弹出菜单像普通网页一样通过HTML文件被定义,你当然也可以在里面包含CSS 和 javascript文件。 而且不像普通网页, 其包含的javascript可以使用所有的已经通过<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a>获取了使用权限的 <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API">WebExtension APIs</a> 。</p> - -<p>你可以要求浏览器在你的弹出菜单中包含一个样式表以使其看起来与浏览器UI一致。为了达成这一目的,在你的 <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> 或 <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/page_action">page_action</a> 关键字中包含<code> "browser_style": true</code> 。</p> - -<p>弹出菜单存在一个限制其可以加载资源的源地址的安全机制, 同时不允许类似 <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code> 的做法的使用 查看 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a> 获取更多细节。</p> - -<p>你可以使用Add-on Debugger来调试弹出菜单标记和脚本,但是你需要一些技巧来设置让弹出菜单不在自动关闭。<a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Debugging#Debugging_popups"> 阅读关于调试弹出菜单</a>。</p> - -<h3 id="弹出菜单尺寸重新计算">弹出菜单尺寸重新计算</h3> - -<p>弹出菜单自动根据其内容调整尺寸。其适应算法可能因浏览器而不同。</p> - -<p>在火狐, 尺寸只再弹出菜单显示前被计算,而且在内容变化后至多进行每秒十次的计算。严格来说, 尺寸受 <code><a href="/en-US/docs/Web/HTML/Element/body"><body></a></code> 元素放置尺寸决定。 一种怪异的说法是, 他由 <code><a href="/en-US/docs/Web/HTML/Element/html"><html></a></code> 决定, Firefox 计算该元素的推荐宽度, 重新调整弹出菜单至其宽度, 然后完成尺寸调整所以这里没有上下滚动。 如果适应用户的屏幕他可能会增长到800X600px的尺寸。 如果用户 <a href="https://support.mozilla.org/en-US/kb/customize-firefox-controls-buttons-and-toolbars#w_customize-the-menu-or-the-toolbar">移动弹出菜单对应按钮到菜单面板</a> ,而后弹出菜单会在菜单栏内显示并具有合适的尺寸。</p> - -<h2 id="设置页面">设置页面</h2> - -<p>设置页面允许你定义你的扩展可以被用户修改的选项。 用户从浏览器扩展管理器中访问设置页面:</p> - -<p>{{EmbedYouTube("02oXAcbUv-s")}}</p> - -<p>每个浏览器访问该页面的方法存在区别。</p> - -<ul> -</ul> - -<p>你可以通过调用 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/Runtime/openOptionsPage" title="If your add-on does not have an options page, or the browser failed to create one for some other reason, runtime.lastError will be set."><code>runtime.openOptionsPage()</code></a> 打开设置页面</p> - -<p>设置页面存在一个限制其可以加载资源的源地址的安全机制, 同时不允许类似 <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval">eval()</a></code> 的做法的使用 查看 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a> 获取更多细节。</p> - -<h3 id="定义一个设置页面:">定义一个设置页面:</h3> - -<p>创建一个设置页面有以下流程:</p> - -<ul> - <li>写一个HTML文件定义页面。该文件像普通网页一样可以包含CSS和Javascript 文件而且可以使用所有 <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API">WebExtension APIs</a> ,特别的你可以使用 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/Storage" title="Enables WebExtensions to store and retrieve data, and listen for changes to stored items."><code>storage</code></a> API 来保存设置。</li> - <li>将这些文件打包至你的扩展。</li> - <li>在manifest.json 文件包含 <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/options_ui">options_ui</a></code> 关键字, 并给予设置页面的URL。</li> -</ul> - -<h3 id="例子_3">例子</h3> - -<p> <a href="https://github.com/mdn/webextensions-examples/tree/master/favourite-colour">favourite-colour</a> 使用了设置页面。</p> - -<h2 id="上下文菜单项">上下文菜单项</h2> - -<p>使用 {{WebExtAPIRef("contextMenus")}} API, 你可以按你指定的情况向浏览器上下文菜单添加项目, 比如,你可以只在用户点击图片时显示一项,或者在一个可编辑的元素上,或者被选择的页面的一部份。</p> - -<h3 id="指定一个上下文菜单项">指定一个上下文菜单项</h3> - -<p>您可以使用{{WebExtAPIRef("contextMenus")}} API来 程序化地管理上下文菜单项。</p> - -<h3 id="例子_4">例子</h3> - -<p> <a href="https://github.com/mdn/webextensions-examples/tree/master/context-menu-demo">context-menu-demo</a> 创建了几种不同的上下文菜单项。</p> - -<h2 id="通知">通知</h2> - -<p>使用 {{WebExtAPIRef("notifications")}} API,你通过使用操作系统的通知系统可以创建短时通知:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/14043/notify-shadowed.png" style="display: block; height: 334px; margin-left: auto; margin-right: auto; width: 700px;"></p> - -<h3 id="定义一个通知">定义一个通知</h3> - -<p>使用{{WebExtAPIRef("notifications")}} API 可以程序化地管理通知。</p> - -<h3 id="Examples">Examples</h3> - -<p><a href="https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n">notify-link-clicks-i18n</a> 创建了通知。</p> diff --git a/files/zh-cn/mozilla/firefox/releases/19/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/19/site_compatibility/index.html new file mode 100644 index 0000000000..c026e80052 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/19/site_compatibility/index.html @@ -0,0 +1,144 @@ +--- +title: Site Compatibility for Firefox 19 +slug: Site_Compatibility_for_Firefox_19 +translation_of: Mozilla/Firefox/Releases/19/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 19 <a href="http://www.mozilla.org/zh-CN/firefox/beta/">Beta</a> was released on <time datetime="2013-01-10">January 10</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p> +<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p> +<ul> + <li><a href="http://www.mozilla.org/zh-CN/firefox/19.0beta/releasenotes/">Firefox 19 Beta Release Notes</a></li> + <li><a href="/zh-CN/docs/Firefox_19_for_developers">Firefox 19 for developers</a> (some changes are not listed yet)</li> + <li>Add-on Compatibility for Firefox 19 (Add-ons Blog)</li> +</ul> +<p>This list may be updated until the release of the final version, so please check back later.</p> +<section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="flexbox脱前缀">flexbox脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801098">Bug 801098 – Unprefix CSS3 flexbox</a></li> + </ul> + <p>The <a href="/zh-CN/docs/CSS/Using_CSS_flexible_boxes">CSS3 flexible boxes (flexbox)</a> implementation has been prefixed. From now on, use the related properties and keywords without <code>moz</code> prefix. Note that the flexbox is still disabled by default in Firefox 19. If you'd like to test the feature, open <code>about:config</code> and change the value of <code>layout.css.flexbox.enabled</code> to <code>true</code>.</p> + </section> + <section id="sect3"> + <h3 id="-moz-initial属性脱前缀"><code>-moz-initial</code>属性脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=806068">Bug 806068 – Unprefix -moz-initial</a></li> + </ul> + <p>The <code>-moz-initial</code> keyword has been unprefixed. While <code>-moz-initial</code> will remain in the meantime as an alias of <a href="/zh-CN/docs/CSS/initial"><code>initial</code></a>, it will be <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807184">removed at some time</a>, so use the unprefixed keyword instead.</p> + </section> + <section id="sect4"> + <h3 id="-moz-placeholder伪类已修改成伪元素-moz-placeholder"><code>:-moz-placeholder</code>伪类已修改成伪元素<code>::-moz-placeholder</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=737786">Bug 737786 – Switch from :-moz-placeholder to ::-moz-placeholder (pseudo-class to pseudo-element)</a></li> + </ul> + <p>The <a href="/zh-CN/docs/CSS/:-moz-placeholder"><code>:-moz-placeholder</code></a> pseudo-class that matches form elements with the <a href="/zh-CN/docs/HTML/Forms_in_HTML#The_placeholder_attribute"><code>placeholder</code></a> attribute has been removed, and the <a href="/zh-CN/docs/CSS/::-moz-placeholder"><code>::-moz-placeholder</code></a> pseudo-element has been added instead. The implementation of WebKit has been a pseudo-element, and this change is a part of the standardization effort.</p> + </section> + <section id="sect5"> + <h3 id="CSS动画中带有!important的关键帧规则声明将被忽略"><code>CSS动画中带有!important</code>的关键帧规则声明将被忽略</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=784466">Bug 784466 – [css3-animations] we should drop declarations in keyframe rules that have !important</a></li> + </ul> + <p>Following the latest <a href="/zh-CN/docs/CSS/Using_CSS_animations">CSS3 animations</a> spec, key frame rule declarations with the <code>!important</code> keyword are now be ignored and parse errors will be returned.</p> + </section> + <section id="sect6"> + <h3 id="在aboutconfig中添加了一些控制带前缀的CSS属性的有效性的选项">在about:config中添加了一些控制带前缀的CSS属性的有效性的选项</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=804944">Bug 804944 – add preferences for sets of CSS prefixed properties</a></li> + </ul> + <p>While this is not a change affecting site compatibility, it's worth mentioning because this has been developed as part of efforts to keep compatibility. Preferences to disable some major prefixed properties have been added: <code>layout.css.prefixes.border-image</code>, <code>layout.css.prefixes.transforms</code>, <code>layout.css.prefixes.transitions</code> and <code>layout.css.prefixes.animations</code>. Web developers can disable those preferences (change the values to <code>false</code>) to test whether style rules are applied as intended even after those prefixed implementations are removed.</p> + </section> +</section> +<section id="sect7"> + <h2 id="DOM">DOM</h2> + <section id="sect8"> + <h3 id="Element.getElementsBy*_现在将返回HTMLCollection对象"><code>Element.getElementsBy*</code> 现在将返回<code>HTMLCollection对象</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=799464">Bug 799464 – Make Element.getElementsBy* return HTMLCollection</a></li> + </ul> + <p><a href="/zh-CN/docs/DOM/element.getElementsByTagName"><code>getElementsByTagName</code></a>, <a href="/zh-CN/docs/DOM/element.getElementsByTagNameNS"><code>getElementsByTagNameNS</code></a>以及<a href="/zh-CN/docs/DOM/document.getElementsByClassName"><code>getElementsByClassName</code></a>方法返回的元素列表对象的类型从<a href="/zh-CN/docs/DOM/NodeList"><code>NodeList</code></a>(遵循DOM3核心规范)变为<a href="/zh-CN/docs/DOM/HTMLCollection"><code>HTMLCollection</code></a>(遵循DOM4规范草案).</p> + </section> + <section id="sect9"> + <h3 id="hasFeatureisSupported方法现在总会返回true"><code>hasFeature</code>/<code>isSupported</code>方法现在总会返回<code>true</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801425">Bug 801425 – Make hasFeature() and isSupported() always return true</a></li> + </ul> + <p>The <code><a href="/zh-CN/docs/DOM/document.implementation">document.implementation</a>.hasFeature</code> and <a href="/zh-CN/docs/DOM/Node.isSupported"><code>Element.isSupported</code></a> methods have been changed to always return <code>true</code>. The spec has been changed because those APIs were considered useless. However the SVG features are exception; those methods continue to return the support statuses.</p> + </section> + <section id="sect10"> + <h3 id="createElement(null)不再抛出异常"><code>createElement(null)</code>不再抛出异常</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=802562">Bug 802562 – createElement(null) should work like createElement("null")</a></li> + </ul> + <p>Previously the <a href="/zh-CN/docs/DOM/document.createElement"><code>document.createElement</code></a> method has thrown exception <code>INVALID_CHARACTER_ERR</code> if the argument was <code>null</code>. The method now returns the <code>HTMLUnknownElement</code> object because the argument should be treated as a string and considered to be the same code as <code>document.createElement("null")</code>.</p> + </section> + <section id="sect11"> + <h3 id="document.referrer遵循了最新规范"><code>document.referrer</code>遵循了最新规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=809290">Bug 809290 – document.referrer should be based on the script entry point</a></li> + </ul> + <p>When the URL of a nested inline frame (<code>iframe</code>) or a grandchild window is programmatically changed from the parent window, the value of the <a href="/zh-CN/docs/DOM/document.referrer"><code>document.referrer</code></a> property now points the URL of the parent window where the script is written instead of the child window that refers directly. This is due to a change of the spec and leads to the same behavior as Internet Explorer and Opera. WebKit to follow.</p> + </section> + <section id="sect12"> + <h3 id="如果修改日期未知则File.lastModifiedDate属性将返回当前日期"><code>如果修改日期未知,则File.lastModifiedDate</code>属性将返回当前日期</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793459">Bug 793459 – Update File.lastModifiedDate to latest spec</a></li> + </ul> + <p>Following the latest <a href="http://www.w3.org/TR/FileAPI/">File API</a> spec, the <code>lastModifiedDate</code> property of a <a href="/zh-CN/docs/DOM/File"><code>File</code></a> object now returns the current date if the file's last modified date is unknown. Previously it returns <code>null</code> in such case.</p> + </section> + <section id="sect13"> + <h3 id="Encoding_API_遵循了最新规范">Encoding API 遵循了最新规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801487">Bug 801487 – Update StringEncoding API per the latest spec and fix some bugs</a></li> + </ul> + <p>Following a change of the <a href="http://encoding.spec.whatwg.org/#api">Encoding API</a> spec, the implementation of <code>TextEncoder</code> and <code>TextDecoder</code> has been updated.</p> + </section> + <section id="sect14"> + <h3 id="移除XForms支持">移除XForms支持</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=656311">Bug 656311 – Remove XML Events, or improve the implementation</a></li> + </ul> + <p>The XML Events implementation has been removed. The development of the <a href="https://addons.mozilla.org/zh-CN/firefox/addon/mozilla-xforms/">Mozilla XForms</a> extension that has used the API has been <a href="http://www.philipp-wagner.com/blog/2011/07/the-future-of-mozilla-xforms/">practically discontinued</a>. The <a href="/zh-CN/docs/XForms">XForms</a> accessibility support has also been <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=811729">removed</a> from Firefox 19.</p> + </section> +</section> +<section id="sect15"> + <h2 id="JavaScript">JavaScript</h2> + <section id="sect16"> + <h3 id="Map.size和Set.size从方法变成属性"><code>Map.size</code>和<code>Set.size</code>从方法变成属性</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807001">Bug 807001 – Map.prototype.size and Set.prototype.size should be accessor properties</a></li> + </ul> + <p>The <code>size</code> method, that returns the number of key/value pairs saved in a <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Map"><code>Map</code></a> object and the number of values saved in a <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Set"><code>Set</code></a> object, are changed to be read-only properties.</p> + </section> +</section> +<section id="sect17"> + <h2 id="事件处理">事件处理</h2> + <section id="sect18"> + <h3 id="一些事件句柄属性只存在于body和frameset元素上">一些事件句柄属性只存在于<code>body</code>和<code>frameset</code>元素上</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=809765">Bug 809765 – Stop compiling the beforeunload attribute into an event handler on elements other than <body> and <frameset></a></li> + </ul> + <p>Previously, the <a href="/zh-CN/docs/DOM/window.onbeforeunload"><code>onbeforeunload</code></a> attribute has been recognized even if it has been set on any elements, and the named handler is called when the event is fired. To comply with the spec, it's now ignored when it has been set on elements other than <a href="/zh-CN/docs/HTML/Element/body"><code>body</code></a> and <a href="/zh-CN/docs/HTML/Element/frameset"><code>frameset</code></a>. The other attributes treated the same include <a href="/zh-CN/docs/DOM/window.onafterprint"><code>onafterprint</code></a>, <a href="/zh-CN/docs/DOM/window.onbeforeprint"><code>onbeforeprint</code></a>, <a href="/zh-CN/docs/DOM/window.onhashchange"><code>onhashchange</code></a>, <code>onoffline</code>, <code>ononline</code>, <code>onpagehide</code>, <code>onpageshow</code>, <a href="/zh-CN/docs/DOM/window.onpopstate"><code>onpopstate</code></a>, <a href="/zh-CN/docs/DOM/window.onresize"><code>onresize</code></a> and <a href="/zh-CN/docs/DOM/window.onunload"><code>onunload</code></a>.</p> + </section> +</section> +<section id="sect19"> + <h2 id="文件处理">文件处理</h2> + <section id="sect20"> + <h3 id="不再支持Content-Disposition响应头中的name参数"><code>不再支持Content-Disposition</code>响应头中的<code>name</code>参数</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=776339">Bug 776339 – remove support of Content-Disposition "name" parameter</a></li> + </ul> + <p>The <code>name</code> parameter included in the HTTP <code>Content-Disposition</code> header used for file downloading is now ignored. This parameter is non-standard and supported only by Firefox and Google Chrome. From now, use the standard <code>filename</code> parameter instead.</p> + </section> +</section> +<section id="sect43"> + <h2 id="插件">插件</h2> + <section id="sect44"> + <h3 id="移除了对Carbon_NPAPI的支持">移除了对Carbon NPAPI的支持</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=598397">Bug 598397 - remove support for Carbon NPAPI</a></li> + </ul> + <p>The Carbon event model and the Quickdraw drawing model, deprecated since Firefox 4, are no longer available. Webmasters should make sure your content works well if it requires any special plug-in. If it doesn't work on Firefox 19, please contact the plug-in vendor.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/21/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/21/site_compatibility/index.html new file mode 100644 index 0000000000..cf566f4262 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/21/site_compatibility/index.html @@ -0,0 +1,145 @@ +--- +title: Firefox 21网站兼容性 +slug: Site_Compatibility_for_Firefox_21 +translation_of: Mozilla/Firefox/Releases/21/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="-moz-user-selectnone的表现变得和-moz-user-select-moz-none相同也就是和其他浏览器实现了统一"><code>-moz-user-select:none的表现变得和</code><code>-moz-user-select:-moz-none</code>相同,也就是和其他浏览器实现了统一</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816298">Bug 816298 – Change "-moz-user-select:none" to behave like WebKit, IE, and Opera (and "-moz-user-select:-moz-none")</a></li> + </ul> + <p>Previously, when you set the <code>none</code> keyword to the <a href="/zh-CN/docs/CSS/user-select"><code>-moz-user-select</code></a> property, the text of on the element and sub-elements became unselectable, even if one of those sub-elements had <code>-moz-user-select:text</code>. Starting with Firefox 21, <code>none</code> behaves like <code>-moz-none</code> and other browsers, so selection can be re-enabled on sub-elements using <code>-moz-user-select:text</code>.</p> + </section> +</section> +<section id="sect15"> + <h2 id="DOM">DOM</h2> + <section id="sect23"> + <h3 id="删除了对table的cols和layout属性的支持">删除了<code>对table</code>的<code>cols</code>和<code>layout</code>属性的支持</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835169">Bug 835169 – Do we need support for the table[cols] attribute?</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835439">Bug 835439 – Remove support for the table[layout] attribute</a></li> + </ul> + <p>Firefox no longer accepts the <code>cols</code> and <code>layout</code> properties on the <a href="/zh-CN/docs/HTML/Element/table"><code>table</code></a> elements. No other browsers support these obscure properties.</p> + </section> + <section id="sect24"> + <h3 id="scrollWidth和scrollHeight不再受overflowvisible的影响"><code>scrollWidth</code>和<code>scrollHeight</code>不再受<code>overflow:visible</code>的影响</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833542">Bug 833542 – scrollWidth, scrollHeight different when overflow is hidden versus visible</a></li> + </ul> + <p>The <a href="/zh-CN/docs/DOM/element.scrollWidth"><code>scrollWidth</code></a> and <a href="/zh-CN/docs/DOM/element.scrollHeight"><code>scrollHeight</code></a> properties might have wrong values when CSS <code>overflow:visible</code> was set on the element. This behavior has been fixed to match the values as if <code>overflow:hidden</code> is set.</p> + </section> + <section id="sect25"> + <h3 id="window不再接受自定义的索引属性"><code>window</code>不再接受自定义的索引属性</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=828787">Bug 828787 – Stop allowing indexed expandos on windows</a></li> + </ul> + <p>Setting indexed expandos (custom properties which have number as the property name) on the <a href="/zh-CN/docs/DOM/window"><code>window</code></a> object is no longer allowed. Your code like <code>window[2] = "myString"</code> will be ignored from now on.</p> + </section> + <section id="sect26"> + <h3 id="window对象上的索引属性变的可枚举"><code>window</code>对象上的索引属性变的可枚举</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=823228">Bug 823228 - Move indexed properties from nsWindowSH::GetProperty to the outer window proxy</a></li> + </ul> + <p>Previously, <a href="/zh-CN/docs/HTML/Element/iframe"><code>iframe</code>s</a> in the DOM were not enumerable on the <code>window</code> object. This behavior has been changed to comply with the spec, which means they are now returned with <code>Object.keys(window)</code>. This is important to note for things like global leak detection, since appending <code>iframe</code>s to the document will modify the enumerable keys on the <code>window</code> object.</p> + </section> + <section id="sect27"> + <h3 id="XMLHttpRequest.setRequestHeader方法的实现遵循了当前规范"><code>XMLHttpRequest.setRequestHeader</code>方法的实现遵循了当前规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=819051">Bug 819051 – XMLHttpRequest.setRequestHeader() overwrites instead of combines values for the same header.</a></li> + </ul> + <p>Previously, if the same headers were repeatedly set with <a href="/zh-CN/docs/DOM/XMLHttpRequest#setRequestHeader%28%29"><code>XMLHttpRequest.setRequestHeader</code></a>, the last-specified value was used. This behavior has been changed to comply with the spec, so those values will be properly combined.</p> + </section> + <section id="sect28"> + <h3 id="formMethod和formEnctype的默认值成为一个空字符串"><code>formMethod</code>和<code>formEnctype</code>的默认值成为一个空字符串</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=787095">Bug 787095 – Update formMethod reflection to have the empty string as default value (and 'get' as invalid value)</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=839171">Bug 839171 – Update formMethod reflection to have the empty string as default value (and 'get' as invalid value)</a></li> + </ul> + <p>The HTML5 spec of the <a href="/zh-CN/docs/HTML/Element/Input#attr-formmethod"><code>formMethod</code></a> and <a href="/zh-CN/docs/HTML/Element/Input#attr-formenctype"><code>formEnctype</code></a> properties has been updated to have the empty string as default value. Firefox followed the change.</p> + </section> + <section id="sect29"> + <h3 id="如果传递多条规则CSSStyleSheet.insertRule方法会报错"><code>如果传递多条规则,CSSStyleSheet.insertRule</code>方法会报错</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=765599">Bug 765599 – CSSStyleSheet.insertRule should throw when there are more than one rule</a></li> + </ul> + <p>If multiple rules was passed to the <a href="/zh-CN/docs/DOM/CSSStyleSheet/insertRule"><code>CSSStyleSheet.insertRule</code></a> method, only the first rule was inserted into the stylesheet. Instead, Firefox now throws an exception <code>SYNTAX_ERR</code> like other browsers.</p> + </section> + <section id="sect30"> + <h3 id="从NodeIterator和TreeWalker上删除掉expandEntityReferences属性">从<code>NodeIterator</code>和<code>TreeWalker</code>上删除掉<code>expandEntityReferences属性</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=672190">Bug 672190 – consider removing expandEntityReferences from NodeIterator and TreeWalker</a></li> + </ul> + <p>The <a href="/zh-CN/docs/DOM/NodeIterator.expandEntityReferences"><code>expandEntityReferences</code></a> property, which returned a flag indicating whether or not the children of entity reference nodes were visible to the object, has been removed from the <a href="/zh-CN/docs/DOM/NodeIterator"><code>NodeIterator</code></a> and <a href="/zh-CN/docs/DOM/TreeWalker"><code>TreeWalker</code></a> objects, as it never made much sense.</p> + </section> + <section id="sect31"> + <h3 id="CSSKeyframesRule.insertRule方法被改名为appendRule"><code>CSSKeyframesRule.insertRule方法被改名为</code><code>appendRule</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841896">Bug 841896 – CSSKeyframesRule should have a `appendRule` method, not `insertRule`</a></li> + </ul> + <p>One of the methods of the <a href="/zh-CN/docs/DOM/CSSKeyframesRule"><code>CSSKeyframesRule</code></a> interface, <code>insertRule</code> has been renamed to <code>appendRule</code> to match a spec change.</p> + </section> + <section id="sect32"> + <h3 id="HTMLInputElement.inputmode现在默认被禁用"><code>HTMLInputElement.inputmode</code>现在默认被禁用</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857355">Bug 857355 – Hide HTMLInputElement's inputMode API behind a pref and only turn it on for Aurora/Nightly</a></li> + </ul> + <p><a href="/zh-CN/docs/DOM/HTMLInputElement"><code>HTMLInputElement</code></a>'s <code>inputmode</code> API, which has been <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=746142">implemented</a> since Firefox 17, is now disabled by default because the spec is still unstable. You have to enable the <code>dom.forms.inputmode</code> pref or use the <a href="http://www.mozilla.org/zh-CN/firefox/aurora/">Aurora</a> channel to try out this feature. Note that this API will be renamed <code>inputMode</code> (capitalized <code>M</code>) in <a href="/zh-CN/docs/Site_Compatibility_for_Firefox_22">Firefox 22</a>.</p> + </section> +</section> +<section id="sect33"> + <h2 id="JavaScript">JavaScript</h2> + <section id="sect34"> + <h3 id="E4X已经被完全删除">E4X已经被完全删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=788293">Bug 788293 – Remove E4X from Spidermonkey</a></li> + </ul> + <p>The support of <a href="/zh-CN/docs/E4X">ECMAScript for XML (E4X)</a>, deprecated and disabled since <a href="/zh-CN/docs/Site_Compatibility_for_Firefox_17#E4X_has_been_disabled">Firefox 17</a>, has finally been dropped. You can no longer use the feature regardless of the hidden preference.</p> + </section> + <section id="sect35"> + <h3 id="parseInt把以0开头的字符串当成十进制数字解析而不是以前的八进制"><code>parseInt把以0开头的字符串当成十进制数字解析,而不是以前的八进制</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=786135">Bug 786135 – Make parseInt("042") === 42, now that other engines are moving that way</a></li> + </ul> + <p>The <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/parseInt"><code>parseInt</code></a> method implementation has been updated to conform to the ECMAScript 5 spec, and it now parses leading-zero strings as decimal, not octal. Therefore, <code>parseInt("042")</code> will return <code>42</code> instead of <code>34</code>. If you'd like to parse strings as octal, specify the radix like <code>parseInt(str, 8)</code>.</p> + </section> + <section id="sect36"> + <h3 id="修正String.localeCompare在无参情况下的表现以符合ES5规范">修正<code>String.localeCompare</code>在无参情况下的表现,以符合ES5规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=789393">Bug 789393 – String.prototype.localeCompare() with no argument always returns 0</a></li> + </ul> + <p>The <a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/String/localeCompare"><code>String.localeCompare</code></a> method implementation has been updated to conform to the latest ECMAScript 5 spec. If no argument is passed, the method takes the <code>"undefined"</code> string as the argument.</p> + </section> +</section> +<section id="sect37"> + <h2 id="SVG">SVG</h2> + <section id="sect38"> + <h3 id="删除掉那些未实现的SVG特性">删除掉那些未实现的SVG特性</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=824218">Bug 824218 – Remove unimplemented SVG features</a></li> + </ul> + <p>Unimplemented SVG features have been removed instead of just returning the <code>NOT_IMPLEMENTED</code> errors. These features include the <code>viewport</code> and <code>currentView</code> properties of <a href="/zh-CN/docs/DOM/SVGSVGElement"><code>SVGSVGElement</code></a>.</p> + </section> +</section> +<section id="sect39"> + <h2 id="AudioVideo">Audio/Video</h2> + <section id="sect41"> + <h3 id="mozAudioContext属性脱前缀"><code>mozAudioContext</code>属性脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833631">Bug 833631 – Unprefix mozAudioContext</a></li> + </ul> + <p>The <code>mozAudioContext</code> implementation has been unprefixed. It's still <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=788310">disabled by default</a>, though. To try out this feature, change the value of the <code>media.webaudio.enabled</code> pref to <code>true</code>.</p> + </section> +</section> +<section id="sect42"> + <h2 id="安全">安全</h2> + <section id="sect43"> + <h3 id="CSP实现更新到符合最新规范">CSP实现更新到符合最新规范</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=746978">Bug 746978 – sync CSP directive parsing and directive names with w3c CSP 1.0 spec</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=783049">Bug 783049 – CSP : use existing/old parser for X-Content-Security-Policy header, new/CSP 1.0 spec compliant parser for Content-Security-Policy header</a></li> + </ul> + <p>Content Security Policy (CSP) 1.0 spec has been implemented. The existing parser will be used when a policy is served via the <code>X-Content-Security-Policy</code> header, and the new parser that follows the 1.0 spec will be used when a policy is served via the officially spec'd <code>Content-Security-Policy</code> header. Consult the latest spec if you'd like to implement CSP on your site. The <a href="/zh-CN/docs/Security/CSP">documents on MDN</a> will be updated sometime soon.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/23/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/23/site_compatibility/index.html new file mode 100644 index 0000000000..34f2ab9b60 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/23/site_compatibility/index.html @@ -0,0 +1,92 @@ +--- +title: Site Compatibility for Firefox 23 +slug: Site_Compatibility_for_Firefox_23 +translation_of: Mozilla/Firefox/Releases/23/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 23 <a href="http://www.mozilla.org/en-US/firefox/aurora/">Aurora</a> (pre-Beta) was released on <time datetime="2013-05-17">May 17, 2013</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p> +<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p> +<ul> + <li><a href="http://www.mozilla.org/en-US/firefox/23.0a2/auroranotes/">Firefox 23 Aurora Release Notes</a></li> + <li><a href="/en-US/docs/Mozilla/Firefox/Releases/23">Firefox 23 for developers</a></li> +</ul> +<p>This list may be updated until the release of the final version on <time datetime="2013-08-06">August 6, 2013</time>, so please check back later.</p> +<section id="sect1"> + <h2 id="CSS">CSS</h2> + <section id="sect2"> + <h3 id="能产生文字闪烁效果的text-decorationblink属性值被删除">能产生文字闪烁效果的<code>text-decoration:blink</code>属性值被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857820">Bug 857820 – Drop only blink effect from text-decoration: blink; and completely remove <blink> element</a></li> + </ul> + <p>Firefox previously supported the Netscape-derived blink effect with the <code>blink</code> keyword for the CSS <a href="/en-US/docs/Web/CSS/text-decoration"><code>text-decoration</code></a> property as well as the HTML <a href="/en-US/docs/Web/HTML/Element/blink"><code>blink</code></a> element and the DOM <a href="/en-US/docs/JavaScript/Reference/Global_Objects/String/blink"><code>String.blink</code></a> method. Starting with Firefox 23, the blink effect no longer works. While <code>text-decoration:blink</code> continues to be supported by the CSS parser and the DOM APIs, the HTML parser has dropped the <code>blink</code> element support, thus the element will be treated as an unknown element. Internet Explorer, Chrome and Safari haven't supported the effect. Opera may also drop the support once it switches to the Blink rendering engine.</p> + </section> +</section> +<section id="sect7"> + <h2 id="DOM">DOM</h2> + <section id="sect8"> + <h3 id="添加到侧边栏的功能被删除">添加到侧边栏的功能被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=691647">Bug 691647 – clean up nsISidebar (remove window.sidebar.addPanel/addPersistentPanel)</a></li> + </ul> + <p><code>window.sidebar.addPanel</code> and <code>window.sidebar.addPersistentPanel</code> are no longer supported. These methods were a part of a Netscape-derived API which allowed Web publishers to integrate their contents as sidebar panels of the browser. They were not standardized, rarely used, and not very well supported. No other browsers have implemented these.</p> + <p>There is also a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=862147">plan</a> to remove <a href="/en-US/docs/Web/API/window.sidebar"><code>window.sidebar</code></a> itself in the future.</p> + </section> + <section id="sect9"> + <h3 id="requestAnimationFrame脱前缀"><code>requestAnimationFrame</code>脱前缀</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=704063">Bug 704063 – Add unprefixed requestAnimationFrame</a></li> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=753453">Bug 753453 – requestAnimationFrame callback should return DOMHighResTimeStamp</a></li> + </ul> + <p><a href="/en-US/docs/Web/API/window.requestAnimationFrame"><code>requestAnimationFrame</code></a>, the unprefixed version of <code>mozRequestAnimationFrame</code>, has been added. This unprefixed method passes a <a href="/en-US/docs/Web/API/DOMHighResTimeStamp"><code>DOMHighResTimeStamp</code></a> to callbacks. It has microsecond precision and can be compared to <a href="/en-US/docs/Web/API/window.performance.now"><code>performance.now()</code></a>.</p> + <p>On the other hand, the prefixed method, which will be removed in the future, continues to pass an epoch-based <a href="/en-US/docs/Web/API/DOMTimeStamp"><code>DOMTimeStamp</code></a> to callbacks. The passed-in value has millisecond precision and can be compared to <a href="/en-US/docs/Web/API/window.mozAnimationStartTime"><code>mozAnimationStartTime</code></a>.</p> + </section> + <section id="sect10"> + <h3 id="跨域文档的contentDocument属性现在返回null">跨域文档的<code>contentDocument</code>属性现在返回<code>null</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=829872">Bug 829872 – Consider returning null from contentDocument getters when the caller does not subsume the document</a></li> + </ul> + <p>The <code>contentDocument</code> property on frames now returns <a href="/en-US/docs/JavaScript/Reference/Global_Objects/null"><code>null</code></a> if the caller doesn't subsume the document. This change affects the <code>contentDocument</code> property on the <a href="/en-US/docs/Web/HTML/Element/frame"><code>frame</code></a>, <a href="/en-US/docs/Web/HTML/Element/iframe"><code>iframe</code></a> and <a href="/en-US/docs/Web/HTML/Element/object"><code>object</code></a> elements as well as the <code>getSVGDocument</code> method on the <a href="/en-US/docs/Web/HTML/Element/embed"><code>embed</code></a>, <code>iframe</code> and <code>object</code> elements.</p> + </section> + <section id="sect13"> + <h3 id="window.defaultStatus被删除"><code>window.defaultStatus</code>被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=862917">Bug 862917 – Remove window.defaultStatus</a></li> + </ul> + <p>The <a href="/en-US/docs/Web/API/window.defaultStatus"><code>window.defaultStatus</code></a> property is no longer available. Setting this property has had no effect in Firefox because the default preference has disallowed changes to the status text by Web pages. Recently, the Firefox UI dropped support for enabling that pref. Also, this property is not specified in the HTML5 spec. <a href="/en-US/docs/Web/API/window.status"><code>window.status</code></a> is still available.</p> + </section> + <section id="sect14"> + <h3 id="不再允许创建AnimationEvent和TransitionEvent">不再允许创建<code>AnimationEvent</code><code>和TransitionEvent</code></h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=868751">Bug 868751 – Remove support for document.createEvent("AnimationEvent"), document.createEvent("TransitionEvent"), AnimationEvent.initAnimationEvent, and TransitionEvent.initTransitionEvent</a></li> + </ul> + <p>The support for obsolete <code>document.createEvent("AnimationEvent")</code>, <code>document.createEvent("TransitionEvent")</code>, <a href="/en-US/docs/Web/API/AnimationEvent#initAnimationEvent%28%29"><code>AnimationEvent.initAnimationEvent</code></a>, and <code>TransitionEvent.initTransitionEvent</code> has been removed.</p> + </section> +</section> +<section id="sect15"> + <h2 id="视频和音频">视频和音频</h2> + <section id="sect16"> + <h3 id="Audio_Data_API被废弃">Audio Data API被废弃</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=855570">Bug 855570 – Deprecate Audio Data API</a></li> + </ul> + <p>The non-standard, experimental <a href="/en-US/docs/Introducing_the_Audio_API_Extension">Audio Data API</a> is now considered deprecated. The standard <a href="/en-US/docs/Web_Audio_API">Web Audio API</a> can be used instead.</p> + </section> + <section id="sect17"> + <h3 id="HTMLMediaElement.initialTime被删除"><code>HTMLMediaElement.initialTime</code>被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=742537">Bug 742537 – Remove HTMLMediaElement.initialTime</a></li> + </ul> + <p>The <code>HTMLMediaElement.initialTime</code> property is no longer available, due to the removal from the spec.</p> + </section> +</section> +<section id="sect18"> + <h2 id="安全和隐私">安全和隐私</h2> + <section id="sect19"> + <h3 id="在SSL页面(HTTPS)上的非SSL活动内容会被默认阻止">在SSL页面(HTTPS)上的非SSL活动内容会被默认阻止</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=834836">Bug 834836 – Turn on pref to block mixed active content</a></li> + </ul> + <p><a href="/en-US/docs/Site_Compatibility_for_Firefox_18">Firefox 18</a> introduced preferences to block loading content from non-SSL (<code>http</code>) sites on SSL (<code>https</code>) pages. One of those preferences, <code>security.mixed_content.block_active_content</code> is now enabled by default in order to enhance user security. That means insecure scripts, stylesheets, plug-in contents, inline frames, <a href="/en-US/docs/Web/CSS/@font-face">Web fonts</a> and <a href="/en-US/docs/WebSockets">WebSockets</a> are blocked on secure pages, and a notification is displayed instead. It will <strong>not</strong> block "display content" like images, videos or audio. See <a href="https://blog.mozilla.org/tanvi/2013/04/10/mixed-content-blocking-enabled-in-firefox-23/">Tanvi Vyas' blog post</a> for details.</p> + <p>Mozilla is tracking mixed content issues found on <a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=844556">major sites</a> as well as <a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=843977">its own properties</a>.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/24/site_compatibility/index.html b/files/zh-cn/mozilla/firefox/releases/24/site_compatibility/index.html new file mode 100644 index 0000000000..296e580123 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/24/site_compatibility/index.html @@ -0,0 +1,22 @@ +--- +title: Firefox 24网站兼容性 +slug: Site_Compatibility_for_Firefox_24 +translation_of: Mozilla/Firefox/Releases/24/Site_compatibility +--- +<div>{{FirefoxSidebar}}</div><p>{{ draft() }}</p> +<p>Firefox 24 <a href="http://www.mozilla.org/zh-CN/firefox/aurora/">Aurora</a> (pre-Beta) will be released on <time datetime="2013-06-28">June 28, 2013</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p> +<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p> +<ul> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Releases/24">Firefox 24 for developers</a></li> +</ul> +<p>This list may be updated until the release of the final version on <time datetime="2013-09-17">September 17, 2013</time>, so please check back later.</p> +<section id="sect1"> + <h2 id="DOM">DOM</h2> + <section id="sect2"> + <h3 id="releaseEventscaptureEventsrouteEvent等方法被删除"><code>releaseEvents</code>,<code>captureEvents,</code><code>routeEvent</code>等方法被删除</h3> + <ul> + <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=673919">Bug 673919 – Remove releaseEvents, captureEvents, routeEvent</a></li> + </ul> + <p>The <a href="/zh-CN/docs/Web/API/window.releaseEvents"><code>releaseEvents</code></a>, <a href="/zh-CN/docs/Web/API/window.captureEvents"><code>captureEvents</code></a>, <a href="/zh-CN/docs/Web/API/window.routeEvent"><code>routeEvent</code></a>, <code>enableExternalCapture</code> and <code>disableExternalCapture</code> methods on the <a href="/zh-CN/docs/Web/API/Window"><code>window</code></a> object have been removed. They were Netscape-derived APIs <a href="/zh-CN/docs/Gecko_1.9_Changes_affecting_websites">deprecated since Firefox 3</a> and the implementation has been no-op (doing nothing). Recently Google Chrome (the Blink rendering engine) also removed the support for those methods. The standard <a href="/zh-CN/docs/Web/API/Event">DOM Event</a> methods, including <a href="/zh-CN/docs/Web/API/EventTarget.addEventListener"><code>addEventListener</code></a> and <a href="/zh-CN/docs/Web/API/EventTarget.removeEventListener"><code>removeEventListener</code></a>, should be used instead.</p> + </section> +</section> diff --git a/files/zh-cn/mozilla/firefox/releases/3/updating_extensions/index.html b/files/zh-cn/mozilla/firefox/releases/3/updating_extensions/index.html new file mode 100644 index 0000000000..96a2e8ec19 --- /dev/null +++ b/files/zh-cn/mozilla/firefox/releases/3/updating_extensions/index.html @@ -0,0 +1,217 @@ +--- +title: 为Firefox 3升级扩展 +slug: Updating_extensions_for_Firefox_3 +tags: + - Firefox 3 +translation_of: Mozilla/Firefox/Releases/3/Updating_extensions +--- +<div><section class="Quick_links" id="Quick_Links"> + <ol> + <li class="toggle"> + <details> + <summary>Firefox developer 发布说明</summary> + <ol> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Releases">Firefox developer 发布说明</a></li> + </ol> + </details> + </li> + <li class="toggle"> + <details> + <summary>附加组件</summary> + <ol> + <li><a href="/zh-CN/Add-ons/WebExtensions">浏览器扩展</a></li> + <li><a href="/zh-CN/Add-ons/Themes">主题</a></li> + </ol> + </details> + </li> + <li class="toggle"> + <details> + <summary>Firefox 的内部机制</summary> + <ol> + <li><a href="/zh-CN/docs/Mozilla/">Mozilla 项目</a></li> + <li><a href="/zh-CN/docs/Mozilla/Gecko">Gecko</a></li> + <li><a href="/zh-CN/docs/Mozilla/Firefox/Headless_mode">Headless mode</a></li> + <li><a href="/zh-CN/docs/Mozilla/JavaScript_code_modules">JavaScript代码模块</a></li> + <li><a href="/zh-CN/docs/Mozilla/js-ctypes">JS-ctypes</a></li> + <li><a href="/zh-CN/docs/Mozilla/MathML_Project">MathML 项目</a></li> + <li><a href="/zh-CN/docs/Mozilla/MFBT">MFBT</a></li> + <li><a href="/zh-CN/docs/Mozilla/Projects">Mozilla 项目</a></li> + <li><a href="/zh-CN/docs/Mozilla/Preferences">Preference 系统</a></li> + <li><a href="/zh-CN/docs/Mozilla/WebIDL_bindings">WebIDL 绑定</a></li> + <li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM">XPCOM</a></li> + <li><a href="/zh-CN/docs/Mozilla/Tech/XUL">XUL</a></li> + </ol> + </details> + </li> + <li class="toggle"> + <details> + <summary>构建与作出贡献</summary> + <ol> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Build_Instructions">构建说明</a></li> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options">配置构建选项</a></li> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Build_Instructions/How_Mozilla_s_build_system_works">构建系统如何工作</a></li> + <li><a href="/zh-CN/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mozilla源代码</a></li> + <li><a href="/zh-CN/docs/Mozilla/Localization">本地化</a></li> + <li><a href="/zh-CN/docs/Mozilla/Mercurial">Mercurial</a></li> + <li><a href="/zh-CN/docs/Mozilla/QA">质量保证</a></li> + <li><a href="/zh-CN/docs/Mozilla/Using_Mozilla_code_in_other_projects">在其他项目中使用来自Mozilla的代码</a></li> + </ol> + </details> + </li> + </ol> +</section></div> + +<p><span class="comment">英文原文取自于 <a class="external" href="http://developer.mozilla.org/en/docs/Extensions" rel="freelink">http://developer.mozilla.org/en/docs/Extensions</a></span> 这篇文章将对于那些想把他们的扩展在Firefox 3中正常运行的开发者提供一些有用的信息。</p> + +<p>在进入主题之前,首先要提示一下:如果你的扩展所需要的唯一改变只是安装文件中的<code>maxVersion</code>信息,并且你的扩展所在的主机是<a class="link-https" href="https://addons.mozilla.org">addons.mozilla.org</a>,事实上你不需要上传你的新的版本的扩展!只需要在AMO中使用开发者控制面板调整<code>maxVersion</code>。通过这种方式你可以避免你的扩展被再次审核。</p> + +<h3 id=".E7.AC.AC.E4.B8.80.E6.AD.A5_.E5.8D.87.E7.BA.A7.E5.AE.89.E8.A3.85.E6.96.87.E4.BB.B6" name=".E7.AC.AC.E4.B8.80.E6.AD.A5:_.E5.8D.87.E7.BA.A7.E5.AE.89.E8.A3.85.E6.96.87.E4.BB.B6">第一步: 升级安装文件</h3> + +<p>第一步,当然,对于大多数的扩展也仅需要这一步——更新安装文件<code>install.rdf</code>,声明扩展兼容Firefox 3。</p> + +<p>找到声明兼容的最大版本号的那一行(对于Firefox2,如下):</p> + +<pre class="eval"> <span class="nowiki"><em:maxVersion>2.0.*</em:maxVersion></span> +</pre> + +<p>对于Firefox 3,如下:</p> + +<pre class="eval"> <span class="nowiki"><em:maxVersion>3.0.*</em:maxVersion></span> +</pre> + +<p>然后重新安装扩展。</p> + +<p>注意,在Firefox3的本版号中没有额外的“.0”,所以请使用“3.0.*”,而非“3.0.0.*”。</p> + +<div class="blockIndicator note"><strong>Note:</strong> Note that at this point more changes in Firefox 3 are expected. These changes may break some extensions, so you shouldn't release an extension with <code>3.0.*</code> <code>maxVersion</code> to the users until the Firefox 3 release candidate is out. During the Firefox 3 Beta period, you should use <code>3.0b5</code> as your <code>maxVersion</code>.</div> + +<p><br> + There have been (and will continue to be) a number of API changes that will likely break some extensions. We're still working on compiling a complete list of these changes.</p> + +<div class="blockIndicator note"><strong>Note:</strong> If your extension still uses an <code><a href='"cn/Install.js"'>Install.js</a></code> script instead of an <a href='"cn/Install_Manifests"'>install manifest</a>, you need to make the transition to an install manifest now. Firefox 3 no longer supports <code>install.js</code> scripts in XPI files.</div> + +<h4 id="Add_localizations_to_the_install_manifest" name="Add_localizations_to_the_install_manifest">Add localizations to the install manifest</h4> + +<p>Firefox 3 supports new properties in the install manifest to specify localized descriptions. The old methods still work however the new allow Firefox to pick up the localizations even when the add-on is disabled and pending install. See <a href="/cn/Localizing_extension_descriptions" title="cn/Localizing_extension_descriptions">Localizing extension descriptions</a> for more details.</p> + +<h3 id="Step_2_.E7.A1.AE.E4.BF.9D.E6.8F.90.E4.BE.9B.E5.AE.89.E5.85.A8.E7.9A.84.E6.9B.B4.E6.96.B0" name="Step_2:_.E7.A1.AE.E4.BF.9D.E6.8F.90.E4.BE.9B.E5.AE.89.E5.85.A8.E7.9A.84.E6.9B.B4.E6.96.B0">Step 2: 确保提供安全的更新</h3> + +<p>If you are hosting addons yourself and not on a secure add-on hosting provider like <a class="link-https" href="https://addons.mozilla.org">addons.mozilla.org</a> then you must provide a secure method of updating your add-on. This will either involve hosting your updates on an SSL website, or using cryptographic keys to sign the update information. Read <a href="/cn/Extension_Versioning,_Update_and_Compatibility#Securing_Updates" title="cn/Extension_Versioning,_Update_and_Compatibility#Securing_Updates">Securing Updates</a> for more information.</p> + +<h3 id="Step_3_Deal_with_changed_APIs" name="Step_3:_Deal_with_changed_APIs">Step 3: Deal with changed APIs</h3> + +<p>Several APIs have been changed in significant ways. The most significant of these, which will likely affect a large number of extensions, are:</p> + +<h4 id="DOM" name="DOM">DOM</h4> + + +<p>将外部文档的节点插入当前文档之前,你必须使用 <a href="/zh-CN/docs/Web/API/Document/importNode" title="将外部文档的一个节点拷贝一份,然后可以把这个拷贝的节点插入到当前文档中."><code>document.importNode()</code></a> 从外部文档导入源节点,或者使用 <a href="/zh-CN/docs/Web/API/Document/adoptNode" title="从其他的document文档中获取一个节点。 该节点以及它的子树上的所有节点都会从原文档删除 (如果有这个节点的话), 并且它的ownerDocument 属性会变成当前的document文档。 之后你可以把这个节点插入到当前文档中。"><code>document.adoptNode()</code></a>导入源节点, + 想要了解更多的 <a href="/zh-CN/docs/Web/API/Node/ownerDocument" title="Node.ownerDocument 只读属性会返回当前节点的顶层的 document 对象。"><code>Node.ownerDocument</code></a> 问题,请参考 <a class="external" href="http://www.w3.org/DOM/faq.html#ownerdoc" rel="noopener">W3C DOM FAQ</a>.</p> + + <p>即使你不执行导入动作,就执行插入外部文档中的节点.Firefox目前也不会报错(如果严格按标准执行,很多已有的网站都无法正常运行). + 我们鼓励开发者严格按标准修改自己已有的不符合上述标准的代码.</p> + +<h4 id="Bookmarks__History" name="Bookmarks_&_History">Bookmarks & History</h4> + +<p>If your extension accesses bookmark or history data in any way, it will need substantial work to be compatible with Firefox 3. The old APIs for accessing this information have been replaced by the new <a href="/cn/Places" title="cn/Places">Places</a> architecture. See the <a href="/cn/Places_migration_guide" title="cn/Places_migration_guide">Places migration guide</a> for details on updating your existing extension to use the Places API.</p> + +<h4 id="Download_Manager" name="Download_Manager">Download Manager</h4> + +<p>The Download Manager API has changed slightly due to the transition from an RDF data store to using the <a href="/cn/Storage" title="cn/Storage">Storage</a> API. This should be a pretty easy transition to make. In addition, the API for monitoring download progress has changed to support multiple download manager listeners. See <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadManager" title="">nsIDownloadManager</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadProgressListener" title="">nsIDownloadProgressListener</a></code>, and <a href="/cn/Monitoring_downloads" title="cn/Monitoring_downloads">Monitoring downloads</a> for more information.</p> + +<h4 id="Password_Manager" name="Password_Manager">Password Manager</h4> + +<p>If your extension accesses user login information using the Password Manager, it will need to be updated to use the new Login Manager API.</p> + +<ul> + <li>The article <a href="/cn/Using_nsILoginManager" title="cn/Using_nsILoginManager">Using nsILoginManager</a> includes examples, including a demonstration of how to write your extension to work with both the Password Manager and the Login Manager, so it will work with both Firefox 3 and earlier versions.</li> + <li><code><a href="/cn/NsILoginInfo" title="cn/NsILoginInfo">nsILoginInfo</a></code></li> + <li><code><a href="/cn/NsILoginManager" title="cn/NsILoginManager">nsILoginManager</a></code></li> +</ul> + +<p>You can also override the built-in password manager storage if you want to provide your own password storage implementation in your extensions. See <a href="/cn/Creating_a_Login_Manager_storage_module" title="cn/Creating_a_Login_Manager_storage_module">Creating a Login Manager storage module</a> for details.</p> + +<h4 id="Popups_.28Menus.2C_Context_Menus.2C_Tooltips_and_Panels.29" name="Popups_.28Menus.2C_Context_Menus.2C_Tooltips_and_Panels.29">Popups (Menus, Context Menus, Tooltips and Panels)</h4> + +<p>The XUL Popup system was heavily modified in Firefox 3. The Popup system includes main menus, context menus and popup panels. A guide to <a href="/cn/XUL/PopupGuide" title="cn/XUL/PopupGuide">using Popups</a> has been created, detailing how the system works. One thing to note is that <code>popup.<span id="m-showPopup"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/showPopup">showPopup</a></code></span></code> has been deprecated in favor of new <code>popup.<span id="m-openPopup"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/openPopup">openPopup</a></code></span></code> and <code>popup.<span id="m-openPopupAtScreen"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/openPopupAtScreen">openPopupAtScreen</a></code></span></code>.</p> + +<h4 id="Autocomplete" name="Autocomplete">Autocomplete</h4> + +<p>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAutoCompleteController" title="">nsIAutoCompleteController</a></code> interface's <code><a href="/cn/NsIAutoCompleteController#handleEnter.28.29" title="cn/NsIAutoCompleteController#handleEnter.28.29">handleEnter()</a></code> method has been changed to accept an argument that indicates whether the text was selected from the autocomplete popup or by the user pressing enter after typing text.</p> + +<h4 id="DOMParser" name="DOMParser">DOMParser</h4> + +<ul> + <li>When a <code>DOMParser</code> is instantiated, it inherits the calling code's principal and the <code>documentURI</code> and <code>baseURI</code> of the window the constructor came from.</li> + <li>If the caller has UniversalXPConnect privileges, it can pass parameters to <code>new DOMParser()</code>. If fewer than three parameters are passed, the remaining parameters will default to <code>null</code>. + <ul> + <li>The first parameter is the principal to use; this overrides the default principal normally inherited.</li> + <li>The second parameter is the <code>documentURI</code> to use.</li> + <li>The third parameter is the <code>baseURI</code> to use.</li> + </ul> + </li> + <li>If you initialize a <code>DOMParser</code> using a contract, such as by calling <code>createInstance()</code>, and you don't call the <code>DOMParser</code>'s <code>init()</code> method, attempting to initiate a parsing operation will automatically create and initialize the <code>DOMParser</code> with a null principal and <code>null</code> pointers for <code>documentURI</code> and <code>baseURI</code>.</li> +</ul> + +<h4 id="Removed_interfaces" name="Removed_interfaces">Removed interfaces</h4> + +<p>The following interfaces were removed from Gecko 1.9, which drives Firefox 3. If your extension makes use of any of these, you'll need to update your code:</p> + +<ul> + <li><code>nsIDOMPaintListener</code></li> + <li><code>nsIDOMScrollListener</code></li> + <li><code>nsIDOMMutationListener</code></li> + <li><code>nsIDOMPageTransitionListener</code></li> + <li><code>nsICloseAllWindows</code> (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=386200" title='FIXED: SeaMonkey only: no "view cert button" in untrusted cert error dialog'>bug 386200</a>)</li> +</ul> + +<h3 id="Step_4_Check_for_relevant_chrome_changes" name="Step_4:_Check_for_relevant_chrome_changes">Step 4: Check for relevant chrome changes</h3> + +<p>There has been a minor change to the chrome that may require changes in your code. A new <code>vbox</code> has been added, called "browser-bottombox", which encloses the find bar and status bar at the bottom of the browser window. Although this doesn't affect the appearance of the display, it may affect your extension if it overlays chrome relative to these elements.</p> + +<p>For example, if you previously overlaid some chrome before the status bar, like this:</p> + +<pre><window id="main-window"> + <something insertbefore="status-bar" /> +</window> +</pre> + +<p>You should now overlay it like this:</p> + +<pre><vbox id="browser-bottombox"> + <something insertbefore="status-bar" /> +</vbox> +</pre> + +<p>Or use the following technique to make your overlay work on both Firefox 2 and Firefox 3:</p> + +<pre><window id="main-window"> + <vbox id="browser-bottombox" insertbefore="status-bar"> + <something insertbefore="status-bar" /> + </vbox> +</window> +</pre> + +<div class="blockIndicator note"><strong>Note:</strong> This change is effective for Firefox 3 beta 4 and the pre-beta 4 nightlies.</div> + +<h3 id="Other_changes" name="Other_changes">其他方面的修改</h3> + +<p><em>Add simple changes you had to make while updating your extension to work with Firefox 3 here.</em></p> + +<ul> + <li><code><a class="external" rel="freelink">chrome://browser/base/utilityOverlay.js</a></code> is no longer supported for security reasons. If you were previously using this, you should switch to <code><a class="external" rel="freelink">chrome://browser/content/utilityOverlay.js</a></code>.</li> + <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAboutModule" title="">nsIAboutModule</a></code> implementations are now required to support the <code>getURIFlags</code> method. See <a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/about/public/nsIAboutModule.idl" rel="custom">nsIAboutModule.idl</a> for documentation. This affects extensions that provide new <code>about:</code> URIs. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=337746" title='FIXED: [FIX]Move "safe about" hardcoding out of security manager'>bug 337746</a>)</li> + <li>The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabbrowser" title="tabbrowser">tabbrowser</a></code> element is no longer part of "toolkit" (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=339964" title="FIXED: move tabbrowser.xml out of mozilla/toolkit and into mozilla/browser">bug 339964</a>). This means this element is no longer available to XUL applications and extensions. It continues to be used in the main Firefox window (browser.xul).</li> + <li>Changes to <a href="/cn/NsISupports_proxies" title="cn/NsISupports_proxies">nsISupports proxies</a> and possibly to threading-related interfaces need to be documented.</li> + <li>If you use XML processing instructions, such as <code><?xml-stylesheet ?></code> in your XUL files, be aware of the changes made in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=319654" title="FIXED: Processing instructions in XUL are not added to the content model">bug 319654</a>: + <ol> + <li>XML PIs are now added to a XUL document's DOM. This means <a href="/zh-CN/docs/Web/API/Document/firstChild" title="此页面仍未被本地化, 期待您的翻译!"><code>document.firstChild</code></a> is no longer guaranteed to be the root element. If you need to get the root document in your script, use <a href="/zh-CN/docs/Web/API/Document/documentElement" title="Document.documentElement 是一个会返回文档对象(document)的根元素的只读属性(如HTML文档的 <html> 元素)。"><code>document.documentElement</code></a> instead.</li> + <li><code><?xml-stylesheet ?></code> and <code><?xul-overlay ?></code> processing instructions now have no effect outside the document prolog.</li> + </ol> + </li> + <li><code>window.addEventListener("load", myFunc, true)</code> is not fired when loading web content (browser page loads). This is due to <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=296639" title="FIXED: Split windows into an inner and outer object">bug 296639</a> which changes the way inner and outer windows communicate. The simple fix here is to use <code>gBrowser.addEventListener("load", myFunc, true)</code> as described <a href="/cn/Code_snippets/Tabbed_browser#Detecting_page_load" title="cn/Code_snippets/Tabbed_browser#Detecting_page_load">here</a> and works in Firefox 2 as well.</li> + <li><code>content.window.getSelection()</code> gives an object (which can be converted to a string by <code>toString()</code>), unlike the now deprecated <code>content.document.getSelection()</code> which returns a string</li> + <li><code>event.preventBubble()</code> was deprecated in Firefox 2 and has been removed in Firefox 3. Use <a href="/cn/DOM/event.stopPropagation" title="cn/DOM/event.stopPropagation"><code>event.stopPropagation()</code></a>, which works in Firefox 2 as well.</li> + <li>Timers that are initiated using <code>setTimeout()</code> are now blocked by modal windows due to the fix made for <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=52209" title="FIXED: JS timers can fire while a modal dialog is open">bug 52209</a>. You may use <code>nsITimer</code> instead.</li> + <li>If your extension needs to allow an untrusted source (e.g., a web site) to access the extension's chrome, then you must use the new <a href="/cn/Chrome_Registration#contentaccessible" title="cn/Chrome_Registration#contentaccessible"><code>contentaccessible</code> flag</a>.</li> +</ul> diff --git a/files/zh-cn/mozilla/mozilla_persona/index.html b/files/zh-cn/mozilla/mozilla_persona/index.html deleted file mode 100644 index 583cb6cb5a..0000000000 --- a/files/zh-cn/mozilla/mozilla_persona/index.html +++ /dev/null @@ -1,155 +0,0 @@ ---- -title: Mozilla Persona -slug: Mozilla/Mozilla_Persona -tags: - - Mozilla - - Persona ---- -<div class="callout-box"> - <p><strong>保持联系或获取帮助!</strong></p> - <p>关注 <a class="external" href="http://identity.mozilla.com/" title="http://identity.mozilla.com/">我们的 blog</a>,加入 <a class="link-https" href="https://lists.mozilla.org/listinfo/dev-identity" title="https://lists.mozilla.org/listinfo/dev-identity">我们的邮件列表</a>,或在 <a class="link-https" href="https://wiki.mozilla.org/IRC" title="https://wiki.mozilla.org/IRC">IRC</a> 中的 <a class="link-irc" href="irc://irc.mozilla.org/identity" title="irc://irc.mozilla.org/identity">#identity</a> 找到我们。</p> -</div> -<p><a class="link-https" href="https://www.mozilla.org/zh-CN/persona/" title="https://www.mozilla.org/zh-CN/persona/">Mozilla Persona</a> 是一个用于 web 的完全去中心化且安全的验证系统,基于开放 BrowserID 协议。Mozilla 当前管理一个 Persona 相关的一个<a href="/zh-CN/docs/Persona/Bootstrapping_Persona" title="/zh-CN/docs/Persona/Bootstrapping_Persona">可选的、中心化服务</a>的一小组套件。</p> -<p>为什么你和你的站点应该使用 Persona?</p> -<ol> - <li><strong>Persona 完全消除了站点特定的密码,</strong> 把用户和网站从创建、管理和安全存放密码的责任中解放出来。</li> - <li><strong>Persona 易于使用。</strong>只需点击两次,一个 Persona 用户可以登入到一个诸如 <a href="http://voo.st" title="http://voo.st">Voost</a> 或 <a href="http://crossword.thetimes.co.uk/" title="http://crossword.thetimes.co.uk/">The Times Crossword</a> 的新站点,绕开了账户创建相关的摩擦。</li> - <li><strong>Persona 易于实现。</strong>开发人员在一个下午就可以把 Persona 添加到站点上。</li> - <li>最好的是,<strong>不会被锁定</strong>。 开发人员获取所有他们用户的验证过的邮件地址,而用户可以在 Persona 上使用任何邮件地址。</li> - <li><strong>Persona 基于 BrowserID 协议构建。</strong>一旦流行的浏览器供应商实现了 BrowserID<strong>,它们不再需要依赖于 Mozilla 来登入。</strong></li> -</ol> -<p>继续阅读来开始!</p> -<div class="note"> - <strong>注意:</strong>Persona 在活跃开发中。关注<a class="external" href="http://identity.mozilla.com/" title="http://identity.mozilla.com/">我们的 blog</a> 来了解新特性,或加入<a class="link-https" href="https://lists.mozilla.org/listinfo/dev-identity" title="https://lists.mozilla.org/listinfo/dev-identity">我们的邮件列表</a>来提供反馈!</div> -<h2 id="在你的站点上使用_Persona">在你的站点上使用 Persona</h2> -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h3 id="准备开始">准备开始</h3> - <dl> - <dt> - <a href="/zh-CN/docs/Persona/Why_Persona" title="zh-CN/BrowserID/Why_BrowserID">为什么使用 Persona?</a></dt> - <dd> - 了解在你的站点上支持 Persona 的原因和它与其它身份验证系统的区别。</dd> - <dt> - <a href="/zh-CN/Persona/Quick_Setup" title="BrowserID/Quick setup">快速安装</a></dt> - <dd> - 一份快捷的攻略,展示了如何向你的网站中添加 Persona。</dd> - </dl> - </td> - <td> - <h3 id="Persona_API_参考">Persona API 参考</h3> - <dl> - <dt> - <a href="/zh-CN/DOM/navigator.id" title="navigator.id">navigator.id API 参考</a></dt> - <dd> - <code>navigator.id</code> 对象的参考,web 开发者可以用此来把 Persona 继承到站点中。</dd> - <dt> - <a href="/zh-CN/Persona/Remote_Verification_API" title="zh-CN/BrowserID/Remote_Verification_API">验证 API 参考</a></dt> - <dd> - 建立在 <code>https://verifier.login.persona.org/verify</code> 上的远程验证 API 的参考。</dd> - </dl> - </td> - </tr> - <tr> - <td> - <h3 id="指导">指导</h3> - <dl> - <dt> - <a href="/zh-CN/Persona/Security_Considerations" title="BrowserID/Security considerations">安全考虑</a></dt> - <dd> - 确保 Persona 部署安全的实践和技术。</dd> - <dt> - <a href="/zh-CN/Persona/Browser_compatibility" title="/Browser_compatibility">浏览器兼容性</a></dt> - <dd> - 准确获知哪些浏览器支持 Persona。</dd> - <dt> - <a href="/zh-CN/Persona/Internationalization" title="/Internationalization">国际化</a></dt> - <dd> - 了解 Persona 如何处理不同的语言。</dd> - </dl> - </td> - <td> - <h3 id="资源">资源</h3> - <dl> - <dt> - <a class="link-https" href="https://github.com/mozilla/browserid/wiki/Persona-Libraries" title="https://github.com/mozilla/browserid/wiki/BrowserID-Libraries">库和插件</a></dt> - <dd> - 寻找你偏好的编程语言、web 框架、博客或是内容管理系统(CMS)的即插库。</dd> - <dt> - <a class="link-https" href="https://github.com/mozilla/browserid-cookbook" title="https://github.com/mozilla/browserid-cookbook">Persona cookbook</a></dt> - <dd> - Persona 站点的示例源代码。包括 PHP、Node.JS 等等的片段。</dd> - <dt> - <a href="/zh-CN/docs/persona/branding" title="/zh-CN/docs/persona/branding">品牌资源</a></dt> - <dd> - 登入按钮和其它向用户表现 Persona 的图形。</dd> - </dl> - </td> - </tr> - </tbody> -</table> -<p> </p> -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 id="给身份提供者的信息">给身份提供者的信息</h2> - <p>如果你是一个电子邮件提供商或另一个身份提供服务,翻阅下面的链接来获知如何成为一个 Persona 身份提供者。</p> - <dl> - <dt> - <a href="/zh-CN/docs/Persona/Identity_Provider_Overview" title="IdP">IdP 概述</a></dt> - <dd> - Persona 身份提供者的高层视角。</dd> - <dt> - <a href="/zh-CN/Persona/Implementing_a_Persona_IdP" title="Guide to Implementing a Persona IdP">实现一个 IdP</a></dt> - <dd> - 成为一个 IdP 的详细技术细节指导。</dd> - <dt> - <a href="/zh-CN/Persona/IdP_Development_tips" title="Developer tips">开发提示</a></dt> - <dd> - 开发一个新的身份提供者的一系列开发提示和技巧。</dd> - <dt> - <a href="/zh-CN/docs/Persona/.well-known-browserid" title="https://developer.mozilla.org/zh-CN/docs/Persona/.well-known-browserid">.well-known/browserid</a></dt> - <dd> - <code>.well-known/browserid</code> 文件的结构和用途概述,这个文件被 IdPs 用于通知它们支持这个协议。</dd> - </dl> - </td> - <td> - <h2 id="Persona_项目">Persona 项目</h2> - <dl> - <dt> - <a href="/zh-CN/Persona/Glossary" title="navigator.id">术语表</a></dt> - <dd> - BrowserID 和 Persona 定义的术语。</dd> - <dt> - <a href="/zh-CN/Persona/FAQ" title="zh-CN/BrowserID/FAQ">FAQ</a></dt> - <dd> - 常见问题的回答。</dd> - <dt> - <a href="/zh-CN/Persona/Protocol_Overview" title="BrowserID/Protocol overview">协议概述</a></dt> - <dd> - 底层 BrowserID 协议的中等技术概述。</dd> - <dt> - <a href="/zh-CN/persona/Crypto" title="MDN">加密</a></dt> - <dd> - 一瞥 Persona 和 BrowserID 背后的密码学概念。</dd> - <dt> - <a class="link-https" href="https://github.com/mozilla/id-specs/blob/master/browserid/index.md" title="https://github.com/mozilla/id-specs/blob/master/browserid/index.md">协议规范</a></dt> - <dd> - 这里是深层技术细节。</dd> - <dt> - <a href="/Persona/Bootstrapping_Persona" title="zh-CN/BrowserID/Bootstrapping_BrowserID">Persona 网站</a></dt> - <dd> - 要让 Persona 运作, 我们在<a class="link-https" href="https://login.persona.org" rel="freelink">https://login.persona.org</a> 建立了三个服务:一个备用身份提供者、一个可迁移的 {{ domxref("navigator.id") }} API 实现以及一个身份断言验证服务。</dd> - <dt> - <a href="https://github.com/mozilla/browserid">Persona 源码</a></dt> - <dd> - Persona 网站背后的源码托管在 GitHub 的一个仓库上。欢迎提交补丁!</dd> - </dl> - </td> - </tr> - </tbody> -</table> -<p> </p> |