diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 21:46:22 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 21:46:22 -0500 |
commit | a065e04d529da1d847b5062a12c46d916408bf32 (patch) | |
tree | fe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/zh-tw/archive | |
parent | 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff) | |
download | translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2 translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip |
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/zh-tw/archive')
134 files changed, 0 insertions, 18697 deletions
diff --git a/files/zh-tw/archive/add-ons/developing_add-ons/index.html b/files/zh-tw/archive/add-ons/developing_add-ons/index.html deleted file mode 100644 index 048ba6dd7e..0000000000 --- a/files/zh-tw/archive/add-ons/developing_add-ons/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: 開發附加元件 -slug: Archive/Add-ons/Developing_add-ons -translation_of: Archive/Add-ons/Developing_add-ons ---- -<p>大多數的 Mozilla 所開發的軟件,主要是透過「附加元件」來擴充其工能。 「附加元件」主要分成三大類:「擴充套件(Extensions)」 、「外掛程式(Plugin-ins)」及「佈景主題(Themes)」。本文的主要目的,是去指導及提供你所需的資訊用來去製作 Firefox 、 Thunderbird ...等等的 Mozilla 的軟體上的「附加元件」,以及提交及發佈你所製作的「附加元件」的方法。</p> -<table class="mainpage-table"> - <tbody> - <tr> - <td colspan="2"> - <h2 id="附加元件主題">附加元件主題</h2> - </td> - </tr> - <tr> - <td> - <dl> - <dt> - <a class="internal" href="/zh_tw/提交附加元件至AMO" title="zh tw/提交附加元件至AMO">提交附加元件至 AMO</a></dt> - <dd> - Provides helpful information for add-on developers to help them properly package and deliver their add-ons. This includes information about addons.mozilla.org, Mozilla's add-on distribution web site.</dd> - <dt> - <a class="internal" href="/zh_tw/擴充套件" title="zh tw/擴充套件">擴充套件</a></dt> - <dd> - Extensions add new functionality to Mozilla applications such as Firefox, SeaMonkey and Thunderbird. They can add anything from a toolbar button to a completely new feature.</dd> - <dt> - <a class="internal" href="/zh_tw/Plugins" title="zh tw/Plugins">外掛程式</a></dt> - <dd> - Information about how to create plug-ins, which are binary components that let Mozilla based software display content they can't handle natively.</dd> - </dl> - </td> - <td> - <dl> - <dt> - <a class="internal" href="/zh_tw/佈景主題" title="zh tw/佈景主題">佈景主題</a></dt> - <dd> - Themes let users customize the appearance of the user interface presented by Mozilla-based applications.</dd> - <dt> - <a class="internal" href="/zh_tw/Creating_OpenSearch_plugins_for_Firefox" title="zh tw/Creating OpenSearch plugins for Firefox">搜尋引擎外掛</a></dt> - <dd> - Firefox supports search engine plug-ins, which enable the search box to support different search engines.</dd> - <dt> - <a class="internal" href="/zh_tw/The_Mozilla_platform" rel="internal" title="/zh tw/The Mozilla platform">Mozilla 平台</a></dt> - <dd> - Information about the Mozilla platform, including all of its APIs and technologies, as well as how to use them in your own projects.</dd> - </dl> - </td> - </tr> - </tbody> -</table> -<p> </p> diff --git a/files/zh-tw/archive/add-ons/index.html b/files/zh-tw/archive/add-ons/index.html deleted file mode 100644 index caac45ae4c..0000000000 --- a/files/zh-tw/archive/add-ons/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Add-ons -slug: Archive/Add-ons -translation_of: Archive/Add-ons ---- -<p>In progress. Archived add-ons documentation.</p> - -<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html b/files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html deleted file mode 100644 index 451d3dc91c..0000000000 --- a/files/zh-tw/archive/add-ons/supporting_search_suggestions_in_search_plugins/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: 讓搜尋模組支援搜尋建議 -slug: Archive/Add-ons/Supporting_search_suggestions_in_search_plugins -tags: - - 搜尋模組 -translation_of: Archive/Add-ons/Supporting_search_suggestions_in_search_plugins ---- -<p>MozSearch 格式的搜尋模組可以支援搜尋建議,當使用者在搜尋欄中逐字鍵入關鍵詞時,<a href="zh_tw/Firefox_2">Firefox 2</a> 將依據搜尋模組內指定的 URL 送出查詢並取回結果。 -</p><p>取回結果之後,Firefox 將其顯示為一個下拉選單,讓使用者從中挑選搜尋引擎建議的關鍵詞。如果使用者繼續輸入關鍵詞,則會重新取回結果並更新選單。 -</p><p>Firefox 2 中內建的 Yahoo! 與 Google 搜尋模組都支援搜尋建議功能。 -</p> -<h2 id=".E6.90.9C.E5.B0.8B.E6.A8.A1.E7.B5.84.E7.9A.84.E5.B7.A5.E4.BD.9C" name=".E6.90.9C.E5.B0.8B.E6.A8.A1.E7.B5.84.E7.9A.84.E5.B7.A5.E4.BD.9C">搜尋模組的工作</h2> -<p>搜尋模組必須額外定義一個 <code><Url></code> 元素以便支援搜尋建議功能,此元素之 <code>type</code> 屬性需設定為 <code>"application/x-suggestions+json"</code>。支援搜尋建議功能的模組都會有兩個 <code><Url></code> 元素,另一個元素指定主要的 code>text/html</code> 搜尋 URL。 -</p><p>舉例來說,Yahoo! 搜尋模組的 <code><Url></code> 長得像這樣: -</p> -<pre><Url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchTerms}"/> -</pre> -<p>如果使用者在搜尋欄中輸入「fir」,則 Firefox 會將此 URL 的 <code>{searchTerms}</code> 代換為「fir」後送出搜尋: -</p> -<pre><Url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/> -</pre> -<p>搜尋回來的結果將構成建議詞清單。 -</p><p>製作搜尋模組的方法可以參考<a href="zh_tw/%e8%a3%bd%e4%bd%9c_MozSearch_%e6%90%9c%e5%b0%8b%e6%a8%a1%e7%b5%84">製作 MozSearch 搜尋模組</a>一文。 -</p> -<h2 id=".E4.BC.BA.E6.9C.8D.E5.99.A8.E7.AB.AF.E7.9A.84.E5.B7.A5.E4.BD.9C" name=".E4.BC.BA.E6.9C.8D.E5.99.A8.E7.AB.AF.E7.9A.84.E5.B7.A5.E4.BD.9C">伺服器端的工作</h2> -<p>搜尋建議功能的重點在伺服端的程式,如果你是網站設計師而想支援搜尋建議功能,則必須實做出依據搜尋字串給予進一步搜尋建議詞彙、並以 <a class="external" href="http://www.json.org/">JSON</a> 格式傳回的功能。 -</p><p>當瀏覽器想取回搜尋字串時,會對 <code><Url></code> 元素指定的 URL 送出 HTTP GET 要求;此時伺服器則需依據字串決定相關字詞為何,並以 JSON 傳回 2 到 4 個建議字詞,如下: -</p> -<dl><dt> <b>查詢字串</b> -</dt><dd> JSON 的第一個元素是原始查詢字串,這樣 Firefox 可以得知傳回值是否與目前查閱的字詞相符。 -</dd></dl> -<dl><dt> <b>建議字詞列表</b> -</dt><dd> 建議字詞的陣列,此陣列需以「{{ mediawiki.external('」及「') }}」括起,例如 <tt>{{ mediawiki.external('\"建議詞 1\", \"建議詞 2\", \"建議詞 3\", \"建議詞 4\"') }}</tt> -</dd></dl> -<dl><dt> <b>說明</b> -</dt><dd> 此元素為選用,亦為一個陣列,分別針對每個「建議字詞列表」的建議詞設定說明,其中可以是任何搜尋引擎想提供瀏覽器顯示的資訊,例如此建議詞有多少搜尋結果等等。 -</dd></dl> -<div class="note">Firefox 2 尚不支援「說明」功能,會忽略此傳回值。</div> -<dl><dt> <b>查詢網址</b> -</dt><dd> 此元素為選用,還是一個陣列,內容是各建議詞的替代網址。打個比方:如果除搜尋結果頁面之外還想直接提供建議詞的地圖連結,那就可以將地圖的網址列在此陣列裡。 -</dd></dl> -<dl><dd> 若沒有額外指定此元素,則將依據搜尋模組 XML 中的 <code><Url></code> 元素決定查詢網址。 -</dd></dl> -<div class="note">Firefox 2 尚不支援「查詢網址」功能,會忽略此傳回值。</div> -<p>也就是說,若搜尋詞為「fir」且不傳回說明及查詢網址,則傳回的 JSON 應該是長這樣: -</p> -<pre class="eval">["fir", ["firefox", "first choice", "mozilla firefox"]] -</pre> -<p>在此範例中只涵括查詢字串及建議字詞列表兩元素,其他選用的都不列入。 -</p><p>雖然建議的字詞想放多少就可以放多少,但由於每次使用者多打一個字都會查詢一次,所以還是有所限度比較穩當。至於怎麼依據使用者的要求提出建議,就全交給你自己決定了。 -</p>{{ languages( { "ca": "ca/Implementaci\u00f3_de_suggeriments_en_els_connectors_de_cerca", "en": "en/Supporting_search_suggestions_in_search_plugins", "es": "es/Permitir_sugerencias_en_los_plugins_de_b\u00fasqueda", "fr": "fr/Gestion_de_suggestions_dans_les_plugins_de_recherche", "it": "it/Supportare_i_suggerimenti_nei_plugin_di_ricerca", "ja": "ja/Supporting_search_suggestions_in_search_plugins", "pl": "pl/Wsparcie_dla_podpowiedzi_wyszukiwania_w_wyszukiwarkach" } ) }} diff --git a/files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html b/files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html deleted file mode 100644 index 8b685c379e..0000000000 --- a/files/zh-tw/archive/add-ons/working_with_multiprocess_firefox/index.html +++ /dev/null @@ -1,235 +0,0 @@ ---- -title: Working with multiprocess Firefox -slug: Archive/Add-ons/Working_with_multiprocess_Firefox -translation_of: Archive/Add-ons/Working_with_multiprocess_Firefox ---- -<div class="summary"> - <p>這篇文章提供給 Firefox 擴充套件開發者;文中概述了如何讓擴充套件可以執行於多行程的 Firefox.</p> -</div> -<p>在多行程的 Firefox 之前的版本, chrome code (including code inserted by extensions) 和 content 執行於同一作業系統行程中,所以擴充套件可以直接存取 content:</p> -<pre class="brush: js">gBrowser.selectedBrowser.contentDocument.body.innerHTML = "replaced by chrome code";</pre> -<p>然而,在多行程的 Firefox (也稱為 Electrolysis 或 E10S),套件的程式碼與 content 將執行於不同的行程中,因此不再可能直接地存取。</p> -<p>取而代之地, the extension will need to factor code that touches content into separate scripts that are called <em>frame scripts</em>. Frame scripts 執行在 content 行程,並可以直接存取 content. Frame scripts 藉由 message-passing API 和套件其餘的部份通訊。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/8437/e10s-overview.png" style="display: block; margin-left: auto; margin-right: auto;">當套件程式碼(執行於 chrome 行程中)向套件的 frame script(執行於 content 行程中) 傳訊時,必須使用非同步訊息。</p> -<p>content 行程允許向 chrome 行程傳遞同步或非同步訊息,但是,非同步通訊是較好的選擇。</p> -<p>For more details on using the message manager and content scripts, refer to the <a href="/en-US/docs/The_message_manager">message manager guide</a>. The rest of this article explains how to work out if you're affected or not, provides an overview of the sorts of changes that are needed, then walks through the process of porting some simple extension patterns so they work properly with multiprocess Firefox.</p> -<h2 id="確認你是否受到相容性影響">確認你是否受到相容性影響</h2> -<p>As a rule:</p> -<ul> - <li>如果你只使用 Add-on SDK's <a href="/en-US/Add-ons/SDK/High-Level_APIs">high-level APIs</a>,你不會受到相容性困擾 (Add-on SDK 目前並不是完全相容於多行程的 Firefox,但相關問題短期內將會處理完成)</li> - <li>如果你不存取任何網頁內容,你不會受到相容性困擾</li> - <li>if you access web content directly using an <a href="/en-US/Add-ons/Overlay_Extensions">overlay extension</a>, a <a href="/en-US/Add-ons/Bootstrapped_extensions">bootstrapped extension</a>, or <a href="/en-US/Add-ons/SDK/Low-Level_APIs">low-level SDK APIs</a> like <a href="/en-US/Add-ons/SDK/Low-Level_APIs/window_utils">window/utils</a> or <a href="/en-US/Add-ons/SDK/Low-Level_APIs/tabs_utils">tabs/utils</a>, then you probably will be affected</li> - <li>if you load XUL pages in tabs, you will be affected</li> -</ul> -<p>To know for sure, you need to test it, and setting that up is a two-step process:</p> -<ul> - <li><strong>開啟 Firefox 的多行程支援:</strong> multiprocess support is in <a href="http://nightly.mozilla.org/">Firefox Nightly</a>, but is hiding behind a preference. To enable it visit <a class="external external-icon" href="http://kb.mozillazine.org/About:config">about:config</a>, find the preference named <code>browser.tabs.remote.autostart</code>, set it to <code>true</code>, and restart the browser. As a visual indicator that you're running multiprocess Firefox, the titles of tabs are underlined.</li> - <li><strong>宣告你的套件是多行程相容的:</strong> to make migration to multiprocess Firefox easier, we've implemented <a href="/en-US/Firefox/Multiprocess_Firefox/Compatibility_shims">shims</a> that help extensions to work even when they're not compatible. To check whether your extension is really compatible you need to disable these shims. To do that, add a new property to your extension's <a href="/en-US/Add-ons/Install_Manifests">install.rdf</a> named <code>multiprocessCompatible</code>, with a value of <code>true</code>. At the moment, this flag does not disable all shims, so it's not yet a reliable way to test that your add-on is compatible. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1051017">bug 1051017</a> for details on this.</li> -</ul> -<p>Now you'll be able to test your extension in multiprocess Firefox, with no <a href="/en-US/Firefox/Multiprocess_Firefox/Compatibility_shims">compatibility shims</a>. At the moment you can't actually install extensions in multiprocess Firefox, so you have to install the extension, then switch on multiprocess support. This is being tracked as <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1055808">bug 1055808</a>.</p> -<h2 id="Updating_your_code">Updating your code</h2> -<p>The general approach to updating your code is:</p> -<ul> - <li>factor the part of your extension that accesses web content into one or more separate scripts. In multiprocess Firefox these are called <em>frame scripts</em>.</li> - <li>register chrome:// URLs for your frame scripts</li> - <li>use a <a href="/en-US/docs/The_message_manager">message manager</a> to load the scripts into <a href="/en-US/docs/Mozilla/Tech/XUL/browser"><code>browser</code></a> objects</li> - <li>if you need to communicate between the main extension code and a frame script, use message manager APIs to do so</li> - <li>if you load XUL in tabs, <a href="/en-US/docs/Custom_about:_URLs">register these as about: URLs</a> and load them with the about: URL.</li> -</ul> -<p>There are more details on this in the <a href="/en-US/docs/The_message_manager">message manager</a> documentation.</p> -<h3 id="Backwards_compatibility_of_the_new_APIs">Backwards compatibility of the new APIs</h3> -<p>With multiprocess support turned off, the e10s messaging APIs are still available and functional. They have been available in one form or another since Firefox 4; however, the original APIs are different than the current ones. Some known differences:</p> -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=776825">Interface changes in Firefox 17</a></li> - <li>Before Firefox 19, code like <code>new content.document.defaultView.XMLHttpRequest()</code> fails with <code>NS_ERROR_FAILURE: Failure</code></li> -</ul> -<p>You should test your changes not only in nightlies with multiprocess support turned on, but also in releases you intend to support with multiprocess support turned off.</p> -<h2 id="Examples">Examples</h2> -<p>This section walks through the process of porting a few different sorts of extension. The extensions are all extremely simple, and are intended to represent fundamental extension patterns that require different handling in multiprocess Firefox.</p> -<p>You can find all the source code for these examples in the <a href="https://github.com/mdn/e10s-example-addons">e10s-example-addons GitHub repository</a>.</p> -<h3 id="Run_a_script_in_all_pages">Run a script in all pages</h3> -<div class="note"> - <p><a href="https://github.com/mdn/e10s-example-addons/tree/master/run-script-in-all-pages">See the code for this example</a>.</p> -</div> -<p>The first extension runs some code on every page load. The code doesn't need to interact with any other part of the extension: it just makes some predetermined modification to the page. In this case it adds a border to the document's <a href="/en-US/docs/Web/HTML/Element/body"><code>body</code></a>.</p> -<p>It does this by attaching to a XUL overlay a version of the <a href="/en-US/Add-ons/Code_snippets/On_page_load#Basic_onPageLoad_for_a_browser_window">"On page load" code snippet</a>:</p> -<pre class="brush: js">var myExtension = { - init: function() { - // The event can be DOMContentLoaded, pageshow, pagehide, load or unload. - if(gBrowser) gBrowser.addEventListener("DOMContentLoaded", this.onPageLoad, false); - }, - onPageLoad: function(aEvent) { - var doc = aEvent.originalTarget; // doc is document that triggered the event - if (doc.nodeName != "#document") return; // only documents - // make whatever modifications you want to doc - doc.body.style.border = "5px solid blue"; - } -} - -window.addEventListener("load", function load(event){ - window.removeEventListener("load", load, false); //remove listener, no longer needed - myExtension.init(); -},false);</pre> -<p>Because this code accesses web content directly, it won't work in multiprocess Firefox.<br> - <img alt="" src="https://mdn.mozillademos.org/files/8431/all-pages-original.png" style="display: block; margin-left: auto; margin-right: auto;"></p> -<h4 id="Porting_to_the_message_manager">Porting to the message manager</h4> -<p>To port this example using the message manager, we can put all the meat of the add-on in a frame script:</p> -<pre class="brush: js">// frame-script.js -// will run in the content process - -addEventListener("DOMContentLoaded", function(event) { - var doc = event.originalTarget; - if (doc.nodeName != "#document") return; // only documents - doc.body.style.border = "5px solid red"; -}); -</pre> -<p>We'll register a chrome:// URL for the frame script:</p> -<pre>// chrome.manifest - -content modify-all-pages chrome/content/ -</pre> -<p>The main script, that we attach to the XUL overlay, is just a stub that uses the global message manager to load the frame script into each tab:</p> -<pre class="brush: js">// chrome script -// will run in the chrome process - -var globalMM = Cc["@mozilla.org/globalmessagemanager;1"] - .getService(Ci.nsIMessageListenerManager); - -globalMM.loadFrameScript("chrome://modify-all-pages/content/frame-script.js", true);</pre> -<p><img alt="" src="https://mdn.mozillademos.org/files/8415/all-pages-ported.png" style="display: block; margin-left: auto; margin-right: auto;"></p> -<h4 id="Porting_to_the_Add-on_SDK">Porting to the Add-on SDK</h4> -<p>A good alternative for an extension like this is to port to the Add-on SDK. The Add-on SDK includes a module called <a href="/en-US/Add-ons/SDK/High-Level_APIs/page-mod">page-mod</a> which is designed to load scripts into web pages. The Add-on SDK calls these scripts <em>content scripts</em>.</p> -<p>In this case the main extension code creates a page-mod to load a content script into every page loaded by the user:</p> -<pre class="brush: js">// main.js - -var pageMod = require("sdk/page-mod"); -var self = require("sdk/self"); - -pageMod.PageMod({ - include: "*", - contentScriptFile: self.data.url("modify-all-pages.js") -});</pre> -<p>The content script can modify the page directly:</p> -<pre class="brush: js">// modify-all-pages.js - content script - -document.body.style.border = "5px solid green";</pre> -<h3 id="Run_a_script_in_the_active_tab">Run a script in the active tab</h3> -<div class="note"> - <p><a href="https://github.com/mdn/e10s-example-addons/tree/master/run-script-in-active-page">See the code for this example</a>.</p> -</div> -<p>The example demonstrates how an extension can:</p> -<ul> - <li><a href="/en-US/docs/The_message_manager#Types_of_message_manager">load a frame script into a specific XUL <code><browser></code> element</a></li> - <li><a href="/en-US/docs/The_message_manager#Synchronous_messaging">make a synchronous call from the frame script to the main extension</a></li> -</ul> -<p>The example is a restartless extension that adds a button using the CustomizableUI module. When the user clicks the button, the extension runs some code that modifies the current tab. The basic infrastructure is taken from the <a href="https://github.com/jvillalobos/Australis-Hello-World">Australis "Hello World" extension written by Jorge Villalobos</a>.<br> - <br> - What the code actually does is: find any <code><a href="/en-US/docs/Web/HTML/Element/Img"><img></a></code> elements and replace their <code>src</code> with a link to a silly GIF randomly chosen from a list hardcoded into the extension. The silly gifs are taken from the list in the <a href="https://github.com/bwinton/whimsy">Whimsy extension</a>.</p> -<p>The first version accesses the page directly, so it's not multiprocess compatible:</p> -<pre class="brush: js">// bootstrap.js - -let Gifinate = { - init : function() { - let io = - Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - - // the 'style' directive isn't supported in chrome.manifest for bootstrapped - // extensions, so this is the manual way of doing the same. - this._ss = - Cc["@mozilla.org/content/style-sheet-service;1"]. - getService(Ci.nsIStyleSheetService); - this._uri = io.newURI("chrome://gifinate/skin/toolbar.css", null, null); - this._ss.loadAndRegisterSheet(this._uri, this._ss.USER_SHEET); - - // create widget and add it to the main toolbar. - CustomizableUI.createWidget( - { id : "gifinate-button", - defaultArea : CustomizableUI.AREA_NAVBAR, - label : "Gifinate", - tooltiptext : "Gifinate!", - onCommand : function(aEvent) { - Gifinate.replaceImages(aEvent.target.ownerDocument.defaultView.content.document); - } - }); - }, - - replaceImages : function(contentDocument) { - let images = contentDocument.getElementsByTagName("img"); - for (var i = 0; i < images.length; ++i) { - let gif = this.gifs[Math.floor(Math.random() * this.gifs.length)]; - images[i].src = gif; - } - },</pre> -<p><img alt="" src="https://mdn.mozillademos.org/files/8433/gifinate-original.png" style="display: block; margin-left: auto; margin-right: auto;"></p> -<h4 id="Porting_to_the_message_manager_2">Porting to the message manager</h4> -<p>To port this example to the message manager we'll make <code>onCommand</code> load a frame script into the current <code><browser></code>, then listen for "request-gifs" messages from the frame script. The "request-gifs" message is expected to contain the number of GIFs we need for this page: the message listener retrieves and returns that many GIFs.</p> -<pre class="brush: js">// bootstrap.js -// will run in the chrome process - -let Gifinate = { - init : function() { - let io = - Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - - // the 'style' directive isn't supported in chrome.manifest for bootstrapped - // extensions, so this is the manual way of doing the same. - this._ss = - Cc["@mozilla.org/content/style-sheet-service;1"]. - getService(Ci.nsIStyleSheetService); - this._uri = io.newURI("chrome://gifinate/skin/toolbar.css", null, null); - this._ss.loadAndRegisterSheet(this._uri, this._ss.USER_SHEET); - - // create widget and add it to the main toolbar. - CustomizableUI.createWidget( - { id : "gifinate-button", - defaultArea : CustomizableUI.AREA_NAVBAR, - label : "Gifinate Button", - tooltiptext : "Gifinate!", - onCommand : function(aEvent) { - Gifinate.replaceImages(aEvent.target.ownerDocument); - } - }); - }, - - replaceImages : function(xulDocument) { - var browserMM = xulDocument.defaultView.gBrowser.selectedBrowser.messageManager; - browserMM.loadFrameScript("chrome://gifinate/content/frame-script.js", false); - browserMM.addMessageListener("request-gifs", Gifinate.getGifs); - }, - - getGifs : function(message) { - var gifsToReturn = new Array(message.data); - for (var i = 0; i < gifsToReturn.length; i++) { - let gif = this.gifs[Math.floor(Math.random() * this.gifs.length)]; - gifsToReturn[i] = gif; - } - return gifsToReturn; - }, -</pre> -<p>Again, we need to register a chrome:// URL for the frame script:</p> -<pre>// chrome.manifest - -content gifinate frame-script.js</pre> -<p>In the frame script, we get all the <code><img></code> elements and send the "request-gifs" message to the main add-on code. Because this is a frame script we can make it a synchronous message, and update the <code>src</code> attributes with the value it returns:</p> -<pre class="brush: js">// frame-script.js -// will run in the content process - -var images = content.document.getElementsByTagName("img"); -var response = sendSyncMessage("request-gifs", images.length); -var gifs = response[0]; - -for (var i = 0; i < images.length; ++i) { - images[i].src = gifs[i]; -}</pre> -<p>The overall flow of the add-on now looks like this:<br> - <img alt="" src="https://mdn.mozillademos.org/files/8411/gifinate-ported.png" style="display: block; margin-left: auto; margin-right: auto;"></p> -<h2 id="Known_bugs">Known bugs</h2> -<p>This is a list of open bugs likely to affect add-on developers migrating to multiprocess Firefox:</p> -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1051238"><b>Bug 1051238</b></a> -<span id="summary_alias_container"> <span id="short_desc_nonedit_display">frame scripts are cached forever, so an add-on can't properly update without a browser restart</span></span></li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1017320"><b>Bug 1017320</b></a> -<span id="summary_alias_container"> <span id="short_desc_nonedit_display">tracking bug for implementing compatibility shims</span></span></li> - <li><span><span><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1051017"><b>Bug 1051017</b></a> -<span id="summary_alias_container"> <span id="short_desc_nonedit_display">not all shims are disabled, even if an add-on is declared to be multiprocess compatible</span></span></span></span></li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1055808"><strong>Bug 1055808</strong></a> - can't install local add-ons in multiprocess Firefox</li> -</ul> diff --git a/files/zh-tw/archive/apps/advanced_topics/index.html b/files/zh-tw/archive/apps/advanced_topics/index.html deleted file mode 100644 index 1c0c5a0820..0000000000 --- a/files/zh-tw/archive/apps/advanced_topics/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: 進階主題 -slug: Archive/Apps/Advanced_topics -translation_of: Archive/Apps/Advanced_topics ---- -<p>這些文章提供了額外的資訊,關於更進階的開放網頁程式主題。</p> -<div class="row topicpage-table"> - <div class="section"> - <h2 class="Documentation" id="Architecture" name="Architecture">Apps 架構文件</h2> - <dl> - <dt> - <a href="/en-US/docs/Apps/Architecture">應用程式的架構</a></dt> - <dd> - 大致介紹開放網頁程式計畫的設計和實作之下的架構。</dd> - <dt> - <a href="/en-US/docs/Apps/Platform-specific_details">在不同平台安裝 app 的細節</a></dt> - <dd> - 有關應用程式在特定裝置或系統上安裝或執行時有些微的差異;這篇文章會幫您了解這段差異。</dd> - <dt> - <a href="/en-US/docs/Apps/Apps_for_Android">Android上的開放網路應用程式</a></dt> - <dd> - 有關開發及測試在Android上運作的開放網路應用程式的事。</dd> - <dt> - <a href="/en-US/docs/Apps/Release_notes">App runtime release notes</a></dt> - <dd> - 不同的平台上,網頁 app 執行時的 release notes。</dd> - </dl> - <h2 class="Documentation" id="Other" name="Other">其他文件</h2> - <dl> - <dt> - <a href="/en-US/docs/Apps/Creating_a_store">建立商店</a></dt> - <dd> - 如果您要建立自己的商店來販售及發佈開放網頁程式,這些資訊可能可以幫助您。</dd> - </dl> - <p><span class="alllinks"><a href="/en-US/docs/tag/Marketplace">View All...</a></span></p> - </div> - <div class="section"> - <h5 class="Tools" id="Tools" name="Tools">Tools for app developers</h5> -<ul> - <li><a href="https://marketplace.firefox.com/developers/">Visit Firefox Marketplace Developer Hub</a></li> - <li><a href="/en-US/docs/Mozilla/Firefox_OS/Using_Firefox_OS_Simulator">Firefox OS Simulator</a></li> - <li><a href="/en-US/docs/Apps/App_developer_tools">App developer tools</a></li> -</ul> -<h5 class="Documentation" id="Documentation" name="Documentation">Technology reference documentation</h5> -<div class="twocolumns"> - <ul> - <li><a href="/en-US/docs/Web/CSS">CSS</a></li> - <li><a href="/en-US/docs/DOM">DOM</a></li> - <li><a href="/en-US/docs/Web/HTML">HTML</a></li> - <li><a href="/en-US/docs/JavaScript">JavaScript</a></li> - <li><a href="/en-US/docs/WebAPI">WebAPI</a></li> - <li><a href="/en-US/docs/Web/WebGL">WebGL</a></li> - <li><a href="/en-US/docs/SVG">SVG</a></li> - <li><a href="https://www.mozilla.org/en-US/apps/">Open Web Apps overview site</a></li> - <li><a href="https://wiki.mozilla.org/Apps">Apps project wiki page</a></li> - </ul> -</div> -<h5 class="Community" id="Community" name="Community">Getting help from the community</h5> -<p>If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!</p> -<ul> - <li>Consult the webapps forum: <ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-webapps"> 郵件討論</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.webapps"> 新聞群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.webapps/feeds"> feed 消息來源</a></li> -</ul> - <ul> - <li>Ask your question on the Open Web Apps IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/openwebapps">#openwebapps</a></li> - </ul> - </li> -</ul> -<p><span class="alllinks"><a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="external">Don't forget about the <em>netiquette</em>...</a></span></p> - </div> -</div> -<p> </p> diff --git a/files/zh-tw/archive/apps/index.html b/files/zh-tw/archive/apps/index.html deleted file mode 100644 index 89e9dac3d6..0000000000 --- a/files/zh-tw/archive/apps/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Apps -slug: Archive/Apps -translation_of: Archive/Apps ---- -<p class="summary">In progress. This page includes archived content for Apps, including obsolete web app content, Firefox OS app-related content, etc.</p> - -<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html deleted file mode 100644 index 431f85c5f6..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/contacts/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: 聯絡人資訊 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Contacts ---- -<h3 id="聯絡人資訊_(contacts)">聯絡人資訊 (contacts)</h3> -<p>Contacts API 讓您可以取得使用者手機中所儲存的聯絡人列表、聯絡人姓名、電話、… 等資訊。<br> - 由於它牽涉到使用者私密資訊,目前僅開放審查通過的應用(privileged/certified)能夠使用這個 API。您的應用必須提出使用這個 API 的聲明,並且通過審查方可使用。<br> - <br> - 權限宣告:分為 "readonly", "readwrite", "readcreate" 三種級別,分別代表「只讀取」、「讀取與修改」、「讀取與新增」。您可依照應用需求作適當的權限宣告。</p> -<pre>"permissions": { - "contacts":{ "access": "readonly" } -}</pre> -<h4 id="1._讀取聯絡人列表">1. 讀取聯絡人列表</h4> -<pre> var options = { - sortBy: 'familyName', - sortOrder: 'ascending' - }; - var request = navigator.mozContacts.find(options); - request.onsuccess = function findSuccess() { - var firstContact = request.result[0]; - console.log('name' + firstContact.name); - console.log('tel number' + firstContact.tel[0].value); - console.log('update time' + new Date(firstContact.updated)); - }; - - request.onerror = function findError() { - console.warn('Error: cannot find any contacts - ' + request.error.name); - };</pre> -<h4 id="2._新增聯絡人">2. 新增聯絡人</h4> -<pre> var myContact = { - 'name': 'Alice Wang', - 'givenName': 'Alice', - 'familyName': 'Wang', - 'tel': [{'value': '0912345678'}] - }; - var contact = new mozContact(); - contact.init(myContact); - var request = navigator.mozContacts.save(contact); - request.onerror = function onerror() { - console.warn('Error: save contact - ' + request.error.name); - }; </pre> -<h4 id="3._修改聯絡人資訊">3. 修改聯絡人資訊</h4> -<pre> var options = { - filterBy: ['tel', 'givenName', 'familyName'], - filterOp: 'contains', - filterValue: 'Alice' - }; - var request = navigator.mozContacts.find(options); - request.onsuccess = function findSuccess() { - var contact = req.result[0]; - contact.tel[0].value = '0987654321'; - var requestUpdate = navigator.mozContacts.save(contact); - requestUpdate.onerror = function onerror() { - console.warn('Error: update contact - ' + requestUpdate.error.name); - }; - }; </pre> -<h4 id="4._刪除聯絡人">4. 刪除聯絡人</h4> -<pre> var options = { - filterBy: ['id'], - filterOp: 'equals', - filterValue: '0987654321' - }; - var request = navigator.mozContacts.find(options); - request.onsuccess = function findSuccess() { - var contact = req.result[0]; - var requestRemove = navigator.mozContacts.remove(contact); - requestRemove.onerror = function onerror() { - console.warn('Error: remove contact - ' + requestRemove.error.name); - }; - }; </pre> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html deleted file mode 100644 index d8c6fd2916..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/device_storage/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: 儲存裝置資訊 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Device_Storage ---- -<h3 id="儲存裝置資訊_(Device_Storage)">儲存裝置資訊 (Device Storage)</h3> -<p>DeviceStorage API 提供 SD 記憶卡內的資料存取介面,可讀取圖片檔、聲音檔、影片檔,與 SD 記憶卡的其他檔案,並檢視 SD 記憶卡空間的使用率。<br> - 由於牽涉到使用者的儲存裝置資訊,目前僅開放 Privileged/Certified App 能夠使用此 API。你的 App 必須提出「使用此 API」的聲明,並且通過審查方可使用。<br> - <br> - 權限宣告:依照檔案類型 (圖片、影片、聲音、其他) 而有不同宣告方式,這種宣告另分為「readonly」、「readwrite」、「readcreate」共 3 種級別,分別代表「唯讀」、「讀取與修改」、「讀取與創建」。你可依照 App 需求作適當的權限宣告。</p> -<pre>"permissions": { - "device-storage:pictures": { "access": "readonly" }, - "device-storage:music": { "access": "readcreate" }, - "device-storage:videos": { "access": "readwrite" }, - "device-storage:sdcard": { "access": "readonly" } -}</pre> -<h4 id="1._音樂檔案列表">1. 音樂檔案列表</h4> -<ul> - <li>權限宣告:"device-storage:music": { "access": "readonly" }</li> -</ul> -<pre> var type = 'music'; - var deviceStorage = navigator.getDeviceStorage(type); - if (!deviceStorage) { - console.warn('Error: cannot get DeviceStorage for ' + type); - return; - } - var request = deviceStorage.enumerate(); - request.onsuccess = function(e) { - var file = request.result; - console.log('file name ' + file.name); - console.log('file size ' + file.size); - console.log('file type ' + file.type); - console.log('file last Modified Date ' + file.lastModifiedDate); - request.continue(); - }; - request.onerror = function() { - console.warn('Error: cannot list files in SD card - ' + request.error.name); - };</pre> -<h4 id="2._讀取某個_SD_卡檔案">2. 讀取某個 SD 卡檔案</h4> -<ul> - <li>權限宣告:"device-storage:pictures": { "access": "readonly" }</li> -</ul> -<pre> var type = 'pictures'; - var deviceStorage = navigator.getDeviceStorage(type); - if (!deviceStorage) { - console.warn('Error: cannot get DeviceStorage for ' + type); - return; - } - var filename = 'downloads/DSC02798.JPG'; - var request = deviceStorage.get(filename); - request.onsuccess = function(e) { - var file = request.result; - var url = URL.createObjectURL(file); - var myImage = document.getElementById('profilePhoto'); - myImage.src = url; - }; - request.onerror = function() { - console.warn('Error: get file from SD card - ' + request.error.name); - };</pre> -<h4 id="3._寫入檔案到_SD_卡">3. 寫入檔案到 SD 卡</h4> -<ul> - <li>權限宣告:"device-storage:sdcard": { "access": "readcreate" }</li> -</ul> -<pre> var type = 'sdcard'; - var deviceStorage = navigator.getDeviceStorage(type); - if (!deviceStorage) { - console.warn('Error: cannot get DeviceStorage for ' + type); - return; - } - var filename = 'test-' + Math.random().toString() + '.txt'; - var pathname = 'test-tmp/' + filename; - console.log('file path: ' + pathname); - var blob = new Blob(['hello', 'world'], {type: 'text/plain'}); - var request = deviceStorage.addNamed(blob, pathname); - request.onsuccess = function(e) { - // try to get the file - var readRequest = deviceStorage.get(pathname); - readRequest.onsuccess = function() { - var file = readRequest.result; - var reader = new FileReader(); - reader.onload = function(e) { - console.log('file content ' + e.target.result); - }; - reader.readAsText(file); - }; - readRequest.onerror = function() { - console.warn("Error: read file failure - " + request.error.name); - }; - }; - request.onerror = function() { - console.warn('Error: write file failure - ' + request.error.name); - };</pre> -<h4 id="4._SD_卡空間使用率">4. SD 卡空間使用率</h4> -<ul> - <li>權限宣告:"device-storage:sdcard": { "access": "readonly" }</li> -</ul> -<pre> var type = 'sdcard'; - var deviceStorage = navigator.getDeviceStorage(type); - if (!deviceStorage) { - console.warn('Error: cannot get DeviceStorage for ' + type); - return; - } - var request = deviceStorage.stat(); - request.onsuccess = function(e) { - var totalSize = e.target.result.totalBytes; - var freeBytes = e.target.result.freeBytes; - console.log('totalSize ' + totalSize + ', freeBytes ' + freeBytes); - }; - request.onerror = function() { - console.warn('Error: cannot get stat of SD card - ' + request.error.name); - };</pre> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html deleted file mode 100644 index 575d719313..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/geolocation/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 位置資訊 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Geolocation ---- -<h3 id="位置資訊_(geolocation)">位置資訊 (geolocation)</h3> -<p>Geolocation API 讓您可以取得使用者目前所在的地理位置資訊,雖然現今它已是一個 Web 開放標準的 API,但在 Firefox OS 中您必須做權限宣告才可使用。<br> - 但當您使用這個 API 企圖存取使用者位置時,系統會出現一個視窗詢問使用者是否願意透露位置訊息給您的應用,並且提供一個默認選項記住使用者的選擇。<br> - <br> - 權限宣告:需要</p> -<pre>"permissions": { - "geolocation": {} -}</pre> -<p>範例:</p> -<pre>navigator.geolocation.getCurrentPosition(function(position) { - console.log('latitude ' + position.coords.latitude); - console.log('longitude ' + position.coords.longitude); -}, function() { - console.warn('Error: cannot fetch location'); -}); -</pre> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html deleted file mode 100644 index d258c076d5..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/index.html +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: 第三方應用開發者指南 -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide ---- -<h3 id="基本章節">基本章節</h3> -<h4 id="快速入門">快速入門</h4> -<h4 id="API_說明">API 說明</h4> -<ul> - <li><a href="https://developer.mozilla.org/en-US/docs/tag/WebAPI" title="https://developer.mozilla.org/zh-TW/docs/WebAPI">API 列表</a></li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/WebAPI/Permissions" title="https://developer.mozilla.org/zh-TW/docs/WebAPI/Permissions">權限宣告</a></li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Using_geolocation#.E7.80.8F.E8.A6.BD.E5.99.A8.E7.9B.B8.E5.AE.B9.E6.80.A7" title="/zh-TW/docs/Mozilla/Firefox_OS/第三方應用開發者指南/位置資訊">位置資訊 Geolocation API</a></li> - <li><a href="/zh-TW/docs/Mozilla/Firefox_OS/第三方應用開發者指南/聯絡人資訊" title="/zh-TW/docs/Mozilla/Firefox_OS/第三方應用開發者指南/聯絡人資訊">聯絡人資訊</a></li> - <li><a href="/zh-TW/docs/Mozilla/Firefox_OS/第三方應用開發者指南/儲存裝置資訊" title="/zh-TW/docs/Mozilla/Firefox_OS/第三方應用開發者指南/儲存裝置資訊">儲存裝置資訊</a></li> - <li>註冊系統訊息 (system message)</li> -</ul> -<h4 id="其他技術細節">其他技術細節</h4> -<ul> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/Security/Security_model" title="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/Security/Security_model">Firefox OS 安全性概述</a></li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/WebAPI/Web_Activities" title="/zh-TW/docs/Mozilla/Firefox_OS/第三方應用開發指南/Web_Activity">Web Activity</a></li> - <li>video/graphic (?)</li> - <li>Attention screen</li> - <li>window.open</li> - <li>background service</li> - <li>touch event</li> - <li>special events - <ul> - <li>mozvisibilitychange</li> - </ul> - </li> - <li>special properties - <ul> - <li>windowsizechange</li> - </ul> - </li> -</ul> -<h4 id="除錯與預覽">除錯與預覽</h4> -<ul> - <li><a href="/zh-TW/docs/Tools/Debugger" title="/zh-TW/docs/Tools/Debugger">除錯器 (Debugger)</a></li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator" title="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (r2d2b2g)</a></li> - <li>B2G desktop</li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="https://developer.mozilla.org/zh-TW/docs/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox">在 Firefox 裡使用 Gaia</a></li> -</ul> -<h4 id="測試">測試</h4> -<ul> - <li>單元測試</li> - <li>UI 測試</li> -</ul> -<h4 id="應用上架">應用上架</h4> -<ul> - <li><a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F/Manifest-840092-dup" title="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F/Manifest-840092-dup">App Manifest</a></li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/WebAPI/Permissions" title="https://developer.mozilla.org/zh-TW/docs/WebAPI/Permissions">App 權限 (Permission</a>)</li> - <li>hosted app & <a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup/Packaged_apps" title="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/3rd_Party_App_Developer_Guide/%E5%B0%81%E5%8C%85%E5%BC%8F_%28Packaged%29_App">封裝式 (Packaged) App</a></li> - <li>安裝應用 - <ul> - <li>應用來源 (open web/Firefox marketplace)</li> - <li>安裝方式 (hosted app/packaged app)</li> - </ul> - </li> - <li>應用審核流程</li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/3rd_Party_App_Developer_Guide/%E6%89%98%E7%AE%A1%E6%9B%B4%E6%96%B0%E4%BD%9C%E6%A5%AD_%28Hosting_Updates%29_" title="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/3rd_Party_App_Developer_Guide/%E6%89%98%E7%AE%A1%E6%9B%B4%E6%96%B0%E4%BD%9C%E6%A5%AD_%28Hosting_Updates%29_">B2G 托管更新作業 (Hosting Updates)</a></li> -</ul> -<h3 id="進階章節">進階章節</h3> -<h4 id="樣式參考與範本">樣式參考與範本</h4> -<ul> - <li>multiple resolution</li> - <li>viewport</li> - <li>Building Block</li> - <li>template</li> -</ul> -<h4 id="調校技巧">調校技巧</h4> -<ul> - <li>lazy loading</li> - <li>preload small image (sprite)</li> -</ul> -<h4 id="Gaia_系統應用_(System_App)_細節">Gaia 系統應用 (System App) 細節</h4> -<ul> - <li>系統應用角色</li> - <li>iframe 框架與程序 (Process) 的關係</li> - <li>zIndex</li> - <li>hardware buttons</li> - <li>running app management</li> -</ul> -<h4 id="其他_Open_Web_技術">其他 Open Web 技術</h4> -<ul> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Gecko_DOM_%E5%8F%83%E8%80%83/WebFM" title="https://developer.mozilla.org/zh-TW/docs/Gecko_DOM_%E5%8F%83%E8%80%83/WebFM">WebFM 收音機</a></li> - <li>HTML5 API</li> - <li>CSS</li> - <li>jQuery/backbone/... frameworks</li> - <li>appcache</li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html deleted file mode 100644 index 8b9e1e52ad..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/web_activity/index.html +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: Web Activity -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/Web_Activity ---- -<h4 id="Web_Activity">Web Activity</h4> -<p>許多手機上常見的功能例如:選取聯絡人、撥打電話、照相是您的 App 會需要用到的功能。您可以不必重新發明輪子,而利用「Web Activity」的技術呼叫其他的 App 來完成任務。Web Activity 可以實作兩個 App 間的切換,例如從「相機」切換到「圖片集」,或者是「簡訊」使用「聯絡人」選取一個簡訊發送對象。<br> - <br> - 在您的 App 中只需要描述所需的操作,系統會幫您檢查手機中有哪些 App 提供這些操作。以下是一個具體的例子。這是在「相機」中的一段程式碼,用來切換到別的 App 瀏覽相片。</p> -<pre> var act = new MozActivity({ - name: 'browse', - data: { - type: 'photos' - } - }); - act.onerror = function(e) { - if (act.error.name === 'NO_PROVIDER') { - console.warn('Error: no activity provider'); - } - else { - console.warn('Error: unknown activity - ' + act.error.name); - } - };</pre> -<p>在這段程式碼中,「相機」新增了一個 MozActivity 物件並在參數物件中聲明該 activity 是「瀏覽(browse)」的動作,瀏覽的資料是「相片(photos)」。請注意它並非直接指定要切換到「圖片集」 ,而是由系統決定哪個 App 提供這樣的行為,若有多個 App 同時提供一樣的行為時,系統會產生一個選單讓使用者選取。<br> - 參數物件的 'data' 欄位可以提供額外所需的資料內容,讓承接 activity 任務的 App 決定是否根據資料內容做其他處理。<br> - <br> - 讓我們來看看提供 Web Activity 的 App 該如何聲明它的 activity 及相關設定。</p> -<pre>"activities": { - "browse": { - "filters": { - "type": "photos" - }, - "disposition": "window" - } -}</pre> -<p><br> - 像「圖片集」這樣的 App 可以在它的 manifest.webapp 檔案中聲明它提供瀏覽相片的 activity,如上所示。它提供一個「瀏覽(browse)」動作的 activity,瀏覽的資料是「相片(photos)」作為篩選條件。這樣的 activity 聲明宣告,便能與上面的 MozActivity 呼叫匹配,成為能承接這個 activity 的對象之一。若手機中只有這一個 App 有這樣的 activity 宣告,那系統預設就會將這個 App 開啓,但若有多個 App 都能夠執行這個任務,系統會產生一個選單讓使用者選取。</p> -<h4 id="disposition_window">"disposition": "window"</h4> -<p>依照不同 App 的需求,目前在 Firefox OS 中有兩種形式的 Web Activity ,一種為「視窗切換」(window disposition) 、一種為「畫面滑入」(inline disposition)。前者視覺上是 App 之間的切換,後者則是承接 activity 的 App 會由下方滑入,覆蓋在目前 App 之上。除了視覺上的效果不同之外,「畫面滑入」的 Web Activity 在 activity 處理結束畫面關閉之後(例如選擇了一張圖片),會回到原本的 App ,而「視窗切換」的 Web Activity 則需要使用者自己手動回到主畫面 (homescreen) 或者 App 列表,才能夠切換回原本的 App 。提供 Web Activity 的 App 可以自行決定提供哪種形式讓其他 App 呼叫。<br> - <br> - 除了在 manifest.webapp 宣告 Web Activity 之外,程式碼中當然也要有具體的實作。如下所示是「圖片集」 App 的實作程式碼:</p> -<pre> navigator.mozSetMessageHandler('activity', function activityHandler(a) { - var activityName = a.source.name; - if ( activityName === 'browse') { - // If this was a cold start, then the db needs to be initialized. - if (!photodb) - initDB(true); // Initialize both the photo and video databases - // Always switch to the list of thumbnails. - setView(thumbnailListView); - } - }); -</pre> -<p>當有 MozActivity 的呼叫發生時,會以系統訊息的方式通知將要被開啓的 App 。因此這個 App 必須要註冊 'activity' 的系統訊息,提供對應的回呼函示 (callback function),明白表示當 MozActivity 的呼叫發生時, App 被開啓後將如何處理這個 activity。這邊「圖片集」 App 執行初始化圖庫、以縮圖方式列出圖庫內的相片。<br> - 「圖片集」 App 在 manifest.webapp 的聲明中使用 window disposition 的方式處理 activity,表示使用者並不會在完成什麼動作之後回到「相機」 App 。「圖片集」 App 就如同是被使用者手動在主畫面(homescreen)點選開啟一般,由使用者自行決定何時離開。</p> -<h4 id="disposition_inline">"disposition": "inline"</h4> -<p>我們來看另一種形式的 Web Activity。同樣以「圖片集」 App 為例,它可以提供一個 Web Activity 供其他 App 挑選照片。挑選照片的 actvity 必須要把被挑選到的相片名稱、路徑…等等的資訊傳回給呼叫方(caller),並且在挑選動作完成後回到呼叫方的 App 。這個情況下,使用 inline disposition 的形式來實作。<br> - manifest.webapp 的宣告是這樣的:</p> -<pre>"activities": { - "pick": { - "filters": { - "type": ["image/jpeg", "image/png"] - }, - "disposition": "inline", - "returnValue": true, - "href": "/index.html#pick" - } -}</pre> -<p><br> - 它提供一個「挑選(pick)」動作的 activity,挑選的資料形態以一個陣列作為篩選條件,提供挑選 "image/jpeg" 或 "image/png" 圖檔,並且會回傳挑選的值。<br> - 由於 inline disposition 的 Web Activity 是以單一畫面滑入的形式被開啓,不同於 window disposition 是整個 App 被開啓,這裡我們可以多指派一個聲明表示要處理這個 Web Activity 的頁面位置 ("href": "/index.html#pick")。<br> - <br> - 這個頁面會有具體的程式碼實作如下:</p> -<pre> navigator.mozSetMessageHandler('activity', function activityHandler(activityRequest) { - var activityName = activityRequest.source.name; - if (activityName === 'pick') { - var pickType = activityRequest.source.data.type; - var width = activityRequest.source.data.width; - var height = activityRequest.source.data.height; - var blob = startPick(pickType, width, height); - if (blob) { - activityRequest.postResult({type: pickType, blob: blob}); - } else { - activityRequest.postError('pick cancelled'); - } - } - });</pre> -<p><br> - 當有 MozActivity 的呼叫發生時,「圖片集」 App 收到 'activity' 的系統訊息,回呼函示 (callback function)會被運行,它可以讀取請求此 activity 的 App 所提供的數據,例如所需的圖片類型、寬度、高度… 等,作為陳列圖片清單的參考。當使用者成功選取了一張圖片,呼叫 activityRequest.postResult 傳回挑選結果。這個結果是個物件,讓呼叫 MozActivity 的 App 能夠知道圖片相關的資訊。<br> - <br> - 在「設定」 App 中希望能讓使用者選取一張圖片做為桌布,只需要呼叫 activity 來完成。</p> -<pre> var activityRequest = new MozActivity({ - name: 'pick', - data: { - type: 'image/jpeg', - width: 320, - height: 480 - } - }); - activityRequest.onsuccess = function onPickSuccess() { - if (!activityRequest.result.blob) - return; - - var reader = new FileReader(); - reader.readAsDataURL(activityRequest.result.blob); - reader.onload = function() { - navigator.mozSettings.createLock().set({ - 'wallpaper.image': reader.result - }); - displayImgae(reader.result); - }; - }; - activityRequest.onerror = function onPickError() { - console.warn('pick failed!'); - }; -</pre> -<p>在這段程式碼中,「設定」呼叫了一個 MozActivity 並在參數物件中聲明該 activity 是「挑選(pick)」的動作,挑選的是「image/jpeg」檔案,限定寬度與高度為 320 x 480。同樣的,「設定」 App 不知道實際上哪個 App 會被呼叫,它只在意當挑選動作完成時,它的 onsuccess 回呼函示會被執行,取得 blob 內容,並且畫面焦點將回到它身上,讓它可以顯示選取的圖片。系統將決定哪個 App 提供這樣的行為,若有多個 App 同時提供一樣的行為時,系統會產生一個選單讓使用者選取。<br> - </p> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/封包式_(packaged)_app/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/封包式_(packaged)_app/index.html deleted file mode 100644 index 80a905ab88..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/封包式_(packaged)_app/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: 封包式 (Packaged) App -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/封包式_(Packaged)_App ---- -<div class="note"> - <p id="*.E5.8E.9F.E6.96.87.E5.87.BA.E8.99.95.EF.BC.9Ahttps.3A.2F.2Fmarketplace.firefox.com.2Fdevelopers.2Fdocs.2Fpackaged">原文出處:https://marketplace.firefox.com/developers/docs/packaged</p> -</div> -<p><strong>封包式</strong><strong> (Packaged) App</strong> 屬於 Open Web App,即以 ZIP 壓縮檔納入其 HTML、CSS、JavaScript、app manifest 等所有資源;取代「將資源置於 Web 伺服器之上」的方式。封包式 App 的 ZIP 壓縮檔另將 <a href="https://developer.mozilla.org/docs/Apps/Manifest">app manifest</a> 置於其根目錄之下,且此 manifest 檔案必須命名為 manifest.webapp。</p> -<div class="note"> - <p><strong>注意:</strong>截至 2013 年 1 月為止,Firefox Marketplace 上所提供的封包式 App 限定為 Firefox OS App。</p> -</div> -<p> </p> -<h2 id="封包式_App_之用途"><strong>封包式</strong><strong> App </strong><strong>之用途</strong></h2> -<p>若 App 會存取裝置上的 Sensitive API,則最好能透過封包式 App 而達到安全性的需求。App 均必須經過上架商城 (如 Firefox OS Marketplace) 認證方可販售。這些商城將審核 App,確認其是否可行,再以其自有金鑰完成加密簽核。再審核過安全性、隱私性、功能性等的可能問題之後,可為 App 的使用者更多添一份保障。</p> -<p> </p> -<h2 id="封包式_App_的類型"><strong>封包式</strong><strong> App </strong><strong>的類型</strong></h2> -<p>封包式 App 可分為 3 類:</p> -<h4 id="Privileged_app">Privileged app</h4> -<p style="margin-left: 36.0pt;">Privileged App 是由 Firefox OS Marketplace 以特殊程序核准之後發出。如果任一 App 要存取裝置上的特定 Sensitive API,則可為使用者提供更高的安全性。此種 App 即等同 iOS 或 Android 平台上的 Native App,並具備下列特性:</p> -<ul> - <li>經過程式碼審核或同等作業之後,才會由 App 商城發出許可</li> - <li>App 資源亦需由 App 商城簽署。</li> - <li>即使無法存取特定 Sensitive Web API 的未受信任內容,亦可透過 Privileged App 的方式使用之。</li> - <li>強制性的<a href="https://developer.mozilla.org/en-US/docs/Apps/CSP">內容安全政策 (CSP)</a>;Privileged App 即使用此CSP:</li> -</ul> -<pre>"default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'"</pre> -<ul> - <li>另具備安全性相關的必要機制。可參閱 <a href="https://wiki.mozilla.org/Apps/Security">Security</a> 以進一步了解。</li> -</ul> -<h4 id="Certified_app">Certified app</h4> -<p style="margin-left: 36.0pt;">Certified App 將用於重要的系統功能,如智慧型手機上預設的撥號鍵盤,或系統設定用 App;當然亦可用於 Firefox OS 手機上的重要功能。Certified App 並不會用於第三方 App,所以大多數的 App 開發人員可略過此類 App 不管。除了所有的裝置許可均為隱式許可 (Implicit permission,意即不需要外部的使用者許可) 之外,Certified App 與 Privileged App 大部分均屬於相似的封包式 App。而 Certified App 必須取得 OEM 裝置或電信服務供應商裝置的許可,才能讓此隱式 App 使用重要 API。下列即為 Certified App 的 CSP (與 Privileged App 的 CSP 略有不同):</p> -<pre>"default-src *; script-src 'self'; object-src 'none'; style-src 'self'"</pre> -<p style="margin-left: 36.0pt;">若與 Certified App 相較,Privileged App 則針對 inline CSP 的影響而稍微放寬了限制。進一步了解其原因,可參閱<a href="https://wiki.mozilla.org/Apps/CSP">預設 CSP</a> 與 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=768029">Bug 768029</a>。</p> -<h4 id="Plain_packaged_app">Plain packaged app</h4> -<p style="margin-left: 36.0pt;">當然也可讓一般 App 封裝為 ZIP 壓縮檔。在 Marketplace 簽署之後,並不會執行如 Privileged/Certified App 所需的特殊授權程序。且 Plain Packaged App 並不會使用特定的 Sensitive Web API;同時也不屬於 Privileged/Certified App 所用 CSP 管轄所及。</p> -<p> </p> -<h2 id="與托管式_(Hosted)_App_的差異"><strong>與托管式</strong><strong> (Hosted) App </strong><strong>的差異</strong></h2> -<p>封包式 App 的功能,其實與一般網站型態的 Open Web App (即所謂托管式 Hosted App) 功能相同。但封包式 App 的差異在於:</p> -<ul> - <li>封包式 App 不需網際網路檔案供應源。托管式 App 所用的 one-app-per-origin 政策,並不適用於封包式 App。</li> - <li>封包式 App 的 ZIP 檔案內部使用特殊協定:<code>app://<uuid></code>。舉例來說,若在封包式 App 內部載入<code> /index.html </code>作為內容,則其實載入了如下的字串 (僅 UUID 不同):</li> -</ul> -<pre>app://550e8400-e29b-41d4-a716-446655440000/index.html</pre> -<ul> - <li>封包式 App 的 manifest 檔案必須命名為 <code>manifest.webapp</code>。</li> - <li>封包式 App 檔案源必須存取自 ZIP 壓縮檔;而 ZIP 壓縮檔又已儲存於 App 所安裝的裝置上。</li> - <li>封包式 App 均以不同 <code>mozApps</code> 函式所安裝:<code>installPackage()</code>。</li> - <li>針對所有應用程式的內容,封包式 App <code>均強制使用特定的</code> <a href="https://developer.mozilla.org/docs/Security/CSP/Introducing_Content_Security_Policy">CSP</a>;托管式 App 亦可使用 CSP,但非必要條件。</li> - <li>封包式 App 可於 iframes 之內嵌入遠端內容,但該內容將無法存取 Privileged API,亦不會具備預設的 CSP。</li> - <li>封包式 App 具備更新程序,可為使用者取得新版本的 App。托管式 App 則不需要此程序。</li> -</ul> -<p>與一般的托管式 App 相同,封包式 App 仍可存取 Web 伺服器上的資料庫。</p> -<p> </p> -<h2 id="使用_Sensitive_Web_API"><strong>使用</strong><strong> Sensitive Web API</strong></h2> -<p>現在有許多惡意 Web API,因此應謹慎存取 Web API。針對 App 所要存取的所有 Sensitive API,你應該在 <a href="https://developer.mozilla.org/docs/Apps/Manifest">manifest 檔案</a>的 <code>permissions </code>欄位中新增輸入項。</p> -<p>一般托管式 App 亦可存取某些 Sensitive API,但其他 API 就限定封包式 (Privileged 或 Certified) App 才可存取。可參閱 <a href="https://developer.mozilla.org/docs/Apps/App_permissions">App 許可</a>找到相關需求的表格。</p> -<p> </p> -<h2 id="封包式_App_與_Firefox_Marketplace"><strong>封包式</strong><strong> App </strong><strong>與</strong><strong> Firefox Marketplace</strong></h2> -<p>與托管式 App 相較,Firefox Marketplace 處理封包式 App 的方式較為不同。一旦提交自己的封包式 App 之後,其 ZIP 壓縮檔即儲存於 Marketplace 的伺服器上,且 Marketplace 隨即根據該 ZIP 壓縮檔中的 manifest 檔案,產生新的 manifest 檔案並命名為「mini-manifest」。只要使用者想安裝此 App,就會將 mini-manifest 檔案傳送至 <code>installPackage()</code> 函式以安裝該 App。此 mini-manifest 檔案僅用於安裝與更新作業,與 App 的執行作業無關。</p> -<p> </p> -<h2 id="測試封包式_App_的安裝作業"><strong>測試封包式</strong><strong> App </strong><strong>的安裝作業</strong></h2> -<p>透過 Firefox OS 模擬器 (Firefox OS Simulator),即可輕鬆安裝封包式 App。目前 Firefox OS 模擬器亦針對各個平台而提供 <a href="https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-windows.xpi">Windows</a>、<a href="https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-mac.xpi">OSX</a>、<a href="https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-linux.xpi">Linux</a> 等不同版本。</p> -<p>安裝模擬器時,將於 Firefox 的「網頁開發者 (Web Developer)」功能表中新增「Firefox OS Simulator」項目。在開啟附加元件之後,即可透過「Add Directory」而指定本端 webapp.manifest 檔案的位置。模擬器另可將該 App 封包 (即壓縮該資料夾),再透過剛封包完畢的 App 開啟模擬器。</p> -<p>針對 Linux 與 Windows 的使用者,還需要其他步驟才能設定 Android Debug Bridge (adb),以溝通實際裝置。請參閱<a href="https://developer.android.com/tools/device.html#setting-up">步驟 3:設定系統以偵測自己的裝置</a>。</p> -<p>在實際裝置上,可點選 Settings > Device Information > More Information > Developer > Remote Debugging,進而啟動遠端除錯功能。</p> -<p>任何時間點均可連上受支援的裝置。一旦連上裝置,模擬器即可偵測並顯示所接上的裝置。而在 App 列表的旁邊,可看到「push」的新按鈕。按下「push」即可將剛封包完畢的 App 傳送至裝置上。</p> -<p> </p> -<h2 id="更新封包式_App"><strong>更新封包式</strong><strong> App</strong></h2> -<p>若要進一步了解更新作業,請參閱<a href="https://developer.mozilla.org/docs/Apps/Updating_apps">更新 App</a>。</p> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/托管更新作業_(hosting_updates)_/index.html b/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/托管更新作業_(hosting_updates)_/index.html deleted file mode 100644 index ea5b41073b..0000000000 --- a/files/zh-tw/archive/b2g_os/3rd_party_app_developer_guide/托管更新作業_(hosting_updates)_/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: 托管更新作業 (Hosting Updates) -slug: Archive/B2G_OS/3rd_Party_App_Developer_Guide/托管更新作業_(Hosting_Updates)_ ---- -<div class="note"> - <p>本文節錄自 <a href="https://wiki.mozilla.org/B2G/Updating" title="https://wiki.mozilla.org/B2G/Updating">B2G/Updating</a></p> -</div> -<p><strong>托管更新作業</strong><strong> (Hosting Updates) </strong></p> -<p>其實亦可解釋為:用戶端針對更新檔案所進行的輪詢作業。</p> -<p>B2G 用戶端針對更新所執行的輪詢 (Poll),即針對 <strong>update manifest</strong> 檔案進行提取 (Fetching) 與剖析 (Parsing)。此檔案即稱為「update.xml」。</p> -<p>B2G 用戶端均已完成「輪詢特定伺服器上的更新」的設定,亦將查詢伺服器上特別架構而成的路徑。而我們建議透過 HTTPS 協定 (當然 HTTP 亦支援),讓用戶端查詢伺服器。若現有用戶端更改了輪詢程式碼,則只要將一筆更新傳送至此用戶端,即可針對「用戶端所輪詢過的路徑與伺服器」進行變更。</p> -<p>在下列範例中,我們假設將更新作業托管 (Hosting) 給 updates.b2g.com 伺服器。</p> -<p>則由用戶端所輪詢的 URL,主要可用下列參數呈現:</p> -<table> - <tbody> - <tr> - <td> - <p>PRODUCT_MODEL</p> - </td> - <td> - <p>裝置型號的名稱。此為 B2G 屬性資料庫中的 ro.product.model 數值。</p> - </td> - </tr> - <tr> - <td> - <p>CHANNEL</p> - </td> - <td> - <p>更新「頻道」,有助於測試作業。舉例來說,我們可設定伺服器托管「nightly」、「beta」、「release」等頻道。</p> - </td> - </tr> - <tr> - <td> - <p>VERSION</p> - </td> - <td> - <p>此為用戶端的軟體版本,此以「18.0.2」為例。</p> - </td> - </tr> - <tr> - <td> - <p>BUILD_ID</p> - </td> - <td> - <p>專屬 ID,如針對特定軟體版本 (Build) 所設的時間戳記。</p> - </td> - </tr> - </tbody> -</table> -<p>當然另有許多數值,可為查詢作業建構出更新用的 URL。</p> -<p>B2G 用戶端隨後將整合「本身已設定的更新主機」的數值,搭配上述的相關數值,進而建構出 URL,以於執行期間執行輪詢作業。</p> -<p>此 URL 範例可為:</p> -<pre><a class="external free" href="https://updates.b2g.com/release/unagi1/18.0/20121203123456/update.xml" rel="nofollow">https://updates.b2g.com/release/unagi1/18.0/20121203123456/update.xml</a> -</pre> -<p> </p> -<p>針對用戶端的請求,若伺服器回傳「404 Not Found」,即代表目前並無可用的更新;若回傳「200」與 manifest 檔案,則代表可能有更新。該 manifest 檔案將描述可用的新版本,亦即用戶端目前<strong>應該更新的</strong>版本。此 manifest 檔案範例為:</p> -<pre><?xml version="1.0"?> -<updates> - <update type="major" appVersion="19.0" version="19.0" extensionVersion="19.0" buildID="20121210123456" - licenseURL="http://www.mozilla.com/test/sample-eula.html" - detailsURL="http://www.mozilla.com/test/sample-details.html"> - <patch type="partial" URL="https://updates.b2g.com/release/unagi1/18.0/20121203123456/update.mar" - hashFunction="SHA512" hashValue="5111e033875752b7d9b32b4795152dea5ef954cb8a9d4a602dd19a923b464c43521287dcb5781faf3af76e6dc5e8a3dd9c13edea18c1f2c8f3bd89e17d103d6f" - size="41901319"/> - </update> -</updates> -</pre> -<p>而 manifest 檔案中的欄位則描述了:</p> -<ul> - <li>可於用戶端顯示使用者介面的後設資料 (Metadata)</li> - <li>關於可用新版本的後設資料</li> - <li>更新封裝的位置</li> - <li>用以驗證更新裝包下載作業的後設資料</li> -</ul> -<p>當然,使用者或用戶端裝置可能會拒絕更新作業。</p> -<p>透過這些機制,伺服器將可托管更新封裝,以利舊版用戶端的更新作業。或可僅托管「線性更新歷史紀錄 (Linear update history)」,讓用戶端必須透過單一路徑完成升級。</p> -<p>針對「版本 (Build) 伺服器」和「更新主機」之間的互動細節,仍與作業環境息息相關。本文尚不足以詳細解說完畢。</p> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/add-ons/index.html b/files/zh-tw/archive/b2g_os/add-ons/index.html deleted file mode 100644 index 13f42518cd..0000000000 --- a/files/zh-tw/archive/b2g_os/add-ons/index.html +++ /dev/null @@ -1,282 +0,0 @@ ---- -title: Firefox OS 附加元件 -slug: Archive/B2G_OS/Add-ons -translation_of: Archive/B2G_OS/Add-ons ---- -<div class="warning"> -<p><strong>重要</strong>: 僅 Firefox OS 2.5+ 支援附加元件功能。</p> -</div> - -<p class="summary">「附加元件」的概念在 Web 瀏覽器的世界中眾人皆知,而我們也將這個概念帶進 Firefox OS。Firefox OS 的附加元件可以僅僅作用於單一 App 上,也可以指定作用於多個、甚至所有 App 上。本文帶您一步步撰寫自己的 Firefox OS 附加元件,同時提供一些秘訣及其他應該了解的資訊。</p> - -<div class="note"> -<p><strong>附註</strong>:本文僅重點概略翻譯。</p> -</div> - -<div class="note"> -<p><strong>附註</strong>:Firefox OS 附加元件採用 WebExtensions 擴充模式。此模式大部份源自於 Chrome/Blink 擴充套件機制,讓附加元件在開發時能擁有許多互通性與功能上的優勢。詳情可見持續編寫中的 <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions">WebExtensions 文件集</a>。</p> -</div> - -<h2 id="開發附加元件">開發附加元件</h2> - -<p>Firefox OS 附加元件其實也是個內含 JavaScript / CSS / 其他必備檔案的 App,但不是拿來獨立運作,而是在描述檔中增加特別的說明來定義要在哪些 App 中使用這個附加元件。When apps are launched on a Firefox OS device that has an add-on installed, the add-on is injected into any app that matches the pattern specifed in the filter.</p> - -<p>Firefox OS add-ons use the same syntax and structure for their code as the new school of Firefox add-ons developed using the <a href="https://wiki.mozilla.org/WebExtensions">WebExtensions API</a>, which is itself based on the <a href="https://developer.chrome.com/extensions">Chrome extensions</a> model.</p> - -<h3 id="簡單範例">簡單範例</h3> - -<p>以下我們以一個簡單的例子說明 Firefox OS 附加元件的程式基礎。這個附加元件會在 system app 放上一塊看板,使用者可以點擊關閉。</p> - -<p><img alt="firefox os screenshot showing add-on banner" src="https://mdn.mozillademos.org/files/11445/add-on-screenshot.png" style="display: block; height: 445px; margin: 0px auto; width: 250px;"></p> - -<p>這個附加元件很簡單,但用來作為入門倒是相當足夠了。你可以在 <a href="https://github.com/mdn/simple-addon">GitHub 上下載範例程式</a>,而後用 WebIDE 裝到你的 Firefox OS 裝置上(參考 {{anch("Testing your add-on using WebIDE")}} 一節)。往後你也可以透過 <a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 來發表自己的附加元件。</p> - -<p>Be aware that Firefox OS add-ons can do a lot more than what we've got listed here. The <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a> documentation will have more information added as time goes on.</p> - -<h2 id="解析_Firefox_OS_add-on">解析 Firefox OS add-on</h2> - -<p>In this section we'll walkthrough the contents of the sample add-on repo, explaining each piece of content. 目錄結構看起來像這樣:</p> - -<ul class="directory-tree"> - <li>simple-addon/ - <ul> - <li>manifest.json</li> - <li>update.webapp</li> - <li>css/ - <ul> - <li>style.css</li> - </ul> - </li> - <li>js/ - <ul> - <li>index.js</li> - </ul> - </li> - <li>icons/ - <ul> - <li>128.png</li> - </ul> - </li> - <li>extension.zip</li> - </ul> - </li> -</ul> - -<h3 id="manifest.json">manifest.json</h3> - -<p>你應該發現了:在這個範例附加元件目錄中,有兩種類似的描述檔。第一個<code>「manifest.json</code>」的結構類似 Chrome 擴充套件,與 CSS、JavaScript 及其他檔案一起放在 {{anch("extensions.zip")}} 當中。It can contain a large variety of instructions (see <a href="https://developer.chrome.com/extensions/manifest">Chrome Manifest File Format</a>), but for now we're just going to concentrate on a simple subset:</p> - -<pre class="brush: json language-json"><code class="language-json"><span class="punctuation token">{</span> - <span class="key token">"manifest_version":</span> <span class="number token">1</span><span class="punctuation token">,</span> - <span class="key token">"name":</span> <span class="string token">"Add-on banner"</span><span class="punctuation token">,</span> - <span class="key token">"description":</span> <span class="string token">"Firefox OS add-on example"</span><span class="punctuation token">,</span> - <span class="key token">"version":</span> <span class="string token">"1.0"</span><span class="punctuation token">,</span> - <span class="key token">"author":</span> <span class="string token">"Chris Mills"</span><span class="punctuation token">,</span> - <span class="key token">"content_scripts":</span> <span class="punctuation token">[</span><span class="punctuation token">{</span> - <span class="key token">"matches":</span> <span class="punctuation token">[</span><span class="string token">"app://system.gaiamobile.org/index.html"</span><span class="punctuation token">]</span><span class="punctuation token">,</span> - <span class="key token">"css":</span> <span class="punctuation token">[</span><span class="string token">"css/style.css"</span><span class="punctuation token">]</span><span class="punctuation token">,</span> - <span class="key token">"js":</span> <span class="punctuation token">[</span><span class="string token">"js/index.js"</span><span class="punctuation token">]</span> - <span class="punctuation token">}</span><span class="punctuation token">]</span><span class="punctuation token">,</span> - <span class="key token">"icons":</span> <span class="punctuation token">{</span> - <span class="key token">"128":</span> <span class="string token">"/icons/128.png"</span> - <span class="punctuation token">}</span> -<span class="punctuation token">}</span></code></pre> - -<p>Most of these fields are pretty self-explanatory, but we'll cover the last few.</p> - -<p>首先以 <code>content_scripts</code> 指定要植入 app 的檔案 — 你可以看到這邊以 <code>css</code> 及 <code>js</code> 兩欄分別指定 CSS 樣式檔及 JavaScript 程式檔。<code>matches</code> 欄位則是用以指定該把檔案放入哪些 app 裡,這個欄位的內容形式很多元(參考 <a href="https://developer.chrome.com/extensions/match_patterns">Chrome Match Patterns</a>),但我們先簡單指定為 <code>app://system.gaiamobile.org/index.html</code>,讓附加元件僅影響 system app。若想影響所有 app,可以將此欄位寫為 <code>app://*/* </code>。</p> - -<div class="note"> -<p><strong>Note</strong>: You can reference multiple scripts and stylesheets by simply including multiple items in the arrays, for example <code>"css": ["css/style.css", "css/more.css"]</code>.</p> -</div> - -<div class="note"> -<p><strong>Note</strong>: Firefox OS does not currently support the Chrome <all_urls> keyword.</p> -</div> - -<p>At the bottom of the manifest we've included the <code>icons</code> field; see the next section for more info on this.</p> - -<h3 id="update.webapp">update.webapp</h3> - -<p><code>update.webapp</code> 則是 <a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest">Firefox OS 式的描述檔</a>,基本上就是跟打包 app 時用的描述檔格式相同。(參考 <a href="https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing#Self-publishing_packaged_apps">Self-publishing packaged apps</a>。)</p> - -<p>Our <code>update.webapp</code> file looks like so:</p> - -<pre class="brush: json language-json"><code class="language-json"><span class="punctuation token">{</span> - <span class="key token">"name" :</span> <span class="string token">"Add-on banner"</span><span class="punctuation token">,</span> - <span class="key token">"description":</span> <span class="string token">"Firefox OS add-on example"</span><span class="punctuation token">,</span> - <span class="key token">"developer":</span> <span class="punctuation token">{</span> <span class="key token">"name":</span> <span class="string token">"Chris Mills"</span> <span class="punctuation token">}</span><span class="punctuation token">,</span> - <span class="key token">"package_path":</span> <span class="string token">"extension.zip"</span><span class="punctuation token">,</span> - <span class="key token">"icons":</span> <span class="punctuation token">{</span> - <span class="key token">"128":</span> <span class="string token">"/icons/128.png"</span> - <span class="punctuation token">}</span> -<span class="punctuation token">}</span></code></pre> - -<p>Again, most of this is fairly self-explanatory.</p> - -<p>這邊最重要的欄位該是 <code>package_path</code>,用以指定內含附加元件程式的包裝檔位置。</p> - -<p>You'll notice that the <code>icons</code> field is included here, the same as it is in {{anch("manifest.json")}} — <code>update.webapp</code> is the only place you <em>need</em> to have the icons information at the moment, but we'd recommend you include it in both places for now, just in case things change. The <code>icons</code> field points to the add-on icon so it can be used inside the Gaia Settings app, and the Firefox Marketplace when it starts to host add-ons.</p> - -<h3 id="指定圖示">指定圖示</h3> - -<p>你必須在描述檔中至少指定一個圖示,否則描述檔無效。詳情可參考 <a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest#icons">Manifest 參考文件:圖示</a> 一節。</p> - -<h3 id="CSS">CSS</h3> - -<p>There is nothing special about the CSS included in the example. The only thing to bear in mind is that you should make sure your add-on classnames and selectors do not conflict with any of the existing CSS in the app(s) it is applied to.</p> - -<p>For example, we wrapped our example banner in a {{htmlelement("div")}} with class <code>fxos-banner</code>. But you could even consider using some kind of unique code for your classname.</p> - -<h3 id="JavaScript">JavaScript</h3> - -<p>Again, the JavaScript file that powers the add-on doesn't have any special functionality inside it (see the <a href="https://github.com/mdn/simple-addon/blob/gh-pages/js/index.js">JavaScript source on Github</a>.) It is injected into the apps it is applied to along with any CSS specified in the {{anch("manifest.json")}} file.</p> - -<div class="note"> -<p><strong>Note</strong>: Add-on code is injected every time an app is launched and the match specified in manifest.json pattern matches that app. It is also injected whenever add-ons are enabled. When an add-on is injected into an app because the app is launching, all add-on files are injected into the app before anything in the app is initialized, including the DOM. It is up to the add-on developer to handle the different launch cases cases (immediate injection vs. injection on launch); there is more info on this below.</p> -</div> - -<p>Other main things to note are covered below.</p> - -<h4 id="The_window_object">The window object</h4> - -<p>Add-ons only share a proxied version of the content <code>window</code>. As a result, anything that is written to the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window">window</a> object from an add-on is unavailable to the app code. However, anything on the <code>window</code> object that is set by app code is available to add-ons. Similarly, the DOM is accessible as usual.</p> - -<h4 id="Injecting_code_at_the_correct_time">Injecting code at the correct time</h4> - -<p>You must be careful to properly handle cases where an add-on is injected into an app after the app has been loaded. Such a scenario can occur when an app is already running and an add-on that targets it is enabled.</p> - -<p>in such a case, a <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onload">window.onload</a> handler won't work because the <a href="https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded">DOMContentLoaded</a> event has already occured.</p> - -<p>There's no good solution to this problem right now. In the interim, we recommend to check whether or not the DOM has been loaded before setting a <code>DOMContentLoaded</code> callback. This pattern is used in the demo:</p> - -<pre class="brush: js language-js"><code class="language-js"><span class="comment token">// If injecting into an app that was already running at the time -</span><span class="comment token">// the app was enabled, simply initialize it. -</span><span class="keyword token">if</span> <span class="punctuation token">(</span>document<span class="punctuation token">.</span>documentElement<span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="function token">initialize<span class="punctuation token">(</span></span><span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span> -<span class="comment token"> -// Otherwise, we need to wait for the DOM to be ready before -</span><span class="comment token">// starting initialization since add-ons are usually (always?) -</span><span class="comment token">// injected *before* `document.documentElement` is defined. -</span><span class="keyword token">else</span> <span class="punctuation token">{</span> - window<span class="punctuation token">.</span><span class="function token">addEventListener<span class="punctuation token">(</span></span><span class="string token">'DOMContentLoaded'</span><span class="punctuation token">,</span> initialize<span class="punctuation token">)</span><span class="punctuation token">;</span> -<span class="punctuation token">}</span> - -<span class="keyword token">function</span> <span class="function token">initialize<span class="punctuation token">(</span></span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="comment token"> // ... -</span><span class="punctuation token">}</span></code></pre> - -<h4 id="避免重複植入">避免重複植入</h4> - -<p>為避免附加元件的程式碼多次重複植入到同一 App 中,您必須檢查附加元件是否曾經植入過,例如這樣</p> - -<p>you should check whether your add-on is already present, like this:</p> - -<pre class="brush: js language-js"><code class="language-js"><span class="keyword token">function</span> <span class="function token">initialize<span class="punctuation token">(</span></span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">if</span> <span class="punctuation token">(</span>document<span class="punctuation token">.</span><span class="function token">querySelector<span class="punctuation token">(</span></span><span class="string token">'.fxos-banner'</span><span class="punctuation token">)</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="comment token"> // Already injected, abort. -</span> <span class="keyword token">return</span><span class="punctuation token">;</span> - <span class="punctuation token">}</span> <span class="keyword token">else</span> <span class="punctuation token">{</span> - <span class="keyword token">var</span> body <span class="operator token">=</span> document<span class="punctuation token">.</span><span class="function token">querySelector<span class="punctuation token">(</span></span><span class="string token">'body'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="keyword token">var</span> fxosBanner <span class="operator token">=</span> document<span class="punctuation token">.</span><span class="function token">createElement<span class="punctuation token">(</span></span><span class="string token">'div'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - fxosBanner<span class="punctuation token">.</span>classList<span class="punctuation token">.</span><span class="function token">add<span class="punctuation token">(</span></span><span class="string token">'fxos-banner'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="keyword token">var</span> bannerText <span class="operator token">=</span> document<span class="punctuation token">.</span><span class="function token">createElement<span class="punctuation token">(</span></span><span class="string token">'p'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="keyword token">var</span> closeBtn <span class="operator token">=</span> document<span class="punctuation token">.</span><span class="function token">createElement<span class="punctuation token">(</span></span><span class="string token">'button'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> - - fxosBanner<span class="punctuation token">.</span><span class="function token">appendChild<span class="punctuation token">(</span></span>bannerText<span class="punctuation token">)</span><span class="punctuation token">;</span> - fxosBanner<span class="punctuation token">.</span><span class="function token">appendChild<span class="punctuation token">(</span></span>closeBtn<span class="punctuation token">)</span><span class="punctuation token">;</span> - body<span class="punctuation token">.</span><span class="function token">appendChild<span class="punctuation token">(</span></span>fxosBanner<span class="punctuation token">)</span><span class="punctuation token">;</span> - - closeBtn<span class="punctuation token">.</span>textContent <span class="operator token">=</span> <span class="string token">'X'</span><span class="punctuation token">;</span> - bannerText<span class="punctuation token">.</span>textContent <span class="operator token">=</span> <span class="string token">'Wow, you have an extension installed!'</span><span class="punctuation token">;</span> - - closeBtn<span class="punctuation token">.</span>onclick <span class="operator token">=</span> <span class="keyword token">function</span><span class="punctuation token">(</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - fxosBanner<span class="punctuation token">.</span>parentNode<span class="punctuation token">.</span><span class="function token">removeChild<span class="punctuation token">(</span></span>fxosBanner<span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="punctuation token">}</span> - <span class="punctuation token">}</span> -<span class="punctuation token">}</span></code></pre> - -<p>So here we are using <code>if (document.querySelector('.fxos-banner'))</code> to check whether the example banner already exists. If so, then we return out of the function. If not, then the <code>querySelector()</code> method returns <code>null</code>, and we run the code block that creates the banner.</p> - -<h4 id="App_management_functions_in_add-ons">App management functions in add-ons</h4> - -<p>All <code><a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMApplicationsRegistry">Apps</a></code> and <code><a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMApplicationsRegistry/mgmt">Mgmt</a></code> functions work on add-ons just like they do on apps. Be aware however that the latter are only available to add-ons when they are injected into a certified app that has the <code>webapps-manager</code> permission specified in the manifest.</p> - -<p>In addition to these functions, an <code><a href="http://mxr.mozilla.org/mozilla-central/source/dom/webidl/Apps.webidl#141">onenabledstatechange</a></code> callback is exposed for add-ons being enabled and disabled. This event is fired for all add-ons, so you will have to check which add-on was enabled/disabled before performing initialization or cleanup.</p> - -<pre class="brush: js language-js"><code class="language-js">navigator<span class="punctuation token">.</span>mozApps<span class="punctuation token">.</span>mgmt<span class="punctuation token">.</span>onenabledstatechange <span class="operator token">=</span> <span class="keyword token">function</span><span class="punctuation token">(</span>event<span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">var</span> app <span class="operator token">=</span> event<span class="punctuation token">.</span>application<span class="punctuation token">;</span> - <span class="keyword token">if</span> <span class="punctuation token">(</span>app<span class="punctuation token">.</span>manifestURL <span class="operator token">===</span> <span class="string token">'https://origin.of.manifest/manifest.webapp'</span><span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">var</span> wasEnabled <span class="operator token">=</span> app<span class="punctuation token">.</span>enabled<span class="punctuation token">;</span> - <span class="comment token"> // do something with this information -</span> <span class="punctuation token">}</span> -<span class="punctuation token">}</span><span class="punctuation token">;</span></code></pre> - -<h3 id="extension.zip">extension.zip</h3> - -<div class="note"> -<p><strong>Note</strong>: The <code>extension.zip</code> file has been left in the demo repo mainly for illustrative purposes, so it is clear how the system works. You actually don't need to include the zip in your directory, as WebIDE will generate it for you when you install the add-on. The Firefox Marketplace is likely to do the same when it starts to list add-ons.</p> -</div> - -<p>The <code>extension.zip</code> archive contains the code for the extension, and is referenced in the {{anch("update.webapp")}} <code>package_path</code> field — This is how Gecko finds the code to be installed. Archived inside you'll find:</p> - -<ul class="directory-tree"> - <li>css/ - <ul> - <li>style.css</li> - </ul> - </li> - <li>js/ - <ul> - <li>index.js</li> - </ul> - </li> - <li>icons/ - <ul> - <li>128.png</li> - </ul> - </li> - <li>manifest.json</li> -</ul> - -<p>So the <code>manifest.json</code> file sits inside the archive, and serves to reference the files to be injected and specify which apps to affect.</p> - -<h3 id="Testing_your_add-on_using_WebIDE">Testing your add-on using WebIDE</h3> - -<p>Mozilla's WebIDE tool is available in Firefox desktop by default. To use it for installing add-ons on your phone, follow the steps listed below:</p> - -<ol> - <li>Make sure you have Firefox 43 or above installed (this was <a href="https://nightly.mozilla.org/">Nightly</a> at the time of writing), as add-ons are not supported in WebIDE below this version.</li> - <li>Open your browser and open the WebIDE tool (press the WebIDE button, or choose <em>Tools > Web Developer > WebIDE</em> from the menu.)</li> - <li>Make sure your phone has remote debugging enabled (<em>Settings App > Developer > Set the "Debugging via USB " selection to "ADB and DevTools".</em>)</li> - <li>Connect your phone to your computer via a USB cable. Make sure you don't have other phones connected at the same time.</li> - <li>In the WebIDE UI, press the <em>Select Runtime</em> option, and select your phone, which should be listed under <em>USB Devices</em>.</li> - <li>At this point, your phone should be showing an <em>Allow USB debugging connection?</em> prompt. Choose <em>Allow</em>.</li> - <li>Select the <em>Open App</em> option, then choose <em>Open Packaged App...</em></li> - <li>In the resulting file chooser, navigate to the directory that contains your <code>update.webapp</code> manifest file, and press <em>Open</em>.</li> - <li>Providing there are no warnings or errors reported, you can install your add-on on the device using the "Play" button in the center (<em>Install and Run</em>.)</li> - <li>To see the add-on in action, enable it by choosing <em>Settings app > Add-ons > Add-on example > toggle the checkbox at the top</em>.</li> -</ol> - -<h2 id="Add-on_settings">Add-on settings</h2> - -<p>You can control the add-ons on your phone by going to <em>Settings app > Add-ons</em>; in here you'll find a list of your installed add-ons, and you can tap each entry to see more information about each add-on.</p> - -<p style="width: 520px; margin: 0 auto;"><img alt="firefox os screenshot showing a list of installed add-ons in the settings app" src="https://mdn.mozillademos.org/files/11447/add-on-settings-screen.png" style="height: 445px; margin-right: 20px; width: 250px;"><img alt="information screen for an individual addon, with a list of apps this add-on affects, and controls to disable and delete the add-on" src="https://mdn.mozillademos.org/files/11449/individual-add-on-settings-page.png" style="height: 445px; width: 250px;"></p> - -<h3 id="Enablingdisabling_and_deleting_add-ons">Enabling/disabling and deleting add-ons</h3> - -<p>By default, add-ons will be enabled after installation when they are installed form the Firefox Marketplace. When installed via WebIDE however they will be disabled by default.</p> - -<p>You can manually enable/disable add-ons via the checkbox at the top of each individual add-on's page (found under <em>Settings app > Add-ons</em>), or programmatically using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMApplicationsManager/setEnabled">navigator.mozApps.mgmt.setEnabled()</a> function (see this <a href="https://github.com/fxos/directory/blob/master/app/js/controller/list_controller.js#L220-L223">setEnabled() usage example</a> on Github.)</p> - -<p>You can delete an add-on entirely by tapping the <em>Delete</em> button found on individual app pages.</p> - -<h3 id="Apps_affected_by_add-ons">Apps affected by add-ons</h3> - -<p>You'll also notice that in the page for each individual add-on there is a section that lists which apps are affected by that add-on. Currently this doesn't seem to work (it always lists <em>This add-on does not affect any installed apps</em>.) This should be fixed soon (see {{Bug(1196386)}} for progress.)</p> - -<h2 id="權限">權限</h2> - -<p>附加元件的權限繼承自其所植入的 App,在描述檔中想多要一點權限是行不通的,也無法以此方式增加其植入對象的權限。</p> diff --git a/files/zh-tw/archive/b2g_os/api/fmradio/index.html b/files/zh-tw/archive/b2g_os/api/fmradio/index.html deleted file mode 100644 index ec662a0029..0000000000 --- a/files/zh-tw/archive/b2g_os/api/fmradio/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: WebFM -slug: Archive/B2G_OS/API/FMRadio -translation_of: Archive/B2G_OS/API/FMRadio ---- -<p>WebFM API 可存取裝置上的 FM 收音機功能。此介面可開啟/關閉 FM 收音機,亦可搜尋各個電台。</p> -<h2 id="Syntax" name="Syntax">進入點 (Entry point)</h2> -<pre class="eval"><span class="nx">if (navigator.mozFMRadio) - navigator</span><span class="p">.</span><span class="nx">mozFMRadio.enable()</span>; -</pre> -<h2 id="API">API</h2> -<pre>interface FM : EventTarget { - readonly attribute boolean enabled; - readonly attribute boolean antennaAvailable; - readonly attribute double frequency; - readonly attribute double frequencyUpperBound; - readonly attribute double frequencyLowerBound; - readonly attribute double channelWidth; - - attribute Function onantennaavailablechange; - attribute Function onfrequencychange; - attribute Function onenabled; - attribute Function ondisabled; - - DOMRequest enable(double frequency); - DOMRequest disable(); - DOMRequest setFrequency(double frequency); - DOMRequest seekUp(); - DOMRequest seekDown(); - DOMRequest cancelSeek(); -}</pre> -<h3 id="屬性_(Attribute)">屬性 (Attribute)</h3> -<dl> - <dt> - enabled</dt> - <dd> - 表示目前是否開啟收音機</dd> - <dt> - antennaAvailable</dt> - <dd> - 表示是否已插上天線並可使用天線</dd> - <dt> - frequency</dt> - <dd> - 目前的收音機頻率</dd> - <dt> - frequencyUpperBound</dt> - <dd> - 以 <code>seek</code> 函式搜尋收音機電台的最高頻率</dd> - <dt> - frequencyLowerBound</dt> - <dd> - 以 <code>seek</code> 函式搜尋收音機電台的最低頻率</dd> - <dt> - channelWidth</dt> - <dd> - 頻率範圍內的頻寬,以「MHz」為單位。常用數值為 0.05、0.1 (預設)、0.2 其中之一。</dd> - <dd> - 指定了某一頻率之後,就會四捨五入到 channelWidth 所指定的最接近頻率。舉例來說,若 100 Mz 為有效頻率,且 channelWidth 為 0.2,則 100.2 與 99.8 將成為有效頻率。但若是 100.15 將四捨五入為 100.2。</dd> -</dl> -<h3 id="函式_(Method)">函式 (Method)</h3> -<dl> - <dt> - enable(frequency)</dt> - <dd> - 開啟收音機並轉為指定頻率。若沒有參數 (Argument) 就呼叫此函式,將隨即丟出錯誤。作業成功或錯誤均將回傳 DOMRequest。</dd> - <dt> - disable()</dt> - <dd> - 關閉收音機。若回傳成功的 DOMRequest,則代表已正確關閉收音機。</dd> - <dt> - setFrenquecy(frequency)</dt> - <dd> - 非同步變更收音機的頻率。此數值必須位於 <code>frequencyLowerBound</code> 與 <code>frequencyUpperBound</code> 之間。若嘗試設定此範圍之外,將導致錯誤。</dd> - <dd> - 若回傳成功的 DOMRequest,則代表已正確變更頻率。</dd> - <dt> - seekUp()</dt> - <dd> - 要求收音機尋找新的頻率 (一般搜尋較目前頻率更高的頻率)。若成功搜尋到新的頻率,將隨即啟動 <code>frequencychange</code> 事件。若回傳成功的 DOMRequest,則代表已開始搜尋作業。一旦達到最高頻率,將回到較低頻率開始搜尋。</dd> - <dt> - seekDown()</dt> - <dd> - 與上方函式的功能相同,但將搜尋較目前頻率更低的頻率。一旦達到最低頻率,將回到較高頻率開始搜尋。</dd> - <dt> - cancelSeek()</dt> - <dd> - 取消目前的搜尋作業。若回傳成功的 DOMRequest,則代表已取消搜尋作業。</dd> -</dl> -<h3 id="事件_(Event)">事件 (Event)</h3> -<dl> - <dt> - enabled</dt> - <dd> - 開啟收音機時觸發此事件</dd> - <dt> - disabled</dt> - <dd> - 關閉收音機時觸發此事件</dd> - <dt> - antennaavailablechange</dt> - <dd> - 插上/拔除天線時觸發此事件</dd> - <dt> - frequencychange</dt> - <dd> - 只要變更收音機頻率,均將觸發此事件</dd> -</dl> -<h2 id="另請參閱">另請參閱</h2> -<p><a href="https://github.com/mozilla-b2g/gaia/tree/master/apps/fm" title="https://github.com/mozilla-b2g/gaia/tree/master/apps/fm">Gaia radio app</a></p> diff --git a/files/zh-tw/archive/b2g_os/api/index.html b/files/zh-tw/archive/b2g_os/api/index.html deleted file mode 100644 index 706080ff54..0000000000 --- a/files/zh-tw/archive/b2g_os/api/index.html +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: B2G OS APIs -slug: Archive/B2G_OS/API -tags: - - API - - B2G API - - NeedsTranslation - - TopicStub - - b2g os api's -translation_of: Archive/B2G_OS/API ---- -<p id="B2G_OS_uses_standard_Web_API's">List of B2G OS APIs </p> - -<p></p><div class="index"> -<span>A</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/AudioChannelManager" title="The AudioChannelManager interface of the AudioChannels API includes features for managing your device's audio channels, including setting what channel's volume to affect when the volume buttons are pressed inside a particular app."><code>AudioChannelManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> -<span>B</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothAdapter" title="The BluetoothAdapter interface of the Web Bluetooth API is used to handle all the operations requested by Bluetooth networks. A Bluetooth adapter is the physical interface which is used to interact with local Bluetooth device."><code>BluetoothAdapter</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothAdapterEvent" title="The BluetoothAdapterEvent interface of the Web Bluetooth API provides access to a BluetoothAdapter object and its address as the parameter of a adapteradded or adapterremoved event handler (see BluetoothManager.onadapteradded and BluetoothManager.onadapterremoved), when fired."><code>BluetoothAdapterEvent</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothAttributeEvent" title="The BluetoothAttributeEvent interface of the Web Bluetooth API provides access to changed attributes and their new values as the parameter of attributechanged event handlers (including BluetoothManager.onattributechanged, BluetoothAdapter.onattributechanged, and BluetoothDevice.onattributechanged), when fired."><code>BluetoothAttributeEvent</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothClassOfDevice" title="The BluetoothClassOfDevice interface of the Web Bluetooth API provides identifying/classification information about a given remote Bluetooth device, available at discovery stage."><code>BluetoothClassOfDevice</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothDevice" title="The BluetoothDevice interface of the Web Bluetooth API provides information regarding a given Bluetooth device."><code>BluetoothDevice</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothDeviceEvent" title="The BluetoothDeviceEvent interface of the Web Bluetooth API provides access to a found/paired device (BluetoothDevice) object or the address or an unpaired device as the parameter of a devicefound, devicepaired or deviceunpaired event handler (see BluetoothDiscoveryHandle.ondevicefound, BluetoothAdapter.ondevicepaired, and BluetoothAdapter.ondeviceunpaired), when fired."><code>BluetoothDeviceEvent</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothDiscoveryHandle" title="The BluetoothDiscoveryHandle interface of the Web Bluetooth API is used to notify the current application about the discovery of a remote bluetooth device."><code>BluetoothDiscoveryHandle</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothGatt" title="The BluetoothGatt interface of the Web Bluetooth API handles initial communications and connections with Gatt services."><code>BluetoothGatt</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothGattCharacteristic" title="The BluetoothGattCharacteristic interface of the Web Bluetooth API represents a GATT service characteristic, which includes characteristic definition, value, properties and configuration info, and a list of descriptors that provide related information."><code>BluetoothGattCharacteristic</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothGattCharacteristicEvent" title="The BluetoothGattCharacteristicEvent interface of the Web Bluetooth API provides access to an updated BluetoothGattCharacteristic object as the parameter of the BluetoothGatt.oncharacteristicchanged, handler, when the characteristicchanged event is fired."><code>BluetoothGattCharacteristicEvent</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothGattDescriptor" title="The BluetoothGattDescriptor interface of the Web Bluetooth API represents a GATT descriptor, which contains related information about a characteristic value."><code>BluetoothGattDescriptor</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothGattServer" title="The BluetoothGattServer interface of the Web Bluetooth API provides Bluetooth GATT server functionality to allow creation of Bluetooth Smart/LE services and characteristics."><code>BluetoothGattServer</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothGattService" title="The BluetoothGattService interface of the Web Bluetooth API represents a service provided by a GATT server, including the service definition, a list of referenced services, and a list of the characteristics of this service."><code>BluetoothGattService</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothLeDeviceEvent" title="The BluetoothLeDeviceEvent interface of the Web Bluetooth API provides access to an LE device BluetoothDevice object and its RSSI value and advertisement record, as the parameter of a devicefound event handler (see BluetoothDiscoveryHandle.ondevicefound), when fired."><code>BluetoothLeDeviceEvent</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothManager" title="The BluetoothManager interface of the Web Bluetooth API allows to access all Bluetooth adapters available on the device. Adapters are the connection interface to connect a Bluetooth device to that device."><code>BluetoothManager</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothPairingEvent" title="The BluetoothPairingEvent interface of the Web Bluetooth API provides access to a device's name and the BluetoothPairingHandle object required for pairing devices as the parameter of pairing-related handlers (for example including BluetoothPairingListener.ondisplaypasskeyreq and BluetoothPairingListener.onenterpincodereq), when fired."><code>BluetoothPairingEvent</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothPairingHandle" title="The BluetoothPairingHandle interface of the Web Bluetooth API contains the functionality required for completing a device pairing operation, including passkeys, and mechanisms to reply to user-entered pin codes and confirm passkeys."><code>BluetoothPairingHandle</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/BluetoothPairingListener" title="The BluetoothPairingListener interface of the Web Bluetooth API defines event handlers triggered for different pairing operations."><code>BluetoothPairingListener</code> (Firefox OS)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> -<span>C</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/CallEvent" title="The CallEvent interface of the Web Telephony API represents events related to telephone calls."><code>CallEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/CameraCapabilities" title="The CameraControl.capabilities property returns a CameraCapabilities object, which describes all the camera's capabilities."><code>CameraCapabilities</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/CameraControl" title="When you use the CameraManager.getCamera() method to get a reference to a camera, you specify a callback function to be invoked on success. That function receives as a parameter a CameraControl object. You can use its methods and properties to manage and make use of the camera."><code>CameraControl</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/CameraManager" title="The CameraManager interface provides access to any cameras available on the device being used."><code>CameraManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/ContactManager" title="The ContactManager interface is used to access and manage the contact available on the device."><code>ContactManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> -<span>D</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DOMApplication" title="In the Open Web apps JavaScript API, an App object is a JavaScript object that represents an app that is or could be installed in the user's app repository."><code>DOMApplication</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DOMCursor" title="A DOMCursor object represents an ongoing operation over a list of results. It is an enhanced DOMRequest that allows to iterate through a list of results asynchronously. Each time its continue() method is called, the DOMCursor tries to reach the next result in the list and calls its result's success or error accordingly."><code>DOMCursor</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DOMRequest" title="A DOMRequest object represents an ongoing operation. It provides callbacks that are called when the operation completes, as well as a reference to the operation's result. A DOM method that initiates an ongoing operation may return a DOMRequest object that you can use to monitor the progress of that operation."><code>DOMRequest</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DataStore" title="The DataStore interface of the Data Store API represents a retrieved set of data, and includes standard properties for accessing the store's name, owner, etc., methods for reading, modifying and syncing data, and the onchange event handler for reacting to changes to the data."><code>DataStore</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DataStoreChangeEvent" title="The DataStoreChangeEvent interface of the Data Store API represents the event related to a record changed in the data store, i.e. this is returned once a change is made and the change event is fired (see DataStore.onchange for the handler)."><code>DataStoreChangeEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DataStoreCursor" title="The DataStoreCursor interface of the Data Store API represents a cursor that allows apps to iterate through a list of DataStoreTask objects representing the change history of the data store, for use when synchronizing the data."><code>DataStoreCursor</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DataStoreTask" title="The DataStoreTask interface of the Data Store API represents a record changed in the data store when a DataStoreCursor is used to iterate through the data store's change history."><code>DataStoreTask</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DeviceStorage" title="The DeviceStorage interface is used to access files on a specific storage area available on the device. A storage area is, in essence, a file system repository even if it hides the reality of the underlying file system."><code>DeviceStorage</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/DeviceStorageChangeEvent" title="The DeviceStorageChangeEvent provides information about any change made to a file inside a given storage area. It extends the Event interface."><code>DeviceStorageChangeEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> - - -<span>F</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/FMRadio" title="The WebFM API provides access to the device FM radio. This interface lets you turn the FM radio on and off and tune it to different stations. It is accessible through the navigator.mozFMRadio property."><code>FMRadio</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> - - -<span>H</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/HTMLMediaElement" title=""><code>HTMLMediaElement</code> (Firefox OS extensions)</a></span></span></li> -</ul> - - - - - - - - -<span>M</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MMICall" title="The MMICall interface of the Web Telephony API represents an MMI call, allowing us to receive the result of the call."><code>MMICall</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozActivity" title="The MozActivity interface allows apps to delegate an activity to another app."><code>MozActivity</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozActivityOptions" title="The MozActivityOptions interface allows apps to declare the activity they want to create and also to access information of activities they want to handle."><code>MozActivityOptions</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozActivityRequestHandler" title="The MozActivityRequestHandler interface allows apps that handle activities to access and interact with the request made by a third party app that tries to delegate an activity."><code>MozActivityRequestHandler</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozAlarmsManager" title="The MozAlarmsManager API allows to schedule notifications or applications to be started at a specific time."><code>MozAlarmsManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozContact" title="The MozContact interface is used to describe a single contact in the device's contact database."><code>MozContact</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozContactChangeEvent" title="The MozContactChangeEvent interface provides information about the contact that has changed. It inherits from the Event interface."><code>MozContactChangeEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozIccManager" title="The MozIccManager interface gives access to ICC related functionalities."><code>MozIccManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMmsEvent" title="The DOM MozMmsEvent represents events related to WebSMS MMS messages."><code>MozMmsEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMmsMessage" title="The DOM MozMmsMessage object represents an MMS message and has all the information about sender, recipient, body content, attachements, and date of the message itself."><code>MozMmsMessage</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileCFInfo" title="The MozMobileCFInfo interface defines options used to retrieve or define call forwarding settings."><code>MozMobileCFInfo</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileCellInfo" title="The MozMobileCellInfo interface allow to access to cell location information."><code>MozMobileCellInfo</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileConnection" title="This API is used to get information about the current mobile voice and data connection states of the device. It is accessible through navigator.mozMobileConnections, which returns an array of MozMobileConnection objects."><code>MozMobileConnection</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileConnectionInfo" title="The MozMobileConnectionInfo interface allows to access connection information for voice or data. The navigator.mozMobileConnection uses it through its voice and data properties."><code>MozMobileConnectionInfo</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileCCInfo" title="The MozMobileICCInfo interface allow to access access to information stored in the device's ICC card. The navigator.mozMobileConnection uses it through its iccInfo property."><code>MozMobileICCInfo</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileMessageManager" title="Provides support for sending and managing both MMS and SMS messages on a device with WebSMS."><code>MozMobileMessageManager</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileMessageThread" title="The DOM MozMobileMessageThread object represents a thread of messages."><code>MozMobileMessageThread</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozMobileNetworkInfo" title="The MozMobileNetworkInfo interface allows access to information related to the network carrier. The navigator.mozMobileConnection uses it through its voice.network and data.network properties."><code>MozMobileNetworkInfo</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNDEFRecord" title="MozNDEFRecord is a data structure that implements the NFC Data Exchange Format (NDEF). It is a standard common format for NFC-related data communication between applications, NFC tags, and devices."><code>MozNDEFRecord</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNFC" title="MozNFC is the top level API for operating in NFC Reader/Writer mode, NFC P2P mode and NFC Card Emulation mode."><code>MozNFC</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNFCPeer" title="The NFC implementation in Gecko follows the NFC Forum specifications."><code>MozNFCPeer</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNFCTag" title="MozNFCTag contains the basic functions needed to read, write, and inspect NDEF-compatible NFC Tags."><code>MozNFCTag</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNetworkStats" title="The MozNetworkStats object gives access to statistics about the data usage for a given network."><code>MozNetworkStats</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNetworkStatsData" title="The MozNetworkStatsData objects represent a chunk of data usage statistics."><code>MozNetworkStatsData</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozNetworkStatsManager" title="The MozNetworkStatsManager interface provides methods and properties to monitor data usage."><code>MozNetworkStatsManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozPowerManager" title="The MozPowerManager interface allows to explicitly control the part of the device that uses power."><code>MozPowerManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozSettingsEvent" title="The MozSettingsEvent represents a settingchange event, providing information about a change to the value of a setting on the device. It extends the DOM Event interface."><code>MozSettingsEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozSmsEvent" title="The DOM MozSmsEvent represents events related to WebSMS text messages."><code>MozSmsEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozSmsFilter" title="The MozSmsFilter interface provides a way to filter out MozSmsMessage or MozMmsMessage objects through the MozMobileMessageManager.getMessages() method."><code>MozSmsFilter</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozSmsManager" title="Provides support for sending and managing SMS messages on a device with WebSMS."><code>MozSmsManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span> <span title="This is an obsolete API and is no longer guaranteed to work."><i class="icon-trash"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozSmsMessage" title="The DOM MozSmsMessage object represents an SMS text message and has all the information about sender, recipient, body text and date of the message itself."><code>MozSmsMessage</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozSmsSegmentInfo" title="The DOM MozSmsSegmentInfo interface provides information about how a string of text will be automatically split into segments. Each segment represents a single SMS of a multi-part SMS message."><code>MozSmsSegmentInfo</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozTimeManager" title="The MozTimeManager interface is used to set the system time on a device."><code>MozTimeManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozVoicemail" title="The MozVoicemail interface allows access to the information regarding the voicemail features available through the RIL of a Firefox OS device."><code>MozVoicemail</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozVoicemailEvent" title="The MozVoicemailEvent API provides access to the event information when a statuschange event is triggered."><code>MozVoicemailEvent</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozVoicemailStatus" title="The MozVoicemailStatus API provides access to a voicemail status."><code>MozVoicemailStatus</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozWakeLock" title="The MozWakeLock interface of the Wake Lock API tracks a wake lock set on any resource set on the device."><code>MozWakeLock</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozWifiConnectionInfoEvent" title="The MozWifiConnectionInfoEvent interface provides developers with information regarding the state of the current Wifi connection."><code>MozWifiConnectionInfoEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozWifiP2pGroupOwner" title="The MozWifiP2pGroupOwner is an interface that represents the group owner of WiFi Direct connection."><code>MozWifiP2pGroupOwner</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozWifiP2pManager" title="The MozWifiP2pManager is an interface that allows to control Wi-Fi connection with other computers using Wi-Fi Direct."><code>MozWifiP2pManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/MozWifiStatusChangeEvent" title="The MozWifiStatusChangeEvent interface provides developers with information regarding the current status of the Wifi connection."><code>MozWifiStatusChangeEvent</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> -<span>N</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/Navigator" title="The Navigator interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. This page represents the list of properties and methods added to Navigator on Firefox OS devices. For the list of properties and methods available to any Web sites, consult Navigator."><code>Navigator</code> (Firefox OS extensions)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> - - -<span>P</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/PermissionSettings" title="The PermissionSettings interface provides ways to let the user manage all the permissions requested by all apps on a Firefox OS device."><code>PermissionSettings</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> - - - - -<span>S</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/SettingsLock" title="The SettingsLock interface represents a lock on settings. it allows a script to modify settings asynchronously, but in a safe way: ordering is guaranteed and the no other script will modify the settings until the modification are done (the next lock objects will start processing after it has been closed)."><code>SettingsLock</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/SettingsManager" title="Provides access to the device's settings."><code>SettingsManager</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> -<span>T</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/TCPServerSocket" title="The TCPServerSocket interface provides an API to handle a persistent server that will listen for incoming connections on a given port."><code>TCPServerSocket</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/TCPSocket" title="The TCPSocket interface provides access to a raw TCP socket."><code>TCPSocket</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/Telephony" title="The Telephony interface of the Web Telephony API provides support for dialing, answering, and managing phone calls on a device with telephony support."><code>Telephony</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/TelephonyCall" title="The TelephonyCall interface of the Web Telephony API represents one telephone call, providing information about the call and offering mechanisms for controlling it and detecting changes to its status."><code>TelephonyCall</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/TelephonyCallGroup" title="The TelephonyCallGroup interface of the Web Telephony API represents a multi-person/conference call, providing functions to allow callers to be added and removed from the conference call, hanging up of the entire call, and more."><code>TelephonyCallGroup</code></a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> -<span>U</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/UDPSocket" title=""><code>UDPSocket</code></a></span></span></li> -</ul> - - -<span>W</span><ul> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/WifiManager" title="The WifiManager API provides access to the wifi device capability."><code>WifiManager</code></a></span></span></li> -<li><span class="indexListRow"><span class="indexListTerm"><a href="/en-US/docs/Archive/B2G_OS/API/Window" title="The Window interface represents a window containing a DOM document. This page represents the list of properties and methods added to Window on Firefox OS devices. For the list of properties and methods available to any Web sites, consult Window."><code>Window</code> (Firefox OS extensions)</a></span><span class="indexListBadges"> <span title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></span></span></li> -</ul> - - - - - - - -</div><p></p> diff --git a/files/zh-tw/archive/b2g_os/apps/index.html b/files/zh-tw/archive/b2g_os/apps/index.html deleted file mode 100644 index 7c848f3df1..0000000000 --- a/files/zh-tw/archive/b2g_os/apps/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: 製作 Firefox OS 的 apps -slug: Archive/B2G_OS/Apps -translation_of: Web/Apps/Fundamentals ---- -<p>Firefox OS 裝置的應用程式其實只是開啟網頁上的Web<span style="line-height: inherit;">應用</span><span style="line-height: inherit;">;它們完全由各種開放的Web技術所組成,如 JavaScript, HTML, 和 CSS。雖然我們寫給 apps 的主要文件幾乎涵蓋了您所需要知道的所有事情,這裡列了一些特別著重於開發及測試 Firefox OS的文件。</span></p> -<div class="row topicpage-table"> - <div class="section"> - <h2 class="Documentation" id="Documentation" name="Documentation">文件及入門教材</h2> - <dl> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Apps/Writing_a_web_app_for_Firefox_OS">寫一個 Firefox OS 的 Web app</a></dt> - <dd> - 一份教您製作您的第一個 Firefox OS web 應用程式的入門指南。</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Apps/Tips_and_techniques">撇步及技巧</a></dt> - <dd> - 一份我們開發者建議您的撇步及技巧集(像是對於問題的替代方案)。</dd> - </dl> - <p><span class="alllinks"><a href="/en-US/docs/tag/Apps">全部文章...</a></span></p> - </div> - <div class="section"> - <h2 class="Community" id="Community" name="Community">尋求社群協助</h2> - <p>您在 app 相關問題上需要幫助、且無法在文件中找到解法嗎?</p> - <ul> - <li>在 layout 論壇中請教,, 其中涵蓋 CSS 和 HTML: {{ DiscussionList("dev-tech-css", "mozilla.dev.tech.layout") }} - <ul> - <li>在 Mozilla IRC channel 裡面提出你的問題: <a class="link-irc" href="irc://irc.mozilla.org/openwebapps">#openwebapps</a></li> - </ul> - </li> - </ul> - <p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html"><em>請遵守網路禮節</em>...</a></span></p> - <h2 class="Tools" id="Tools" name="Tools">工具</h2> - <ul> - <li><span class="external">Firefox </span>的<span class="external"> <a href="/en-US/docs/Tools/Debugger">Debugger</a> 支援 Firefox OS apps 的遠端除錯</span>。</li> - <li><span class="external">其他 <a href="/en-US/docs/Tools">開發者工具</a></span></li> - </ul> - <p><span class="alllinks"><a href="/en-US/docs/tag/Tools">View All...</a></span></p> - <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">相關文章</h2> - <ul> - <li><a href="/en-US/docs/Apps">Apps</a></li> - </ul> - </div> -</div> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html b/files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html deleted file mode 100644 index 4e612e8a87..0000000000 --- a/files/zh-tw/archive/b2g_os/apps/writing_a_web_app_for_b2g/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: 寫一個 Firefox OS 的 Web app -slug: Archive/B2G_OS/Apps/Writing_a_web_app_for_B2G -translation_of: Web/Apps/Fundamentals/Quickstart ---- -<p>B2G apps 只是用 HTML、CSS、和 Javascript 寫的 Web apps。在網頁上發佈 Web apps 就跟發佈一般的網站一樣。為了讓網站可以像 Web app 一樣可以被安裝在行動裝置上,你只需要加上一個 manifest 以及掛上一個安裝按鈕,如以下說明。</p> -<p>建議您從下面的文章著手:</p> -<ul> - <li><a href="/en/Apps/Getting_Started" title="Getting started with making apps">從製作 apps 開始上手</a></li> - <li><a href="/en/Apps/Manifest" title="App manifest">App manifest</a></li> -</ul> -<p>當然,您也可以無拘無束地<a href="/en/Apps" title="https://developer.mozilla.org/en/Apps/"> 沉浸在 Open Web Apps 的深處</a>!</p> -<h2 id="安裝_Web_app">安裝 Web app</h2> -<p>在網頁上發佈 app 和 manifest 之後,接著要讓 Gecko 知道這個訊息。像是在安裝時,Gecko 查詢 manifest 並將必須的項目加入到 home 的畫面,等等。</p> -<p>安裝 app 需要呼叫 <a href="/en/Apps/Apps_JavaScript_API/navigator.mozApps.install" title="https://developer.mozilla.org/en/Apps/Apps_JavaScript_API/navigator.mozApps.install">navigator.mozApps.install() API</a>。這裡有個安裝按鈕的範例,當您將 app 置於自己管理的位置時,這個範例可以讓您將按鈕嵌入於您自己的網頁:</p> -<pre><script> -var manifest_url = "http://my.webapp.com/manifest.json"; -</script> - -<button onclick="navigator.mozApps.install(manifest_url); return false;"> - Install this awesome app on your homescreen! -</button> -</pre> -<p>注意:這個安裝按鈕也可以被置於像是 <a href="/en/Apps/Submitting_an_app" title="https://developer.mozilla.org/en/Apps/Submitting_an_app">Mozilla Marketplace</a> 的 app market,然而一般而言,在您自己的主要頁面上面也放一個「安裝 web app」的按鈕是非常貼心的。</p> -<p>現在請用 B2G 瀏覽器 app 瀏覽您的網站,並且點選安裝按鈕吧。</p> diff --git a/files/zh-tw/archive/b2g_os/architecture/index.html b/files/zh-tw/archive/b2g_os/architecture/index.html deleted file mode 100644 index a0a649e4f9..0000000000 --- a/files/zh-tw/archive/b2g_os/architecture/index.html +++ /dev/null @@ -1,717 +0,0 @@ ---- -title: Firefox OS 架構 -slug: Archive/B2G_OS/Architecture -translation_of: Archive/B2G_OS/Architecture ---- -<div class="summary"> -<p><span class="seoSummary">本文件是 Firefox OS 平台架構的初步概要介紹,將會簡單地向您介紹 Firefox OS 的重要概念,並解釋元件間如何互動。</span></p> -</div> - -<div class="note"> -<p><strong>注意:</strong>Firefox OS 仍算是開發中的產品。本文說明的架構仍非最後確定的架構,隨時可能修改。</p> -</div> - -<h2 id="Firefox_OS_術語">Firefox OS 術語</h2> - -<p>在閱讀 Firefox OS 技術文件之前,建議先了解以下的詞彙:</p> - -<dl> - <dt>B2G</dt> - <dd>Boot to Gecko 的縮寫。</dd> - <dt>Boot to Gecko</dt> - <dd>Firefox OS 作業系統的工程代號。此代號常常用以代表 Firefox OS。因為在本專案還未定下正式名稱之前,此代號已經用了很長的一段時間,因此常常用以代表 Firefox OS。</dd> - <dt>Firefox OS</dt> - <dd>Firefox OS 即是將 Mozilla (及其 OEM 夥伴) 的品牌與服務,套用至 <strong>Boot to Gecko</strong> 的基礎之上開發而得的最終產品。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Gaia" title="/en-US/docs/Mozilla/Firefox_OS/Gaia">Gaia</a></dt> - <dd>Firefox OS 平台的使用者介面 (UI)。 在啟動 Firefox OS 之後,都是透過 Gaia 層產出螢幕上的任何東西。Gaia 建構出鎖定畫面、主畫面,以及大家預期智慧型手機所應提供的其他標準 App。Gaia 完全使用 HTML、CSS、JavaScript 實作而成。透過實作在 Gecko 層的開放 Web API,與其底層的作業系統溝通。第三方 App 均可安裝於 Gaia 層。</dd> - <dt><a href="/en-US/docs/Gecko" title="/en-US/docs/Accessibility/AT-APIs/Gecko">Gecko</a></dt> - <dd>Firefox OS App 的執行環境 (Runtime),也就是本層可支援所有的開放標準:HTML、CSS、JavaScript。本層另必須確保這些 API 可正確運作於 Gecko 支援的所有 OS。意即 Gecko 另包含了網路連線堆疊、圖形堆疊、配置引擎、JavaScript 虛擬機器、移植層。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Gonk" title="/en-US/docs/Mozilla/Firefox_OS/Gonk">Gonk</a></dt> - <dd>Gonk 是 Firefox OS 平台的底層作業系統,是由 Linux 核心 (以 <a href="http://source.android.com/">Android Open Source Project</a> 為架構),與使用者空間的硬體抽象層 (Hardware abstraction layer,HAL) 所組成。核心以及許多使用者空間的函式庫,均來自常見的開放源碼專案,如 Linux、libusb、bluez 等。HAL 的某些部分是與 AOSP 共享,如 GPS 或相機。你可將 Gonk 當成是簡單的 Linux 分支版本。Gonk 又是 Gecko 的移植目標;意即有一套 Gecko 可在 Gonk 上執行,就像是 Gecko 也有 Mac OS X、Windows、Android 等版本。因為 Firefox OS 可完整控制 Gonk,所以某些不能開放給其他 OS 用的介面,還是可開發給 Gecko 使用。舉例來說,Gecko 可直接存取 Gonk 的完整電話功能堆疊,並於 Gonk 上顯示緩衝區 (Frame buffer),但是其他 OS 不能進行類似的存取。</dd> - <dt><a name="Jank">Jank</a></dt> - <dd>此一詞彙常見於行動 App 領域,指在 APP 中執行了緩慢或沒有效率的程式碼,進而阻礙了 UI 更新並發商系統延遲或無回應的情形。Gaia 開發者使用不同的最佳化方法,要儘力避免此狀況發生。</dd> -</dl> - -<h2 id="整體架構示意圖">整體架構示意圖</h2> - -<p>下圖比較了專利平台與 Firefox OS 之間的架構。</p> - -<p><img alt="on the left is a native mobile architecture stack, on the right is the Firefox OS architecture. they are similarm except that the native stack is all proprietary device functionality, and the Firefox OS stack is all done with open source and web technologies." src="https://mdn.mozillademos.org/files/9487/general-architecture.png" style="display: block; height: 488px; margin: 0px auto; width: 997px;"></p> - -<p>Firefox OS 即減去了 OS 與 App 層之間的原生 API 層。這種統合式的設計可減輕平台負擔並簡化安全機制,卻又不致犧牲效能,也不會影響智慧型手機的使用體驗。</p> - -<ol> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia">Gaia</a> 作為裝置的核心 Web App 與 UI 層,並全以 HTML5、CSS、JavaScript 撰寫而成,並有許多 API 可供 UI 程式碼存取手機硬體與 Gecko 功能。</li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Gecko">Gecko</a> 即為 Firefox OS 的 Web 引擎與表現層 (Presentation layer),作為 Web 內容與底層裝置的之間介面,進而將硬體接上 HTML。Gecko 亦提供 HTML5 剖析 (Parsing) 與繪圖引擎,並透過程式設計的方式,以安全的 Web API 存取硬體功能、更新作業,以及其他核心服務。</li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gonk">Gonk</a> 是 Firefox OS 堆疊中的核心層級元件,作為 Gecko 與底層硬體之間的介面。Gonk 可控制底層硬體,並將硬體功能告知 Gecko 中建構的 Web API。Gonk 可視為「黑盒子」,暗自進行所有複雜又零碎的背景作業,以於硬體層制定請求,進而控制行動裝置。</li> - <li>行動裝置,就是執行 Firefox OS 的行動電話硬體。OEM 廠商則負責提供行動裝置。</li> -</ol> - -<h2 id="特殊_Firefox_OS_架構">特殊 Firefox OS 架構</h2> - -<p><img alt="Firefox OS Architecture" src="/files/4605/FirefoxOS.png" style="display: block; height: 915px; margin: 0px auto; width: 754px;"></p> - -<h2 id="Firefox_OS_開機流程">Firefox OS 開機流程</h2> - -<p>本段將說明 Firefox OS 的開機流程,包含整個流程所牽涉的部份,以及相關部分在系統裡的位置。流程順序大致如下:最先從核心空間裡的開機載入器 (Bootloader) 開始,到原生程式碼中開始程序,進入 B2G 再到使用者空間的 Gecko,最後到 Gecko 裡的系統 App、視窗管理器、主畫面 App。而其他 App 也同樣依照上述程序執行。</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/7491/bootup.png" style="height: 1979px; width: 2112px;"></p> - -<h3 id="開機程序">開機程序</h3> - -<p>在首次啟動 Firefox OS 裝置時,就會於主要的開機載入器 (bootloader) 中開始作業。自此,就如同一般作業系統程序,更高一階的開機相關載入器會載入執行,然後往上更高一階的載入器又會被接續執行,如此下去形成一串開機載入流程鏈,直到最後程序就會將執行權交到 Linux 核心。</p> - -<p>關於開機程序有幾點需要注意:</p> - -<ul> - <li>開機載入器通常顯示裝置開機時的第一個畫面,一般為硬體製造商的標誌。</li> - <li>開機載入器可將映像檔 (Image) 建構於裝置之中。不同的裝置另使用不同的通訊協定。大部分的手機均使用 <a href="http://android-dls.com/wiki/index.php?title=Fastboot">fastboot 協定</a>。但 Samsung Galaxy II 使用 odin 協定。</li> - <li>在開機流程的尾聲,往往會載入數據機映像檔,並於數據機處理器上執行之。各款裝置的方法均有所不同。</li> -</ul> - -<h3 id="Linux_核心">Linux 核心</h3> - -<p>Gonk 使用 Linux 核心的版本,與 Android 開放源碼專案 (<a href="http://source.android.com/" title="http://source.android.com/">Android Open Source Project,AOSP</a>) 所衍生使用的版本非常相似,但是並未沿用幾項 AOSP 所進行的修改。除外,雖然 Lunix 基本上已經相當穩定,但仍有些製造商會自行修改。</p> - -<p><a href="http://en.wikipedia.org/wiki/Linux_startup_process" title="http://en.wikipedia.org/wiki/Linux_startup_process">Linux 的啟動程序</a>已經可在網路上找到相當詳盡的文件說明,所以在此不再贅述。</p> - -<p>Linux 核心會啟動一些基本的程序 (Process)。在執行 init.rc 中定義的程序後,會再執行 <a href="https://github.com/mozilla-b2g/gonk-misc/blob/master/init.b2g.rc">init.b2g.rc</a> 以啟動基本核心程序,如 <code>b2g</code> (Firefox OS 基礎程序,內含 Gecko) 以及 <code>rild</code> (通話功能的相關程序,各晶片組多有不同),請見下方所述細節。和大部分的 Unix 作業系統一樣,最後會啟動使用者空間 (Userspace) 程序。</p> - -<p>在啟動 <code>init </code>程序之後,Linux 核心就會處理由使用者空間傳來的系統呼叫,並中斷來自於硬體裝置的類似呼叫。許多硬體功能均透過 <a href="http://en.wikipedia.org/wiki/Sysfs" title="http://en.wikipedia.org/wiki/Sysfs"><code>sysfs </code></a>揭露給使用者空間,以下便是 Gecko 讀取電池狀態的<a href="https://github.com/cgjones/mozilla-central/blob/master/hal/gonk/GonkHal.cpp#L277" title="https://github.com/cgjones/mozilla-central/blob/master/hal/gonk/GonkHal.cpp#L277">程式碼片段</a>:</p> - -<pre class="brush:cpp;">FILE *capacityFile = fopen("/sys/class/power_supply/battery/capacity", "r"); -double capacity = dom::battery::kDefaultLevel * 100; -if (capacityFile) { - fscanf(capacityFile, "%lf", &capacity); - fclose(capacityFile); -}</pre> - -<h3 id="更多有關_init_程序">更多有關 init 程序</h3> - -<p>Gonk 中的 <code>init</code> 程序,將處理必要的檔案系統並產生系統服務,之後就如同程序管理一般繼續待命,並將編譯指令碼 (也就是 <code>init*.rc</code> 檔案);指令碼內的指令則說明在啟動不同服務時所應進行的作業。</p> - -<p><code>init </code>程序必須處理一個相當關鍵的作業,即啟動 <code>b2g</code> 程序;這也是 Firefox OS 的核心。</p> - -<p>以下為 <code>init.rc</code> 中用以啟動 b2g 的程式碼:</p> - -<pre>service b2g /system/bin/b2g.sh - class main - onrestart restart media</pre> - -<div class="note"> -<p><strong>注意:</strong>Firefox OS 與 Android 的 init.rc 之間的差異,將各款裝置而有所不同。有時候只是附加 <code>init.b2g.rc</code>,但有時修改的幅度甚大。</p> -</div> - -<h2 id="使用者空間_(Userspace)_的程序架構">使用者空間 (Userspace) 的程序架構</h2> - -<p>現在讓我們來看看高階一點的部分,到底Firefox OS的各個元件之間是如何運作互動的。下圖所描述的是Firefox OS的主要使用者空間程序。</p> - -<p>接著可進一步了解 Firefox OS 不同元件是如何運作互動。下圖呈現 Firefox OS 的主要使用者空間程序。</p> - -<p><img alt="Userspace diagram" src="https://developer.mozilla.org/files/3849/B2G%20userspace%20architecture.svg" style="float: right; height: 491px; position: relative; width: 520px;"></p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<p> </p> - -<div class="note"> -<p><strong>注意:</strong>由於 Firefox OS 尚處於開發階段,所以此示意圖可能隨時修改而非完全正確。</p> -</div> - -<p>b2g 程序是主要的系統程序,能以高權限存取大部分的硬體;b2g 可溝通數據機、畫出顯示緩衝區 (Framebuffer),並與 GPS 或相機等硬體溝通。在系統內部,b2g 則執行 Gecko 層 (即以 libxul.so 所實作)。另可參考 <a href="#Gecko">Gecko</a> 以了解 Gecko 層的運作方式,以及 b2g 與 Gecko 層溝通的方法。</p> - -<h3 id="b2g">b2g</h3> - -<p>b2g 程序會生成許多低權限的內容程序 (Content process),並透過這些程序來載入 Web 的 App 與內容。這些程序會再透過訊息傳遞系統「<a href="/en-US/docs/IPDL" title="/en-US/docs/IPDL">IPDL</a>」溝通 Gecko 伺服器。</p> - -<p><code>b2g 程序所執行</code>的 libxul,即參照 <code>b2g/app/b2g.js </code>取得預設偏好設定。透過偏好設定,程序將開啟上述的 HTML 檔案「<code>b2g/chrome/content/shell.html</code>」,即於 <code>omni.ja</code> 檔案中編譯而得。而 <code>shell.html</code> 則包含了 <code>b2g/chrome/content/shell.js</code> 檔案,將觸發 Gaia 的「<code>system」</code>這個 App。</p> - -<h3 id="rild">rild</h3> - -<p><code>rild 為銜接</code>數據機處理器的介面,也是用以建構<strong>無線介面層 (Radio Interface Layer,RIL)</strong> 的常駐程式 (Daemon)。往往是由硬體製造商所撰寫的專屬程式碼,以溝通自家的數據機硬體。<code>rild 可讓用戶端</code>程式碼連接 <code>rild 本身</code>綁定的 Unix-domain socket。可經由以下類似的 <code>init 指令碼</code>啟動之:</p> - -<pre>service ril-daemon /system/bin/rild - socket rild stream 660 root radio</pre> - -<h3 id="rilproxy">rilproxy</h3> - -<p>在 Firefox OS 中,<code>rild</code> 用戶端即屬於 <code>rilproxy</code> 程序,作為 <code>rild</code> 與 <code>b2g</code> 之間不具功能的傳送代理dumb forwarding proxy。為何需要此代理伺服器,就必須從實作細節來說明了。但簡單來說,proxy 確實有其存在的必要。<a href="https://github.com/mozilla-b2g/rilproxy" title="https://github.com/mozilla-b2g/rilproxy"><code>可到 GitHub 上找到 rilproxy</code> 原始碼</a>。</p> - -<h3 id="mediaserver">mediaserver</h3> - -<p><a href="https://github.com/android/platform_frameworks_base/tree/ics-mr0-release/media/libmediaplayerservice" title="https://github.com/android/platform_frameworks_base/tree/ics-mr0-release/media/libmediaplayerservice"><code>mediaserver</code> 程序</a>用以控制音訊與視訊的播放作業。Gecko 透過 Android 的遠端程序呼叫 (Remote Procedure Call,RPC) 和其溝通。某些可由 Gecko 撥放的媒體檔案 (如 OGG Vorbis 音訊、OGG Theora 視訊、<a href="http://www.webmproject.org/about/" title="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CDUQFjAA&url=http%3A%2F%2Fwww.webmproject.org%2F&ei=8Q84UOnoMoHH6wHZ44DwBA&usg=AFQjCNHK9j6wyhUful5RmKCpU6b8GDfpYQ&sig2=tCl8VxL3mCvrH86EyOwO_A">WebM</a> 視訊等),均是由 Gecko 解碼後直接傳送給 <code>mediaserver</code> 程序。其他的媒體檔案則是交由 <code>libstagefright</code> 解碼。<code>libstagefright 可存取特定</code>編碼與硬體編碼器 (Hardware encoder)。</p> - -<div class="note"> -<p><strong>注意:</strong>mediaserver 程序為 Firefox OS 的「暫時性」元件,主要是協助早期的開發作業。預計最快在 Firefox OS 2.0 階段就會移除。</p> -</div> - -<h3 id="netd">netd</h3> - -<p><code>netd </code>程序可用來設定網路介面。</p> - -<h3 id="wpa_supplicant">wpa_supplicant</h3> - -<p><code>wpa_supplicant</code> 程序為標準 UNIX 樣式常駐程式,可處理 WiFi 存取點的連線作業。</p> - -<h3 id="dbus-daemon">dbus-daemon</h3> - -<p>dbus-daemon 用以建構 <a href="http://www.freedesktop.org/wiki/Software/dbus" title="http://www.freedesktop.org/wiki/Software/dbus">D-Bus</a> 訊息匯流系統,可供 Firefox OS 進行藍牙通訊作業。</p> - -<h2 id="Gecko">Gecko</h2> - -<p>如前所述,<a href="https://developer.mozilla.org/en-US/docs/Gecko" title="/en-US/docs/Gecko">Gecko</a> 即由 Web 標準 (<a href="https://developer.mozilla.org/en-US/docs/HTML" title="/en-US/docs/HTML">HTML</a>、<a href="https://developer.mozilla.org/en-US/docs/CSS" title="/en-US/docs/CSS">CSS</a>、<a href="https://developer.mozilla.org/en-US/docs/JavaScript" title="/en-US/docs/JavaScript">JavaScript</a>) 建構而成,並用以打造 Firefox OS 上所顯示的一切,另可控制手機硬體。Web App 則透過安全且受控制的 Web API (同樣以 Gecko 所建構而得) 來將 HTML5 連上硬體。Web API 可透過程式設計的方式,存取底層行動裝置硬體 (如電池或振動) 的功能,或取得儲存的資料 (如行事曆或聯絡資訊)。Web 內容亦可透過content invokes the accessible Web APIs within HTML5.</p> - -<p>App 是由相關 HTML5 網頁內容所組成。如果要撰寫 Web App 並於 Firefox OS 行動裝置上執行,則開發者也只要組合、封包、發佈此網頁內容即可。而在執行期間,即交由瀏覽器轉譯、編譯、換至此網頁內容。可參閱<a href="https://developer.mozilla.org/en-US/Apps">應用程式中心 (App Center)</a> 進一步了解。</p> - -<div class="note"> -<p><strong>注意:</strong>如果要搜尋 Gecko 的 Codebase,則可前往 <a href="http://dxr.mozilla.org" style="line-height: 1.5;">http://dxr.mozilla.org</a>,功能比較炫、參照功能不錯,但 Repo 較有限。亦可使用傳統的 <a href="http://mxr.mozilla.org" style="line-height: 1.5;">http://mxr.mozilla.org</a>,內含較多的 Mozilla 專案。</p> -</div> - -<h3 id="Gecko_架構圖">Gecko 架構圖</h3> - -<p><img alt="" src="https://mdn.mozillademos.org/files/5027/securityframework.png" style="height: 591px; width: 979px;"></p> - -<ul> - <li><strong>安全架構:</strong>包含 - - <ul> - <li><strong>Permission Manager</strong>:用以存取 Web API 功能的閘門。</li> - <li><strong>Access Control List</strong>:存取 Web API 功能所必備的規則與許可。</li> - <li><strong>Credential Validation</strong>:App 與使用者的驗證。</li> - <li><strong>Permissions Store</strong>:存取 Web API 功能所必備的權限。</li> - </ul> - </li> - <li><strong>Web API</strong>:標準 API 的集合,可將硬體功能提供予網頁內容,讓 Web App 能透過程式設計的方式,安全存取行動裝置底層硬體的功能,以及裝置所儲存\可用的資料。</li> - <li><strong>I/O</strong>:銜接硬體與資料儲存區的介面。</li> - <li><strong>軟體更新</strong>:取得\安裝更新檔至系統軟體與第三方 App。</li> - <li><strong>內容配置與繪製</strong>:用以剖析、編譯、執行網頁內容的引擎,並可搭配格式資訊,將格式化過後的內容呈現於使用者眼前。</li> - <li><strong>b2g 程序:</strong>(Gecko) 於高度權限的系統程序中執行,可存取行動電話的硬體功能。執行 App 屬於 b2g 的子程序。</li> -</ul> - -<h3 id="和_Firefox_OS_相關的_Gecko_檔案">和 Firefox OS 相關的 Gecko 檔案</h3> - -<h4 id="b2g_2">b2g/</h4> - -<p>b2g 資料夾主要包含 Firefox OS 相關功能。</p> - -<h5 id="b2gchromecontent">b2g/chrome/content</h5> - -<p>內含於系統 App 上運行的 Javascript 檔。</p> - -<h5 id="b2gchromecontentshell.html">b2g/chrome/content/shell.html</h5> - -<p>Gaia 的進入點。如前所述,shell.html 會拉進 shell.js 與 settings.js。用於系統 App 的 HTML。</p> - -<pre class="brush: html"><script type="application/javascript;version=1.8" src="chrome://browser/content/settings.js"> </script> -<script type="application/javascript;version=1.8" src="chrome://browser/content/shell.js"> </script></pre> - -<p><code>settings.js 裡面是系統預設的設定參數。</code></p> - -<h5 id="b2gchromecontentshell.js">b2g/chrome/content/shell.js</h5> - -<p><code>shell.js 是載入 Gaia「system」App 的第一個指令碼。</code></p> - -<p><code>shell.js 將匯入所有必要的模組、註冊關鍵的監聽器、定義</code> <code style="font-style: normal; line-height: 1.5;">sendCustomEvent 與<font face="Open Sans, sans-serif"> </font></code><code style="font-style: normal; line-height: 1.5;">sendChromeEvent 以溝通 </code>Gaia<code style="font-style: normal; line-height: 1.5;">、提供 webapp 安裝輔助程式:indexedDB 配額、遠端除錯器、鍵盤助手、螢幕截圖工具。</code></p> - -<p>不過<code> shell.js</code> 最重要的功能,則是啟動 Gaia 的<code>「system」</code>App,然後將整體系統相關的管理作業交給該「<code>system</code>」App。</p> - -<pre class="brush: js">let systemAppFrame = - document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe'); - ... - container.appendChild(systemAppFrame);</pre> - -<h5 id="b2gappb2g.js">b2g/app/b2g.js</h5> - -<p>此指令碼包含預先定義的設定,就像是瀏覽器的 about:config,以及 Gaia 的 pref.js。這些設定值另可透過「設定 (Settings)」App 變更,也可用 Gaia 建置指令碼中的 Gaia’s user.js 覆寫之。</p> - -<h4 id="domAPI">/dom/{API}</h4> - -<p>新實作的 API (post-b2g) 會位於 <code>dom/ 資料夾。</code>舊 API 位於 <code>dom/base</code>,例如<code>navigator.cpp</code>。</p> - -<h5 id="domapps">/dom/apps</h5> - -<p><code>將載入 .jsm。而</code> <code>.js</code> API 實作即如 <code>webapp.js 安裝、getSelf 等。</code></p> - -<h5 id="domappsPermissionsTable.jsm">dom/apps/PermissionsTable.jsm</h5> - -<p>所有的存取權限都定義在 <a href="http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/PermissionsTable.jsm">PermissionsTable.jsm</a> 之中。</p> - -<h4 id="domwebidl">/dom/webidl</h4> - -<p>WebIDL是用以定義 Web API 的語言,請參閱 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings">WebIDL_bindings</a> 了解所支援的屬性。</p> - -<h4 id="halgonk">/hal/gonk</h4> - -<p>此目錄包含 gonk 銜接層 (Port layer) 的相關檔案。</p> - -<h4 id="所產生的檔案">所產生的檔案</h4> - -<h5 id="modulelibprefsrcinitall.js">module/libpref/src/init/all.js</h5> - -<p>內有全部的設定檔。</p> - -<h5 id="systemb2g_omni.ja_and_omni.js">/system/b2g/ omni.ja and omni.js</h5> - -<p>內有裝置內資源所適用的樣式。</p> - -<h3 id="處理輸入事件">處理輸入事件</h3> - -<p>Gecko 內絕大多數的行動,都是由使用者的行動所觸發,可用輸入事件為代表 (如按下按鈕、觸碰裝置的螢幕等)。這些事件必須透過 <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAppShell" title="">nsIAppShell</a></code> 的 <a href="https://dxr.mozilla.org/mozilla-central/source/widget/gonk/nsAppShell.cpp" rel="custom">Gonk implementation</a> (為 Gecko 介面之一,作為 Gecko App 的主要進入點),進入到Gecko。也就是說,輸入裝置驅動程式將呼叫 <code>nsAppShell</code> 物件 (代表 Gecko 子系統) 上的函式,來將事件發送到使用者介面。</p> - -<p>例如:</p> - -<pre class="brush:cpp;">void GeckoInputDispatcher::notifyKey(nsecs_t eventTime, - int32_t deviceId, - int32_t source, - uint32_t policyFlags, - int32_t action, - int32_t flags, - int32_t keyCode, - int32_t scanCode, - int32_t metaState, - nsecs_t downTime) { - UserInputData data; - data.timeMs = nanosecsToMillisecs(eventTime); - data.type = UserInputData::KEY_DATA; - data.action = action; - data.flags = flags; - data.metaState = metaState; - data.key.keyCode = keyCode; - data.key.scanCode = scanCode; - { - MutexAutoLock lock(mQueueLock); - mEventQueue.push(data); - } - gAppShell->NotifyNativeEvent(); -}</pre> - -<p>這些事件來自於Linux標準<code>input_event</code>系統. Firefox OS在其上添加了一層簡單的<a href="https://dxr.mozilla.org/mozilla-central/source/widget/gonk/libui/InputReader.cpp" rel="custom">抽象層</a>,提供了一些像是事件過濾等不錯的功能。產生事件的程式碼在<a href="https://dxr.mozilla.org/mozilla-central/source/widget/gonk/libui/EventHub.cpp" rel="custom">widget/gonk/libui/EventHub.cpp</a>裡的<code>EventHub::getEvents()方法。</code></p> - -<p>Gecko接收到事件後,這些事件會透過<code><a href="https://dxr.mozilla.org/mozilla-central/source/widget/gonk/nsAppShell.cpp" rel="custom">nsAppShell</a>發送到DOM:</code></p> - -<pre class="brush:cpp;">static nsEventStatus sendKeyEventWithMsg(uint32_t keyCode, - uint32_t msg, - uint64_t timeMs, - uint32_t flags) { - nsKeyEvent event(true, msg, NULL); - event.keyCode = keyCode; - event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE; - event.time = timeMs; - event.flags |= flags; - return nsWindow::DispatchInputEvent(event); -} -</pre> - -<p>之後,事件有可能被Gecko處理掉或是當作<a href="/en-US/docs/DOM_Client_Object_Cross-Reference/DOM_Events" style="line-height: 1.5;" title="/en-US/docs/DOM_Client_Object_Cross-Reference/DOM_Events">DOM事件</a>被<span style="line-height: 1.5;">發送到網頁應用程式做進一步處裡。</span></p> - -<h3 id="影像繪圖">影像繪圖</h3> - -<p>在最底層,Gecko利用 <a href="http://www.khronos.org/opengles/2_X/" title="http://www.khronos.org/opengles/2_X/">OpenGL ES 2.0</a> 向包有硬體影格緩衝區(frame buffers)的GL context物件繪圖,這是由Gonk所實作的<code><a href="https://dxr.mozilla.org/mozilla-central/source/widget/gonk/nsWindow.cpp" rel="custom">nsWindow</a>完成</code>:</p> - -<pre class="brush:cpp;">gNativeWindow = new android::FramebufferNativeWindow(); -sGLContext = GLContextProvider::CreateForWindow(this);</pre> - -<p><code>FramebufferNativeWindow類別(</code>class)是直接從Android而來,請見<code><a href="https://github.com/android/platform_frameworks_base/blob/ics-mr1-release/libs/ui/FramebufferNativeWindow.cpp" title="https://github.com/android/platform_frameworks_base/blob/ics-mr1-release/libs/ui/FramebufferNativeWindow.cpp">FramebufferNativeWindow.cpp</a>;使用了</code><strong>gralloc</strong> API存取繪圖驅動,好配對影格緩衝裝置的緩衝到記憶體之中。</p> - -<p>Gecko透過圖層(Layers)系統合成螢幕上的影像,大體而言如下:</p> - -<ol> - <li>Gecko將不同部分的記憶體分頁(pages)畫入記憶體緩衝,有時後這些緩衝存在系統記憶體,有時候因為Gecko會直接畫入視訊記憶體(video memory),所以這些緩衝也可能會是配對在Gecko定址空間的材質(textures) ,以上的工作主要是由<code><a href="http://mxr.mozilla.org/mozilla-central/source/gfx/layers/basic/BasicThebesLayer.cpp#83" title="http://mxr.mozilla.org/mozilla-central/source/gfx/layers/basic/BasicThebesLayer.cpp#201">BasicThebesLayer::PaintThebes()</a>方法完成。</code></li> - <li>Gecko利用OpenGL命令將這些材質合成起來,合成工作由<code><a href="http://mxr.mozilla.org/mozilla-central/source/gfx/layers/opengl/ThebesLayerOGL.cpp#124" title="http://mxr.mozilla.org/mozilla-central/source/gfx/layers/basic/BasicThebesLayer.cpp#201">ThebesLayerOGL::RenderTo()</a>方法執行。</code></li> -</ol> - -<p>因為有關Gecko如何處理影像繪圖的作法已經超出本文範圍,所以本文不再做進一步討論了。</p> - -<h3 id="硬體抽象層(Hardware_Abstraction_Layer_HAL)">硬體抽象層(Hardware Abstraction Layer, HAL)</h3> - -<p>Gecko HAL是Gecko接口層之一,它使用高階層Gecko能取用的C++ API存取跨平台間的底層系統介面,這些API以每個平台為基礎實作在Gecko HAL之內。Gecko的Javacsript程式碼並不能看到這個HAL層。</p> - -<h4 id="HAL如何運作">HAL如何運作</h4> - -<p>讓我們先來看看<a href="/zh-TW/docs/Web/API/Window/navigator/vibrate" title="The documentation about this has not yet been written; please consider contributing!"><code>Vibration</code></a> API。這個Gecko HAL API被定義在<a href="https://dxr.mozilla.org/mozilla-central/source/hal/Hal.h" rel="custom">hal/Hal.h</a>,基本上你可以看到如下函式(為了說明需要,經過函式簽名(function signature)簡化):</p> - -<pre>void Vibrate(const nsTArray<uint32> &pattern);</pre> - -<p>Gecko呼叫這個函式來根據某個特定型態開啟震動(另外有一個對應的函式用來關閉震動)。Gonk對這個函式的實作在<a href="https://dxr.mozilla.org/mozilla-central/source/hal/gonk/GonkHal.cpp" rel="custom">hal/gonk/GonkHal.cpp</a>:</p> - -<pre class="brush:cpp;">void Vibrate(const nsTArray<uint32_t> &pattern) { - EnsureVibratorThreadInitialized(); - sVibratorRunnable->Vibrate(pattern); -} -</pre> - -<p>下面以<code style="font-style: normal; line-height: 1.5;">VibratorRunnable::Run()實作的</code><span style="line-height: 1.5;">程式碼發送震動</span><span style="line-height: 1.5;">開啟</span><span style="line-height: 1.5;">請求到另一個執行緒,其中主要的迴圈部分如下:</span></p> - -<pre class="brush:cpp;">while (!mShuttingDown) { - if (mIndex < mPattern.Length()) { - uint32_t duration = mPattern[mIndex]; - if (mIndex % 2 == 0) { - vibrator_on(duration); - } - mIndex++; - mMonitor.Wait(PR_MillisecondsToInterval(duration)); - } - else { - mMonitor.Wait(); - } -} -</pre> - -<p><code>vibrator_on()便是打開震動馬達的Gonk HAL API,這個函式透過sysfs向內部核心驅動程式送出訊息,寫入值到核心物件之中。</code></p> - -<h4 id="HAL_API退回替代(Fallback)實作">HAL API退回替代(Fallback)實作</h4> - -<p>Gecko HAL API 跨平台支援。當為沒有震動馬達的平台(如桌上型電腦)建置Gecko,則另一個HAL退回替代API會被使用,這個替代API實作於<a href="https://dxr.mozilla.org/mozilla-central/source/hal/fallback/FallbackVibration.cpp" rel="custom">hal/fallback/FallbackVibration.cpp</a>:</p> - -<pre class="brush:cpp;">void Vibrate(const nsTArray<uint32_t> &pattern) { -}</pre> - -<h4 id="沙箱(Sandbox)實作">沙箱(Sandbox)實作</h4> - -<p>因為大多數的網頁內容都是在低權限的內容程序運行,所以我們無法確保這些程序有權限去,例如,打開震動馬達,除此之外,為了避免出現程序爭相啟動震動的狀況出現,採用中央控制的作法較為理想。在Gecko HAL,透過sandbox作法可以達到中央控制的目標;其實sandbox也就是一個由內容程序發出到Gecko"伺服器"的<span style="line-height: 1.5;">代理請求,這個代理請求式透過IPDL送出。</span></p> - -<p>以震動為例,這是由<a href="https://dxr.mozilla.org/mozilla-central/source/hal/sandbox/SandboxHal.cpp" rel="custom">hal/sandbox/SandboxHal.cpp</a>所實作的<code>Vibrate()完成</code>:</p> - -<pre class="brush:cpp;">void Vibrate(const nsTArray<uint32_t>& pattern, const WindowIdentifier &id) { - AutoInfallibleTArray<uint32_t, 8> p(pattern); - - WindowIdentifier newID(id); - newID.AppendProcessID(); - Hal()->SendVibrate(p, newID.AsArray(), GetTabChildFrom(newID.GetWindow())); -}</pre> - -<p>這會發送一個 PHal 介面定義的訊息,亦即<span style="line-height: 1.5;">IPDL的<a href="https://dxr.mozilla.org/mozilla-central/source/hal/sandbox/PHal.ipdl" rel="custom">hal/sandbox/PHal.ipdl</a>內所描述的。其中呼叫的函式大致如下:</span></p> - -<pre>Vibrate(uint32_t[] pattern);</pre> - -<p>訊息的接收端是<code>HalParent::RecvVibrate()函式,這個函式定義在</code><a href="https://dxr.mozilla.org/mozilla-central/source/hal/sandbox/SandboxHal.cpp" rel="custom">hal/sandbox/SandboxHal.cpp</a>裡面,大致如下:</p> - -<pre class="brush:cpp;">virtual bool RecvVibrate(const InfallibleTArray<unsigned int>& pattern, - const InfallibleTArray<uint64_t> &id, - PBrowserParent *browserParent) MOZ_OVERRIDE { - - hal::Vibrate(pattern, newID); - return true; -}</pre> - -<p>本段範例雖然有省略一些相關性不高的部分,不過確實的說明訊息傳遞是如何由Gecko到Gonk,再到Gonk HAL實作Vibrate(),最後到震動馬達驅動程式。</p> - -<h3 id="DOM_APIs">DOM APIs</h3> - -<p><strong>DOM介面</strong>是網頁根本上和Gecko溝通的方法,如果想知道更多這方面的細節,請參考<a href="/en-US/docs/DOM/About_the_Document_Object_Model" title="/en-US/docs/DOM/About_the_Document_Object_Model">關於DOM</a>。 DOM介面是用<a href="/en-US/docs/XPIDL" title="/en-US/docs/XPIDL">IDL</a>定義的,其中包括了外部函式介面(foreign function interface, FFI)以及介於javascript和C++的物件模型(object model, OM) 。</p> - -<p>像是vibration API便是透過IDL讓網頁內容使用,這部分程式碼定義在<code><a href="https://dxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMNavigator.idl" rel="custom">nsIDOMNavigator.idl</a>:</code></p> - -<pre>[implicit_jscontext] void mozVibrate(in jsval aPattern);</pre> - -<p>mozVibrate(冠有廠商前綴的函式,這個函式背後的震動規格尚未定案)接受<code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/Jsval" title="/en-US/docs/SpiderMonkey/JSAPI_Reference/JSVAL_IS_OBJECT">jsval</a>型態的參數,也就是Javascript的值。IDL編譯器<font face="Open Sans, sans-serif">,</font></code><code style="line-height: 1.5;"><a href="/en-US/docs/XPIDL/xpidl" style="line-height: 1.5;" title="/en-US/docs/XPIDL/xpidl">xpidl</a>,會產生C++的介面,這個介面會由</code><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;"><a href="https://dxr.mozilla.org/mozilla-central/source/dom/base/Navigator.cpp" rel="custom">Navigator.cpp</a>內的</span><code style="font-style: normal; line-height: 1.5;">Navigator類別實作之。</code></p> - -<pre class="brush:cpp;">NS_IMETHODIMP Navigator::MozVibrate(const jsval& aPattern, JSContext* cx) { - // ... - hal::Vibrate(pattern); - return NS_OK; -}</pre> - -<p>這個函式最關鍵的部分在於呼叫 hal::Vibreate() 將控制權由DOM移交給Gecko HAL,自此我們便會如前所述地進入HAL層,最後到達驅動程式。在上層的 DOM 並不在意現在是在哪個平台上執行(Gonk, WIndows, Mac OS X等等),DOM 也不在意現在是內容程序的程式碼在跑或是Gecko伺服器的在跑,所有的一切都交由底層系統處理。</p> - -<p>vibration API相對單純,適合用於說明,而<a href="/en-US/docs/API/WebSMS" title="/en-US/docs/API/WebSMS">SMS API</a> 便是比較複雜的API,它用到自己的"遠端"層將內容程序和伺服器連接起來。</p> - -<h2 id="無線介面層(Radio_Interface_Layer_RIL)">無線介面層(Radio Interface Layer, RIL)</h2> - -<p><a href="#The_userspace_process_architecture">The userspace process architecture</a>段落已經提過RIL,這邊我們將更進一步檢視各個元件是如何互動運作。</p> - -<p>和RIL有關的元件有:</p> - -<dl> - <dt><code>rild</code></dt> - <dd>和特定數據機韌體溝通的背景程序(daemon)。</dd> - <dt><code>rilproxy</code></dt> - <dd>rild和Gecko b2g程序之間訊息傳遞的代理背景程序(daemon)。rilproxy的存在解決了無法和rild直接溝通的問題,因為rild只可以在radio群組內溝通。</dd> - <dt><code>b2g</code></dt> - <dd>實作Gecko的程序,又稱為<strong>chrome process</strong>。其中和RIL相關的部分有<a href="https://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_worker.js" rel="custom">dom/system/gonk/ril_worker.js</a>(這是一個worker執行緒,會透過rilproxy和rild溝通,並且實作了無線狀態機(radio state machine))以及<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIRadioInterfaceLayer" title="">nsIRadioInterfaceLayer</a></code>介面(是主執行緒的<a href="/en-US/docs/XPCOM" style="line-height: 1.5;" title="/en-US/docs/XPCOM">XPCOM</a>服務,主要是作為ril_worker.js和Gecko各元件,包括Gecko內容程序,之間的訊息傳遞<span style="line-height: 1.5;">)。</span></dd> - <dt>Gecko's content process</dt> - <dd><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIRILContentHelper" title="">nsIRILContentHelper</a></code>介面會提供XPCOM服務,有了這個服務,Gecko內容程序會使用到的DOM API,例如<a href="/en-US/docs/API/WebTelephony" title="/en-US/docs/API/WebTelephony">Telephony</a>與<a href="/en-US/docs/API/WebSMS" title="/en-US/docs/API/WebSMS">SMS</a> API,便能夠和Chrome程序的無線介面溝通。</dd> -</dl> - -<h3 id="範例_Example_Communicating_from_rild_to_the_DOM">範例: Example: Communicating from rild to the DOM</h3> - -<p>讓我們來看看一段例子,看一下系統底層是如何和DOM程式碼溝通。當數據機接收到來電時,它會透過專屬機制通知rild,rild接著按照<code style="line-height: 1.5;"><a href="https://github.com/mozilla-b2g/android-hardware-ril/blob/master/include/telephony/ril.h" style="line-height: 1.5;" title="https://github.com/mozilla-b2g/android-hardware-ril/blob/master/include/telephony/ril.h">ril.h</a>內定義的</code><span style="line-height: 1.5;">"open"協定發送訊息到rild客戶端,以來電通話為例,</span><code style="font-style: normal; line-height: 1.5;">RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED</code><span style="line-height: 1.5;"> 訊息會被rild發送至rilporxy。</span></p> - -<p>實作在<code><a href="https://github.com/mozilla-b2g/rilproxy/blob/master/src/rilproxy.c" title="https://github.com/mozilla-b2g/rilproxy/blob/master/src/rilproxy.c">rilproxy.c</a>的rilproxy會透過以下程式碼,和rild</code><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;">建立</span><span style="font-family: courier new,andale mono,monospace; font-style: inherit; font-weight: inherit; line-height: 1.5;">連線:</span></p> - -<pre class="brush:cpp;">ret = read(rilproxy_rw, data, 1024); - -if(ret > 0) { - writeToSocket(rild_rw, data, ret); -}</pre> - -<p>一旦從rild那裏取回訊息後,訊息便會經由連接rilproxy和Gecko的socket傳給Gecko,Gecko是藉由<a href="https://dxr.mozilla.org/mozilla-central/source/ipc/ril/Ril.cpp" rel="custom">IPC thread</a>接收訊息:</p> - -<pre class="brush:cpp;">int ret = read(fd, mIncoming->Data, 1024); -// ... handle errors ... -mIncoming->mSize = ret; -sConsumer->MessageReceived(mIncoming.forget()); -</pre> - -<p>訊息的接收端是<a href="https://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/SystemWorkerManager.cpp" rel="custom">SystemWorkerManager</a>,然後訊息又會被重新打包發送到<code>{source("dom/system/gonk/ril_worker.js", "ril_worker.js")}}執行緒,這個</code><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;">ril_worker.js</span><code style="font-style: normal; line-height: 1.5;">實做了RIL狀態機(</code><span style="line-height: 1.5;">RIL state machine); 這其中的過程是透過 </span><code style="font-style: normal; line-height: 1.5;">RILReceiver::MessageReceived()函式完成</code><span style="line-height: 1.5;">:</span></p> - -<pre class="brush:cpp;">virtual void MessageReceived(RilRawData *aMessage) { - nsRefPtr<DispatchRILEvent> dre(new DispatchRILEvent(aMessage)); - mDispatcher->PostTask(dre); -}</pre> - -<p><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;">訊息</span><span style="line-height: 1.5;">傳遞到</span><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;">ril_worker.js執行緒後,onRILMessage()函數接著會被呼叫。其中呼叫方法是利用Javascript API函式</span><code style="font-style: normal; line-height: 1.5;"><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_CallFunctionName" title="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_CallFunctionName">JS_CallFunctionName</a>()</code><span style="line-height: 1.5;">:</span></p> - -<pre>return JS_CallFunctionName(aCx, obj, "onRILMessage", NS_ARRAY_LENGTH(argv), - argv, argv);</pre> - -<p><code>onRILMessage()定義在</code><a href="https://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_worker.js" rel="custom">dom/system/gonk/ril_worker.js</a>中;然後訊息會被切割成包裹,之後每一個包裹會被送給適當的處理函式:</p> - -<pre class="brush:js;">handleParcel: function handleParcel(request_type, length) { - let method = this[request_type]; - if (typeof method == "function") { - if (DEBUG) debug("Handling parcel as " + method.name); - method.call(this, length); - } -} -</pre> - -<p>ril_worker.js對每一個請求類型有實作一個同名的處理函式,所以程式碼能夠簡單地取得請求類型名稱,然後再比對是否有對應的函式存在,如果有便呼叫對應函式起來處理。</p> - -<p><code><font face="Open Sans, sans-serif">以</font>RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED</code>為例,下面的處理函式會被呼叫:</p> - -<pre class="brush:js;">RIL[UNSOLICITED_RESPONSE_CALL_STATE_CHANGED] = function UNSOLICITED_RESPONSE_CALL_STATE_CHANGED() { - this.getCurrentCalls(); -};</pre> - -<p>當收到訊息通知後,通話狀態也跟著改變,所以狀態機接著呼叫getCurrentCall()取得目前通話狀態:</p> - -<pre class="brush:js;">getCurrentCalls: function getCurrentCalls() { - Buf.simpleRequest(REQUEST_GET_CURRENT_CALLS); -}</pre> - -<p>這樣會回傳一個請求給rild,要求目前所有進行中通話的狀態。這個請求會沿著<code>RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED</code> 訊息之前所行進過的路走,只不過方向相反(從<span style="line-height: 1.5;"> </span><code style="font-style: normal; line-height: 1.5;">ril_worker.js</code><span style="line-height: 1.5;"> 到 </span><code style="font-style: normal; line-height: 1.5;">SystemWorkerManager</code><span style="line-height: 1.5;"> 、到 </span><code style="font-style: normal; line-height: 1.5;">Ril.cpp、</code><span style="line-height: 1.5;">再到</span><code style="font-style: normal; line-height: 1.5;">rilproxy,最後是</code><span style="line-height: 1.5;"> </span><code style="font-style: normal; line-height: 1.5;">rild</code><span style="line-height: 1.5;"> socket</span><span style="line-height: 1.5;">)。</span><span style="line-height: 1.5;"> </span><code style="font-style: normal; line-height: 1.5;">rild</code><span style="line-height: 1.5;"> 然後會回應請求,再回到ril_worker.js的</span><span style="font-family: courier new,andale mono,monospace; line-height: 1.5;">REQUEST_GET_CURRENT_CALLS訊息處理器,整個過程是雙向溝通。</span></p> - -<p>通話狀態然後會被處理,和之前的狀態比較,如果狀態有變更,ril_worker.js 會再通知在主執行緒上的<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIRadioInterfaceLayer" title="">nsIRadioInterfaceLayer</a></code>服務:</p> - -<pre class="brush:js;">_handleChangedCallState: function _handleChangedCallState(changedCall) { - let message = {type: "callStateChange", - call: changedCall}; - this.sendDOMMessage(message); -}</pre> - -<p><code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIRadioInterfaceLayer" title="">nsIRadioInterfaceLayer</a></code>實作在<a href="https://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/RadioInterfaceLayer.js" rel="custom">dom/system/gonk/RadioInterfaceLayer.js</a>,而訊息是透過onmessage()收到:</p> - -<pre class="brush:js;"> onmessage: function onmessage(event) { - let message = event.data; - debug("Received message from worker: " + JSON.stringify(message)); - switch (message.type) { - case "callStateChange": - // This one will handle its own notifications. - this.handleCallStateChange(message.call); - break; - ... -</pre> - -<p>之後訊息會透過父程序訊息管理器(Parent Process Message Manager, PPMM)送到內容程序:</p> - -<pre class="brush:js;">handleCallStateChange: function handleCallStateChange(call) { - [some internal state updating] - ppmm.sendAsyncMessage("RIL:CallStateChanged", call); -}</pre> - -<p>內容程序透過<code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIRILContentHelper" title="">nsIRILContentHelper</a></code> 服務的<span style="background-color: rgba(234, 239, 242, 0.247059); font-family: consolas,monaco,andale mono,monospace; font-size: 1rem; line-height: 19px; white-space: pre;">receiveMessage()從子</span><span style="line-height: 1.5;">程序訊息管理器(</span><span style="line-height: 1.5;">Child Process Message Manager, CPMM)那裡</span><span style="background-color: rgba(234, 239, 242, 0.247059); font-family: consolas,monaco,andale mono,monospace; font-size: 1rem; line-height: 19px; white-space: pre;">接受訊息:</span></p> - -<pre class="brush:js;">receiveMessage: function receiveMessage(msg) { - let request; - debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json)); - switch (msg.name) { - case "RIL:CallStateChanged": - this._deliverTelephonyCallback("callStateChanged", - [msg.json.callIndex, msg.json.state, - msg.json.number, msg.json.isActive]); - break;</pre> - -<p>接著,每一個電話callback物件的<code><a href="https://developer.mozilla.org/zh-TW/docs/XPCOM_Interface_Reference/nsIRILTelephonyCallback#callStateChanged()">nsIRILTelephonyCallback.callStateChanged()</a></code>方法會被呼叫;每一個有存取<a href="/zh-TW/docs/Web/API/Window/navigator/mozTelephony" title="The documentation about this has not yet been written; please consider contributing!"><code>window.navigator.mozTelephony</code></a> API的網頁應用程式會註冊這樣一個callback物件,這個callback物件會發送事件到網頁應用程式,如現階段通話物件狀態改變或有新通話來電事件。</p> - -<pre class="brush:cpp;">NS_IMETHODIMP Telephony::CallStateChanged(PRUint32 aCallIndex, PRUint16 aCallState, - const nsAString& aNumber, bool aIsActive) { - [...] - - if (modifiedCall) { - // Change state. - modifiedCall->ChangeState(aCallState); - - // See if this should replace our current active call. - if (aIsActive) { - mActiveCall = modifiedCall; - } - - return NS_OK; - } - - nsRefPtr<TelephonyCall> call = - TelephonyCall::Create(this, aNumber, aCallState, aCallIndex); - nsRefPtr<CallEvent> event = CallEvent::Create(call); - nsresult rv = event->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("incoming")); - NS_ENSURE_SUCCESS(rv, rv); - return NS_OK; -}</pre> - -<p>應用程式收到事件後可以跟著進行更新使用者介面等等:</p> - -<pre class="brush:js;">handleEvent: function fm_handleEvent(evt) { - switch (evt.call.state) { - case 'connected': - this.connected(); - break; - case 'disconnected': - this.disconnected(); - break; - default: - break; - } -}</pre> - -<p>更進一步的範例請見<code style="line-height: 1.5;"><a href="https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/js/dialer.js" style="line-height: 1.5;" title="https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/js/dialer.js">撥號應用程式的</a></code><code style="line-height: 1.5;"><a href="https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/js/dialer.js" style="line-height: 1.5;" title="https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/dialer/js/dialer.js">handleEvent()</a>。</code></p> - -<h3 id="3G_data">3G data</h3> - -<p>有一個 RIL 訊息會向電信服務(cellular service)發起數據請求(data call),這會啟動數據機的數據傳輸狀態。數據請求會開啟 Linux 核心的<a href="https://zh.wikipedia.org/wiki/Point-to-Point Protocol" title="Point-to-Point Protocol">Point-to-Point Protocol</a> (PPP) 介面裝置,這個裝置能夠透過使用者介面設定。</p> - -<h3 id="相關DOM_APIs">相關DOM APIs</h3> - -<p>以下是和 RIL 溝通相關的DOM APIs:</p> - -<ul> - <li><a href="/en-US/docs/API/WebTelephony/Introduction_to_WebTelephony" title="/en-US/docs/API/WebTelephony/Introduction_to_WebTelephony">Telephony API</a></li> - <li><a href="/en-US/docs/API/WebSMS/Introduction_to_WebSMS" title="/en-US/docs/API/WebSMS/Introduction_to_WebSMS">SMS API</a></li> - <li>Mobile Connection API</li> -</ul> - -<h2 id="WiFi">WiFi</h2> - -<p>Firefox OS 的 WiFi 後端使用 <code>wpa_supplicant</code> 處裡大部份工作。所以說WiFi 後端的主要工作是管理請求者(supplicant),還有輔助一些任務,例如載入 WiFi 驅動程式和開關網路介面;從根本上來看,WiFi 後端就是一個狀態機(state machine),而其狀態會跟隨請求者狀態。</p> - -<div class="note"> -<p><strong>Note:</strong> 許多 WiFi 有關的有趣東西都和 wpa_supplicant 程序可能的狀態變更息息相關。</p> -</div> - -<p>WiFi 元件的實作可以分成兩份檔案:</p> - -<dl> - <dt><a href="https://dxr.mozilla.org/mozilla-central/source/dom/wifi/DOMWifiManager.js" rel="custom">dom/wifi/DOMWifiManager.js</a></dt> - <dd>實作網頁內容所看到的API;定義在 <code><a href="/zh-TW/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWifi.idl" title="">nsIWifi.idl</a></code>.</dd> - <dt><a href="https://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiWorker.js" rel="custom">dom/wifi/WifiWorker.js</a></dt> - <dd>實作狀態機和驅動請求者的程式碼。</dd> -</dl> - -<p>這兩份檔案利用<a href="/en-US/docs/The_message_manager" title="/en-US/docs/The_message_manager">訊息管理員(message manager)</a> 溝通。 後端聆聽請求訊息,比如說"連接",然後回應訊息當請求行動完成後;DOM 端聆聽回應以及狀態改變和資訊更新的訊息。</p> - -<div class="note"> -<p><strong>Note:</strong> 任何同步 DOM API 都會藉由快取資料來實作,同步訊息會盡量避免。</p> -</div> - -<h3 id="WifiWorker.js">WifiWorker.js</h3> - -<p>這份檔案實作了 WiFi 介面背後的主要邏輯,由 SystemWorkerManager 喚起,然後運行在 chrome 程序裡(對多執行緒版本來說)。 WifiWorker.js 可以切成兩塊: 一個巨大無名函式與 WifiWorker;無名函式會產出 WifiManager,為本地提供 API,包含和請求者連線以及可取得的掃描結果等事件通知,它會回應請求的資訊,控管和請求者連線的細節,遵照 API 使用客戶的指示行動。</p> - -<p>WifiManager 和 DOM 中間是 WifiWorker 物件。WifiWorker 根據事件行動並且轉傳事件給 DOM,反過來,它也會收到 DOM 傳過來的請求,並且對請求者(supplicant)採取適當的動作,WifiWorker 也會維護請求者的狀態資訊和下不步行動的資訊。</p> - -<h3 id="DOMWifiManager.js">DOMWifiManager.js</h3> - -<p>實作 DOM API,負責在呼叫方和 WiFi worker 之間傳遞訊息。</p> - -<div class="note"> -<p><strong>Note:</strong> 為了避免和 chrome 程序之間同步訊息,WiFi Manager 需要根據收到的事件快取狀態。</p> -</div> - -<p>有一個同步訊息,那就是當 DOM API 初始化時為了取得請求者(supplicant)當下的狀態。</p> - -<h3 id="DHCP">DHCP</h3> - -<p>DHCP 和 DNS 由標準 Linux DHCP 客戶端,dhcpcd,負責。當網路連線中斷後,因為無法運作,Firefox OS 會終止 dhcpcd,直到又重新連上網路,dhcpcd 會被再重啟。<code>dhcpcd</code> 也負責設定預設路徑(route)。</p> - -<h2 id="Network_Manager">Network Manager</h2> - -<p>Network Manager 負責設定 3G 數據和 WiFi 元件的網路介面。</p> - -<h2 id="程序與執行緒">程序與執行緒</h2> - -<p>Firefox OS 採用 POSIX threads 實現所有應用程式的執行緒,這包括了應用成程式主執行緒、Web Worker 和輔助執行緒。Nice值決定了程序和執行緒的執行優先順序,然後再依賴 Linux 核心排程器先後執行;根據程序不同的狀態會有不同的Nice值。目前有7種Nice層級:</p> - -<table class="standard-table"> - <caption>程序執行優先順序</caption> - <thead> - <tr> - <th scope="col">優先順序</th> - <th scope="col">Nice</th> - <th scope="col">用於</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>MASTER</code></td> - <td>0</td> - <td>主 b2g process</td> - </tr> - <tr> - <td><code>FOREGROUND_HIGH</code></td> - <td>0</td> - <td>持有 CPU wakelock 的程式</td> - </tr> - <tr> - </tr> - <tr> - <td><code>FOREGROUND</code></td> - <td>1</td> - <td>前景(foreground)程式</td> - </tr> - <tr> - <td><code>FOREGROUND_KEYBOARD</code></td> - <td>1</td> - <td>鍵盤程式</td> - </tr> - <tr> - <td><code>BACKGROUND_PERCEIVABLE</code></td> - <td>7</td> - <td>音樂播放背景(background)程式</td> - </tr> - <tr> - <td><code>BACKGROUND_HOMESCREEN</code></td> - <td>18</td> - <td>主畫面程式</td> - </tr> - <tr> - <td><code>BACKGROUND</code></td> - <td>18</td> - <td>其他背景程式</td> - </tr> - </tbody> -</table> - -<p>有些層級的 Nice 值雖然一樣,不過記憶體不足時的終止行為不一樣。所有的優先順序可以在建置時調整,相關的程式碼請見<a href="http://hg.mozilla.org/mozilla-central/file/54e8c6492dc4/b2g/app/b2g.js#l610"><code>b2g/app/b2g.js</code></a>。</p> - -<p>一個程序(process)之內,主執行緒繼承了該程序的 Nice 值,而 Web Worker 執行緒所得到的 Nice 值為主執行緒的加一點,所以優先權較低,這麼做是為了避免耗費 CPU 資源的worker 拖慢的主執行續的運作。程序優先順趣會因為事件發生而變化,比如說當一個程式由前景轉到背景時、一個新的程式啟動、現存程式取得 CPU wakelock,一旦程序的執行優先權變動,旗下所屬的執行緒的執行優先權也會跟著變動。</p> - -<div class="note"> -<p><strong>Note:</strong> cgroups 目前沒有在資源管理用上,因為在某些裝置和核心上並不可靠。</p> -</div> - -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html b/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html deleted file mode 100644 index 3924fbf5a6..0000000000 --- a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/gaia_ui_tests_run_tests/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Gaia UI Tests Run Tests -slug: Archive/B2G_OS/Automated_testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests -translation_of: Archive/B2G_OS/Automated_testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests ---- -<div class="warning"> - <p>這個頁面尚未完成。請有志一同的夥伴幫忙補充。<br> - 有任何意見都可以寄到 gaia-ui-automation@mozilla.org。</p> -</div> -<h2 id="Running_Tests">Running Tests</h2> -<p> Basically, we can run gaia-ui-tests on a device with marionette server, emulators, and desktop B2G. However, please notice again that you should <u><strong>choose the right branch</strong></u> of gaia-ui-tests describing your B2G the best as we talked on previous section.</p> -<h3 id="Testing_on_Devices">Testing on Devices</h3> -<p> First of all, connect your device through USB to computer, and then forward the package from the phone to computer port:</p> -<pre>adb forward tcp:2828 tcp:2828 -</pre> -<p> <a name="adb_forward_error">You might get weird error</a>, such as "no permission", from the command above. In that case, you could try to do the commands below:</p> -<pre>adb kill-server -sudo adb devices -adb forward tcp:2828 tcp:2828 -</pre> -<p> It's almost all done before you start to run your tests! Before you start to run the test, read through <a href="https://developer.mozilla.org/en-US/docs/Gaia_Test_Runner#Risks" title="https://developer.mozilla.org/en-US/docs/Gaia_Test_Runner#Risks">this warning</a> in order to start gaia-ui-tests correctly.<br> - Now, you can send this command to execute all gaiatests:</p> -<pre><code>gaiatest <gaia_ui_tests folder>/tests/ --address=localhost:2828 --type=b2g-xfail <your manifest file location></code> -</pre> -<p> Or, if you want to run solely one file, just do:</p> -<pre><code>gaiatest <file> --address=localhost:2828 --type=b2g-xfail <your manifest file location></code> -</pre> -<p> After the test, you will see all the result on pass/fail. And, for each individual test, it might have more information that you can go through. Here are some common examples you might be able to see:</p> -<table class="standard-table"> - <tbody> - <tr> - <td style="text-align: center;"><strong>Error Message </strong></td> - <td style="text-align: center;"><strong>Corresponding Actions</strong></td> - </tr> - <tr> - <td>error: [Errno 111] Connection refused</td> - <td>reissue adb forward command</td> - </tr> - <tr> - <td>Element ... not visible before timeout</td> - <td>make sure the element would display on the app you test</td> - </tr> - <tr> - <td>TimeoutException: Condition timed out</td> - <td>make sure the condition on the app is the same as your expectations</td> - </tr> - <tr> - <td>broken pip</td> - <td>mostly bad marionette server issue</td> - </tr> - </tbody> -</table> -<p> </p> -<h3 id="Testing_on_Emulator">Testing on Emulator</h3> -<p><strong>Automatically launched emulator</strong></p> -<div class="geckoVersionNote"> - <p>TODO</p> -</div> -<p><strong>Mannually launched emulator</strong></p> -<div class="geckoVersionNote"> - <p>TODO</p> -</div> -<h3 id="Testing_on_Desktop_B2G">Testing on Desktop B2G</h3> -<p> After you downloaded the Gaia UI test from GitHub, you also can use <span class="author-g-bbktpz122z7l6tqfmcrf">desktop build to run the tests.</span><span class="author-g-bbktpz122z7l6tqfmcrf"> The Firefox OS desktop client, also called the </span><span class="author-g-bbktpz122z7l6tqfmcrf i"><i>B2G desktop client</i></span><span class="author-g-bbktpz122z7l6tqfmcrf">, lets you run Gaia and Web apps in a Gecko-based environment somewhat similar to an actual device. It doesn't emulate device hardware, so it's not adequate for testing device APIs, and isn't a replacement for testing on actual hardware. However, it does have a several APIs enabled that aren't available on Firefox such as the Contacts and Settings APIs. It can therefore be useful during the development of your application, or while working on the Gaia user interface itself.</span></p> -<p> You can download the latest build of the desktop client from <a href="http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/">this location</a>, but make sure you download the appropriate file for your operating system.</p> -<ul> - <li><strong>Mac</strong>: b2g-[VERSION].multi.mac64.dmg</li> - <li><strong>Linux (32bit)</strong>: b2g-[VERSION].multi.linux-i686.tar.bz2</li> - <li><strong>Linux (64bit)</strong>: b2g-[VERSION].multi.linux-x86_64.tar.bz2</li> -</ul> -<div class="note"> - <p>Note 1: Unfortunately, due to <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=832469">Bug 832469</a> the nightly desktop builds do not currently work on Windows, so you will need either Mac or Linux to continue :</p> - <p>Note 2: If you do not have the required operating systems installed on your machine, a virtual machine is fine as well.</p> -</div> -<p> Once downloaded, you will need to extract the contents to a local folder. For the purposes of the rest of this guide, I’ll refer to this location as<code> <strong>$B2G_HOME</strong></code>.<br> - Add the following line to your gaia/profile/user.js file,</p> -<pre><code>user_pref('marionette.force-local', true)</code></pre> -<p>which on :</p> -<ul> - <li><strong>Mac</strong> is located in $B2G_HOME/B2G.app/Contents/MacOS</li> - <li><strong>Linux</strong> is located in $B2G_HOME/b2g</li> -</ul> -<p> Because we’re running against the desktop client we must filter out all tests that are unsuitable. To run the tests, use the following command:</p> -<pre><code>gaiatest --address=localhost:2828 --type=b2g-antenna-bluetooth-carrier-camera-sdcard-wifi-xfail <your manifest file location></code> -</pre> -<h2 id="Test_Variables">Test Variables</h2> -<p> There is one warning previously mentioned here. Please do read <a href="https://developer.mozilla.org/en-US/docs/Gaia_Test_Runner#Risks" title="https://developer.mozilla.org/en-US/docs/Gaia_Test_Runner#Risks">the warning</a> before you setup your json test variables file.</p> -<p> We use the --testvars option to pass in local variables, particularly those that cannot be checked into the repository. For example in gaia-ui-tests these variables can be your private login credentials, phone number or details of your WiFi connection.</p> -<p> To use it, copy testvars_template.json to a different filename but add it into .gitignore so you don't check it into your repository.</p> -<p> When running your tests add the argument: --testvars=(filename).json</p> -<p><strong>Variables</strong></p> -<p><code>this_phone_number (string)</code> The phone number of the SIM card in your device. Prefix the number with '+' and your international dialing code.</p> -<p><code>remote_phone_number (string)</code> A phone number that your device can call during the tests (try not to be a nuisance!). Prefix the number with '+' and your international dialing code.</p> -<p><code>wifi.ssid (string)</code> This is the SSID/name of your WiFi connection. Currently this supports WPA/WEP/etc. You can add WiFi networks by doing the following (remember to replace "KeyManagement" and "wep" with the value your network supports) :</p> -<p><code>"wifi": { "ssid": "MyNetwork", "keyManagement": "WEP", "wep": "MyPassword" } </code></p> -<p><code>WPA-PSK: "wifi": { "ssid": "MyNetwork", "keyManagement": "WPA-PSK", "psk": "MyPassword" } </code></p> -<p><code>Marketplace: "marketplace": { "username": "MyUsername", "password": "MyPassword" } </code></p> -<div class="note"> - <p>Due to <a href="http://bugzil.la/775499">Bug 775499</a>, WiFi connections via WPA-EAP are not capable at this time.</p> -</div> -<p> </p> -<h2 id="Test_Parameters">Test Parameters</h2> -<p> As you see in the last command we gave out on previous sections, there are many test variables for you to know. You can do this to get more information:</p> -<pre>gaiatest --help</pre> -<p> </p> -<h2 id="Test_Data_Prerequisites">Test Data Prerequisites</h2> -<p>Occasionally a test will need data on the hardware that cannot be set during the test setUp. The following tests need data set up before they can be run successfully:</p> -<p><u><code>test_ftu</code></u> Requires a single record/contact saved onto the SIM card to test the SIM contact import</p> -<p> </p> -<p style="text-align: center;"><strong>Go to <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests/Gaia_UI_Tests_Write_Tests" title="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests">"Writing Tests"</a> section</strong></p> -<p style="text-align: center;"> </p> diff --git a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html b/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html deleted file mode 100644 index 2c11cea761..0000000000 --- a/files/zh-tw/archive/b2g_os/automated_testing/gaia-ui-tests/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Gaia UI Tests Guidelines -slug: Archive/B2G_OS/Automated_testing/gaia-ui-tests -translation_of: Archive/B2G_OS/Automated_testing/gaia-ui-tests ---- -<div class="summary"> - <p>Gaia-ui-tests 是 Mozilla 的一套用於自動測試 Gaia UI 的架構。所有的測試都是以 Python 撰寫,佐以少數的 Javascript 來與 Firefox OS 的 API 溝通。此一系列的教學文章將會描述如何設定環境、撰寫及執行測試。</p> -</div> -<p>Gaia-ui-tests uses <strong>Gaiatest</strong>, a Python package based around <a href="https://developer.mozilla.org/en-US/docs/Marionette" title="https://developer.mozilla.org/en-US/docs/Marionette">Marionette</a>. Gaiatest is designed to wrap HTML locators, Marionette calls and API calls together for interoperble communication and functionality. Marionette is based on the W3C standard developed for the <a href="http://docs.seleniumhq.org/projects/webdriver/" title="http://docs.seleniumhq.org/projects/webdriver/">Selenium WebDriver</a> a programming interface for browser automation. If you have used WebDriver and page/app objects before then you will find using Marionette and gaiatest easy.</p> -<h2 id="Getting_started_with_Gaia_UI_tests">Getting started with Gaia UI tests</h2> -<p>For those keen to get started with automated testing on Gaia/Firefox OS we have a tutorial series that will help you go from nothing to writing your own tests. Once you've completed this tutorial you'll have enough knowledge of testing, Firefox OS and Marionette to get started as a Mozilla tests contributor. It is <strong>highly</strong> recommended that you complete this tutorial if you wish to become a contributor.</p> -<dl> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_1_Marionette_Firefox_OS_start">Part 1: Getting started with Marionette and Firefox OS</a></dt> - <dd> - This article covers installing the tools you need to get started with running tests, such as B2G Desktop, Python and Marionette.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_2_Marionette_Firefox_OS_interactions">Part 2: Basic interactions with Firefox OS using Marionette</a></dt> - <dd> - An overview of the basic commands you will use to manipulate Firefox OS via Marionette.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_3_Reusable_tests">Part 3: Upgrading our code into a reusable test</a></dt> - <dd> - Moving on, in this article we will assemble some basic commands into a simple test inside a Python file so they can all be run as a single entity.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_4_Reusing_commands_Firefox_OS_setup">Part 4: Re-using commands to set up Firefox OS</a></dt> - <dd> - Here we look at moving some of the commands into Python methods to promote code reuse.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_5_Introducing_a_test_runner">Part 5: Introducing a test runner</a></dt> - <dd> - A test runner is a central feature of any good test suite, allowing you to run multiple tests and report and aggregate results. In this article we will explore the basics of Python's unittest runner.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_6_Marionette_By_class">Part 6: Using tuples, and Marionette's By class</a></dt> - <dd> - This time around we explain how to further reduce duplication of code, by storing repeated locators in tuples and simplifying the syntax with Marionette's <code>By</code> class.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_7_Writing_your_own_tests">Part 7: Writing your own tests</a></dt> - <dd> - Now the basics and behind you, and it is time to start to writing your own tests! Here we give you some tool recommendations to make the work easier, and suggest some tests to try your hand at writing.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_8_Using_a_base_class">Part 8: Using a base class</a></dt> - <dd> - In its current state, our test file contains all the test runner code. This is ok for now, but as soon as you start to run many test files it will mean a lot of duplication. Here we solve this problem by abstracting the test runner code into a separate Python class.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Part_9_app_objects">Part 9: Reducing duplication with app objects</a></dt> - <dd> - As a final improvement to the code's maintainability, in this article we explore abstracting code that handles interaction with specific Firefox OS apps out into Python app objects.</dd> -</dl> -<h2 id="Advanced_topics">Advanced topics</h2> -<p>One you've got the basics of writing and running tests under your belt, you way want to move on to some more involved or advanced work, such as running the full gaia-ui-tests tests suite, or logging power draw as the result of a test.</p> -<dl> - <dt> - <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests" title="Gaia UI Tests Run Tests">Running the gaia-ui-tests</a></dt> - <dd> - Guides to running the gaia-ui-tests suite against real Firefox OS devices and <a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_B2G_desktop_client">B2G Desktop</a> in a variety of configurations.</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Gathering_power_draw_data_using_gaiatest">Gathering Power Draw</a></dt> - <dd> - How to use gaiatest to log power draw while a test is running.</dd> -</dl> -<h2 id="See_also">See also</h2> -<p><a href="https://github.com/mozilla-b2g/gaia/tree/master/tests/python/gaia-ui-tests">Gaia-ui-tests main repository</a></p> -<h2 id="QuestionsCommentsConcerns"><span class="mw-headline" id="Questions.2FComments.2FConcerns">Questions/Comments/Concerns </span></h2> -<p>This project is at a fairly early stage, and your feedback would be greatly appreciated:</p> -<ul> - <li>Send mails to the <a href="http://mailto:_gaia-ui-automation@mozilla.org">gaia-ui-automation@mozilla.org</a> list.</li> - <li>Alternatively, find us on <a href="https://wiki.mozilla.org/IRC">Mozilla IRC</a> at channels #ateam, #mozwebqa, and #moztpeqa.</li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/automated_testing/index.html b/files/zh-tw/archive/b2g_os/automated_testing/index.html deleted file mode 100644 index 66f4eb520d..0000000000 --- a/files/zh-tw/archive/b2g_os/automated_testing/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: 測試 Boot to Gecko -slug: Archive/B2G_OS/Automated_testing -translation_of: Archive/B2G_OS/Automated_testing ---- -<p>因為 Boot to Gecko 還在開發中,不久的將來即將有對新硬體的支援,因此如何做測試就是很重要的事情。這個頁面提供了從多種方面測試 Boot to Gecko 的文章及資訊。</p> -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h3 id="Documentation" name="Documentation">Unit testing</h3> - <ul> - <li><a href="/en-US/docs/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests" title="/en-US/docs/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests">Gaia Unit Tests</a></li> - <li><a href="/en-US/docs/Mozilla/Boot_to_Gecko/B2G_Mochitests" title="/en-US/docs/Mozilla/Boot_to_Gecko/B2G_Mochitests">Mochitests</a></li> - </ul> - <dl> - </dl> - <h3 id="Documentation" name="Documentation">Miscellaneous testing topics</h3> - <dl> - <dt> - <a href="/en-US/docs/Debugging/Debugging_OpenGL" title="/en-US/docs/Debugging/Debugging_OpenGL">Debugging OpenGL</a></dt> - <dd> - How to debug OpenGL code on Boot to Gecko.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Feature_support_chart" title="/en-US/docs/Mozilla/Boot_to_Gecko/Feature support chart">Feature support chart</a></dt> - <dd> - A chart of what features are supported by the different builds of Boot to Gecko.</dd> - </dl> - <h3 id="Documentation" name="Documentation">Marionette for Boot to Gecko</h3> - <ul> - <li><a class="link-https" href="https://wiki.mozilla.org/Auto-tools/Projects/Marionette" title="https://wiki.mozilla.org/Auto-tools/Projects/Marionette">The Marionette Test Automation Framework</a></li> - <li><a href="/en/Marionette" title="https://developer.mozilla.org/en/Marionette">Marionette on MDN</a></li> - </ul> - <h4 id="Gaia_Unit_Tests">Gaia Unit Tests</h4> - <ul> - <li><a href="/en/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests" title="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests">Running/Writing Unit Tests</a></li> - </ul> - <h4 id="Marionette_Tutorials">Marionette Tutorials</h4> - <ul> - <li><a href="/en/Mozilla/Boot_to_Gecko/Setting_Up_Marionette_for_B2G" title="Building B2G for QEMU Emulator">Setting up Marionette for Boot to Gecko</a></li> - <li><a href="/en/Mozilla/Boot_to_Gecko/Marionette_for_Interactive_Python" title="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Marionette_for_Interactive_Python">Marionette for Interactive Python</a></li> - <li>Marionette for QEMU emulator</li> - </ul> - <h4 id="Writing_Tests_For_Marionette">Writing Tests For Marionette</h4> - <ul> - <li><a href="/en/Marionette/Marionette_Python_Tests" title="en/Marionette/Marionette_Python_Tests">Marionette Python Tests</a></li> - <li><a href="/en-US/docs/Marionette/Marionette_JavaScript_Tests" title="/en-US/docs/Marionette/Marionette_JavaScript_Tests">Marionette JavaScript Tests</a></li> - <li><a href="/en/Marionette/Running_Tests" title="en/Marionette/Running_Tests">Running Marionette Tests</a></li> - </ul> - <p><span class="alllinks"><a href="/Special:Tags?tag=B2G&language=en" title="Special:Tags?tag=B2G&language=en">View All...</a></span></p> - </td> - <td> - <h3 id="Community" name="Community">Getting help from the community</h3> - <p>If you're working with Boot to Gecko, or developing applications you'd like to run on Boot to Gecko based devices, there are community resources to help you!</p> - <ul> - <li>Consult the Boot to Gecko forum: <ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-b2g"> 郵件討論</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.b2g"> 新聞群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.b2g/feeds"> feed 消息來源</a></li> -</ul></li> - </ul> - <ul> - <li>Ask your question on the Mozilla IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/b2g" title="irc://irc.mozilla.org/b2g">#b2g</a></li> - </ul> - <p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html" title="http://www.catb.org/~esr/faqs/smart-questions.html">Don't forget about the <em>netiquette</em>...</a></span></p> - <br> - <h3 id="Related_Topics" name="Related_Topics">Related topics</h3> - <ul> - <li><a href="/en/HTML" title="en/HTML">QA</a></li> - </ul> - </td> - </tr> - </tbody> -</table> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/building/index.html b/files/zh-tw/archive/b2g_os/building/index.html deleted file mode 100644 index 9e5c54202c..0000000000 --- a/files/zh-tw/archive/b2g_os/building/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: 建置 Boot to Gecko -slug: Archive/B2G_OS/Building -translation_of: Archive/B2G_OS/Building ---- -<div> - </div> -<p>當您已經建立好編譯的系統、第一次成功地抓了程式碼以及設定好程式碼,您就可以編譯 Boot to Gecko。</p> -<h2 id="更新程式碼">更新程式碼</h2> -<p>如果您不是第一次編譯B2G,您需要在編譯之前先抓取最新的程式碼。您可以執行以下指令來更新B2G工具及相依套件:</p> -<pre>git pull -./repo sync -</pre> -<p>您可以藉由指定名稱來更新某部分的倉儲:</p> -<pre>./repo sync gaia -</pre> -<p>repo指令也有其他您可能會有興趣的選項可用;您可執行 <span style="font-family: 'Courier New', 'Andale Mono', monospace;">repo help </span>指令來獲取有用的資訊。</p> -<h2 id="編譯">編譯</h2> -<div class="note"> - <p>注意:在編譯前,您可以設置一個 <span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">.userconfig 檔案來訂製這次編譯。</span><a href="/en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file" title="/en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file">使用 .userconfig 檔案來客製</a> <span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">有更多詳細資訊。</span></p> -</div> -<p>執行 <span style="font-family: 'Courier New', 'Andale Mono', monospace;">build.sh 就可以開始編譯 Boot to Gecko:</span></p> -<pre>cd B2G -./build.sh -</pre> -<p>是時候該再喝杯咖啡,或小睡一下了(尤其是第一次編譯)。</p> -<h3 id="專程編譯某些模組">專程編譯某些模組</h3> -<p>如果您只想要編譯某個模組,例如 Gecko,您可以指定名稱:</p> -<pre>./build.sh gecko -</pre> -<p>您也可以用這個指令來取得您編譯的模組的列表:</p> -<pre>./build.sh modules -</pre> -<h3 id="設定要使用的處理器數目">設定要使用的處理器數目</h3> -<p>B2G 的編譯 scripts 預設使用系統的 cores 數量加二作為平行工作的數量。您可以再執行 <code>build.sh</code> 的時候指定 <code>-j </code>參數來改變這個預設值。如果您想要把編譯工作丟到背景、並且減輕 CPU 負載來做其他事情的話,這對您就很方便。當您面臨到編譯問題時,如果您一次就只執行一個編譯工作的話、設定處理器數目也可以讓您更容易讀取編譯的錯誤輸出,真的很方便。</p> -<p>舉例來說,設定同時只會有兩個工作來編譯:</p> -<pre>./build.sh -j2 -</pre> -<p>對於此對常見的使用案例就是防止不要平行編譯。這會讓編譯的輸出更加容易閱讀,更容易釐清編譯的問題。執行下面指令:</p> -<pre>./build.sh -j1 -</pre> -<h3 id="多語系編譯">多語系編譯</h3> -<p>建立多語系的編譯版本:</p> -<h4 id="Gaia">Gaia</h4> -<ol> - <li>決定要用哪個 Gaia 語系檔。這邊我們用 <a href="http://hg.mozilla.org/integration/gaia-nightly/file/e2eed5263e77/shared/resources/languages-dev.json"><code>locales/languages_dev.json</code></a> 和 <a href="http://hg.mozilla.org/integration/gaia-nightly/file/e2eed5263e77/shared/resources/languages-all.json"><code>locales/languages_all.json</code></a> 當做我們 Gaia 的語系檔。</li> - <li>Clone the appropriate locales</li> - <li>從 <a href="http://hg.mozilla.org/gaia-l10n">http://hg.mozilla.org/gaia-l10n</a> 複製適當的語系到目錄下;<code>這裡我們放於 gaia-l10n/</code> 下。接著您會需要將列於語系檔之內的美個語系的倉儲(repo)都複製下來。</li> - <li>您需要將上面步驟二目錄的絕對路徑設定在<code> LOCALE_BASEDIR</code> 環境變數中。也要把步驟一中檔案的絕對路徑設定在 <code>LOCALES_FILE</code> 環境變數中。</li> -</ol> -<p>如例:</p> -<pre>export LOCALE_BASEDIR=$PWD/gaia-l10n -export LOCALES_FILE=$PWD/gecko/gaia/shared/resources/languages-dev.json -</pre> -<h4 id="Gecko">Gecko</h4> -<ol> - <li>決定要用哪個 Gecko 語系檔。這邊我們用 <a href="http://hg.mozilla.org/releases/mozilla-b2g18/file/default/b2g/locales/all-locales">b2g/locales/all-locales</a> 當做我們的 Gecko 語系檔。</li> - <li>複製適當的語系到目錄下;像是 <code>gecko-l10n/</code> 。 - <ul> - <li>mozilla-central 要用 <a href="http://hg.mozilla.org/l10n-central/">http://hg.mozilla.org/l10n-central/</a></li> - <li>mozilla-aurora 要用 <a href="http://hg.mozilla.org/releases/l10n/mozilla-aurora/">http://hg.mozilla.org/releases/l10n/mozilla-aurora/</a></li> - <li>mozilla-beta 或 mozilla-b2g18 則是 <a href="http://hg.mozilla.org/releases/l10n/mozilla-beta/">http://hg.mozilla.org/releases/l10n/mozilla-beta/</a></li> - </ul> - </li> - <li>複製 <a href="http://hg.mozilla.org/build/compare-locales">compare-locales</a>.</li> - <li> - <p>將步驟二目錄的絕對路徑設定在 <code>L10NBASEDIR </code>環境變數中。將步驟一中的語系以空白分隔方式設定在 <code>MOZ_CHROME_MULTILOCALE </code>環境變數中。</p> - </li> - <li> - <p>將 <code>compare-locales/scripts</code> 目錄加入到 <code>PATH</code> 變數、 <code>compare-locales/lib</code> 加入到 <code>PYTHONPATH</code> 變數中.</p> - 如例: - <pre>export L10NBASEDIR=$PWD/gecko-l10n -export MOZ_CHROME_MULTILOCALE="ja zh-TW" -export PATH="$PATH:$PWD/compare-locales/scripts" -export PYTHONPATH="$PWD/compare-locales/lib" -</pre> - <p>當您完成這些設定之後,就可以執行 build.sh 了。</p> - <p>看起來您也可以用<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=818560#c9/"> .userconfig</a> 來做這些事情。</p> - <p>當我們整理好之後,可能會修改這些指令。</p> - </li> -</ol> -<h2 id="已知的錯誤">已知的錯誤</h2> -<ul> - <li> - <h3 id="KeyedVector.h19331_error_indexOfKey_was_not_declared_in_this_scope">KeyedVector.h:193:31: error: indexOfKey was not declared in this scope</h3> - </li> -</ul> -<p>當您的 gcc 版本太新的時候會出現這個錯誤。請安裝 gcc/g++/g++-multilib 4.6.x 版本.</p> -<p><a href="/en-US/docs/Mozilla/Boot_to_Gecko/B2G_build_prerequisites" title="en-US/docs/Mozilla/Boot_to_Gecko/B2G_build_prerequisites">設置您的編譯環境</a> 有更多資訊。</p> -<div class="note"> - <p><strong>社群上的提醒:</strong> 用 4.7.x 加上修改一些 B2G 程式碼可能可以 (gcc 會告訴你要改哪些地方) 但是這邊就沒人能幫你了!但是不改就不會碰到這些問題。</p> -</div> -<ul> - <li> - <h3 id="arm-linux-androideabi-g_Internal_error_Killed_program_cc1plus">arm-linux-androideabi-g++: Internal error: Killed (program cc1plus)</h3> - </li> -</ul> -<p>如果看到這個訊息,通常是代表記憶體不夠。在執行 <code>./build.sh </code>之前請確認有足夠的記憶體,如果您的系統記憶體有4G的話,應該可以跑的很順利。</p> -<ul> - <li> - <h3 id="If_you_get_build_errors_while_the_build_system_is_running_tests">If you get build errors while the build system is running tests</h3> - </li> -</ul> -<p>有時候(尤其是在作業系統或是編譯工具更新後)您在編譯系統執行編譯後測試時,會碰到一些靈異現象就像下面這樣:</p> -<pre>Generating permissions.sqlite... -test -d profile || mkdir -p profile -run-js-command permissions -WARNING: permission unknown:offline-app -WARNING: permission unknown:indexedDB-unlimited -build/permissions.js:122: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPermissionManager.add] -make[1]: *** [permissions] Error 3 -make: *** [gaia/profile.tar.gz] Error 2</pre> -<p>這種情況下試著刪除 <code>gaia/xulrunner-sdk </code>目錄然後再重新抓程式碼:</p> -<pre>rm -r gaia/xulrunner-sdk -</pre> -<p>這樣會刪掉由編譯系統自動抓取、預先編譯的 <a href="/en-US/docs/XULRunner" title="/en-US/docs/XULRunner">XULRunner</a>;在下一次編譯的時候,XULRunner 會再被自動抓取一份。</p> -<h2 id="接著的步驟">接著的步驟</h2> -<p>在編譯後,下個步驟就取決於您編譯的 Boot to Gecko 是給模擬器還是給實體手機;細節請參考下列文章:</p> -<ul> - <li><a href="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators" title="en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators">使用 B2G 模擬器</a></li> - <li><a href="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client" title="en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client">使用 B2G 的電腦桌面 client 程式</a></li> - <li><a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Installing_Boot_to_Gecko_on_a_mobile_device" title="en/Mozilla/Boot_to_Gecko/Installing Boot to Gecko on a mobile device">將 Boot to Gecko 安裝於行動裝置</a></li> - <li><a href="/en-US/docs/Mozilla/Boot_to_Gecko/Pandaboard" title="en-US/docs/Mozilla/Boot_to_Gecko/Pandaboard">將 Boot to Gecko 安裝於 pandaboard</a></li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html b/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html deleted file mode 100644 index 0dc0cd18b7..0000000000 --- a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/firefox_os_build_process_summary/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Firefox OS 建置程序摘要 -slug: >- - Archive/B2G_OS/Building_and_installing_Firefox_OS/Firefox_OS_build_process_summary -translation_of: Archive/B2G_OS/Building_and_installing_B2G_OS/B2G_OS_build_process_summary ---- -<div class="summary"> - <p><font><font>建置</font></font><font><font>和安裝Firefox OS需要大量的時間,網路頻寬和電腦計算能力。</font><font>不幸的是,一路上事情很容易出問題,所以</font><font>此頁面列出了<font><font>建置</font></font>的目標和步驟,希望</font></font><font><font>可以在用戶<font><font><font><font>建置的</font></font>過程中</font></font><font><font>幫上忙</font></font>。</font><font>至於每一步驟的細節,會在其他文</font></font>件討論<font><font>。</font></font></p> -</div> -<div class="note"> - <p><span style="font-weight: bold;"><font><font>注:</font></font></span><font><font>Firefox OS<font><font>建置</font></font>過程會提及到“B2G”或“Boot2Gecko”。</font><font>“Boot2Gecko”是Firefox OS專案的原始代號名稱。</font></font></p> -</div> -<h2 id="建置目標:4個“映像”檔"><font><font><font><font>建置</font></font>目標:4個“映像”檔</font></font></h2> -<p><font><font><font><font>建置</font></font>的目標是建立4個可以被複製到Firefox OS設備的映像檔。</font></font></p> -<table style="width: 90%; vertical-align: top; margin: 4px auto;"> - <tbody> - <tr> - <td><b><font><font>boot.img</font></font></b></td> - <td><font><font>Linux核心和根檔案系統映像檔(root filesystem image),後者提供<font><font>一套</font></font>可用的基本Unix工具。</font></font></td> - </tr> - <tr> - <td><b><font><font>system.img</font></font></b></td> - <td><font><font>Firefox的操作系統核心,包括部分<font><font>的</font></font>Gonk,Gecko的接口,可執行b2g檔。</font></font></td> - </tr> - <tr> - <td><b><font><font>userdata.img</font></font></b></td> - <td> - <p><font><font>使用者的</font></font><font><font>Gecko profile</font></font><font><font>以及Gaia網頁應用程式。</font></font></p> - </td> - </tr> - <tr> - <td><b><font><font>recovery.img</font></font></b></td> - <td><font><font>Linux核心和根<font><font>檔案系統</font></font>映像檔,另外還有簡單的工具,好讓使用戶能夠從問題中<font><font>修復</font></font>。</font></font></td> - </tr> - </tbody> -</table> -<p><font><font>一旦四個映像檔產生好後,它們可以被轉移到一個裝置。</font></font></p> -<p><font><font>Firefox OS是建立在Android開源專案上(Android Open Source Project, AOSP)。</font><font>AOSP的</font></font><code><font><font>ADB</font></font></code><font><font>和</font></font><code><font><font>fastboot工具</font></font></code><font><font>提供了十分好用的方法來存取和操作設備。</font></font><font><font>值得一提的是</font></font><font><font><code>adb reboot-bootloader命令</code></font></font><font><font>可以讓已經</font></font><font><font>連接上的裝置重開機,並且暫停至bootloader早期階段,在這個早期階段中可以下<code>fastboot flash $partition $image命令</code></font></font><font><font><code>,把映像檔複製到裝置之上</code>。</font></font></p> -<h3 id="開機映像檔(The_Boot_image)"><font><font>開機映像檔(The Boot image)</font></font></h3> -<p><font><font>boot.img(開機映像檔)</font></font><font><font>包含Linux核心和初始根磁碟分區,boot.img</font></font><font><font>提供核心軟體工具和初始化腳本。為了效率考量,</font><font><font><font>初始根磁碟分區會</font></font>被複製到記憶體之中,因此被稱為“ramdisk”。boot.img</font><font>將被複製到設備上的“啟動”(boot)分區</font></font><code>,而在裝置的檔案系統運作時,<font><font>ramdisk的內容是可以在根目錄底下看見,比如說下adb shell指令</font></font></code><font><font>。</font></font></p> -<p><font><font>boot.img還<font><font>在根目錄下的<code><font><font>default.prop</font></font></code>文<font><font><font><font>件</font></font></font></font>裡</font></font>建立了root用戶的權限</font></font><font><font>。</font></font></p> -<p><font><font>另外也可以通過檔案<font><font>檢查</font></font>,分割<font><font>檔案</font></font>到核心和ramdisk映像檔,<font><font>修改從</font></font>ramdisk映像抓出來的內容,並重新組裝ramdisk映像檔,然後重新建置boot.img,這樣來修改現存的開機映像檔 。</font><font><font><font>例如請參考</font></font></font></font><font><font><a href="http://k.japko.eu/alcatel-otf-hackers-guide-1.html">Alcatel One Touch Fire Hacking (Mini)</a></font></font><font><font>指南。</font></font></p> -<p><font><font>可以在安裝<font><font><font><font>開機映像檔</font></font></font></font>前測試<font><font><font><font>開機映像檔。</font></font></font></font></font></font>首先讓裝置開機後暫停於bootloader,然後下<code>fastboot boot /some/path/to/boot.img命令來開機進入尚未安裝的boot.img。</code></p> -<h3 id="系統映像"><font><font>系統映像</font></font></h3> -<p><font><font>系統映像檔(</font></font><code><font><font>system.img</font></font></code><font><font>)是Firefox OS的核心:</font></font></p> -<ul> - <li><strong><font><font>Gonk</font></font></strong><font><font>:操作系統的底層元件</font></font></li> - <li><strong>Gecko</strong><font><font>:Firefox的HTML和JavaScript引擎</font></font></li> - <li><strong><font><font>B2G</font></font></strong><font><font>:操作系統核心運行程序。</font></font></li> -</ul> -<div class="note"> - <p><font><font>有<font><font>關於平台架構的更多資訊,</font></font>請見</font></font><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform"><font><font>Firefox OS平台</font></font></a><font><font>指南。</font></font></p> -</div> -<p><font><font>system.img會被複製到system分區,而在檔案系統運作時會在/system/目錄底下。</font></font></p> -<div class="note"> - <p><strong><font><font>注</font></font></strong><font><font>:system.img提供了許多裝置會用到的二進位大型物件(BLOB),特別是RIL(Radio Interface Layer)的blob控制了設備上的蜂巢式行動網路(cellular radio network)。</font></font></p> -</div> -<h3 id="用戶資料映像檔"><font><font>用戶資料映像檔</font></font></h3> -<p><font><font>用戶資料應像檔(</font></font><code><font><font>userdata.img</font></font></code><font><font>)提供了運行中載入的各種Gaia應用程式。</font></font></p> -<p><font><font><code><font><font>userdata.img會被複製到裝置的userdata分區,然後檔案系統</font></font></code></font></font><font><font><code>運作時會在/data/目錄底下。值得一提的是</code></font></font><font><font><code>/data/b2g/目錄含有使用者的Gecko profile,而/data/local/webapps/目錄則含有使用者實際可以用的網頁應用程式</code></font></font><font><font>。</font></font></p> -<h3 id="復原映像檔"><font><font>復原映像檔</font></font></h3> -<p><font><font>復原映像檔(</font></font><code><font><font>recovery.img</font></font></code><font><font>)包含了和boot.img相同的核心和類似的ramdisk。</font><font>然而,<code><font><font>recovery.img</font></font></code>採用不同的初始化腳本,所以使用者</font></font><font><font>會被導引到另一個介面,這個介面會有可以透過裝置實體按鍵來操作的復原指令。</font></font></p> -<p><font><font><code><font><font>recovery.img會被複製到recovery分區,檔案系統運作時並不會掛載復原映像檔。</font></font></code></font></font></p> -<h2 id="構建過程:準備,設定,建置,安裝"><font><font>構建過程:準備,設定,建置,安裝</font></font></h2> -<p><font><font>建置和安裝Firefox OS的整個過程包括四個步驟:</font></font></p> -<table style="width: 90%; vertical-align: top; margin: 4px auto;"> - <tbody> - <tr> - <td><b><font><font>準備</font></font></b></td> - <td><font><font>取得建置需要的程式和檔案,如正確的編譯器和函式庫。</font></font></td> - </tr> - <tr> - <td><b><font><font>配置</font></font></b></td> - <td><font><font>下載原始碼,並創建</font></font><code><font><font>.configure</font></font></code><font><font>檔定義環境變數</font></font>,例如路徑等。</td> - </tr> - <tr> - <td><b><font><font>建置</font></font></b></td> - <td> - <p><font><font>建置使用者</font></font><font><font>的Gaia個人檔案和Gaia網頁應用程式。</font></font></p> - </td> - </tr> - <tr> - <td><b><font><font>安裝</font></font></b></td> - <td><font><font>在設備上安裝檔案。</font></font></td> - </tr> - </tbody> -</table> -<p> </p> -<h3 id="準備"><font><font>準備</font></font></h3> -<p><font><font>一開始需要準備好<font><font>建置需要的程式和檔案,如正確的編譯器和函式庫</font></font>。</font></font></p> -<p><font><font>這個步驟可以通過手動執行或使用腳本來完成。</font><font>詳情將在</font></font><font><font><a href="/en-US/Firefox_OS/Firefox_OS_build_prerequisites" title="火狐OS建立的先決條件"><font><font>建置Firefox </font></font></a>OS的先決條件</font></font><font><font>頁面<font><font>討論</font></font>。</font></font></p> -<div class="note"> - <p><strong><font><font>注</font></font></strong><font><font>:在UNIX和類UNIX的機器,</font></font><font><font>我們可以利用which指令,搭配需要的程式名稱當作變數,來檢查這些需要的工具是否存在。</font></font></p> -</div> -<h3 id="設定"><font><font>設定</font></font></h3> -<p><font><font>接著我們需要複製一份Firefox OS(B2G)的原始碼,通常可以透過git從B2G專案那裡複製一份,另外我們也需要產生一份.config檔,這個檔案會定義建置用的變數。</font></font></p> -<p><font><font>設定會執行</font></font><code><font><font>config.sh</font></font></code><font><font>腳本。</font><font>詳情請見</font></font><a href="/en-US/Firefox_OS/Preparing_for_your_first_B2G_build" title="準備進行首次B2G構建"><font><font>準備進行首次B2G建置</font></font></a><font><font>頁面。</font></font></p> -<p><font><font>configure腳本需要一個參數,指定建置的裝置種類。</font><font>建置名稱是和CPU架構而非裝置相關的代碼<font><font>名稱,目前可取得的代碼名稱請見<a href="/en-US/Firefox_OS/Phones"><font><font>這裡</font></font></a>。</font></font></font></font></p> -<p><font><font>設定步驟也將使用Android開源專案的repo</font></font><font><font>工具,來下載(或<font><font>更新)建置的原始碼到/repo/project目錄下。這個步驟會下載大量的</font></font></font></font><font><font>檔案並且花費不少時間。</font></font></p> -<h3 id="建置"><font><font>建置</font></font></h3> -<p><font><font>建置步驟實際上將編譯所有的原始碼,並且生成的映像檔。</font></font></p> -<p><font><font>建置會執行</font></font><code><font><font>build.sh</font></font></code><font><font>腳本。</font><font>詳情請見</font></font><a href="/en-US/Firefox_OS/Building" title="建築"><font><font>建置Firefox OS</font></font></a><font><font>頁面。</font></font></p> -<p><font><font>基本上建置十分單調,這個步驟就是從AOSP工具、到Linux核心、到Gaia網頁應用程式把一切都建置起來,而且有時候很不好判斷是那一個環節出錯導致</font></font><font><font>建置失敗。</font></font></p> -<p><font><font>我們可以只建置全部的某一部份,例如執行建置腳本時只帶入gecko參數,就會只建置Gecko系統,相同地,只帶入gaia參數,就只會建置Gaia。這些分別建置的部份可以分別地</font></font><font><font>被安裝到裝置上。</font></font></p> -<p><font><font>另外,也可以建置之前所討論的映像檔,例如建置系統映像檔可以這樣建置./build.sh out/platform/$target/system.img,其中$target參數和設定步驟中所提供的參數相同。</font></font></p> -<h3 id="安裝"><font><font>安裝</font></font></h3> -<p><font><font>安裝的步驟會將新編譯的程式碼放置到設備上。</font><font>這個步驟會執行</font></font><code><font><font>flash.sh</font></font></code><font><font>腳本。</font></font></p> -<p><font><font>如果只要安裝那些在建置步驟中分別被建置的部份,我們可以通過在執行falsh.sh時多帶入一個參數,例如./falsj.sh gaia就只會安裝Gaia網頁應用程式。</font></font></p> diff --git a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html b/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html deleted file mode 100644 index f01f67100c..0000000000 --- a/files/zh-tw/archive/b2g_os/building_and_installing_firefox_os/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: 建置並安裝 Firefox OS -slug: Archive/B2G_OS/Building_and_installing_Firefox_OS -translation_of: Archive/B2G_OS/Building_and_installing_B2G_OS ---- -<p>由於 Firefox OS 現正積極開發中,而且仍處於預先發佈的階段。如果要確保自己安裝的是最新版本,最好能自己動手建置並安裝。透過此頁面所整理的文章,你可在模擬器或相容裝置上建置並安裝 Firefox OS,或於 Firefox 瀏覽器上安裝 <a href="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Introduction_to_Gaia" title="en/Mozilla/Boot_to_Gecko/Introduction_to_Gaia">Gaia</a> 使用者介面。</p> -<p><nobr></nobr></p> -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 class="Documentation" id="取得並建置_Firefox_OS">取得並建置 Firefox OS</h2> - <dl> - <dt> - <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Firefox_OS_build_prerequisites" title="Mozilla/Firefox_OS/Firefox OS build prerequisites">Firefox OS 必備建置條件</a></dt> - <dd> - 首次建置 Firefox OS 時的必要步驟。</dd> - <dt> - <a href="/en/Mozilla/Boot_to_Gecko/Preparing_for_your_first_B2G_build" title="/en/Mozilla/Boot_to_Gecko/Preparing for your first B2G build">準備首次建置 Firefox OS</a></dt> - <dd> - 在建置 Firefox OS 之前,必須先複製 Firefox OS 的 Repo 並完成細部設定。本篇文章將解釋相關細節。</dd> - <dt> - <a href="/en/Mozilla/Boot_to_Gecko/Building_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Building Boot to Gecko">建置 Firefox OS</a></dt> - <dd> - 建置 Firefox OS 的方法。</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Porting" title="/en-US/docs/Mozilla/Firefox_OS/Porting">匯入 Firefox OS</a></dt> - <dd> - 將 Firefox OS 匯入新裝置的相關資訊。</dd> - </dl> - <p><span class="alllinks"><a href="/en-US/docs/tag/B2G" title="Special:Tags?tag=B2G&language=en">全部文章...</a></span></p> - </td> - <td> - <h2 class="Community" id="安裝_Firefox_OS_及或_Gaia">安裝 Firefox OS 及/或 Gaia</h2> - <dl> - <dt> - <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Choosing_how_to_run_Gaia_or_B2G" title="Mozilla/Firefox_OS/Choosing how to run Gaia or B2G">選擇 Gaia 或 Firefox OS 的執行方式</a></dt> - <dd> - 可於 Firefox 中執行 Gaia;亦可於行動裝置或桌面版模擬器中執行 Firefox OS。本篇指南將協助你根據自己需要,找出最適合的方式。</dd> - <dt> - <a href="/en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="en/Mozilla/Boot_to_Gecko/Using Gaia in Firefox">在 Firefox 中執行 Gaia</a></dt> - <dd> - 於 Firefox 桌面版瀏覽器中執行 Gaia。</dd> - <dt> - <a href="/en/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client" title="en/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client">使用 Firefox OS 桌面用戶端</a></dt> - <dd> - 執行並使用 Firefox OS 桌面用戶端;即是在桌面版應用程式中模擬 Gaia 環境。相較於 Firefox 中執行 Gaia,此種方式雖然更精確,但仍不如模擬器所達的精確度。</dd> - <dt> - <a href="/en/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators" title="en/Mozilla/Boot_to_Gecko/Using the B2G emulators">使用 Firefox OS 模擬器</a></dt> - <dd> - 本指南將說名 Firefox OS 模擬器的建置與使用方式,及使用何種模擬器的適當時機。</dd> - <dt> - <a href="/en/Mozilla/Boot_to_Gecko/Installing_Boot_to_Gecko_on_a_mobile_device" title="en/Mozilla/Boot_to_Gecko/Installing Boot to Gecko on a mobile device">於行動裝置上安裝 Firefox OS</a></dt> - <dd> - 在實際的行動裝置上安裝 Firefox OS。</dd> - <dt> - <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Dual_boot_of_B2G_and_Android_on_SGS2" title="/en-US/docs/Mozilla/Boot_to_Gecko/Dual boot of B2G and Android on SGS2">在 SGS2 上的 Firefox OS 與 Android 雙重開機</a></dt> - <dd> - 於 Samsung Galaxy S2 上建立 Firefox OS/Android 雙重開機環境的方法。</dd> - </dl> - </td> - </tr> - </tbody> -</table> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html b/files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html deleted file mode 100644 index 20566a839b..0000000000 --- a/files/zh-tw/archive/b2g_os/choosing_how_to_run_gaia_or_b2g/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: 選擇如何運作 Gaia 或 B2G -slug: Archive/B2G_OS/Choosing_how_to_run_Gaia_or_B2G -translation_of: Archive/B2G_OS/Choosing_how_to_run_Gaia_or_B2G ---- -<p>根據各別的需求,當您以 Boot to GEcko 或是 <a href="/en/Mozilla/Boot_to_Gecko/Introduction_to_Gaia" title="en/Mozilla/Boot_to_Gecko/Introduction_to_Gaia">Gaia</a> 使用者介面時、您會思考各種選項及組合。您可以挑出接著列出的這些選項;每個選項都需要考慮其優缺點,有些會比其他的更具延展性。</p> -<h2 id="在_Firefox_中運作_Gaia">在 Firefox 中運作 Gaia</h2> -<p>如果您很清楚您在做什麼的話,您可以複製 <a class="link-https" href="https://github.com/mozilla-b2g/gaia" title="https://github.com/mozilla-b2g/gaia">Gaia 的 repository</a> 並且 <a href="/en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox">在 Firefox 15 或以上版本中運作 Gaia</a>.</p> -<h3 id="優點">優點</h3> -<ul> - <li>不必 build 任何東西,只需簡單的安裝。</li> - <li>可以使用 Firefox 內建的開發者工具來除錯。</li> -</ul> -<h3 id="缺點">缺點</h3> -<ul> - <li>看到的範圍是基於瀏覽器的視窗大小,而不是行動裝置的螢幕大小。</li> - <li>很多硬體介面的功能無法使用。</li> - <li>應用程式在各自、釘著的分頁中運作,而不是主要的 UI 分頁。</li> - <li>如果您用 Firefox nightly 版本的話,它不一定很穩定。</li> -</ul> -<h3 id="為什麼要在_Firefox_中運作_Gaia">為什麼要在 Firefox 中運作 Gaia</h3> -<p>有兩個很重要的理由會讓您不在行動裝置或模擬器、而是在 <a href="/en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox">Firefox 上運作 Gaia</a>;容易開始著手開發和運作、也可以使用 Firefox 中優秀的開發者工具。如同要了解 Gaia 的 hackers 一般,開發者一開始測試 apps 的 UI 和基本功能的時候會享受到這極大的好處。</p> -<div class="note"> - <strong>Note:</strong> 在開始配送 app 之前,您絕對會需要在實體的行動裝置上做測試。</div> -<h2 id="在桌面環境中運作_B2G_模擬器">在桌面環境中運作 B2G (模擬器)</h2> -<p>可以自己建置一個 Boot to Gecko 模擬器,並且在上面運作 Gaia。這個軟體雖然是以 Firefox 為基礎,但和行動裝置上的 Boot to Gecko 的行為非常類似。現在 Mozilla 提供 nightly 版本的模擬器給開發者,且這項工作在 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=744008" title="FIXED: Produce B2G builds for desktop operating systems.">bug 744008</a> 裡持續追蹤著。如果您熟悉建置 Firefox code-base 或是 C++ 專案的話,您可以 <a class="link-https" href="https://wiki.mozilla.org/Gaia/Hacking#Building_B2G" title="https://wiki.mozilla.org/Gaia/Hacking#Building_B2G">依循這些步驟</a> 自己建置這個應用程式。</p> -<h3 id="優點_2">優點</h3> -<ul> - <li>模擬器提供行動裝置大小的範圍。</li> - <li>大部分而言,使用模擬器的體驗是近似實際的行動裝置的。</li> - <li>可以使用更多行動裝置的 APIs (但不是全部)。</li> -</ul> -<h3 id="缺點_2">缺點</h3> -<ul> - <li>您需要一個安裝好的 C/C++ 編譯環境。</li> - <li>您需要自己建置 Gecko 以及模擬器。</li> - <li>Firefox 開發者工具無法使用。</li> -</ul> -<h3 id="為什麼要運作_B2G_模擬器">為什麼要運作 B2G 模擬器</h3> -<p>這是一個不錯且折衷的測試和開發解決方案。對於將您的 app 或是其他程式碼放在近似行動裝置的環境中、卻不用再每次測試時都燒進手機而言,是一個不錯的方案。</p> -<div class="note"> - <strong>Note:</strong> 在開始配送 app 之前,您絕對會需要在實體的行動裝置上做測試。</div> -<h2 id="在行動裝置上運作_B2G">在行動裝置上運作 B2G</h2> -<p>對於測試 B2G 或 Gaia 環境、或是您的 web app 而言,最徹底的方式是建置並將 Boot to Gecko 安裝在實體的行動裝置上。同時這也是最複雜的處理程序。</p> -<h3 id="優點_3">優點</h3> -<ul> - <li>您可以得到完整的行動裝置體驗。</li> - <li>所有的行動裝置 APIs 都可以使用。</li> - <li>您可以在實際操作行動裝置中,體驗您的程式的效能。</li> -</ul> -<h3 id="缺點_3">缺點</h3> -<ul> - <li>您需要具備一個完整的 C/C++ 建置系統。</li> - <li>您需要自己編譯 Gecko 和 Gaia。</li> - <li>您需要一個相容的行動裝置來安裝 B2G 作業系統。</li> - <li>您需要把 B2G 燒到行動裝置上,同時移除掉原本在運作的作業系統。</li> -</ul> -<h3 id="為什麼要在行動裝置上運作_B2G">為什麼要在行動裝置上運作 B2G</h3> -<p>對於在 B2G 或 Gaia 上測試任何程式或網頁專案而言,這毫無疑問地是最精準的方式。經由在實際的行動裝置硬體上執行,您可以確認您的專案表現及顯示都相當良好,並且都可以正確地使用所有的行動裝置 APIs。另外,在您開始配送任何程式之前,您應該一定要在實體行動裝置上測試;沒這樣做的話,一定會不幸地發生一些難以預測的影響。</p> diff --git a/files/zh-tw/archive/b2g_os/debugging/index.html b/files/zh-tw/archive/b2g_os/debugging/index.html deleted file mode 100644 index 1084a2f201..0000000000 --- a/files/zh-tw/archive/b2g_os/debugging/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: 在 Boot to Gecko 上除錯 -slug: Archive/B2G_OS/Debugging -translation_of: Archive/B2G_OS/Debugging ---- -<p>基本上,在 B2G 有兩種除錯的方法。開發者可以在電腦上藉由 Firefox 15 以上的版本來 執行 <a href="/en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox">Gaia</a> (以及很多相容於 B2G 的 <a href="/en/Apps" title="en/Apps">web apps</a> )來進行高階的除錯。這樣會讓開發者可以利用 Firefox 裡面優秀的<a href="/en/Tools" title="en/Tools"> 開發工具 </a>開發工具來幫忙除錯,就像是在抓 web app 的 bug 一樣。</p> -<p>開發者也可以在 gdb 除錯器的控制之下,使用自己的行動裝置來執行 B2G。</p> -<h2 id="使用_Firefox_除錯_Gaia_和_web_apps">使用 Firefox 除錯 Gaia 和 web apps</h2> -<p><快馬加鞭中,請耐心等待></p> -<h2 id="使用_gdb_除錯_B2G">使用 gdb 除錯 B2G</h2> -<p>用 gdb 來對 Boot to Gecko 除錯很簡單。只要用 <code>run-gdb.sh</code> 這個 script 指令,就會重新啟動 B2G 並在 gdb 的控制之下執行:</p> -<pre>./run-gdb.sh -</pre> -<p>如果 B2G 已經在執行了,而現在只想要 attach,就要執行下面這個 script 指令:</p> -<pre>./run-gdb.sh attach -</pre> -<h2 id="OOP">OOP</h2> -<p>首先,用「MOZ_DEBUG_CHILD_PROCESS=1 ./run-gdb.sh」啟動 b2g,接著當啟動 OOP app 的時候,會顯示 plugin-container 的 PID。使用<./run-gdb.sh attach PID>啟動第二個 gdb instance。</p> -<p>必須在很短的時間之內啟動除錯器的第二個 instance,且在啟動的短時間之內,就要按 c 繼續。</p> -<h2 id="更多...">更多...</h2> -<p>我們需要在這裡添加更多內容。</p> diff --git a/files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html b/files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html deleted file mode 100644 index dd2fd2efb5..0000000000 --- a/files/zh-tw/archive/b2g_os/firefox_os_build_prerequisites/index.html +++ /dev/null @@ -1,606 +0,0 @@ ---- -title: Firefox OS build prerequisites -slug: Archive/B2G_OS/Firefox_OS_build_prerequisites -translation_of: Archive/B2G_OS/B2G_OS_build_prerequisites ---- -<div class="summary"> -<p><span class="seoSummary">在您開始取得程式碼並建立您的Firefox OS作業系統以前,需要一個設定正確的編譯環境,請參考<a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions" title="https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions">build system</a>這個頁面,裡面有詳細的說明。這裡簡單的提一下,您可以在64位元的Linux以及OS X上面作編譯。</span></p> -</div> - -<div class="note"> -<p><strong>註</strong>: 若您計畫編譯一個Firefox OS並裝載在一隻手機上,請確認該手機在編譯動作開始時"並未"跟您的電腦連接,正確的連結時機會在詳細步驟中說明。</p> -</div> - -<h2 id="支援的裝置或模擬器">支援的裝置或模擬器</h2> - -<p>您需要一個目標來裝載您建立的Firefox OS,他可以是一個真實的裝置或是一個模擬器。我們支援數種裝置但一個裝製常常有多種的版本,這樣的情況我們只支援特定的版本。另外不同的裝置我們的支援程度也稍有不同。</p> - -<div class="note"> -<p>註:Mozilla的<a href="https://github.com/mozilla-b2g/B2G">B2G source code</a>是一個B2G的參考實現,而手機製造商是可以自由的為他們的手機做出patch以及修改的。舉例來說,您在市場上購買的Alcatel One Touch這隻手機裡面的B2G就是一個製造商的版本。這樣B2G版本的差異安裝在上面的應用程式是沒有差異的,不過在平台這一層是有一些差別的。由於Nexus 4的版本是直接由Mozilla維護的,因此跟其他第三級支援裝置比較起來我們各版本的Gecko應該更能直接在Nexus 4上直接無問題的使用。</p> -</div> - -<h3 id="第一級支援裝置">第一級支援裝置</h3> - -<p>第一級支援裝置是一些主要開發用的裝置,因此一般來說能得最快的新功能與新的bug fixes。</p> - -<dl> - <dt>Keon</dt> - <dd>Keon 即為 <a href="http://www.geeksphone.com/" title="http://www.geeksphone.com/">Geeksphone</a> Keon 裝置, 也是最初的開發機種中的一個。 請注意這個裝置上的Forefox OS是由 Geeksphone提供.</dd> - <dt>Inari</dt> - <dd>Inari 是另外一個測試裝置. 在您建立Firefox OS給ZTE Open的裝置時請使用這個configuration (configuration的細節後面會提到)。<strong>注意:</strong> 較新版本的Firefox版本可能會無法在ZTE Open手機的default boot partition中開機成功。</dd> - <dt>Flame</dt> - <dd>Flame 是 Mozilla 最新的 Firefox OS 標準參考開發裝置,除了Flame這隻手機以外,在您建立給 ZTE Open C 這個裝置的Firefox OS時請也在configuration 中選用Flame(configuration 的細節後面會提到)。 兩隻手機都用一樣的設定原因是他們都是基於 Android jellybean。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_emulators" title="en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_emulators">模擬器 (ARM 與 x86)</a></dt> - <dd>有兩種模擬器,一種是模擬ARM code,另外一種直接用x86 code執行所有的功能. 更多相關資訊請參考<a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_emulators" title="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_emulators">Learn more about installing and using the emulators</a>.</dd> - <dd><strong>請注意基本上您應該不要使用 x86 模擬器 — 這個模擬器安裝不易而且支援的程度不是很理想。</strong></dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client" title="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client">桌面 client 程式</a></dt> - <dd>您也可以建立一個桌面版本的Firefox OS; 這個版本是讓 <a href="/en-US/docs/Mozilla/Gecko" title="/en-US/docs/Mozilla/Gecko">Gecko</a> 跑在一個 <a href="/en-US/docs/XULRunner" title="/en-US/docs/XULRunner">XULRunner</a> 程式裡面讓您可以使用 <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Introduction_to_Gaia" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Introduction_to_Gaia">Gaia</a> 提供的使用者界面.</dd> - <dt>Flatfish</dt> - <dd>Flatfist 是第一隻 Firefox OS 平板版本,雖然某些功能像是<a href="/zh-TW/docs/Web/Guide/Telephony">Web Telephony</a> 沒有辦法使用。在編譯 Flatfish 時,會需要一些<a href="https://github.com/flatfish-fox/flatfish-kernel">額外的設定</a>。</dd> -</dl> - -<p>另外雖然可能很顯而易見,還是提一下您在建立 <a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client" title="en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client">桌面 client 程式</a> 或任意一個 <a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_emulators" title="en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_emulators">模擬器</a> 時是不需要手機的。</p> - -<h3 id="第二級支援裝置">第二級支援裝置</h3> - -<p><span id="answer_long1" style="display: block;">一般來說,Firefox的功能在第二級支援裝置上都是可用的,這一些裝置被許多開發者使用(特別是應用程式開發者),因此並不需要太過即時的得到Firefox OS上新的改變。</span></p> - -<dl> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Samsung_Nexus_S" title="/en-US/docs/Mozilla/Firefox_OS/Samsung_Nexus_S"><span class="link-https">Samsung Nexus S</span></a></dt> - <dd>已知的 Nexus S 支援型號為 GT-I9020A 以及 GT-I9023,其他的型號可能可以支援</dd> - <dt>Samsung Nexus S 4G</dt> - <dd>SPH-D720 這個型號被當作第二級的支援裝置</dd> -</dl> - -<h3 id="第三級支援裝置">第三級支援裝置</h3> - -<p><span id="answer_long1" style="display: block;">給這一些裝置的Firefox OS是可以被建立的,不過工程師並不會時常用這一些裝置做開發,因此穩定度與功能上面會明顯的比前兩級的支援裝置要不足。</span></p> - -<dl> - <dt>Samsung Galaxy S2</dt> - <dd>只有i9100這個型號是被正式支援的。(i9100P 應該也可以支援因為差異只在 NFC 晶片)</dd> - <dt>Samsung Galaxy Nexus</dt> - <dd>現在看起來所有的型號都可以支援</dd> - <dt>Nexus 4</dt> - <dd>有一些在 IRC 上的使用者測試並成功過。 如果機器本身是 Android 4.4 也許需要降回 4.3 (Android <a href="https://developers.google.com/android/nexus/images#occamjwr66y">images available from Google</a>)</dd> - <dt>Nexus 5</dt> - <dd>一些在 IRC 上的使用者測試並成功過。</dd> - <dt>Tara</dt> - <dd>Tara 是另一之測試裝置. Tara 的 manifest 只在 master branch. 取得 Tara 的 script 為 "BRANCH=master ./config.sh tara"。</dd> - <dt>Unagi</dt> - <dd>Unagi 用來當作中低階智慧型手機的測試與開發裝置。很多 Firefox OS的開發者使用 Unagi 作開發。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Pandaboard" title="/en-US/docs/Mozilla/Firefox_OS/Pandaboard">Pandaboard</a></dt> - <dd>Pandaboard 是一片基於 OMAP 4 架構的開發板,作為在各種不同行動平台的開發使用。</dd> -</dl> - -<div class="warning"><strong>重要</strong>: 只有基於 <strong>Android 4</strong> (aka <strong>Ice Cream Sandwich</strong>) 以上的裝置才被支援。若您手上的裝置是上面提到的其中之一但 Android 的版本比較舊,請務必在做任何動作前先將它升級。</div> - -<div class="note"> -<p><strong>註</strong>: 第二級與第三級支援裝置沒有硬體的 Home 按鈕,不過會有一個軟體的 Home 按鈕</p> - -<p>所有第一級支援裝置都有一個硬體的 Home 按鈕,這個按鈕可以讓使用者直接回到 Home screen。現在市面上大多數基於 ICS 的 Android 裝置使用在螢幕上的觸碰按鍵。我們現在提供一個虛擬的 Home 按鈕給這一些缺少硬體按鍵的裝置。若您發現這個虛擬的 Home 按鈕沒出現,請打開 Setting 程式,然後到<span style="font-size: 14px; line-height: 1.5em;"> <a href="/en-US/Firefox_OS/Debugging/Developer_settings">Developer settings</a> 並選取 <a href="/en-US/Firefox_OS/Debugging/Developer_settings#Enable_software_home_button">Enable software home button</a>。</span></p> - -<p><span style="font-size: 14px; line-height: 1.5em;">在 Firefox OS 1.4 版有另外一個 developer option 叫做 "Home gesture enabled"; 開啟這的選項表示虛擬的 Home 按鈕將消失,取而代之的是一個由螢幕下方向上滑動的手勢。</span></p> -</div> - -<h2 id="使用_GNULinux_的需求">使用 GNU/Linux 的需求</h2> - -<div class="warning"> -<p><strong>重要</strong>: 即使您沒有要編譯自己的 Boot 2 Gecko,而只有要使用到<a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/make_options_reference"> Gaia's make system</a>, 您仍需要正確版本的 <strong>Python</strong> 與 <strong>Node.js</strong>。</p> -</div> - -<p>在 Linux 建立 Firefox OS, 您需要:</p> - -<ul> - <li>一種 <strong>64 bit 的 GNU/Linux</strong> distribution (建議Ubuntu 14.04).</li> - <li>至少 <strong>4 GB</strong> 的記憶體.</li> - <li>至少 <strong>40 GB</strong> 的硬碟空間.</li> -</ul> - -<p>這其實比最低需求要高不過常常在建立 Firefox OS 的過程出現問題只是因為資源不太夠。一個常見的例子為 "<span style="line-height: 1.5;"><strong>arm-linux-androideabi-g++: Internal error: Killed (program cc1plus)</strong>".</span></p> - -<p>下面列出個工具也必須被安裝:</p> - -<ul> - <li><strong>autoconf 2.13</strong></li> - <li><strong>bison</strong></li> - <li><strong>bzip2</strong></li> - <li><strong>ccache</strong></li> - <li><strong>curl</strong></li> - <li><strong>flex</strong></li> - <li><strong>gawk</strong></li> - <li><strong>git</strong></li> - <li><strong>gcc / g++ / g++-multilib</strong></li> - <li><strong>java sdk (jdk)</strong></li> - <li><strong>lzop</strong></li> - <li><strong>make</strong></li> - <li><strong>OpenGL shared libraries</strong></li> - <li><strong>patch</strong></li> - <li><strong>X11 headers</strong></li> - <li><strong>32-bit ncurses</strong></li> - <li><strong>32-bit zlib</strong></li> -</ul> - -<h3 id="64_位元安裝需求">64 位元安裝需求</h3> - -<p>這個部份列出了一些在不同的Linux發行版本中你必須執行的指令, 以利於安裝所有的需求來建構 Firefox OS.</p> - -<h4 id="Ubuntu_12.04_Linux_Mint_13_Debian_6">Ubuntu 12.04 / Linux Mint 13 / Debian 6</h4> - -<p>在終端機中執行下列指令:</p> - -<pre class="language-html"><code class="language-html">sudo apt-get update -sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libasound-dev libgconf2-dev libgl1-mesa-dev libx11-dev lzop make zip</code></pre> - -<p>如果您將建構 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Flame">"Flame"</a> reference device 或是 Nexus 5, 請在終端機執行以下指令:</p> - -<pre>sudo apt-get install libxml2-utils </pre> - -<p>您可以透過<a href="http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html">這個ppa</a>來安裝 jdk。</p> - -<p>And see the above comments about emulator build issues!</p> - -<h4 id="Ubuntu_12.10_Debian_7">Ubuntu 12.10 / Debian 7</h4> - -<p>在終端機中執行下列指令:</p> - -<pre>sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip</pre> - -<p>In addition to the emulator build issues discussed above, the compiler will default to <code>gcc-4.7</code>, which will fail to build with an error along the following lines:</p> - -<p>"<code>KeyedVector.h:193:31: error: indexOfKey was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation"</code></p> - -<p>To fix this, you will need to specify GCC 4.6 as the default host compiler after having retrieved the B2G sources: Read <a href="/en-US/docs/Mozilla/Firefox_OS/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler">Changing the default host compiler</a> to find out how to do it.</p> - -<p class="note">In a fresh Ubuntu 12.10 install, you'll get an error about unmet dependencies for ia32-libs. The following commands fix it:</p> - -<pre>sudo dpkg --add-architecture i386 -sudo apt-get update -sudo apt-get install ia32-libs</pre> - -<h4 id="Ubuntu_13.04">Ubuntu 13.04</h4> - -<p>Run the following command in Terminal:</p> - -<pre>sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip</pre> - -<p>In addition to the emulator build issues discussed above, the compiler will default to <code>gcc-4.7</code>, which will fail to build with an error along the following lines:</p> - -<p>"<code>KeyedVector.h:193:31: error: indexOfKey was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation"</code></p> - -<p>To fix this, you will need to specify GCC 4.6 as the default host compiler after having retrieved the B2G sources: Read <a href="/en-US/docs/Mozilla/Firefox_OS/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler">Changing the default host compiler</a> to find out how to do it.</p> - -<h4 id="Ubuntu_13.10">Ubuntu 13.10</h4> - -<p>With Ubuntu 13.10, multi-arch packages are now the main way to support multiple architectures (e.g. 32-bit on a 64-bit install). You must tell your Ubuntu system that you want to support 32-bit packages as well:<br> - </p> - -<pre>sudo dpkg --add-architecture i386 -sudo apt-get update</pre> - -<p>Once you've completed that, then you can install the necessary packages:</p> - -<pre style="font-family: 'Open Sans', sans-serif; line-height: 21px;">sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip libxml2-utils - -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1 - -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 2 - -sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 1 - -sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 2 - -sudo update-alternatives --set gcc "/usr/bin/gcc-4.6" - -sudo update-alternatives --set g++ "/usr/bin/g++-4.6" </pre> - -<h4 id="Ubuntu_14.04">Ubuntu 14.04</h4> - -<p>Follow the instructions given for Ubuntu 13.10.</p> - -<h4 id="Fedora_17181920">Fedora 17/18/19/20</h4> - -<p>Run the following command in Terminal:</p> - -<pre class="note">sudo yum install autoconf213 bison bzip2 ccache curl flex gawk gcc-c++ git glibc-devel glibc-static libstdc++-static libX11-devel make mesa-libGL-devel ncurses-devel patch zlib-devel ncurses-devel.i686 readline-devel.i686 zlib-devel.i686 libX11-devel.i686 mesa-libGL-devel.i686 glibc-devel.i686 libstdc++.i686 libXrandr.i686 zip perl-Digest-SHA wget</pre> - -<p>In addition to the above you will need GCC 4.6.x in order to compile the project:</p> - -<ul> - <li><a href="http://people.mozilla.org/~gsvelto/gcc-4.6.4-fc18.tar.xz">Pre-compiled GCC 4.6.x for Fedora 17/18</a></li> - <li><a href="http://people.mozilla.org/~gsvelto/gcc-4.6.4-fc19.tar.xz">Pre-compiled GCC 4.6.x for Fedora 19/20</a></li> -</ul> - -<p>Download the right version for your Fedora installation, then install it to <code>/opt,</code> with the following command on Fedora 17/18:</p> - -<pre class="note">curl -O http://people.mozilla.org/~gsvelto/gcc-4.6.4-fc18.tar.xz -sudo tar -x -a -C /opt -f gcc-4.6.4-fc18.tar.xz -</pre> - -<p>And with the following command for Fedora 19/20:</p> - -<pre class="note">curl -O http://people.mozilla.org/~gsvelto/gcc-4.6.4-fc19.tar.xz -sudo tar -x -a -C /opt -f gcc-4.6.4-fc19.tar.xz -</pre> - -<p>You will need to specify GCC 4.6.x as the default host compiler after having retrieved the B2G sources: Read <a href="/en-US/docs/Mozilla/Firefox_OS/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler">Changing the default host compiler</a> to find out how to do it.</p> - -<p>If build fails with the compiler complaining about not finding libmpc.so.2, install the package compat-libmpc</p> - -<h4 id="Arch_Linux"><strong>Arch Linux</strong></h4> - -<p>Run the following command in Terminal:</p> - -<pre class="note">sudo <span><span>pacman -S --needed </span></span><span><span>alsa-lib </span></span><span><span>autoconf2.13</span></span><span><span> bison</span></span><span><span> ccache</span></span><span><span> </span></span><span><span>curl firefox </span></span><span><span>flex </span></span><span><span>gcc-multilib </span></span><span><span>git </span></span><span><span>gperf </span></span><span><span>libnotify </span></span><span><span>libxt </span></span><span><span>libx11 mesa multilib-devel </span></span><span><span>wget wireless_tools </span></span><span><span>yasm</span></span><span><span> zip </span></span><span><span>lib32-mesa </span></span>lib32-mesa-libgl <span><span>lib32-ncurses lib32-readline</span></span><span><span> </span></span><span><span>lib32-zlib</span></span></pre> - -<p>To install the lib32-* packages you need to have the multilib repository enabled.</p> - -<p>B2G <a href="https://developer.mozilla.org/en-US/Firefox_OS/Building#KeyedVector.h.3A193.3A31.3A_error.3A_indexOfKey_was_not_declared_in_this_scope">can only be compiled with gcc4.6.4</a>, and because Arch Linux always has bleeding edge software you will need to install <a href="https://aur.archlinux.org/packages/gcc46-multilib">gcc46-multilib from AUR</a>. Note that you will have to edit the PKGBUILD and add <code>staticlibs</code> to the <code>options</code> array, or gcc will be unable to compile B2G and give you a <code>cannot find -lgcc</code> error when compiling. You will also need to add the following to your <code>.userconfig</code> file:</p> - -<pre class="language-html">export CC=gcc-4.6.4 -export CXX=g++-4.6.4</pre> - -<p>By default, Arch Linux uses Python3. You'll have to force it to use the old python2. You can do that by linking the python2 executable to python but this is discouraged and considered error-prone. This will also break python 3 if it is installed on your system. A better way is to use <code>virtualenv</code>/<code>virtualenvwrapper</code>:</p> - -<pre><span><span>sudo pacman -S python-virtualenvwrapper -</span></span>source /usr/bin/virtualenvwrapper.sh -mkvirtualenv -p `which python2` firefoxos -workon firefoxos -</pre> - -<p>Android will complain that you need make 3.81 or make 3.82 instead of 4.0. You can download <a href="https://aur.archlinux.org/packages/make-3.81/">make 3.81 from AUR</a>. This will install the make-3.81 binary on your path, you need to create a symlink named make to a location earlier in the PATH variable for the build to use the correct version.</p> - -<pre>mkdir -p ~/bin -ln -s `which make-3.81` ~/bin/make -export PATH=~/bin:$PATH -</pre> - -<p>Android also needs the Java6 SDK and Arch only has Java7. Unfortunately the aur build is broken, but you can still download the <a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR">Java 6 SDK</a> and install it manually. You will then need to put it in your path.</p> - -<pre>cp ~/Downloads/jdk-6u45-linux-x64.bin /opt -su -cd /opt -chmod +x jdk-6u45-linux-x64.bin -./jdk-6u45-linux-x64.bin -exit -ln -s /opt/jdk1.6.0_45/bin/java ~/bin/java - -</pre> - -<h4 id="Gentoo_Linux"><strong>Gentoo Linux</strong></h4> - -<h5 id="Installing_ccache">Installing ccache</h5> - -<p>You will need to install <strong><a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=3#doc_chap3">ccache</a></strong>, a tool for caching partial builds.</p> - -<pre><span><span># emerge -av ccache</span></span> -</pre> - -<p>Because ccache is known to frequently cause support issues, Gentoo encourages you to use it <em>explicitly</em> and <em>sparingly</em>.</p> - -<p>To enable the required use of ccache, on <em>the subsequent step</em> of this guide where the <code>./build.sh</code> script is called, Gentoo users should instead run the command with an explicitly extended path, ie.</p> - -<pre><span><span><strong>PATH=/usr/lib64/ccache/bin:$PATH</strong> ./build.sh</span></span> -</pre> - -<h5 id="Generating_Partition_Images">Generating Partition Images</h5> - -<p>If you are building B2G for actual physical hardware, then you may at some point also wish to generate some partition images for upload to your device. (For example, to restore backed up files to the device via the <strong><em>fastboot</em></strong> utility)</p> - -<p>The filesystem image format used in this case is YAFFS2 (Yet Another Filesystem 2). Gentoo has support for the very latest (ie. git HEAD) <code>yaffs2-utils</code> userland package in portage. (Note: You will also need kernel patches if you want to mount YAFFS2 images, but this is not really required since you can deconstruct and rebuild them instead.)</p> - -<pre># emerge --autounmask-write yaffs2-utils; etc-update; emerge -av yaffs2-utils</pre> - -<p>In order to generate such an image, simply change to the parent directory of the partition filesystem tree you wish to package, and issue a command like this:</p> - -<pre>mkyaffs2image system/ system.img</pre> - -<h2 id="使用_Mac_OS_X_的需求">使用 Mac OS X 的需求</h2> - -<p>要在Mac OS X 上建構 Firefox OS, 您必須遵循一些步驟, 以下將會詳細說明. 我們也會提出一些您可能在特殊情況下會遇到的錯誤, 以及他們的解決方法.</p> - -<div class="note"> -<p><strong>Note: Configuring and Building B2G for Keon WON'T WORK on a Mac</strong>. You'll need to use Linux to build B2G for this device.</p> -</div> - -<h3 id="版本相容性"><strong>版本相容性</strong></h3> - -<p>XCode 4.2 以下的版本與 Mac OS X 10.9 (a.k.a. "Mavericks") 並不相容, 所以您可能會很驚訝地發現Firefox OS會建構錯誤. 基本上您無法在 Mac OS X 10.9 以上的版本建構 ICS emulator, 並且 flatfish 在XCode 5.x系列會無法建構.</p> - -<table class="standard-table"> - <caption>Mac OS X 10.9.x 的版本相容性</caption> - <tbody> - <tr> - <td> </td> - <td>emulator (ICS)</td> - <td>flatfish (JB-4.2)</td> - <td>emulator-jb (JB-4.3)</td> - <td>emulator-kk (KitKat-4.4)</td> - </tr> - <tr> - <td>XCode 4.3.3</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">X</td> - </tr> - <tr> - <td>XCode 4.4.1</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">O[1]</td> - <td style="text-align: center;">O</td> - <td style="text-align: center;">O</td> - </tr> - <tr> - <td>XCode 4.5.2</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">O[1]</td> - <td style="text-align: center;">O</td> - <td style="text-align: center;">O</td> - </tr> - <tr> - <td>XCode 4.6.3</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">O[1]</td> - <td style="text-align: center;">O</td> - <td style="text-align: center;">O</td> - </tr> - <tr> - <td>XCode 5.0.2</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">O</td> - <td style="text-align: center;">O</td> - </tr> - <tr> - <td>XCode 5.1.1</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">X</td> - <td style="text-align: center;">O</td> - <td style="text-align: center;">O</td> - </tr> - </tbody> -</table> - -<ol> - <li>您必須將設定環境變數 <strong>BUILD_MAC_SDK_EXPERIMENTAL=1</strong> 並將其 export 以建構 flatfish.</li> -</ol> - -<h3 id="安裝_XCode_Command_Line_Utilities"><strong>安裝 XCode Command Line Utilities</strong></h3> - -<p>您必須安裝 Xcode's Command Line Utilities. 您可以只下載 Command Line Utilities, 只需要在 <a href="https://developer.apple.com/downloads/" title="https://developer.apple.com/downloads/">Apple's developer downloads page</a> 挑選您的 OS X 版本, 然而如果您想要完整的 Xcode suite, 你可以在 Mac App Store <a href="http://itunes.apple.com/us/app/xcode/id497799835?mt=12">安裝</a>他們<span style="line-height: 1.572;">. </span></p> - -<p>Xcode 4.3.1 (OS X 10.7 "Lion") 以及其他較新的版本如 4.4.1+ (也就是 Mac OS X 10.8 "Mountain Lion"), 並不會自動包含我們所需的 Command Line Utilities. 當您安裝 Xcode 時, 請確認進入 Preferences, then the Downloads panel, and install the Command Line Utilities. 另外, 請確認您至少有 20 GB 的硬碟空間.</p> - -<p><img alt="Screenshot of Xcode Downloads Command Line Tools" src="/files/4557/xcode_downloads_command_line_tools.png" style="height: 528px; width: 750px;"></p> - -<div class="note"> -<p><strong>Note:</strong> The Firefox OS 模擬器 需要 Core 2 Duo processor 或較新的處理器; 也就是, 一個相容於Mac OS X 10.7 "Lion"的作業系統. 您的作業系統不一定要是OS X Lion, 您只需要與其相容. 也就是您當然可以建構Firefox OS 在較舊版本的Mac 上.</p> -</div> - -<div class="note"> -<p><strong>Note:</strong> XCode 4.2.x or older is not compatible with Mac OS X 10.9 or above, and XCode 4.3.x has no platform SDK for 10.8. Please install a newer version. If you're also working on flatfish, please make sure any of XCode 4.4, 4.5, and 4.6 is available.</p> -</div> - -<h3 id="Run_Firefox_OS_Mac_Bootstrap">Run Firefox OS Mac Bootstrap</h3> - -<p>Next, open a terminal and run the following command:</p> - -<pre class="brush: bash">curl -fsSL https://raw.github.com/mozilla-b2g/B2G/master/scripts/bootstrap-mac.sh | bash</pre> - -<p>This will pull and run a bootstrap script that makes sure you have all the prerequisites met to build the emulator. It will also prompt you for permission to install anything you're missing, and provide warnings and suggested fixes to problems. The script will check for and install the following items:</p> - -<ul> - <li><code>git</code></li> - <li><code>gpg</code></li> - <li><code>ccache</code></li> - <li><code>yasm</code></li> - <li><code>autoconf-213</code></li> - <li><code>gcc-4.6</code></li> - <li><code>gnu-tar</code></li> - <li><code>homebrew</code></li> -</ul> - -<h4 id="Xcode_wrangling">Xcode wrangling</h4> - -<p>If you have already upgraded to Xcode 4.4+ and get the message that Xcode is outdated, check the Xcode path with:</p> - -<pre>xcode-select -print-path</pre> - -<p>If it still points to <code>/Developer</code> you can update the path with:</p> - -<pre>sudo xcode-select -switch /Applications/Xcode.app</pre> - -<h4 id="Making_the_Mac_OS_X_10.6_SDK_available">Making the Mac OS X 10.6 SDK available</h4> - -<p>You also need to have the Mac OS X 10.6 SDK available. The SDK needs to be available at</p> - -<pre>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/</pre> - -<p>If it cannot be found there you will need to extract and copy it from Xcode 4.3. To do this:</p> - -<ol> - <li>Download the XCode 4.3 .dmg file from the <a class="external" href="https://developer.apple.com/downloads/index.action">Apple Developer</a> portal (you'll need an <a href="https://developer.apple.com/register/index.action" title="https://developer.apple.com/register/index.action">Apple Developer account</a>).</li> - <li>Download the utility <a href="http://www.charlessoft.com/" title="http://www.charlessoft.com/">Pacifist</a> and use it to extract the 10.6 SDK from the XCode 4.3 .dmg file. Click on the "Extract Package" button, find the SDK by searching for 10.6 in the search box, then <em>Ctrl + click</em> on the MacOSX10.6.sdk directory and Extract it to a suitable location.</li> - <li>Add a symlink from the 10.6 SDK location to the <code>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/</code> directory. For example, if you put the 10.6 SDK on your desktop, the comment would be</li> -</ol> - -<pre>ln -s /Users/<em><yourusername></em>/Desktop/MacOSX10.6.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/</pre> - -<div class="note"> -<p><strong>Note:</strong> This is not necessary for Mac OS X 10.9 or above, because 10.6 SDK is for ICS and ICS doesn't supports Mac OS X 10.9.</p> -</div> - -<h3 id="Be_aware_of_Mac_file_system_case_sensitivity">Be aware of Mac file system case sensitivity</h3> - -<p>By default, Mac OS X ships with a case-insensitive file system. This is problematic because the Linux kernel has a number of files with the same name, but different case. For example, see the header files <code>xt_CONNMARK.h</code> and <code>xt_connmark.h</code>. This results in a number of files appearing to be modified in <code>/kernel</code> after a fresh <code>./config.sh</code>.</p> - -<p>In many cases you can run the build just fine; for some platforms, however, you may encounter the following error:</p> - -<pre><span class="quote">ERROR: You have uncommited changes in kernel -You may force overwriting these changes -with |source build/envsetup.sh force| - -ERROR: Patching of kernel/ failed.</span></pre> - -<p><span class="quote">Please see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867259" title="https://bugzilla.mozilla.org/show_bug.cgi?id=867259">bug 867259</a></span> for more discussion and possible fixes for this problem.</p> - -<p>Alternatively, it will always be safest to build on a case sensitive file system. The easiest way to do this is to create a separate, mountable disk image with case-sensitivity enabled. You can do this using Apple's Disk Utility application or from the command line:</p> - -<pre>hdiutil create -volname 'firefoxos' -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/firefoxos.sparseimage</pre> - -<p>Mount the drive with:</p> - -<pre>open ~/firefoxos.sparseimage</pre> - -<p>Change into the mounted drive with:</p> - -<pre>cd /Volumes/firefoxos/</pre> - -<p>You can then check out the code and compile from this location without worrying about case-sensitivity problems.</p> - -<h3 id="Mountain_Lion_homebrew_gotcha">Mountain Lion homebrew gotcha</h3> - -<div> -<div>If you are on Mountain Lion and you receive an error during the installation of the dependencies via homebrew, such as:</div> -</div> - -<div> -<pre>clang: error: unable to execute command: Segmentation fault: 11</pre> -... try reinstalling the dependency manually adding the <code>--use-gcc</code> flag, for example: - -<pre>brew install mpfr --use-gcc</pre> -</div> - -<h3 id="Follow_Samsung_Galaxy_S2_extra_steps">Follow Samsung Galaxy S2 extra steps</h3> - -<p>If you plan to build for the Samsung Galaxy S2, you will also need to install heimdall. See {{ anch("Installing heimdall") }} for details. This is <strong>not</strong> done for you by the bootstrap script!</p> - -<div class="note"><strong>Note:</strong> If you have installed the <a class="external" href="http://www.samsung.com/us/kies/" title="http://www.samsung.com/us/kies/">Samsung Kies</a> tool, which is used to manage the contents of many Samsung phones, you will have to remove it before you can flash Firefox OS onto your device. You can use the standard application removal process on Windows; on Mac, the Kies install disk image has a utility to fully remove Kies from your system. Flashing <strong>will not work</strong> if you have Kies installed. If you forget to remove Kies, the build system will detect it and remind you to uninstall it. Note also that the uninstall tool does not correctly remove the folder <code>~/Library/Application Support/.FUS</code>, and leaves a reference to a utility there in your user startup items list. You will want to remove these manually.</div> - -<h3 class="note" id="Fix_libmpc_dependency_if_broken">Fix libmpc dependency if broken</h3> - -<p><code>gcc 4.6</code> was built with <code>libmpc 0.9</code>; if you then use homebrew to update packages, libmpc gets updated to version 1.0, but homebrew doesn't rebuild <code>gcc 4.6</code> after the library version changes. So you need to create a symlink to make things work again, like this:</p> - -<pre>cd /usr/local/lib/ -ln -s libmpc.3.dylib libmpc.2.dylib</pre> - -<h3 id="Optional_Install_HAX">Optional: Install HAX</h3> - -<p>Intel provides a special driver that lets the B2G emulator run its code natively on your Mac instead of being emulated, when you're using the x86 emulator. If you wish to use this, you can <a class="external" href="http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/" title="http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/">download and install</a> it. It's not required, but it can improve emulation performance and stability. </p> - -<p>Before you install HAX you will need to install the <a href="http://developer.android.com/sdk/index.html" title="http://developer.android.com/sdk/index.html">Android SDK</a>.</p> - -<h2 class="note" id="Install_adb">Install adb</h2> - -<p>The build process needs to pull binary blobs from the Android installation on the phone before building B2G (unless you're building the emulator, of course). For this, you will need <code>adb</code>, the Android Debug Bridge. Our <a href="/en-US/Firefox_OS/Debugging/Installing_ADB">Installing ADB</a> article explains how to get <code>adb</code> installed.</p> - -<div class="warning"> -<p>Note for future when you start to use adb: adb needs the phone's lock screen to be unlocked in order to see your phone (at least in later versions of Firefox OS). You'll probably want to disable the lock screen (we'll get to how later in the build instructions).</p> -</div> - -<h2 class="note" id="Install_heimdall">Install heimdall</h2> - -<p>Heimdall is a utility for flashing the Samsung Galaxy S2. It's used by the Boot to Gecko flash utility to replace the contents of the phone with Firefox OS, as well as to flash updated versions of B2G and Gaia onto the device. You'll need it if you want to install Firefox OS on a Galaxy S2; it is <strong>not</strong> needed for any other device. For other devices, we build and use the fastboot utility instead.</p> - -<div class="note"><strong>Note:</strong> Again, it's important to note that this is <strong>only required for installing Firefox OS on the Samsung Galaxy S2</strong>.</div> - -<p>There are two ways to install heimdall:</p> - -<ul> - <li>You can <a class="link-https" href="https://github.com/Benjamin-Dobell/Heimdall" title="https://github.com/Benjamin-Dobell/Heimdall">download the code</a> GitHub and build it yourself.</li> - <li>Use a package manager to install it. - <ul> - <li>On Linux: <code>sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev</code></li> - <li>On Mac, you can <a class="link-https" href="https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-suite-1.3.2-mac.dmg" title="https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-suite-1.3.2-mac.dmg">download an installer package</a> and use that.</li> - </ul> - </li> -</ul> - -<h2 id="Configure_ccache">Configure ccache</h2> - -<p>The B2G build process uses ccache. The default cache size for ccache is 1GB, but the B2G build easily saturates this; around 3GB is recommended. You can configure your cache by running the following command inside terminal:</p> - -<pre><code>$ ccache --max-size 3GB</code></pre> - -<h2 id="For_Linux_configure_the_udev_rule_for_your_phone">For Linux: configure the udev rule for your phone</h2> - -<div class="note"> -<p><strong>Note</strong>: This section is specific to Linux; Mac OS X has the necessary device permissions set up already.</p> -</div> - -<p>Next, you need to confingure the udev rule for your phone,</p> - -<p>You can get the <a href="https://developer.android.com/tools/device.html#VendorIds">USB vendor ID</a> by running <code>lsusb</code> with your phone plugged in, but typically it's Google <code>18d1,</code> Samsung <code>04e8</code>, ZTE <code>19d2</code>, Geeksphone/Qualcomm <code>05c6</code>. Add this line in your <code>/etc/udev/rules.d/android.rules</code> file (replacing <code>XXXX</code> with the ID for your device):</p> - -<h2 id="相容的">相容的</h2> - -<pre>SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", MODE="0666", GROUP="plugdev"</pre> - -<p>Take ZTE for example, the content in android.rules will be</p> - -<pre style="font-size: 14px;">SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"</pre> - -<div class="note"> -<p><span style="line-height: 1.572;">If the file doesn't exist, create it. The <code>rules.d</code> directory is usually read only by default, so you may have to use <code>chmod</code> to make the directory writeable, or the file, or both.</span></p> -</div> - -<p><span style="line-height: 1.572;">Once you've saved the file, and closed it, make the file readable:</span></p> - -<pre>sudo chmod a+r /etc/udev/rules.d/android.rules -</pre> - -<p>Now that the udev rules have been updated, restart the udev daemon.</p> - -<p><strong>Ubuntu</strong></p> - -<pre>sudo service udev restart</pre> - -<p><strong>Fedora 20</strong></p> - -<pre>sudo systemctl restart systemd-udevd.service</pre> - -<p>Finally, unplug and the USB cable but don't replug it in because we need to enable remote debugging on the phone first.</p> - -<h2 id="Enable_remote_debugging">Enable remote debugging</h2> - -<p>Before you plug your phone back into your USB port, put it USB developer mode. This allows you to debug and flash the phone. To enable developer mode, on your phone enable <a href="/en-US/Firefox_OS/Debugging/Developer_settings#Remote_debugging">Remote Debugging</a> in <a href="/en-US/Firefox_OS/Debugging/Developer_settings">Developer settings</a> (this was called Developer mode on older versions.) Once the option is checked, remote debugging is enabled, and you are ready to go.</p> - -<p>At this point, connect your phone to your computer via a USB cable (if you created the udev rule before, this will trigger udev to detect the phone and create the device node with the right permissions). Now you can check if you can list your device via the <code>adb devices</code> command (remember that adb can only see your phone when the lock screen is unlocked). If everything has worked ok, you should see an output similar to this (the following is for a Geeksphone Keon):</p> - -<pre style="font-size: 14px;">$ adb devices -List of devices attached -full_keon device</pre> - -<p>If the device did not list as expect, check the file name and the script are all correct (see previous section), then restart the computer and retype the command again. Note also that if your device uses fastboot, the bootloader may identify itself with a different vendor ID than the one you see when the device boots normally.</p> - -<h2 id="Backup_the_phone_system_partition">Backup the phone system partition</h2> - -<div class="note"> -<p><strong>Note</strong>: You have to do this before you build your device if you do not have an existing system backup, because some libraries will be referenced in build time. These library might be proprietary so we can't provide in our code base.</p> -</div> - -<p>It is recommended that you back up the entire Android system partition on your phone.</p> - -<p>You can use this copy of the binary blobs for Android in case you later delete your B2G tree. To do this, run:</p> - -<pre>adb pull /system <backup target dir>/system -</pre> - -<p> Depending on the phone, you may also need to pull the <code>/data</code> and/or <code>/vendor</code> directories:</p> - -<pre>adb pull /data <backup target dir>/data -adb pull /vendor <backup target dir>/vendor -</pre> - -<p>If the pull commands fail with an "insufficient permission" message, try the following:</p> - -<ul> - <li>stop and restart the adb server, or if that fails,</li> - <li>double-check that you have granted root permissions to the <code>adb</code> tool within your custom ROM (e.g. under CyanogenMod, change <em>Settings > System > Developer Options > Root Access</em> to <em>Apps and ADB</em> or <em>ADB only</em>).</li> - <li>Verify that you have set up the udev rule correctly (see {{ anch("For Linux: configure the udev rule for your phone") }}.</li> -</ul> - -<h2 id="On_to_the_next_step">On to the next step</h2> - -<p>At this point, you should be ready to <a href="/en-US/docs/Mozilla/Firefox_OS/Preparing_for_your_first_B2G_build" title="en-US/docs/Mozilla/Firefox_OS/Preparing_for_your_first_B2G_build">fetch the Firefox OS code</a>!</p> diff --git a/files/zh-tw/archive/b2g_os/index.html b/files/zh-tw/archive/b2g_os/index.html deleted file mode 100644 index 7c258aaeea..0000000000 --- a/files/zh-tw/archive/b2g_os/index.html +++ /dev/null @@ -1,222 +0,0 @@ ---- -title: B2G OS -slug: Archive/B2G_OS -translation_of: Archive/B2G_OS ---- -<div class="summary"> -<p><span class="seoSummary">由 Mozilla 所開發的 Firefox OS 全新行動作業系統,即是以 Linux 與 Firefox 的核心 (Gecko 引擎) 為其架構。</span></p> -</div> - -<div class="column-container zone-callout"> -<p>開放源碼的<strong> Firefox OS</strong> 不受任何專利技術的限制,同樣能讓 App 開發者享受 Web 的功能與靈活度,打造出絕佳的消費性 App。</p> - -<p>對 Web 開發者而言,首要應先理解「<strong>整個使用者介面就是 Web App</strong>」,且該 Web App 又能顯示並啟動其他的 Web App。不論是專為 Firefox OS 撰寫的 App,或是對使用者介面所進行的任何修正,都能算是以 HTML、CSS、JavaScript 所建構的 Web App,且亦能存取行動裝置的硬體和服務。</p> - -<p>從產品的角度來看,Firefox OS 即是 Mozilla 與其 OEM 夥伴,在 <strong>Boot to Gecko (B2G)</strong> 技術上所套用的品牌及支援服務。B2G 為作業系統在工程設計時所用的代號,即透過 Mozilla 與其廣大 Mozilla/開放源碼社群的貢獻者所開發。</p> -</div> - -<section class="outer-apps-box" id="sect1"> -<h2 id="開發_Firefox_OS"><a href="https://developer.mozilla.org/en-US/Apps/Build/installable_apps_for_Firefox_OS">開發 Firefox OS</a></h2> - -<h2 id="專屬的_App">專屬的 App</h2> - -<p>此為我們的 App 中心,內含資訊可協助開發者撰寫 Open Web App,並安裝於 Firefox OS 之上。</p> -</section> - -<div class="column-container"> -<div class="column-third"> -<h2 id="平台指南"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform">平台指南</a></h2> - -<p>平台開發者可了解 Firefox OS 平台的各個元件如何搭配及運作。</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia">Gaia</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Gonk" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gonk">Gonk</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Gecko" title="/en-US/docs/Mozilla/Gecko">Gecko</a></li> -</ul> -</div> - -<div class="column-third"> -<h2 id="建構與安裝"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Build_and_install">建構與安裝</a></h2> - -<p>說明應如何於模擬器、相容裝置、桌機版模擬器上建構\安裝 Firefox OS。</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Firefox_OS_build_prerequisites" title="Mozilla/Firefox_OS/Firefox OS build prerequisites">Firefox OS 必要建構條件</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Preparing_for_your_first_B2G_build" title="Mozilla/Firefox_OS/Preparing for your first B2G build">準備第一次編譯</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Building" title="Mozilla/Firefox_OS/Building">建構 Firefox OS</a></li> -</ul> -</div> - -<div class="column-third"> -<h2 id="開發者手機"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Developer_phone_guide">開發者手機</a></h2> - -<p>關於特定開發者手機的調整、更新、復原、購買等資訊。</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Flame">Flame</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Developer_phone_guide/Updating_and_Tweaking_Geeksphone">Geeksphone</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Developer_phone_guide/ZTE_OPEN">ZTE Open</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/ZTE_OPEN_C">ZTE Open C</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Troubleshooting">疑難排解</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Phone_specs">手機與相關裝置的規格</a></li> -</ul> -</div> -</div> - -<div class="column-container equalColumnHeights"> -<div class="zone-callout"> -<h2 id="Firefox_OS_書籍">Firefox OS 書籍</h2> - -<p>有許多已出版與編寫中的書籍,涵蓋了 Firefox OS 多樣的開發面相。可參閱 <a href="http://firefoxosbooks.org/">Firefox OS 書籍</a>。</p> -</div> - -<div class="zone-callout"> -<h2 id="其他專頁"><strong>其他專頁</strong></h2> - -<ul> - <li><a href="https://www.mozilla.org/en-US/styleguide/products/firefox-os/"><span class="gmw_">Firefox OS <span class="gm-spell gm_ gm_d869ea80-e62d-d8a6-6929-a6e9983578ff">風格指南</span></span></a></li> - <li><a class="link-https" href="https://wiki.mozilla.org/B2G/FAQ" title="B2G/FAQ">Mozilla wiki FAQ</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Feature_support_chart" title="/en-US/docs/Mozilla/Firefox_OS/Feature_support_chart">支援功能表</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Geeksphone_FAQ" title="/en-US/docs/Mozilla/Firefox_OS/Geeksphone_FAQ">Geeksphone FAQ</a></li> -</ul> -</div> -</div> - -<div class="note"> -<p><strong>注意:</strong>我們將透過〈<a href="https://developer.mozilla.org/en-US/docs/MDN/Doc_status/Firefox_OS">Firefox OS 說明文件狀態</a>〉頁面,持續更新 Firefox OS 相關文件。如果你也想貢獻 Firefox OS 說明文件,請參閱此頁面並看看有哪些需要調整的內容!</p> -</div> - -<h2 id="Subnav">Subnav</h2> - -<ol> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Introduction">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform" title="Documentation about the Firefox OS platform, including Gonk, Gaia, and everything in between.">平台指南</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform">平台指南概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Architecture" title="An overview of how Firefox OS is structured internally; this is primarily of interest to platform developers and people doing porting work.">架構概述</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Apps_architecture" title="An overview of the application model on Firefox OS.">App 架構</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gonk" title="Documentation about Gonk, the operating system layer underneath Gaia. This consists of a Linux kernel and a hardware abstraction layer to which Gecko communicates."><span class="gm-spell gm_ gm_db111eae-c215-78a2-9789-97be921cbbdc">Gonk</span></a></li> - <li><a href="https://developer.mozilla.org/en-US/Gecko" title="Gecko is the layer of Firefox OS that provides the same open web standards implementation used by Firefox and Thunderbird, as well as many other applications.">Gecko</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia" title="Documentation about Gaia, the user interface application for Firefox OS devices; this is a Web application running atop the Firefox OS software stack.">Gaia</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia/Gaia_apps">Gaia App 指南</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security" title="Documentation about security in Firefox OS">安全性</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_model">Firefox OS 安全模型</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/System_security">系統安全</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Application_security">Firefox OS 中的 App 安全</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Installing_and_updating_applications">安全的安裝\更新 App</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Out_of_memory_management_on_Firefox_OS">Firefox OS 記憶體耗盡時的管理 </a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Feature_support_chart" title="A chart of which features are available in which types of Firefox OS builds.">支援功能表</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Settings_list" title="A list of common setting names that can be used with the settings API">設定清單</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS" title="This includes documentation for building and installing the platform onto devices, as well as building the simulator and emulators.">建構並安裝</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS">建構與安裝概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Firefox_OS_build_process_summary">Firefox OS 建構程序摘要</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites" title="Steps to take before you build Firefox OS for the first time.">必要建構條件</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Preparing_for_your_first_B2G_build" title="Before you can build Firefox OS, you need to clone the repository and configure your build.">準備第一次編譯</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building" title="How to build Firefox OS.">建構 Firefox OS</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Building_Firefox_OS_for_flame_on_OSX">於 OSX 上為「Flame」建構適用的</a><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Building_Firefox_OS_for_flame_on_OSX"> Firefox OS</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Choosing_how_to_run_Gaia_or_B2G" title="Using Gaia within Firefox, running Firefox OS on a mobile device, or in a desktop-based simulator. Which is best?">選擇 Gaia 或 Firefox OS 的執行方式</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_the_B2G_desktop_client" title="Simulating the Gaia environment in a desktop application - more accurate than running Gaia in Firefox but not as accurate as the emulators.">建構 B2G 桌機用戶端</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_B2G_emulators" title="A guide to building and using the Firefox OS emulators, and when to use which emulator.">使用 Firefox OS 模擬器</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Installing_on_a_mobile_device" title="How to install Firefox OS on a real mobile device.">於行動裝置上安裝 Firefox OS</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Firefox_OS_update_packages">建構並套用 Firefox OS 更新封包</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Runtime_tools">執行環境 (Runtime) 工具</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS" title="Hack the OS, customize your builds, get things the way you think they should be!">開發 Firefox OS</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS">Firefox OS 開發概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS/Filing_bugs_against_Firefox_OS">提報 Firefox OS 的錯誤</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS/modifying_hosts_file" title="A guide to what can be achieved by modifying the Firefox OS hosts file.">修改主機端的檔案</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Customization_with_the_.userconfig_file" title="How to customize the build and execution of Firefox OS by changing the .userconfig file.">以 .userconfig 檔案進行自訂</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS/Customizing_the_b2g.sh_script">自訂 b2g.sh 指令碼</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS/Porting" title="Information about how to port Firefox OS to new devices.">移植 Firefox OS</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia">開發 Gaia</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia">Gaia 開發概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Running_the_Gaia_codebase">執行 Gaia 的 Codebase</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Understanding_the_Gaia_codebase">了解 Gaia 的 Codebase</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Making_Gaia_code_changes">更改 Gaia 程式碼</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Test_Gaia_code_changes">測試更改過的 Gaia 程式碼</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Submitting_a_Gaia_patch">提交 Gaia 修正檔</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia/Build_System_Primer">Gaia 版本系統入門</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Customizing_build-time_apps">自訂「建構時間」App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Market_customizations_guide">市場自訂指南</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Customizing_the_keyboard">自訂 Firefox OS App 中的鍵盤</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Localizing_Firefox_OS">本地化 Firefox OS</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/L10n_Best_Practices">本地化最佳實例</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/make_options_reference">「make」選擇參考</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Gaia_tools_reference">Gaia 工具參考</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Phone_guide" title="A developer's guide to the Firefox OS developer phones available.">Firefox OS 手機指南</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Phone_guide">Firefox OS 手機指南概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Phone_specs">手機與相關裝置的規格</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Geeksphone">Geeksphone</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/ZTE_OPEN">ZTE OPEN</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/ZTE_OPEN_C">ZTE OPEN C</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Flame">Flame</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Firefox_OS_device_features">一般裝置功能</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Troubleshooting" title="A guide to resolving common problems with Firefox OS.">疑難排解</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Best_practices_open_reference_devices">開放參考裝置的最佳實例</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases" title="This section of the site contains release notes, explaining what new features and changes of significance to developers have landed in each new release of Gaia and Gecko on Firefox OS.">Firefox OS 版本說明</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases">Firefox OS 版本說明概述</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/2.1">Firefox OS 2.1 for developers</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/2.0">Firefox OS 2.0 for developers</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/1.4">Firefox OS 1.4 for developers</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/1.3">Firefox OS 1.3 for developers</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/1.2">Firefox OS 1.2 for developers</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/1.1">Firefox OS 1.1 for developers</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/1.0.1">Firefox OS 1.0.1 for developers</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing">自動化測試</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing">Firefox OS 自動化測試概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Running_Tests_on_Firefox_OS_for_Developers">於 Firefox OS 執行測試作業:開發者指南</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/gaia-ui-tests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests">Gaia UI 測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Gaia_integration_tests">Gaia 整合測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Gaia_unit_tests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Gaia_unit_tests">Gaia 單元測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/Gaia_performance_tests">Gaia 效能測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Mochitests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Mochitests"><span class="gm-spell gm_ gm_8ea2aeb5-60d9-d796-930f-2db1e4217eaa">Mochitests</span></a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Reftests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Reftests"><span class="gm-spell gm_ gm_9567400a-e713-3d43-ffa9-05fd8c3a28a2">Reftests</span></a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Marionette/Marionette_JavaScript_Tests" title="/en-US/docs/Marionette/Marionette_JavaScript_Tests">WebAPI 測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/XPCShell" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/XPCShell"><span class="gmw_"><span class="gm-spell gm_ gm_cc093417-aacf-72e2-e15f-c15a7509a6a8">xpcshell</span> 測試</span></a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/endurance_tests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/endurance_tests">耐久測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/MTBF_tests">MTBF 測試</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Marionette" title="/en-US/docs/Marionette">Marionette</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Treeherder">Treeherder</a></li> - <li><a class="external external-icon" href="https://wiki.mozilla.org/QA/Execution/Web_Testing/Automation/Jenkins">Jenkins</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging" title="A guide to debugging both your mobile apps and Firefox OS itself.">除錯</a> - <ol> - <li><strong><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging">Firefox OS 除錯概述</a></strong></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Developer_settings">Firefox OS 的開發者設定</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Connecting_a_Firefox_OS_device_to_the_desktop">將 Firefox OS 裝置連上桌機</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Setting_up">以 Firefox 開發者工具設定 Firefox OS 的除錯作業</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/On-device_console_logging">裝置上的 console 記錄</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Installing_ADB">安裝並使用 ADB</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_usage_tips/taking_screenshots">螢幕截圖</a></li> - <li><a href="https://developer.mozilla.org/en_US/docs/Tools/WebIDE" title="A tool that allows you to install open web apps from your computer to a device capable of installing them (such as Firefox OS) - and debug any running app.">使用 WebIDE</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">使用「應用程式管理員 (App Manager)」</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Firefox_OS_crash_reporting">Firefox OS 當機回報</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Debugging_OOMs">Firefox OS 記憶體耗盡的除錯</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Debugging_and_security_testing">Firefox OS 安全性測試與除錯</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Debugging_B2G_using_gdb"><span class="gmw_">使用 <span class="gm-spell gm_ gm_7a44a2c7-9d5d-e693-57b5-a88dd9adacd8">gdb 為 B2G 除錯</span></span></a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Debugging_B2G_using_valgrind">使用 Valgrind 為 B2G 除錯</a></li> - </ol> - </li> -</ol> diff --git a/files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html b/files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html deleted file mode 100644 index 7605d27e06..0000000000 --- a/files/zh-tw/archive/b2g_os/installing_boot_to_gecko_on_a_mobile_device/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: 將 Boot to Gecko 安裝於行動裝置 -slug: Archive/B2G_OS/Installing_Boot_to_Gecko_on_a_mobile_device -translation_of: Archive/B2G_OS/Installing_on_a_mobile_device ---- -<p>如果您編譯給行動裝置的 Boot to Gecko 之後,您就將他安裝在行動裝置上。這篇文章會引導您進行這個動作。</p> -<div class="note"> - <strong>Note:</strong> 第一次把 B2G 寫入手機時,手機必須安裝 Androidd 4.0 (Ice Cream Sandwich) 版本。否則這個動作就不會正常的運作。而一旦您完成第一次 B2G 的安裝之後,您就可以熟練的更新了。</div> -<h2 id="燒錄手機">燒錄手機</h2> -<p>您只要將您的手機連結到電腦上、並打下列指令,就可以燒任何東西到手機上:</p> -<pre>./flash.sh -</pre> -<p>就這樣。您編譯好的 B2G 就會被燒錄到您的行動裝置上。</p> -<h3 id="為您的行動裝置設定_udev_規則">為您的行動裝置設定 udev 規則</h3> -<p>在 Linux,如果您看到這個訊息,</p> -<pre>< waiting for device ></pre> -<p>那或許意味著這個 fastboot 裝置和提供給 adb 裝置的不同,而那個裝置沒有被加入 udev 規則。您現在可以藉由執行 <code>lsusb</code> 來取得 USB 廠商的 ID,但是它會是 Google 的 ID:18d1,所以將下面這一行加入 <code>/etc/udev/rules.d/51-android.rules 這個檔案,然後就會正常運作了:</code></p> -<pre>SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"</pre> -<div class="note"> - <strong>Note:</strong> 如果您在 Linux 上碰到一個非常有幫助的 <code>libusb</code> 錯誤 "-3"的話,這意味著手機需要被 root 來取得 USB 裝置的權限。請使用 <code>sudo</code> 再執行一次這個 script。</div> -<h3 id="Samsung_Galaxy_S2_要特別注意的地方">Samsung Galaxy S2 要特別注意的地方</h3> -<p>如果您的手機是 Galaxy S2 且使用 heimdall 1.3.2 (最新版;可以用 <code>heimdall version</code> 指令檢查版本) 的話,您可能會看到一個警告訊息「FACTORYFS upload failed!」、後面接著「Heimdall flashing failed」和一些額外的資訊。實際上這是一個成功的狀況,所以您可以忽略這個建議。</p> -<p>為了要擺脫這個奇怪的行為,您可以去抓 heidmall 的 <a class="link-https" href="https://github.com/Benjamin-Dobell/Heimdall" title="https://github.com/Benjamin-Dobell/Heimdall">複製的原始碼</a>、並且降級到 1.3.1 release 版 ("<code>git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06</code>"),接著根據 <code>README</code> 編譯、然後安裝,這樣就不會再看到這個錯誤訊息了。然而,這並不是必須的 (看起來比較爽就是了)。</p> -<p>heimdall 的所有版本都無法燒錄超過 100MB 的 system.img。執行下列指令:</p> -<pre>ls -l ./out/target/product/galaxys2/system.img -</pre> -<p>就可以看到您的 system.img 有多大。如果太大的話,先到 IRC 找人問問求救;有幾種方法可以分兩階段來燒錄。</p> -<h2 id="Samsung_Galaxy_S2_額外的步驟">Samsung Galaxy S2 額外的步驟</h2> -<p>如果您正在燒錄到 Galaxy S2 的話,需要遵守一個額外的步驟。因為使用 <code>flash.sh</code> script 不會自動將 Gaia 燒錄上去;您需要也打下列指令:</p> -<pre>./flash.sh gaia -</pre> -<h2 id="燒錄某個分割區partitions到具備_fastboot_的手機">燒錄某個分割區(partitions)到具備 fastboot 的手機</h2> -<p>您可以燒錄某個分割區 (partitions)到 fastboot 的手機 (也就是說,除了 Samsung Galaxy S2 之外的任何其他手機)。指令如下:</p> -<pre>./flash.sh system -./flash.sh boot -./flash.sh user -</pre> -<h2 id="更新某個模組">更新某個模組</h2> -<p>在燒錄的時候,您可以藉由指名元件名稱來更新某個 B2G 的元件。如下:</p> -<pre>./flash.sh gaia -./flash.sh gecko -</pre> -<h2 id="接著,下一步">接著,下一步</h2> -<p>此時,您的手機應該正在運作 Boot to Gecko!是時候該體驗、<a href="/en/Mozilla/Boot_to_Gecko/Writing_apps_for_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Writing_apps_for_Boot_to_Gecko">寫些程式</a>、 <a href="/en/Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko">測試</a>、或是 <a href="/en/Mozilla/Boot_to_Gecko/Debugging_on_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Debugging_on_Boot_to_Gecko">除些錯</a> 了!</p> -<div class="note"> - <strong>Note:</strong> 一個有用的技巧:如果您的 B2G 版本啟動的時候有螢幕鎖且需要密碼才能解鎖的話,預設的解鎖密碼是 0000。</div> -<h2 class="note" id="Troubleshooting">Troubleshooting</h2> -<p>如果行動裝置在安裝或更新 B2G 到新版本後不會正常運作的話,這裡還有一些技巧可以參考。</p> -<h3 class="note" id="如果使用者介面_Gaia_沒有啟動">如果使用者介面 (Gaia) 沒有啟動</h3> -<p>如果您更新您的手機導致使用者介面不會啟動的話,您可以重置手機來清除一些過期的設定或是之類的東西。這樣做可能會讓它回過魂來繼續運作。參考及使用下列指令:</p> -<pre>cd gaia -make reset-gaia -</pre> diff --git a/files/zh-tw/archive/b2g_os/introduction/index.html b/files/zh-tw/archive/b2g_os/introduction/index.html deleted file mode 100644 index 5b0319863d..0000000000 --- a/files/zh-tw/archive/b2g_os/introduction/index.html +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: Firefox OS 簡介 -slug: Archive/B2G_OS/Introduction -translation_of: Archive/B2G_OS/Introduction ---- -<div class="summary"> -<p>Firefox OS 正將無限開拓 Web 的行動界線,且要讓擁有第一支智慧型手機的使用者,能獲得全新的網路體驗。<strong>此開放源碼的行動作業系統,即以</strong> Linux、Open Web 標準、Mozilla 的 Gecko 技術為基礎,勢將重新定義「行動平台」。</p> - -<p>在導入 WebAPI 以存取硬體功能,並提供直覺且豐富的智慧型手機體驗之後,Mozilla 相信 Web 必將成為開發者的絕佳機會,讓更多消費者能觸及有趣且多樣的產品。</p> -</div> - -<h2 id="目標客戶">目標客戶</h2> - -<p>此一系列說明文件,主要將讓 Web\平台開發者能夠進一步了解 Firefox OS 的運作方式、貢獻專案的方法,並打造自己的客製化軟體版本以利安裝於裝置之上。若是想建立並發佈自己的 Web App,亦可透過 <a href="https://developer.mozilla.org/en-US/Apps">「應用程式中心 (App Center)」</a>與 <a href="https://developer.mozilla.org/en-US/Marketplace">Marketplace 的「專區 (Zone)」</a>輕鬆達成。</p> - -<h2 id="Firefox_OS_的基本承諾">Firefox OS 的基本承諾</h2> - -<p>對 Web\平台開發者來說,所應了解的最重要部分就是:整個使用者介面 (UI) 就是 Web App,且此 Web App 又能夠顯示並啟動其他的 Web App。不論是修改 UI、撰寫 Firefox OS 上執行的 App,甚至是存取行動裝置硬體與服務,都是透過標準的 Web 技術進行。</p> - -<p>從產品面來看,Firefox OS 已是 Mozilla 的品牌名稱,透過 Boot to Gecko (B2G,為作業系統產品的設計代號) 而提供相關服務。Firefox OS 的 UI 稱為 Gaia,並包含了 OS 的預設 App 與系統功能。</p> - -<p>若要進一步了解平台架構,可參閱《<a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform">平台指南</a>》。</p> - -<h2 id="目前與未來的規劃">目前與未來的規劃</h2> - -<p>現正開發 Firefox OS 2.0 版,且 1.3/1.4 版已經趨於穩定。目前市面上已有多款手機,消費者或開發者所適用的型號均有。若要進一步了解,可參閱:</p> - -<ul> - <li>Firefox OS <a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases">開發者版本說明</a>:各版本新支援的功能。</li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide">手機指南</a>:目前市面上的手機型號。</li> - <li><a href="https://wiki.mozilla.org/B2G/Roadmap">B2G 規劃</a>:Firefox OS 的進度表及時間表。</li> -</ul> - -<h3 id="版本週期">版本週期</h3> - -<p>從 Firefox OS 1.2 開始,Firefox OS 版本週期即已儘量同步於 Gecko 與 Firefox 桌面版的版本週期 (即 6 週)。現每 3 個月即釋出新版本 Firefox OS,因此每 2 個 Gecko (Firefox 瀏覽器核心) 版本週期就會釋出 1 次新版本 Firefox OS。</p> - -<p>舉例來說,Gecko 30 即與 Firefox OS 1.4 一同釋出 (跨過 Gecko 29);Gecko 32 即與 Firefox OS 2.0 (本為 1.5) 一同釋出 (跨過 Gecko 31)。</p> - -<div class="note"> -<p><strong>注意:</strong>可參閱我們的<a href="https://wiki.mozilla.org/RapidRelease/Calendar">版本釋出排程</a>,確認 Firefox OS 與 Gecko\桌面版 Firefox 之間的對應版本,另可參閱 <a href="https://wiki.mozilla.org/Release_Management/FirefoxOS/Release_Milestones">Firefox OS Release Milestones</a> 進一步了解版本管理的相關細節。</p> -</div> - -<h2 id="社群">社群</h2> - -<p>Boot to Gecko 與 Gaia 均是由 Mozilla 內部的工程師團隊開發而得,另加上 Mozilla 外部與開放源碼社群的一同貢獻。如果你想聯繫 Firefox OS 或 Gaia 開發的社群,則可利用下列的郵件群組與 IRC 頻道。</p> - -<p>同樣的,可使用 Bugzilla 系統提報 <a href="https://bugzilla.mozilla.org/describecomponents.cgi?product=Firefox%20OS">Firefox OS 元件</a>的任何問題。如果你不確定哪些元件應該提報問題,歡迎隨時發問。</p> - -<div class="note"> -<p><strong>注意:</strong>如果你對 B2G/Gaia 原始碼的特定部分 (例如特定的 Gaia App) 有任何問題或意見,則可在 <a href="https://wiki.mozilla.org/Modules/FirefoxOS">Firefox Modules 頁面</a>上找到特定聯絡細節。</p> -</div> - -<h2 id="打造作業系統">打造作業系統</h2> - -<p>B2G 作業系統是以 Mozilla 的 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Gecko">Gecko</a> 繪圖引擎為基礎,並從 Linux kernel 以及稱為 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Gonk">Gonk</a> 的硬體抽象層 (Hardware Abstraction Layer,HAL) 延伸。這裡所說的 Gecko,基本上就是 Firefox for Android 或 Windows 或 Mac OS X 所用的相同 Gecko。而 Gonk 就是 Gecko 所衍生的另項系統。</p> - -<p>若要進一步打造並安裝 Firefox OS,可參閱《<a href="https://developer.mozilla.org/zh-TW/Firefox_OS/Building_and_installing_Firefox_OS">建立並安裝 Firefox OS</a>》。你也可以<a href="https://github.com/mozilla-b2g/B2G">到 Github 找到 B2G 的原始碼</a>。</p> - -<h2 id="貢獻_Gaia">貢獻 Gaia</h2> - -<p>若想為 Gaia 貢獻,其實並不需要深入了解 Web 的開發概念。如果要入門 Gaia 並執行,可參閱《<a href="https://developer.mozilla.org/en-US/Firefox_OS/Hacking_Firefox_OS/Quickstart_guide_to_Gaia_development">入門開發 Gaia</a>》。</p> - -<p>還有許多有用的工具,可讓你針對 Gaia 與 Firefox OS 的 Web App 進行除錯。若要進一步了解,亦可參閱《<a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia/Hacking">Hacking Gaia</a>》。</p> - -<h2 id="開發_Firefox_OS_的_App">開發 Firefox OS 的 App</h2> - -<p>Firefox OS App 同樣是以標準的 Web 技術 (如 HTML、CSS、JavaScript 等等) 所打造而成。如果你本來就是 Web 開發者,就已經具備了大部分的技術。另必須知道數個特定的 JavaScript API,以利存取裝置的硬體與重要功能 (如相機、陀螺儀、光線感測器、聯絡人資訊、系統警示\通知......)。這些也同樣能參閱<a href="https://developer.mozilla.org/en-US/Apps">應用程式中心</a>與 <a href="https://developer.mozilla.org/en-US/docs/Web">Web 平台</a>頁面獲得更多資訊。</p> - -<div class="note"> -<p><strong>注意:</strong>如果你剛開始打造 Open Web/Firefox OS App,或想要初步了解 Web App 與傳統網頁之間的差異,可參閱《<a href="https://developer.mozilla.org/en-US/Apps/Quickstart">App 迅速入門指南</a>》。</p> -</div> - -<h3 id="支援_Firefox_OS_的多個版本">支援 Firefox OS 的多個版本</h3> - -<p>在開發 Firefox OS 的 App 時,必須留意消費者手上的裝置到底搭載了哪個版本 (可參閱<a href="https://developer.mozilla.org/en-US/Firefox_OS/Developer_phone_guide/Phone_specs#Firefox_OS_phones_available">目前可用手機表</a>)。另請注意,更新手機平台軟體,可不像更新桌面版軟體一樣簡單。消費者往往受制於網路服務供應商。因此開發者應該讓 App 能夠支援不同的版本。舉例來說,multiline 的「Flexbox」就無法在 Firefox OS 1.3 以下的版本中執行。你可能必須使用較簡單的配置函式,或退而使用較舊的版本。</p> - -<p>隨著有越來越多消費性的 Firefox OS 裝置上市,並搭載更高版本的 Firefox OS,這個問題很快就能解決。</p> - -<div class="warning"> -<p>我們目前建議能針對 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Releases/1.1">Firefox OS 1.1</a> 版本的特性來開發 App。</p> -</div> - -<div class="note"> -<p><strong>注意:</strong>MDN 上的《<a href="https://developer.mozilla.org/en-US/docs/Web">Web 平台參考頁面</a>》,包含瀏覽器\平台的支援資訊。另可到《<a href="https://developer.mozilla.org/en-US/Apps/Reference">Apps API Reference</a>》找到特定 App 技術的相關資訊。</p> -</div> diff --git a/files/zh-tw/archive/b2g_os/phone_guide/flame/index.html b/files/zh-tw/archive/b2g_os/phone_guide/flame/index.html deleted file mode 100644 index 60b3a7ad8f..0000000000 --- a/files/zh-tw/archive/b2g_os/phone_guide/flame/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Firefox OS 參考平台手機「Flame」 -slug: Archive/B2G_OS/Phone_guide/Flame -translation_of: Archive/B2G_OS/Phone_guide/Flame ---- -<div class="note"> - <p><strong>Flame 的更新檔案</strong>:我們建議你加入下方的郵件群組,即可收到軟體版本定期更新檔案,以及其他可影響 Flame 效能的檔案:<a href="https://mail.mozilla.org/listinfo/flamenews">https://mail.mozilla.org/listinfo/flamenews</a></p> -</div> -<p><img alt="A picture of the Flame device, showing the Firefox OS homescreen containing several app icons." src="https://mdn.mozillademos.org/files/8373/flame-dev-hud.png" style="float: left; margin-right: 50px; margin-bottom: 20px; width: 25%;"></p> -<h2 id="Available_to_order" style="text-indent: 100%; white-space: nowrap; overflow: hidden; margin: 0; height: 0;">Available to order</h2> -<p>專為開發者所設計的「Flame」參考平台手機,是 Firefox OS 相關裝置的里程碑。Flame 的硬體規格均為一時之選,包含 FWVGA 顯示功能與雙核心處理器,可協助開發者打造絕佳的內容與經驗。且單一硬體平台同樣適合測試人員,可更輕鬆的測試並找出軟體問題,不必擔心裝置型號既有的特定問題。</p> -<p style="">如果你手上有 Flame,也打算開始把玩、開發\發佈 App,或為 Firefox 平台有所貢獻,則應先參閱下列連結:</p> -<ul> - <li><a href="https://developer.mozilla.org/zh-TW/Firefox_OS">Firefox OS 專區</a>:可打造自己的 Firefox OS 版本,並貢獻到 B2G 與 Gaia 專案。</li> - <li><a href="https://developer.mozilla.org/zh-TW/Apps">應用程式中心</a>:打造 Open Web App 並相容於 Firefox OS。</li> - <li><a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace">Marketplace 專區</a>:發佈 App 所需的各種資訊。</li> - <li><a href="https://marketplace.firefox.com/">Firefox Marketplace</a>:尋找並發佈 Firefox OS 新 App 的最佳去處。</li> -</ul> -<p style="">如果你想進一步了解作業系統的更新程序、探索手機的其他部分、將 App 送入手機,或觀看手機本身的規格,則可從下列 2 篇文章中找到相關資訊:</p> -<ul> - <li style=""><a href="/en-US/Firefox_OS/Developer_phone_guide/Flame/Initial_setup">初始設定</a> — 設定電腦的必要步驟,才能妥善配合 Flame。</li> - <li style=""><a href="/en-US/Firefox_OS/Developer_phone_guide/Flame/Updating_your_Flame">更新自己的 Flame</a> — 更新 Flame 上的 Firefox OS,將 App 送入手機之後,即可測試 App 並排解疑難雜症。</li> -</ul> -<h2 id="購買_Flame">購買 Flame</h2> -<p>Flame 銷售已經告一段落。但我們仍為 Mozilla 貢獻者保留了許多機會要免費送出手機,包含第二輪的 Foxtrot 方案。如果你想免費獲得手機,請儘速聯絡 IRC 上的 Asa Dotzler。</p> -<h2 id="連線網路與裝置的規格">連線網路與裝置的規格</h2> -<p><strong>連線網路:</strong></p> -<ul> - <li>802.11b/g/n 無線網路</li> - <li>GSM 850/900/1800/1900MHz</li> - <li>UMTS 850/900/1900/2100MHz</li> -</ul> -<p><strong>硬體:</strong>請透過<a href="/en-US/Firefox_OS/Developer_phone_guide/Phone_specs">手機與裝置的規格頁面</a>找到更多硬體特色。</p> -<p>其他特色包含:</p> -<ul> - <li>NFC</li> - <li>Bluetooth 3.0</li> - <li>加速規</li> - <li>FM 收音機</li> - <li>距離感測器</li> - <li>GPS 並支援 A-GPS</li> - <li>環境光源感測器</li> -</ul> -<h2 id="另請參閱">另請參閱</h2> -<ul> - <li style=""><a href="/en-US/Firefox_OS/Developer_phone_guide/Flame/Initial_setup">初始設定</a> — 設定電腦的必要步驟,才能妥善配合 Flame。</li> - <li style=""><a href="/en-US/Firefox_OS/Developer_phone_guide/Flame/Updating_your_Flame">更新自己的 Flame</a> — 更新 Flame 上的 Firefox OS,將 App 送入手機之後,即可測試 App 並排解疑難雜症。</li> - <li><a href="http://blog.mozilla.com.tw/posts/6263/">Flame 開發入門</a>:技術傳教士 Chris Heilmann 錄製的相關影片。</li> - <li><a href="http://mozilla.github.io/flame-on/">Flame On</a>:由擁有 Flame 的開發者在 Mozilla Festival 2014 所打造的絕佳網頁。</li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/phone_guide/index.html b/files/zh-tw/archive/b2g_os/phone_guide/index.html deleted file mode 100644 index 7e301af2de..0000000000 --- a/files/zh-tw/archive/b2g_os/phone_guide/index.html +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Boot to Gecko 開發者手機指南 -slug: Archive/B2G_OS/Phone_guide -translation_of: Archive/B2G_OS/Phone_guide ---- -<p>如果您已經從 Mozilla 收到了可以運作 B2G 的開發者手機,或是已經有人幫您將 B2G 安裝好在您的手機上的話,這裡有一份 <a href="https://wiki.mozilla.org/B2G/DeveloperPhone" class="link-https" title="https://wiki.mozilla.org/B2G/DeveloperPhone">關於手機運作的基礎指南</a>。我們正在改善這個部分,也希望可以快一點放更有效率的指令放上 MSN。如果您對建置/燒錄有興趣,請看 <a href="/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment" title="Setting up & building Boot to Gecko">'設定和建置 Boot to Gecko'</a> 章節,裡面有更細節的資訊。</p> diff --git a/files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html b/files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html deleted file mode 100644 index 36ababcb56..0000000000 --- a/files/zh-tw/archive/b2g_os/phone_guide/zte_open/index.html +++ /dev/null @@ -1,287 +0,0 @@ ---- -title: The Firefox OS ZTE OPEN -slug: Archive/B2G_OS/Phone_guide/ZTE_OPEN -translation_of: Archive/B2G_OS/Phone_guide/ZTE_OPEN ---- -<div class="summary"> -<p>Mozilla 與 ZTE 共同合作開發了 ZTE Open。ZTE Open 是一款為開發者和早期接受者所開發的 Firefox OS 裝置,它已解鎖、開放用於測試和實驗。</p> -</div> - -<div class="note"> -<p><strong>Note</strong>: 本指南不適用於 ZTE Open C 裝置,針對 ZTE Open C 請參考 <a href="/en-US/Firefox_OS/Developer_phone_guide/ZTE_OPEN_C">ZTE Open C</a> 頁面。</p> -</div> - -<h2 id="購買裝置">購買裝置</h2> - -<p>請連至 ZTE 美國、歐洲或香港 ebay 商店購買。</p> - -<ul> - <li><a href="http://stores.ebay.com/ztemobileuk">Buy from UK eBay store</a></li> - <li><a href="http://stores.ebay.com/zteauthorizedstoreus/">Buy from US eBay store</a></li> - <li><a href="http://www.ebay.com/itm/331031989534">Buy from Hong Kong page</a></li> -</ul> - -<h2 id="升級_Firefox_OS">升級 Firefox OS</h2> - -<p>接下來我們將提供升級 ZTE Open 的說明指示:</p> - -<h3 id="一般">一般</h3> - -<p>一般 Firefox OS 的建置、更新和測試都是透過用 USB 連接電腦和手機後,利用 ADB (Android Debugging Bridge) 以及 Fastboot 發送指令進行操作,所以我們需要安裝 ADB 以及 fastboot 到電腦上 (可至 <a href="http://developer.android.com/sdk/index.html" title="Android Developer Tookit">Android Developer Toolkit</a> 取得) ,並不需要安裝整個 Android 開發工具包,adb 以及 fastboot 可以到 <code>/platform-tools/</code> 資料夾找到。</p> - -<p>然後,請打開手機的遠端除錯選項<a href="/en-US/Firefox_OS/Debugging/Developer_settings#Remote_debugging">,enable remote debugging</a>。</p> - -<h3 id="Firefox_OS_1.1">Firefox OS 1.1</h3> - -<p>2013/12/10,ZTE 發佈了 ZTE Open 的 Firefox OS 1.1 更新包,<strong>這個更新開啟了 fastboot</strong>, 解決了前一個發佈版本這方面的問題。</p> - -<p>在升級到 v1.2 前,最好先升級到 v1.1。升級 v1.1 首先先到 <a href="http://www.ztedevices.com/support/smart_phone/b5a2981a-1714-4ac7-89e1-630e93e220f8.html">OPEN (American Standard</a> 或 <a href="http://www.ztedevices.com/support/smart_phone/cba40ed6-d3ab-44c0-bdee-3a15803dc187.html">OPEN (European Standard)</a> 下載升級包,請注意我們需要下載對應 OS 版本,所以從 v1.0 升級的人請下載 "V1.1.0B02(for V1.0)",下載檔案中同時也含有說明文件。接下來請解開下載檔案按照以下步驟升級你的 ZTE Open。</p> - -<div class="note"> -<p><strong>Note</strong>: 使用者資料會在 microSD 卡升級過程中被刪除,請先<a href="https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites#Backup_the_phone_system_partition">備份你的資料</a> 。</p> -</div> - -<p>以下是透過 microSD 卡升級步驟:</p> - -<ol> - <li>關機、打開背蓋、取下電池背後的 microSD 記憶卡。</li> - <li>將 SD 卡插入電腦。</li> - <li>把下載的 <strong>US_DEV_FFOS_V1.1.0B04_UNFUS_SD.zip</strong> 或 <strong>EU_DEV_FFOS_V1.1.0B04_UNFUS_SD.zip</strong> (看你下載的版本) 複製到 microSD 卡的 root 底下,請不要解開 zip 檔。</li> - <li>卸除 SD 卡、裝回到手機上。</li> - <li>同時按下音量向上鍵和電源鍵。音量向上鍵位於手機左側長條型按鍵的上半部。兩顆鍵同時按下後會進入 Firefox OS recovery 模式 (注意 Firefox logo 會先出現一陣子再進入 recovery 模式)。</li> - <li>按音量上下鍵再選項間移動,請選擇 “<strong>apply update from external storage</strong>.”</li> - <li>按電源鍵確認選項後會看見 microSD 卡裡的檔案列表。</li> - <li>再用音量上下鍵選擇你剛剛複製過來的軔體檔 <strong>US_DEV_FFOS_V1.1.0B04_UNFUS_SD.zip</strong> 或 <strong>EU_DEV_FFOS_V1.1.0B04_UNFUS_SD.zip</strong>,然後按電源鍵確認。</li> -</ol> - -<p>如果一切順利的話,你會看到一連串訊息,當你看到 <em>“<strong>Install from sdcard complete</strong>.”</em> 那就代表升級完成,請選擇 “reboot system now” 重新開機,重新開機後你將會看到手機第一次啟動的設定頁面。</p> - -<h3 id="Firefox_OS_1.2">Firefox OS 1.2</h3> - -<p>2014, 1月,ZTE 發佈了一版 Firefox OS v1.2 beta 版 (fastboot 開啟、擁有 root 權限),此 beta 版本基本上是由 v1.1 baseline + v1.2 Gecko 與 Gaia, 而且不需要把檔案放在 microSD 卡中。</p> - -<p>請先確認 v1.1 已經上面說明安裝完成,接著打開 terminal 然後輸入以下指令確認連線建立成功:</p> - -<pre class="brush: bash">adb devices -l -</pre> - -<p>如果連線成功,你會看到類似 "roamer2 device usb:2-1.2" 的回應訊息。</p> - -<p>請前往 ZTE 建立的 Dropbox 帳戶下載對應 OS: <a href="https://www.dropbox.com/sh/rnj3rja7gd54s98/32KXfFmedN/P752D04_DEV_US_20131212_v1.2.7z" title="Firefox OS 1.2 build for ZTE Open US">US 版</a> 或 <a href="https://www.dropbox.com/sh/rnj3rja7gd54s98/_twgXEkMFH/P752D04_DEV_EU_20131212_v1.2.7z" title="Firefox OS 1.2 build for ZTE Open UK">UK 版,</a>,Windows 使用者可以去<a href="https://www.dropbox.com/sh/rnj3rja7gd54s98/6ZoJwmlRjn/Installation%20Instruction.docx" title="Special upgrade instructions for Windows users">下載特殊說明</a>還有<a href="https://www.dropbox.com/sh/rnj3rja7gd54s98/-fyi2XHFPG/upgrade_tool" title="Upgrade tool">升級工具</a>來協助安裝新版本。底下的說明指示無需特殊工具、適用於所有作業系統 – Linux, OS X, 和 Windows。</p> - -<p>請解開下載好的檔案,開啟 terminal 進入到解開後的檔案資料夾。請注意以下步驟會刪除個人資料,所以請先<a href="https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites#Backup_the_phone_system_partition">備份</a>好你的資料,接著輸入下列指令:</p> - -<pre class="brush: bash">adb reboot bootloader</pre> - -<p>這個指令會讓裝置重開機,由於 fastboot 只在重開機過程中有效,請在重開機中輸入以下指令:</p> - -<pre class="brush: bash">sudo fastboot devices -</pre> - -<p>如果看到 "< waiting for device >" 訊息,請按下 Ctrl-C 並且再次輸入指令直到看見 "ROAMER2 fastboot" 之類的訊息回應。</p> - -<p>接著請快速在重開機當中輸入下面指令:</p> - -<pre class="brush: bash">fastboot flash boot boot.img -fastboot flash userdata userdata.img -fastboot flash system system.img -fastboot flash recovery recovery.img -fastboot erase cache -fastboot reboot</pre> - -<div class="note"> -<p><strong>Note</strong>: 如果一直看到 "< waiting for device >" 訊息,請嘗試在指令開頭前加上 <strong>sudo</strong> ,例如 "sudo falshboot flash boot boot.img"。</p> -</div> - -<p>如果來不及輸入完指令,請從 "adb reboot bootloader" 指令開始再試一次。</p> - -<p>一切順利的話,重開機後又會看到第一次手機啟用頁面,ZTE Open 此刻已經升級到 v1.2,進入系統後會看到許多測試 app ,請隨意自由自由刪除。</p> - -<div class="note"> -<p><strong>Note</strong>: <a href="https://hacks.mozilla.org/2014/01/upgrading-your-zte-open-to-firefox-1-1-or-1-2-fastboot-enabled/">Upgrading your ZTE Open to Firefox 1.1 or 1.2 (fastboot enabled)</a> 由 <span class="url">Frédéric Harper</span> 所撰寫的文章也提供了有用的安裝步驟說明。</p> -</div> - -<div class="note"> -<p><strong>Note</strong>: ZTE Open 的 v1.2 版有一個通知欄無法展開的問題,這個問題可以藉由燒錄最新的 Firefox OS 1.2 工程版解決,請確認 <a href="/en-US/Firefox_OS/Debugging/Installing_ADB">ADB 安裝好了</a> 還有 <a href="/en-US/Firefox_OS/Debugging/Developer_settings#Debugging_via_USB">遠端除錯</a> 開啟,然後在 terminal 輸入下面指令:<br> - <br> - <code>git clone -b v1.2 <a href="https://github.com/mozilla-b2g/gaia.git" rel="nofollow">https://github.com/mozilla-b2g/gaia.git</a> gaia_v1.2<br> - cd gaia_v1.2<br> - make reset-gaia</code></p> -</div> - -<h3 id="Firefox_OS_1.3_and_beyond">Firefox OS 1.3 and beyond</h3> - -<p>ZTE currently haven't released builds for Firefox OS 1.3 and beyond. To get these on your ZTE open you'll have to manually <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Building_and_installing_Firefox_OS">build and install a new Firefox OS/B2G</a> build on it (start at the <a href="/en-US/docs/Mozilla/Firefox_OS/Firefox_OS_build_prerequisites">build prerequisite</a> instructions, and treat the ZTE like it is an Inari device, for the purposes of configuration). You can recover your phone if necessary, using the procedure cited in the {{ anch("I bricked my phone") }} section.</p> - -<h2 id="Phone_features">Phone features</h2> - -<ul> - <li>CPU Qualcomm MSM7225A 1.0Ghz</li> - <li>UMTS 850/1900 or UMTS900/2100</li> - <li>GSM 850/900/1800/1900 (2G EDGE)</li> - <li>Screen 3.5" HVGA</li> - <li>Camera 2 MP (back)</li> - <li>256 MB (RAM)</li> - <li>MicroSD (support up to 32GB)</li> - <li>Battery 1200 mAh</li> - <li>Wifi b, g, n, Bluetooth 2.1 EDR</li> - <li>Light & Prox. Sensor, G-Sensor</li> - <li>Radio FM, GPS</li> - <li>MicroUSB</li> -</ul> - -<div class="note"> -<p><strong>Note</strong>: the Hong Kong phones also support tri-band 3G Networks — HSDPA 850/1900/2100 (850/1900 for US, CA, 850/1900/2100 for Asia, AU, and 900/2100 for EU.)</p> -</div> - -<h2 id="Wireless_carriers">Wireless carriers</h2> - -<div class="warning"> -<p>Pricing information is for reference only and may not be accurate. Visit the associated link for official information.</p> -</div> - -<h3 id="US_carriers">US carriers</h3> - -<h4 id="ATT">AT&T</h4> - -<ul> - <li><a href="http://www.att.com/shop/wireless.html">Website</a></li> - <li>Nationwide coverage for 2G EDGE and 3G</li> -</ul> - -<h5 id="Sampling_of_prepaid_ATT_plans">Sampling of prepaid AT&T plans</h5> - -<p><a href="http://www.att.com/shop/wireless/gophone.html">Prepaid GoPhone®</a>, Smartphone Plans</p> - -<ul> - <li>$25/month, $5/50MB 3G data</li> - <li>$60/month with 2GB data, $10/GB additional 3G data</li> -</ul> - -<h4 id="Aio">Aio</h4> - -<ul> - <li><a href="http://www.aiowireless.com/home.html">Website</a></li> - <li>{{ anch("AT&T") }}'s own MVNO</li> -</ul> - -<h5 id="Sampling_of_prepaid_Aio_plans">Sampling of prepaid Aio plans</h5> - -<ul> - <li>Aio Smart - $55/month with 2GB 3G data, $10/GB additional 3G data</li> - <li>Aio Pro - $70/month with 7GB 3G data, $10/GB additional 3G data</li> -</ul> - -<h4 id="Good2GO">Good2GO</h4> - -<ul> - <li><a href="https://us.good2gomobile.com/">Website</a></li> - <li>{{ anch("AT&T") }} MVNO</li> -</ul> - -<h5 id="Sampling_of_prepaid_Good2GO_plans">Sampling of prepaid Good2GO plans</h5> - -<ul> - <li>$50/month with 1GB 3G data, $20/GB additional 3G data</li> -</ul> - -<h4 id="Other_anch(ATT)_MVNOs">Other {{ anch("AT&T") }} MVNOs</h4> - -<p>These carriers do not offer additional 3G data.</p> - -<ul> - <li><a href="http://goredpocket.com/">RedPocket</a></li> - <li><a href="http://www.net10wireless.com/">Net10</a></li> - <li><a href="http://www.straighttalk.com/">Straight Talk</a></li> - <li><a href="https://www.airvoicewireless.com/">Airvoice</a></li> -</ul> - -<h4 id="T-Mobile">T-Mobile</h4> - -<ul> - <li><a href="http://www.t-mobile.com/">Website</a></li> - <li>Nationwide coverage for 2G EDGE, limited metropolitan coverage for 3G</li> -</ul> - -<h3 id="Canadian_carriers">Canadian carriers</h3> - -<p>The US version of the ZTE Open also work in Canada on carriers that use the Bell/Telus network, or the Rogers network. Some regional carriers like Sasktel or MTS that have UMTS should work too.</p> - -<p>It will not work on carriers that do not use UMTS or GSM, like Public Mobile, nor on the carriers that use the AWS band like WIND Mobile, Mobilicity, Videotron or Eastlink.</p> - -<h2 id="Memory_card">Memory card</h2> - -<h3 id="File_system">File system</h3> - -<p>In order to be recognized by the phone, the MicroSD card must be formatted as a FAT32 file system. If a card is new or has never been reformatted, it should work as is.</p> - -<h2 id="Device_revisions">Device revisions</h2> - -<h3 id="Revision_01">Revision 01</h3> - -<p>Phones produced before 09/27/2013 do not have fastboot enabled and must be updated. Normally, this would be handled by Software Updates, but since some users have reported trouble with this method, ZTE have made SD card packages available to enable fastboot on earlier devices. Flash images for:</p> - -<ul> - <li><a href="http://www.ztedevices.com/support/smart_phone/b5a2981a-1714-4ac7-89e1-630e93e220f8.html">Phones purchased at ZTE eBay US/Hong Kong store</a></li> - <li><a href="http://www.ztedevices.com/support/smart_phone/cba40ed6-d3ab-44c0-bdee-3a15803dc187.html">Phones purchased at ZTE eBay UK store</a></li> -</ul> - -<p>The zip file is linked under Downloads. Note that you need to download the version with your OS revision in it (that is, download the "V1.1.0B02(for V1.0)" if you are upgrading <em>from</em> V1.0). Once the file is downloaded and unzipped, follow the instructions in the bundled PDF to flash the package to your phone.</p> - -<p>Related Support Forum Questions:</p> - -<ul> - <li><a href="https://support.mozilla.org/en-US/questions/971252">ZTE Open update crashes</a></li> - <li><a href="https://support.mozilla.org/en-US/questions/967817">Why is my ZTE Open unable to update Firefox OS?</a></li> - <li><a href="https://support.mozilla.org/en-US/questions/976414?page=3">How can I unbrick ZTE Open with adb debug Disabled?</a></li> -</ul> - -<h3 id="Revision_02">Revision 02</h3> - -<p>Phones produced on or after 09/27/2013 are fastboot enabled by default. <strong>This includes the Hong Kong phones.</strong></p> - -<div class="note"> -<p><strong>Note</strong>: If you are unsure of your phone's revision, check it in <strong>Settings > Device Information > Software</strong>. If it is older than the following version numbers, you will need to update your phone using the above SD packages to enable fastboot.</p> - -<ul> - <li>Phones from UK store:OPEN_EU_DEV_FFOS_V1.0.0B02</li> - <li>Phones from US store:OPEN_US_DEV_FFOS_V1.0.0B02 <em>(Some phones may display this version incorrectly, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=916098#c39">bug 916098</a>.)</em></li> -</ul> -</div> - -<h2 id="Device_support">Device support</h2> - -<p>Once your phone has {{ anch("Device revisions","fastboot enabled") }}, you will then be able to <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Building_and_installing_Firefox_OS">build and install new Firefox OS/B2G</a> builds on it (start at the <a href="/en-US/docs/Mozilla/Firefox_OS/Firefox_OS_build_prerequisites">build prerequisite</a> instructions, and treat the ZTE like it is an Inari device, for the purposes of configuration), and recover your phone if necessary, using the procedure cited in the {{ anch("I bricked my phone") }} section.</p> - -<p>If you encounter errors about setting the system time while flashing a custom build, you may need to download a <a href="http://sl.edujose.org/2013/10/adapted-boot-image-for-use-with-b2g.html">modified boot image</a>.</p> - -<h3 id="I_bricked_my_phone">I bricked my phone</h3> - -<p>If you are in the process of modifying your phone and it becomes “unresponsive” you should be able to recover it using fastboot with the following simple procedure.</p> - -<p>First remove the USB cable and then remove the battery from the phone for 30 seconds. Then reinsert the battery and press the volume up button while holding the power button for a few seconds. Next reconnect the USB cable and run the following commands from a terminal window in the directory that contains the SD package files described above (it is worth checking for an update to the SD package before you do this):</p> - -<pre class="brush: bash" lang="bash">fastboot flash recovery recovery.img -fastboot flash boot boot.img -fastboot flash userdata userdata.img -fastboot flash system system.img -fastboot reboot -</pre> - -<p>This process should recover your phone. If it doesn't seem to work, you may have to try it a second time.</p> - -<h3 id="Headphones_not_working">Headphones not working?</h3> - -<p>We found that the headset jack is designed by a Chinese manufacturer that has compatibility problems with other brands of headsets that include microphones. You may have voice mute problems when you try to use headsets made by Apple, Samsung, HTC, and others. You can buy a 3.5 mm headset adapter that reverses the microphone and ground pins to avoid this problem. For more information, see {{ Bug("812607") }}.</p> - -<h3 id="Other_support_notes">Other support notes</h3> - -<p>Some customers have come across an Issue of FOTA updates failing to enable fastboot; this is still under investigation, and we are assisting ZTE to analyze every scenario. We will post more information as it is available.</p> - -<p>If your phone was unfortunately damaged during the FOTA update because of ZTE providing false or wrong update files, you can attempt to restore it to factory settings using the appropriate SD image and instructions referenced in {{ anch("Revision 01") }}. Otherwise, send your phone back to the eBay store you purchased it from in exchange for a new one. You may contact the store owner directly via an eBay message.</p> - -<h2 id="See_also">See also</h2> - -<p><a href="https://marketplace.firefox.com/developers/dev_phone">Official Dev Phone page on Firefox Marketplace</a></p> - -<p><a href="http://www.movistar.co/documentos/manualesProductos/ZTE_Mozilla_Open_P752-Manual_de_Usuario.pdf">Draft User Manual [en-US]</a> - PDF</p> diff --git a/files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html b/files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html deleted file mode 100644 index 2524c81d0b..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/apps_architecture/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Firefox OS apps 架構 -slug: Archive/B2G_OS/Platform/Apps_architecture -translation_of: Archive/B2G_OS/Platform/Apps_architecture ---- -<div class="summary"> - <p>本文旨在說明 Firefox OS 內部如何管理和啟動應用程式,主要是針對 Firefox OS 平台開發者以及正在移植 Firefox OS 到新硬體裝置上的開發者,如果你只是一個單純 App 開發者並不會需要知道,不過有興趣的話還是可以看看了解 Firefox OS。</p> -</div> -<h2 id="App_啟動程序">App 啟動程序</h2> -<p>當 app 被啟動時,主畫面 app (Home screen app) 會透過 {{domxref("App")}} API 取得 app 的參照,然後呼叫 {{domxref("App.launch()")}} 方法來啟動 app。</p> -<p>Gecko 收到相關請求後會發送一個含有 app 詳細資訊的 {{domxref("mozChromeEvent")}} 到系統 app (System app),系統 app 接著會將一個 {{HTMLElement("iframe")}} 加入 DOM 樹(DOM tree)中,然後將 app 載入該 {{HTMLElement("iframe")}} 裡,直到 app 終止前這個 iframe 就是 app 的家。</p> -<p>每一支 app 都需要一個描述該 app 的 manifest 檔,app 包也需要遵照特定檔案階層,詳情請見 <a href="/en-US/docs/Web/Apps/App_Manifest">App manifest</a>。</p> -<h2 id="和_Gecko_溝通">和 Gecko 溝通</h2> -<p>Gecko 和 Gaia' 系統 app 之間的溝通是經由 {{domxref("mozChromeEvent")}} 以及 {{domxref("mozContentEvent")}} 完成。 <code>mozChromeEvent</code>s 是從 chrome 廣播到內容,而 <code>mozContentEvent</code>s 是從內容廣播到 chrome,這些溝通主要在控管受信任 UI 的創建與終止,還有在為通知和其他任務,包括通知系統 app 啟動某個 app,提供必要的功能。</p> -<div class="note"> - <p><strong>Note:</strong> 請參考 <a href="/en-US/Firefox_OS/Platform/Gaia/Gaia_apps/System">System app 文件</a> 以取得更多有關這些事件如何運作的細節,同時也可以參考相關的原始碼 {{source("b2g/chrome/content/shell.js")}}。</p> -</div> -<h2 id="延伸閱讀">延伸閱讀</h2> -<ul> - <li><a href="/en-US/docs/Web/Apps">Apps</a></li> - <li>{{domxref("App")}}</li> - <li><a href="/en-US/Firefox_OS/Platform/Gaia/Gaia_apps/System">System app</a></li> - <li><a href="/en-US/Firefox_OS/Platform/Architecture">Firefox OS architecture</a></li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html b/files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html deleted file mode 100644 index 4a284db78e..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gaia/gaia_apps/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Gaia apps -slug: Archive/B2G_OS/Platform/Gaia/Gaia_apps -translation_of: Archive/B2G_OS/Platform/Gaia/Gaia_apps ---- -<div class="summary"> - <p><span class="seoSummary">Gaia 位在 Firefox OS 的上層,其中包含系統管理功能以及一系列 Firefox OS 內建 apps。所有 Gaia 的原始碼 — 即便系統和鍵盤輸入法 — 都是由 HTML5 (HTML + CSS + JavaScript) 和 Open WebAPIs 技術所建構而成的,本文旨在說明 Gaia 內建的 apps 是如何運作之。</span></p> -</div> -<h2 id="Gaia_功能類別">Gaia 功能類別</h2> -<p>Gaia 內不同的 apps 大致上可以分成以下幾類。</p> -<div class="note"> - <p><strong>Note</strong>: 許多 app 運作說明都會連結到 <a href="https://github.com/mozilla-b2g/gaia/">Gaia Github repo</a> 上的 README 頁面,那是因為很多 app 都還在快速開發迭代階段,常常會有更動,所以一直更新 MDN 相當不切實際,如果想要進一步獲取最新的資訊,請再參考各 README 頁面。</p> -</div> -<h3 id="平台類">平台類</h3> -<p>包括系統、設定、螢幕鎖定、建置腳本和藍芽 apps。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/7503/platform_team.png" style="width: 355px; height: 269px; margin: 0px auto; display: block;"></p> -<h4 id="平台類_apps">平台類 apps:</h4> -<dl> - <dt> - <a href="/en-US/Firefox_OS/Platform/Gaia/Gaia_apps/System">系統 (System)</a></dt> - <dd> - System app 是第一個在 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Architecture#Firefox_OS_bootup_procedure">Firefox OS 開機程序 </a>中被 Gecko 載入的web app,它負責處理許許多多系統運行工作,所以不算是在一般個別 web app 的範疇內。</dd> - <dt> - <a href="/en-US/Firefox_OS/Platform/Gaia/Gaia_apps/Browser">瀏覽器 (Browser)</a></dt> - <dd> - Browser app (現在算是 System 一部分) 當有相關需求時,如網頁瀏覽、搜尋或書籤標記,提供瀏覽器類的功能。</dd> - <dt> - <a href="/en-US/Firefox_OS/Platform/Gaia/Gaia_apps/Window_Management">視窗管理 (Window Management)</a></dt> - <dd> - Firefox OS 視窗管理功能 — 包括 app 生命週期和互動、通知、動畫等等 — 由 System app 特定一塊負責。</dd> - <dt> - <a href="/en-US/Firefox_OS/Platform/Gaia/Gaia_apps/Settings">設定 (Settings)</a></dt> - <dd> - Settings app 讓使用者設定裝置、回應當前活動呼叫 (帶有 <code>configure</code> 名稱的<a href="/en-US/docs/WebAPI/Web_Activities"> Web 活動</a>),讓其他 app 可以跳轉到 Settings app 其中的設定面板處理需要的設定任務 (例如說顯示 wifi 設定面板當數據傳輸無法使用時)。</dd> -</dl> -<h3 id="通訊類">通訊類</h3> -<p>包括 Dialer, Contact, SMS apps 與 FTU apps.</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/7499/comms_team.png" style="width: 317px; height: 246px; margin: 0px auto; display: block;"></p> -<h3 id="生產力類">生產力類</h3> -<p>包括 Email, Calendar, 與 Clock apps.</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/7505/productivity_team.png" style="width: 303px; height: 178px; margin: 0px auto; display: block;"></p> -<h4 id="生產力類_apps">生產力類 apps:</h4> -<dl> - <dt> - <a href="https://github.com/mozilla-b2g/gaia/blob/master/apps/calendar/README.md">日歷 (Calendar)</a></dt> - <dd> - Firefox OS 內建 calendar app.</dd> - <dt> - <a href="https://github.com/mozilla-b2g/gaia/blob/master/apps/clock/README.md">時鐘 (Clock</a>)</dt> - <dd> - Firefox OS 預設 Clock app,具備鬧鈴、計時等功能</dd> - <dt> - <a href="https://github.com/mozilla-b2g/gaia/blob/master/apps/email/README.md">Email</a></dt> - <dd> - Gaia e-mail app.</dd> -</dl> -<h3 id="媒體類">媒體類</h3> -<p>包括 Camera, Gallery, Music, 和 Video apps 等等媒體相關功能,如桌布和轉送 DRM 鎖。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/7501/media_team.png" style="width: 386px; height: 250px; margin: 0px auto; display: block;"></p> -<h4 id="媒體類_apps">媒體類 apps:</h4> -<dl> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Gaia_apps/Video">影音 (Video)</a></dt> - <dd> - Video 是影音媒體撥放器。</dd> - <dt> - <a href="https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/README.md">相機 (Camera)</a></dt> - <dd> - Firefox OS 使用者透過相機照相、錄影,它也會回應 type 為pick 的 <a href="/en-US/docs/WebAPI/Web_Activities">Web 活動</a>,讓其他想使用相機功能的 app 使用相機。</dd> -</dl> -<h3 id="其他_Gaia_特色功能">其他 Gaia 特色功能</h3> -<p>除了上述功能,Gaia 還有其他功能如 browser, homescreen, marketplace, test framework, PDF viewer, 和 app manager 等。</p> -<dl> - <dt> - <a href="https://github.com/mozilla/pdf.js/blob/master/README.md">pdf.js</a></dt> - <dd> - pdf.js 是 HTML5 基礎的 PDF 瀏覽器,Gaia 用其來瀏覽 PDF,請注意 pdf.js 的程式碼庫 (repo) 和 Gaia 是分開來的。</dd> -</dl> diff --git a/files/zh-tw/archive/b2g_os/platform/gaia/index.html b/files/zh-tw/archive/b2g_os/platform/gaia/index.html deleted file mode 100644 index d2a4886cf1..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gaia/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Gaia -slug: Archive/B2G_OS/Platform/Gaia -tags: - - B2G - - Gaia - - Mobile - - NeedsTranslation - - TopicStub -translation_of: Archive/B2G_OS/Platform/Gaia ---- -<p>Gaia is the user interface level of <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS" title="Mozilla/Firefox_OS">Firefox OS</a>. Everything that appears on the screen after Firefox OS starts up is drawn by Gaia, including the lock screen, home screen, dialer, and other applications. Gaia is written entirely in <a href="https://developer.mozilla.org/en-US/docs/en-US/HTML" title="HTML">HTML</a>, <a href="https://developer.mozilla.org/en-US/docs/CSS" title="CSS">CSS</a>, and <a href="https://developer.mozilla.org/en-US/docs/JavaScript" title="JavaScript">JavaScript</a>. Its only interface to the underlying operating system and hardware is through standard Web APIs, which are implemented by <a href="https://developer.mozilla.org/en-US/docs/Gecko" title="Gecko">Gecko</a>.</p> -<p>Because of this design, not only can Gaia be run on Firefox OS devices, but also on other operating systems and in other web browsers (Albeit with potentially degraded functionality depending on the capabilities of the browser).</p> -<p>Third party applications onto the device installed alongside Gaia can be launched by Gaia.</p> -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 class="Documentation" id="Documentation" name="Documentation">Documentation about Gaia</h2> - <dl> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Introduction_to_Gaia" title="Mozilla/Boot_to_Gecko/Introduction to Gaia">Introduction to Gaia</a></dt> - <dd> - Gaia is the user interface application for Firefox OS devices; it's simply a Web application running atop the Firefox OS software stack. This guide introduces Gaia at a high level.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Hacking" title="Mozilla/Boot_to_Gecko/Gaia hacking guide">Gaia hacking guide</a></dt> - <dd> - A guide to hacking and modifying the Gaia interface.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Build_System_Primer" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Build_System_Primer">Gaia Build System Primer</a></dt> - <dd> - Most of the meaniful work for the build steps are performed by the scripts that live inside the build/ subdirectory of Gaia.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Hacking_Tips_And_FAQ" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Hacking_Tips_And_FAQ">Gaia Hacking Tips And FAQ</a></dt> - <dd> - A list of helpful tips and frequently asked questions around hacking on Gaia.</dd> - </dl> - <p><span class="alllinks"><a href="/en-US/docs/tag/Gaia" title="tag/B2G">View All...</a></span></p> - </td> - <td> - <h2 class="Community" id="Community" name="Community">Getting help from the community</h2> - <p>If you're working with Gaia, or developing Gaia applications, there are community resources to help you!</p> - <ul> - <li>Consult the Boot to Gecko project forum: {{ DiscussionList("dev-gaia", "mozilla.dev.gaia") }}</li> - </ul> - <p> </p> - <br> - <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related topics</h2> - <ul> - <li><a href="/en-US/docs/Mobile" title="Mobile">Mobile</a></li> - <li><a href="/en-US/docs/Web" title="/en-US/docs/Web">Web Technology for developer</a> - <ul> - <li><a href="/en-US/docs/HTML" title="HTML">HTML</a></li> - <li><a href="/en-US/docs/CSS" title="CSS">CSS</a></li> - <li><a href="/en-US/docs/JavaScript" title="JavaScript">JavaScript</a></li> - </ul> - </li> - <li><a href="/en-US/docs/WebAPI" title="/en-US/docs/WebAPI">WebAPI</a></li> - </ul> - <h2 class="Tools" id="Resources" name="Resources">Resources</h2> - <ul> - <li><a href="/en-US/docs/Mozilla/Firefox_OS/Architecture" title="Mozilla/Firefox_OS/Architecture">Firefox OS architecture overview</a></li> - </ul> - </td> - </tr> - </tbody> -</table> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html b/files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html deleted file mode 100644 index 27c9ea5ea4..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gaia/introduction_to_gaia/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Gaia 簡介 -slug: Archive/B2G_OS/Platform/Gaia/Introduction_to_Gaia -translation_of: Archive/B2G_OS/Platform/Gaia/Introduction_to_Gaia ---- -<p><a class="external" href="/en/Mozilla/Boot_to_Gecko/Gaia" title="en/Mozilla/Boot_to_Gecko/Gaia">Gaia</a> 是 Boot to Gecko (B2G) 的使用者介面;它只是在 B2G 裝置、模擬器、桌上型電腦版本、或是 Firefox 版本上運作的一個網頁應用程式 (Web application)。如果想要在 Gaia 上添加 apps 程式或是做一些改變的話,所有你需要了解的就是網頁科技 (Web Technologies),例如 <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a>、 <a href="/en/HTML" title="en/HTML">HTML</a>、和 <a href="/en/CSS" title="en/CSS">CSS</a>。</p> -<h2 id="Gaia_的鎖定畫面">Gaia 的鎖定畫面</h2> -<p>鎖定畫面預設是啟動的,而預設解鎖密碼 (PIN) 是「0000」。隨著這個功能會隨著時間愈趨完整。</p> -<h2 id="預設的_Gaia_介面">預設的 Gaia 介面</h2> -<p>Gaia 的預設介面跟大家所見最典型的智慧型手機相仿,如這邊所看到的圖。</p> -<p><a href="/@api/deki/files/6276/=screenshot.png" title="screenshot.png"><img align="left" alt="screenshot.png" class="internal lwrap" src="/@api/deki/files/6276/=screenshot.png?size=webview" style="width: 330px; height: 550px;"></a>這是張 prerelease 版本作業系統的圖,有一些暫時使用的圖示(和一些測試的程式)。頂端的狀態條顯示手機正在使用哪個行動網路 (如果行動裝置沒有網路的話,會顯示「No SIM card」)、行動網路強度、WiFi 訊號強度、電池使用狀態、和現在的時間。</p> -<p>畫面的中間區域顯示應用程式的圖示;透過螢幕的圖示切換左右頁。</p> -<p>在螢幕的底部是一個底座,可以放四個最常用的應用程式。現在底座還不能修改,且被預設顯示播號 (Dialer)、訊息 (Messages)、市集 (Market)、和瀏覽器 (Browser)的程式。</p> diff --git a/files/zh-tw/archive/b2g_os/platform/gonk/index.html b/files/zh-tw/archive/b2g_os/platform/gonk/index.html deleted file mode 100644 index 71d064ac30..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/gonk/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Gonk -slug: Archive/B2G_OS/Platform/Gonk -translation_of: Archive/B2G_OS/Platform/Gonk ---- -<p>{{draft()}}</p> -<div class="summary"> - <p>Gonk是<a href="/en-US/docs/Mozilla/Firefox_OS" style="line-height: 1.5;" title="/en-US/docs/Mozilla/Firefox_OS">Firefox OS</a><span style="line-height: 1.5;">的底層系統,包含基於</span><a class="external" href="http://source.android.com/" style="line-height: 1.5;">Android Open Source Project</a><span style="line-height: 1.5;"> (AOSP)</span><span style="line-height: 1.5;">的Linux核心以及硬體抽象層(hardware abstraction layer, HAL)。本文旨在說明Gonk的組成,更多有關FireFox OS架構以及Gonk是如何配置在其中的細節,請參考</span><a href="/en-US/Firefox_OS/Platform/Architecture" style="line-height: 1.5;">Firefox OS架構</a><span style="line-height: 1.5;">指南。</span></p> -</div> -<h2 id="Gonk_概觀">Gonk 概觀</h2> -<p>在Gecko原始碼中,有一個b2g/資料夾,這個資料夾含有Gonk接口,它為網頁開啟了行動裝置的硬體能力。這其中包含了Linux核心、HAL和其他OEM特定的函式庫(library)。好機個Gonk函式庫是開放原始碼專案,如libusb, bluez等,有些HAL部分則是和Android專案共享,如GPS, camera等。</p> -<p>Gonk是裝置接口層,介於硬體和Gecko之間的配接器。Gonk是一個相對簡單的Linux發布版本,可以視為<a href="/en-US/docs/Gecko" style="line-height: 1.5;">Gecko</a><span style="line-height: 1.5;">的配接目標,就像是Gecko和OS X, Windows和Android的接口。</span></p> -<div class="note"> - <p><strong>Note</strong>: 由於不同的行動裝置有不同的晶片組與硬體規格,所以可能會有不同的Gonk發布版本。</p> -</div> -<p>Firefox OS專案擁有Gonk百分之百的控制權,所以能夠提供Gecko那些原本在其他作業系統上無法看到的介面,例如,Gecko可以直接存取電話系統框架和Gonk的顯示frame buffer。</p> -<h2 id="Gonk_原始碼">Gonk 原始碼</h2> -<p><a href="https://github.com/mozilla-b2g/B2G">B2G repo on Github</a> 上有多種裝置的官方Gonk支援移植,可以視為Gonk的檔案庫。至於裝置支援列表,請見B2G/config.sh。</p> -<p>大部分Gonk相關的日常工作包括了移植Gonk到不同硬體上,還有確保Gecko能在不同硬體上順利運行。</p> -<dl> -</dl> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/platform/index.html b/files/zh-tw/archive/b2g_os/platform/index.html deleted file mode 100644 index fe9474eed5..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Firefox OS 平台 -slug: Archive/B2G_OS/Platform -translation_of: Archive/B2G_OS/Platform ---- -<p><span class="seoSummary">Firefox OS 平台是由多樣的元件所組成。如果你只是要撰寫能在 Firefox OS 上執行的 App,其實不太需要通盤了解其架構。但如果你從事平台開發、平台移植,甚或只是單純好奇的話,也許會對以下說明文件感興趣。</span></p> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 class="Documentation" id="Documentation" name="Documentation">關於 Firefox OS 平台的說明文件</h2> - - <dl> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Introduction" title="en-US/docs/Mozilla/Firefox_OS/Introduction">Firefox OS 架構概述</a></dt> - <dd>簡單概述 Firefox OS 的內部架構,可供平台開發或移植工程師初步了解 Firefox OS。</dd> - <dt> </dt> - <dt><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Apps_architecture" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Apps_architecture">Firefox OS 的 A</a><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Apps_architecture" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Apps_architecture">pp 架構</a></dt> - <dd>概述 Firefox OS 的 App 模型。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Gaia" title="/en-US/docs/Mozilla/Gaia">Gaia</a></dt> - <dd>Gaia 是 Firefox OS 裝置的使用者介面 (UI) App,也是在 Firefox OS 軟體堆疊上執行的 Web App。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Gonk" title="/en-US/docs/Mozilla/Firefox_OS/Gonk">Gonk</a></dt> - <dd>Gonk 的說明文件。Gonk 屬於 Gaia 之下的作業系統層,包含 Linux kernel 硬體抽象層 (Hardware abstraction layer),且由 Gecko 負責之間的溝通。</dd> - <dt><a href="/en-US/docs/Gecko" title="/en-US/docs/Gecko">Gecko</a></dt> - <dd>Gecko 即為 Firefox、Thunderbird,以及其他許多 App 所使用的相同 Open Web 標準實作。</dd> - <dt><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security" title="/en-US/docs/Mozilla/Firefox_OS/Security">安全性</a></dt> - <dd>Firefox OS 的安全性說明文件,包含各個面相的裝置安全,適合 App 開發者、裝置整合商等參考。</dd> - <dt><a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Out_of_memory_management_on_Firefox_OS">Firefox OS 記憶體耗盡時的管理作業</a></dt> - <dd>本文將解釋 Firefox OS 記憶體不足時的管理方式,可透過記憶體清理與記憶體不足通知等功能。</dd> - <dt><a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Feature_support_chart" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Feature_support_chart">功能支援表</a></dt> - <dd>各個 Firefox OS 版本所支援的各項功能特色。</dd> - <dt><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Settings_list" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Settings_list">Firefox OS 設定清單</a></dt> - <dd>常見的設定名稱清單,可搭配 <a href="https://developer.mozilla.org/en-US/docs/WebAPI/Settings" title="/en-US/docs/WebAPI/Settings">Settings</a> API。</dd> - </dl> - - <p><span class="alllinks"><a href="/en-US/docs/tag/B2G" title="/en-US/docs/tag/B2G">全部文章...</a></span></p> - </td> - <td> - <h2 class="Community" id="Community" name="Community">尋求社群協助</h2> - - <p>如果你正在開發 Firefox OS,或是可於 Firefox OS 裝置上執行的 App,則能參閱以下社群資源!</p> - - <ul> - <li>Boot to Gecko 論壇:{{ DiscussionList("dev-b2g", "mozilla.dev.b2g") }}</li> - </ul> - - <ul> - <li>在「Boot to Gecko」的 IRC 頻道上提問:<a class="link-irc" href="irc://irc.mozilla.org/b2g" title="irc://irc.mozilla.org/b2g">#b2g</a></li> - </ul> - - <p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html" title="http://www.catb.org/~esr/faqs/smart-questions.html">請遵守網路禮節...</a></span></p> - - - <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">相關主題</h2> - - <ul> - <li><a href="/en-US/docs/Mobile" title="en-US/docs/Mobile">Mobile</a></li> - <li><a href="/en-US/docs/HTML" title="en-US/docs/HTML">HTML</a></li> - <li><a href="/en-US/docs/CSS" title="en-US/docs/CSS">CSS</a></li> - <li><a href="/en-US/docs/JavaScript" title="en-US/docs/JavaScript">JavaScript</a></li> - </ul> - - <h2 class="Tools" id="相關資源">相關資源</h2> - - <ul> - <li><a class="link-https" href="https://wiki.mozilla.org/B2G/FAQ" title="B2G/FAQ">Mozilla wiki FAQ</a></li> - <li><a class="link-https" href="https://wiki.mozilla.org/B2G/Schedule_Roadmap" title="https://wiki.mozilla.org/B2G/Schedule_Roadmap">版本進程</a></li> - <li><a href="/en-US/docs/Mozilla/Firefox_OS/Feature_support_chart" title="/en-US/docs/Mozilla/Firefox_OS/Feature_support_chart">支援功能表</a></li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html b/files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html deleted file mode 100644 index 5b7f2045cc..0000000000 --- a/files/zh-tw/archive/b2g_os/platform/out_of_memory_management_on_firefox_os/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Firefox OS 記憶體管理 -slug: Archive/B2G_OS/Platform/Out_of_memory_management_on_Firefox_OS -translation_of: Archive/B2G_OS/Platform/Out_of_memory_management_on_Firefox_OS ---- -<div class="summary"> - <p><span class="seoSummary">Firefox OS 會運行在一些記憶體容量不大的裝置上,當程序用盡了記憶體,系統核心就必須關閉其他程序好釋放出記憶體使用。本文旨在描述記憶體關閉和記憶體不足通知如何運作、如何控制關閉那些程序,以確保當記憶體不夠時,主系統還是可以運作。</span></p> -</div> -<p>記憶體不足時會有兩個系統介入管理: <strong>Low memory killer (LMK)</strong> 與<strong> Low memory notifications</strong>.</p> -<h2 id="Low_memory_killer">Low memory killer</h2> -<p><a href="https://android.googlesource.com/kernel/common.git/+/edd540ea92954f896bfb7ee0ebf5dfdde6e6cb41/drivers/staging/android/lowmemorykiller.txt">LMK</a> 是 Android 核心的次系統,這個次系統負責關閉程序好騰出記憶體使用。為了決定程序關閉優先順序,每一個程序都會透過 <a href="https://www.kernel.org/doc/Documentation/filesystems/proc.txt">/proc/<pid>/oom_adj or /proc/<pid>/oom_score_adj files</a> 被賦予一個優先值,這個優先值為調整分數(adjustment score 或 <code>oom_adj</code>)。</p> -<p>一般來說 oom_adj 值越大,程序越容易被刪除,LMK 提供多個層級,每個層級對應到一定容量的可用記憶體以及最小 oom_adj 值。當可用記憶體掉到某一個層級,所有 oom_adj 值大於該層級 oom_adj 值的程序都有可能被關閉,LMK 會從占用最多記憶體的程序開始一個一個關閉,直到可用記憶體回復到安全層級為止。</p> -<div class="note"> - <p><strong>Note</strong>: 被 LMK 關閉的背景 app 仍然以 "殭屍 app" 的形式存在在程序管理員 (task manager),下次再回到該 app,app 會被重新喚醒。目前最大殭屍 app 的數量是 10。</p> -</div> -<div class="note"> - <p><strong>Note</strong>: 為了記憶體不足被關閉的 app 不一定就是造成記憶體不足的原因。</p> -</div> -<h3 id="程序關閉優先順序">程序關閉優先順序</h3> -<p>Firefox OS 關閉 app 的優先順序是由每個 app 給定的優先層級和相關聯的 OOM 調整分數所決定 (<a href="http://hg.mozilla.org/mozilla-central/file/545c35907eff/b2g/app/b2g.js#l661">現有值都存在 pref</a>):</p> -<ol> - <li>最先關閉的 app 是背景 app,最近最少使用的。</li> - <li>第二是 homescreen app。</li> - <li>接下來是使用者可察覺的背景 app (例如,在背景撥放音樂的程式,或高優先 (high-priority)、或持有 cpu wakelock 並且註冊有系統訊息處理器(system messages handler) 的 app)。</li> - <li>第四是鍵盤程式。</li> - <li>前景 (Foreground) app 則是第五順位被關閉的 app。</li> - <li>最後則是前景高優先 (high-priority)、或持有 cpu wakelock 的前景 app。</li> -</ol> -<div class="note"> - <p><strong>Note</strong>: 大部分在前景的子程序持有為 2 的oom_adj,背景子程序則持有 3 ~ 6 的 oom_adj,背景子程序到底會持有多大 oom_adj 值取決於許多因素,比如說是否撥放音月或是否屬於 homescreen app。</p> -</div> -<p>下面是例外:</p> -<ul> - <li>主程序永遠不會被關閉,因為一旦主程序被關閉,所有子程序也會被關閉,系統會重新啟動;主程序的 oom_adj 為 0。</li> - <li>為了加速新程序啟動,會有一個 <strong>preallocated process</strong> 被一直保留著,這個程序耗費的記憶體相當少,但卻可以顯著加速程式啟動。除非所有能關閉的程序都關閉了,但主程序需要的記憶體依然不足,這時 preallocated process 才會被關閉。</li> -</ul> -<h2 id="記憶體過低通知">記憶體過低通知</h2> -<p>第二個釋放記憶體的機制是記憶體過低通知。當可用記憶體量低過一定的<a href="https://www.codeaurora.org/cgit/quic/la//kernel/msm/commit/?id=b3f986cba580b14438b77b42070ebbc77b69d4c4">門檻值</a>,LMK 便會向使用者空間 (userspace) 發出記憶體過低通知,系統 app 和一般使用者 app 都會等待這個通知,然後透過觀察器服務 (observer service) 發出 <code>memory-pressure 事件回應之;這個事件</code> app 不會直接看見,只有 C++ 和 Chrome JS 程式碼會看到,在 Gecko 裡我們從這個事件中會盡一切可能釋放記憶體 — 通常是刪除內部快取 (images, DNS, sqlite, 等等),拋棄可以回復的物件 (比如 WebGL contexts) 還有執行垃圾回收機制。<br> - <br> - 當碰到記憶體過低狀況時,第一個發出的 <code>memory-pressure</code> 事件會有 <code>low-memory</code> <code>負載,倘若經過預定的5秒後我們依然處於記憶體過低狀態,另一個 <code>memory-pressure</code> 事件會發出,不過這一次是帶著</code> <code>low-memory-ongoing</code> 負載,這個時候我們持續處於記憶體過低狀態,很明顯地像一些垃圾回收機制等大動作的作法也不夠了,所以其他一些更低階的記憶體釋放作法會被採行。</p> -<h2 id="LMK_和記憶體過低通知如何協同運作">LMK 和記憶體過低通知如何協同運作</h2> -<p>目前<a href="http://hg.mozilla.org/mozilla-central/file/545c35907eff/b2g/app/b2g.js#l722">記憶體過低門檻介於 LMK 的背景 app 層級(大於)和 homescreen 層級(小於)之間</a>,所以整體記憶體不足的反應機制如下:</p> -<ol> - <li>關閉最近最不常用的背景 app。</li> - <li>當記憶體依然不足,發出 <code>memory-pressure</code> 事件通知給所有的 app。</li> - <li>當記憶體依然不足,每5秒發出 <code>memory-pressure</code> 事件,但標記為 ongoing 讓垃圾回收機制不要回應。</li> - <li>關閉 homescreen.</li> - <li>關閉使用者可察覺或高優先值的背景 app。</li> - <li>關閉運作中的鍵盤 app。</li> - <li>關閉前景 app。</li> - <li>關閉高優先值的前景 app。</li> - <li>關閉 preallocated 程序。</li> -</ol> diff --git a/files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html b/files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html deleted file mode 100644 index 1d165926a1..0000000000 --- a/files/zh-tw/archive/b2g_os/preparing_for_your_first_b2g_build/index.html +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: 準備第一次建置 B2G -slug: Archive/B2G_OS/Preparing_for_your_first_B2G_build -translation_of: Archive/B2G_OS/Preparing_for_your_first_B2G_build ---- -<p>在開始建置 B2G 前,要先複製整個倉儲 (repository)並且作編譯的設定。這篇文章說明要怎麼做。</p> - -<h2 id="複製_B2G_倉儲repository">複製 B2G 倉儲(repository)</h2> - -<p>在第一次編譯前,要做的第一步就是複製 B2G 的倉儲(repository)。這個步驟將不會把所有東西抓下來!相反地,他會抓 B2G 建置系統和安裝工具。B2G 大部分的程式碼都在主要的 Mozilla <a href="/en/Mercurial" title="en/Mercurial">Mercurial</a> 倉儲。</p> - -<p>用 git 來複製倉儲:</p> - -<pre>git clone git://github.com/mozilla-b2g/B2G.git</pre> - -<p>複製了之後(應該會花個幾分鐘),<code>cd</code> 到 B2G 的目錄:</p> - -<pre>cd B2G -</pre> - -<h2 id="複製_B2G_樹tree到一台新機器">複製 B2G 樹(tree)到一台新機器</h2> - -<p>當您有一台新電腦時(超幸運的!),您會覺得把 B2G tree 從一台電腦轉移到另一台電腦的話,生活會簡單很多。</p> - -<p>將您就電腦的磁碟掛上(mount)到新的電腦,然後敲入下面的指令,就可以做到:</p> - -<pre>rsync -a <em>source</em>/ <em>dest</em>/ -</pre> - -<p><code>source </code>是整個原始碼樹(source tree)的完整路徑 (包括後面的斜線),而 <code>dest</code> 是您要複製的目的位置 (同樣也包含後面的斜線,它很重要!)。</p> - -<p>這樣做之後,您可以跳過這篇文章剩下的部份,然後直接跳到的「<a href="/en/Mozilla/Boot_to_Gecko/Building_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Building_Boot_to_Gecko">建置</a>」部份。</p> - -<h2 id="設定專屬於您的行動裝置的_B2G">設定專屬於您的行動裝置的 B2G</h2> - -<div class="warning"><strong>重要</strong>:請注意只支援 <strong>Android 4</strong> (aka. <strong>Ice Cream Sandwich</strong>) 的行動裝置。請確認您的手機運作的真的是 ICS,否則這個步驟很可能會失敗於某些非 Nexus 裝置的驅動程式。另外,如果您必須要將行動裝置燒成 ICS,請留意有些 USB hubs 和燒錄工具不相容,因此您可能需要將行動裝置連接到內建的 USB port。</div> - -<p>擷取了核心的 B2G 建置系統之後,您需要為了要安裝的行動裝置作設定。您可以使用 <code>config.sh</code> 工具來擷取支援的行動裝置列表,如下:</p> - -<pre>./config.sh -</pre> - -<p>這會顯示支援的行動裝置列表;舉例來說:</p> - -<pre>Usage: ./config.sh [-cdflnq] (device name) -Flags are passed through to |./repo sync|. - -Valid devices to configure are: -- galaxy-s2 -- galaxy-nexus -- nexus-4 -- nexus-4-kk -- nexus-5 -- nexus-5-l -- nexus-s -- nexus-s-4g -- flo (Nexus 7 2013) -- otoro -- unagi -- inari -- keon -- peak -- hamachi -- helix -- tarako -- dolphin -- dolphin-512 -- pandaboard -- vixen -- flatfish -- flame -- flame-kk -- flame-l -- rpi (Revision B) -- emulator -- emulator-jb -- emulator-kk -- emulator-l -- emulator-x86 -- emulator-x86-jb -- emulator-x86-kk -- emulator-x86-l -> Sony Xperia devices -- aries (Z3 Compact KK) -- aries-l (Z3 Compact L) -- leo-kk (Z3 KK) -- leo-l (Z3 L) -- scorpion-l (Z3 Tablet Compact L) -- sirius-l (Z2 L) -- tianchi-l (T2U L) -- flamingo-l (E3 L)</pre> - -<p>如果您的行動裝置沒被列出,您應該馬上停止來幫忙將 B2G 移植到您的行動裝置,或是等到某個人移植完之後再安裝。我們當然比較希望您可以幫忙移植!</p> - -<div class="note">注意:如果因為任何原因您想要編譯某個版本的 Gecko,請在您著手之前先看 <a href="#Building_against_a_custom_Gecko">Building against a custom Gecko</a>。</div> - -<h3 id="設定給行動裝置">設定給行動裝置</h3> - -<p>首先,連接您的裝置;設定的過程會需要存取它。</p> - -<p>如果您的裝置有被列出,您可以再執行一次 <code>config.sh 來開始設定的程序,這次需要指名您的行動裝置的名字。舉例來說,如果要編譯給 Samsung Google Nexus S的話,您要打:</code></p> - -<pre>./config.sh nexus-s -</pre> - -<p>在設定一開始的附近您可能會需要設定使用顏色的選項,而在這之後設定程序會繼續下去。接著可以去喝個咖啡休息一下,因為這個時候您會第一次把建置 Boot to Gecko 中所有需要的程式碼都抓下來。</p> - -<p>如果您的手機不再使用 Android 且 B2G tree 還沒裝到手機上,而您又有遵照前幾頁所說、聰明地作了一份 <code>/system</code> 磁區的備份的話,您可以這樣使用它:</p> - -<pre>ANDROIDFS_DIR=<absolute path to parent dir of system dir> ./config.sh <target> -</pre> - -<h3 id="設定來建置模擬器">設定來建置模擬器</h3> - -<p>如果您要編譯模擬器的話,就需要指定 "emulator" 來使用 ARM 的模擬器,或是 "emulator-x86" 來編譯 x86 模擬器。後者比較快,但也因此在表現實際行動裝置上較不準確。<br> - <br> - 舉例來說,您要像下面這樣設定來編譯 ARM 模擬器:</p> - -<pre>./config.sh emulator -</pre> - -<p>在設定一開始的附近您可能會需要設定使用顏色的選項,而在這之後設定程序會繼續下去。接著可以去喝個咖啡休息一下,因為這個時候您會第一次把建置 Boot to Gecko 中所有需要的程式碼都抓下來。</p> - -<h2 id="編譯客製的_Gecko">編譯客製的 Gecko</h2> - -<p>可能您會想要或需要以好幾種版本的 Gecko 來編譯 Boot to Gecko (manifest 中預設是一種)。您可以在您抓倉儲 (在上述的 config.sh 之前),藉由編輯 .userconfig 來做到這件事情。舉例來說,如果您要根據 mozilla-central 來編譯:</p> - -<pre>GECKO_PATH=/path/to/mozilla-central -GECKO_OBJDIR=/path/to/mozilla-central/objdir-gonk -</pre> - -<div class="note"> -<p>注意: 如果是在 Mac OS X 下客製化編譯的話,檔案系統本身會注意 mozilla-central 的大小寫。</p> -</div> - -<p>您可以參考 <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file" title="/en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file">客製化 .userconfig 設定檔</a> 來客製化更多東西。</p> - -<p>接著,<a href="/en/Mozilla/Boot_to_Gecko/Building_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Building_Boot_to_Gecko">開始編譯</a></p> diff --git a/files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html b/files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html deleted file mode 100644 index bc539adefa..0000000000 --- a/files/zh-tw/archive/b2g_os/quickstart/app_tools/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: App tools -slug: Archive/B2G_OS/Quickstart/App_tools -translation_of: Archive/B2G_OS/Quickstart/App_tools ---- -<div class="summary"> - <p><span class="short_text" id="result_box" lang="zh-TW"><span><span class="short_text" id="result_box" lang="zh-TW"><span>您</span></span>用什麼</span><span>來建</span><span>立開放式</span><span>Web應用程序</span></span>?<span class="short_text" id="result_box" lang="zh-TW"><span>答案</span><span>是,"</span><span>你通常會</span><span>用它來</span><span>建立</span><span>網絡'</span><span>。</span></span><span class="short_text" id="result_box" lang="zh-TW"><span>以下是</span><span>工具和資源</span><span>的清單</span><span>,可以</span><span>幫助您開始</span><span>做</span><span>開放式</span><span>Web應用程序</span><span>。</span></span><span id="result_box" lang="zh-TW"><span>他們可以</span><span>很容易地成</span><span>您現有的</span><span>Web開發工作流程</span><span>,如果</span><span>你有一個,</span><span>或者你</span><span>可以將它們</span><span>周圍</span><span>建立為一個</span><span>新的工作流程</span><span>。</span></span></p> -</div> -<h2 id="應用程序驗證程序"><span class="short_text" id="result_box" lang="zh-TW"><span>應用程序</span><span>驗證程序</span></span></h2> -<p><span class="short_text" id="result_box" lang="zh-TW"><span>您的應用程序</span><span>以準備好</span><span>進入Firefox</span><span>市場</span><span>?</span></span><span class="short_text" id="result_box" lang="zh-TW"><span><a href="https://marketplace.firefox.com/developers/validator">應用程序驗證器</a><span>會</span><span>檢查你的</span><span>清單</span><span>,並會</span><span>顯示任何</span><span>錯誤,</span><span>它也有可能<span class="short_text" id="result_box" lang="zh-TW"><span><span>會</span><span>顯示</span></span></span></span><span>你沒有考慮</span><span>過的警告</span><span>。</span></span></span></p> -<h2 id="火狐系統模擬器"><span class="short_text" id="result_box" lang="zh-TW"><span>火狐</span><span>系統</span><span>模擬器</span></span></h2> -<p><span class="short_text" id="result_box" lang="zh-TW"><span>安裝和</span><span>使用</span></span><span class="short_text" id="result_box" lang="zh-TW"><span><a href="https://marketplace.firefox.com/developers/docs/firefox_os_simulator">火狐系統模擬器</a>是</span><span>開始</span><span>和令</span><span>你的應用程序</span><span>運行</span><span>的</span><span>最簡單的方法</span><span>。</span></span><span class="short_text" id="result_box" lang="zh-TW"><span>安裝</span><span>後</span><span>的</span><span>模擬器,</span><span>通過 工具</span><span>-</span><span>></span> <span class="hps">Web開發</span><span> -</span><span>></span><span> 火狐</span><span class="short_text" id="result_box" lang="zh-TW"><span>系統</span></span><span>模擬器</span><span>菜單。<span class="short_text" id="result_box" lang="zh-TW"><span>啟動後,</span></span></span></span><span class="short_text" id="result_box" lang="zh-TW"><span> 便會有JavaScript控制台</span><span>,以便您</span><span>可以</span><span>從模擬器</span><span>中</span><span><span class="short_text" id="result_box" lang="zh-TW"><span>測</span></span>試應用程序</span><span>的</span><span>啟動</span><span><span class="short_text" id="result_box" lang="zh-TW"><span>和刪除</span><span>錯誤</span></span>!</span></span></p> -<h2 id="應用程序管理器"><span class="short_text" id="result_box" lang="zh-TW"><span>應用程序管理器</span></span></h2> -<div class="almost_half_cell" id="gt-res-content"> - <div dir="ltr" style="zoom: 1;"> - </div> -</div> -<p><span class="short_text" id="result_box" lang="zh-TW"><span>新</span><span>的測試工具</span><span>被稱為</span><span><a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_App_Manager">應用程序管理器</a></span><span>。</span></span><span class="short_text" id="result_box" lang="zh-TW"><span><span class="short_text" id="result_box" lang="zh-TW"><span>這個工具</span><span>可以讓你</span><span>通過USB</span>以<span>火狐</span><span>來連接至兼容的</span><span>設備(或</span><span>一個<span class="short_text" id="result_box" lang="zh-TW"><span>火狐</span><span class="short_text" id="result_box" lang="zh-TW"><span>系統</span></span><span>模擬器</span></span></span><span>)</span></span></span></span><span class="short_text" id="result_box" lang="zh-TW"><span>把</span><span>應用程序</span><span>直接</span><span>存在設備上,</span><span>驗證</span><span>的應用程序,</span><span>並</span><span>在</span><span>設備上<span class="short_text" id="result_box" lang="zh-TW"><span><span class="short_text" id="result_box" lang="zh-TW"><span>刪除</span><span>錯誤</span></span></span></span></span><span>。</span></span></p> -<h2 id="Firefox的開發者工具">Firefox的<span class="short_text" id="result_box" lang="zh-TW"><span>開發者工具</span></span></h2> -<div class="almost_half_cell" id="gt-res-content"> - <div dir="ltr" style="zoom: 1;"> - <div class="almost_half_cell" id="gt-res-content"> - <div dir="ltr" style="zoom: 1;"> - <span class="short_text" id="result_box" lang="zh-TW"><span>火狐</span><span>現在提供</span><span>了一套</span><span>開發</span><span>工具</span><span>,確保</span><span>了極大的發展</span><span>經驗</span><span>,既</span><span>好用</span><span>,又高效率。<span id="result_box" lang="zh-TW"><span>欲了解更多</span><span>有關這些工具</span><span>如何運作</span><span>,看看</span><span>還有什麼</span><span>的Mozilla</span><span>所提供的,</span><span>請到我們的</span><span><a href="/en-US/docs/Tools">工具區域</a></span><span>。</span></span></span></span></div> - </div> - </div> -</div> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/quickstart/index.html b/files/zh-tw/archive/b2g_os/quickstart/index.html deleted file mode 100644 index a5bb4fa406..0000000000 --- a/files/zh-tw/archive/b2g_os/quickstart/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Build -slug: Archive/B2G_OS/Quickstart -tags: - - Apps - - NeedsTranslation - - Quickstart - - TopicStub -translation_of: Archive/B2G_OS/Quickstart ---- -<div class="summary"> - <p><span class="seoSummary">Quickstart information on coding open web apps.</span></p> -</div> -<dl> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/Intro_to_open_web_apps">Introduction to open web apps</a></dt> - <dd> - What are open web apps? How they differ from regular web pages? Why is this significant? This article aims to answer these questions and more.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/Your_first_app">Your first app</a></dt> - <dd> - This article takes you through the basic steps and additional knowledge on top of regular web development required to create installable open web apps.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/Intro_to_Firefox_OS">Introduction to Firefox OS</a></dt> - <dd> - An introduction to Firefox OS, Mozilla's new open web app-based mobile platform.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/Intro_to_manifests">Introduction to manifests</a></dt> - <dd> - An FAQ designed to answer any questions you may have about manifests, hosting apps, origins, and other such topics.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/For_Web_developers">App development for web developers</a></dt> - <dd> - If you're a web developer, how do open web apps differ from what you're used to? This article explains all.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/For_mobile_developers">App development for mobile developers</a></dt> - <dd> - If you're a native mobile application developer, what advantages can open web apps bring to you, and how do they differ from what you are used to? Here are some ideas.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/Developing_app_functionality">Developing app functionality</a></dt> - <dd> - This page talks about the kinds of different functionality that you might want to build into your apps, with links to further information.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/Payments">Payments</a></dt> - <dd> - How do you build functionality to make people pay for installing your open web apps? Here is the lowdown.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Quickstart/Build/App_tools">App tools</a></dt> - <dd> - Last for this section, we provide some links to more information on the tools available to help you develop great open web apps.</dd> -</dl> diff --git a/files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html b/files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html deleted file mode 100644 index d40315b16c..0000000000 --- a/files/zh-tw/archive/b2g_os/quickstart/your_first_app/index.html +++ /dev/null @@ -1,265 +0,0 @@ ---- -title: Your first app -slug: Archive/B2G_OS/Quickstart/Your_first_app -translation_of: Archive/B2G_OS/Quickstart/Your_first_app ---- -<div class="note"> -<p><strong>Note</strong>: 快速入門這段章節已經取代先前舊的快速入門章節,更新為最新的及更專注於<a href="/en-US/Apps/Build/installable_apps_for_Firefox_OS/Firefox_OS_app_essentials">Firefox OS app essentials</a> 文章。我們希望你將發現這份是比舊文更有用和更快學習經驗的文章。</p> -</div> - -<article class="brush: js"> -<div class="summary"> -<p>開放式Web應用讓開發人員實現了期盼多年的夙願:通過Firefox OS這一首款開放式Web應用平台,可以僅僅使用HTML、CSS和JavaScript在跨平台的環境中生成可部署的應用。本手冊包含了基本的架構和應用構建指南,你能夠迅速掌握這些內容並開始創造自己的下一個偉大的應用!</p> -</div> - -<p>如果你想按照本指南開發,你可以下載我們的<a href="https://github.com/chrisdavidmills/mdn-app-template">quick start app template</a>. 或可以藉由參閱我們的<a href="/en-US/docs/Project:MDN/Style_guide/Sample_app_coding_guidelines#Apps_template">Apps template</a> 指南,找到更多有關的內容。</p> - -<h2 id="App_結構">App 結構</h2> - -<h3 id="打包型_Apps_VS._托管型_Apps">打包型 Apps VS. 托管型 Apps</h3> - -<p>開放網絡應用有兩種類型:打包型和托管型。打包型apps本質上來說就是一個包含各種HTML、CSS、JavaScript、圖像、表單等應用資源的zip文件。托管型apps在一個給定域名的服務器上運行,就像是一個獨立的網站。兩種應用都需要有有效的表單。到了要在火狐市場中列出你的app,你要上傳app zip文件或提供托管app所在的URL。</p> - -<div style="width: 480px; margin: 0 auto;"> -<p>{{EmbedYouTube("Q7x-B13y33Q")}}</p> - -<div class="video-caption"> -<p>用Treehouse為製作夥伴: <a class="button" href="http://teamtreehouse.com/?cid=1154">Check them out!</a></p> -</div> -</div> - -<p>本指南的目的,會讓你將創建一個於本機(localhost)地址上的托管型app。一旦你的app準備好進入火狐市場,你可以選擇把它作為打包app或作為托管app啓動。</p> - -<h3 id="App_表單">App 表單</h3> - -<p>每一個火狐app都需要一個位於根目錄下的manifest.webapp文件, 這個<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest"><code>manifest.webapp</code></a> 文件提供app有關的重要信息,如:版本、名稱、描述、圖標位址、本地字符串、指明app可以從哪兒被安裝等等。只有名稱和描述是必須的。app模板中的簡單表單如下所示:</p> - -<pre class="brush: js">{ - "version": "0.1", - "name": "Open Web App", - "description": "Your new awesome Open Web App", - "launch_path": "/app-template/index.html", - "icons": { - "16": "/app-template/app-icons/icon-16.png", - "48": "/app-template/app-icons/icon-48.png", - "128": "/app-template/app-icons/icon-128.png" - }, - "developer": { - "name": "Your Name", - "url": "http://yourawesomeapp.com" - }, - "locales": { - "es": { - "description": "Su nueva aplicación impresionante Open Web", - "developer": { - "url": "http://yourawesomeapp.com" - } - }, - "it": { - "description": "La tua nuova fantastica Open Web App", - "developer": { - "url": "http://yourawesomeapp.com" - } - } - }, - "default_locale": "en" -}</pre> - -<div style="width: 480px; margin: 0 auto;"> -<p>{{EmbedYouTube("dgAUgHQOm8M")}}</p> - -<div class="video-caption"> -<p>Made in partnership with Treehouse: <a class="button" href="http://teamtreehouse.com/?cid=1154">Check them out!</a></p> -</div> -</div> - -<p> </p> - -<p>一個基本的表單是你所需要最先上手的地方。關於表單的更多細節,見<a href="/en-US/docs/Web/Apps/Manifest">App Manifest</a>.</p> - -<h2 id="App_佈局_設計">App 佈局 & 設計</h2> - -<p>隨著不同設備上屏幕解析度標準的增多,響應式設計已經變得越來越重要。即使你app的主要目標平台是移動平台比如Firefox OS,其他設備很有可能也會訪問它。<a href="//developer.mozilla.org/docs/CSS/Media_queries">CSS media queries</a> 使你可以根據設備調整佈局,如下的CSS樣例中所示的結構:</p> - -<pre class="brush: css">/* The following are examples of different CSS media queries */ - -/* Basic desktop/screen width sniff */ -@media only screen and (min-width : 1224px) { - /* styles */ -} - -/* Traditional iPhone width */ -@media - only screen and (-webkit-min-device-pixel-ratio : 1.5), - only screen and (min-device-pixel-ratio : 1.5) { - /* styles */ -} - -/* Device settings at different orientations */ -@media screen and (orientation:portrait) { - /* styles */ -} -@media screen and (orientation:landscape) { - /* styles */ -}</pre> - -<p>有許多JavaScript和CSS的框架可以用於協助響應式設計和移動app發展(<a href="http://twitter.github.com/bootstrap">Bootstrap</a>等),選擇最適合你的app和開發樣式的框架即可。</p> - -<h2 id="Web_APIs">Web APIs</h2> - -<p>JavaScript APIs正隨著設備快速開發,同時地被創造和增強。Mozilla的<a href="https://wiki.mozilla.org/WebAPI">WebAPI</a> 致力於為JavaScript APIs引入成打的標準移動端特性。設備支援和狀況列表可以在<a href="https://wiki.mozilla.org/WebAPI">WebAPI</a> 頁面中查看。在下面這個例子中,JavaScript 特徵偵測仍然是最好的例子:</p> - -<pre class="brush: js">// If this device supports the vibrate API... -if('vibrate' in navigator) { - // ... vibrate for a second - navigator.vibrate(1000); -}</pre> - -<p>在下面這個例子中,<div>的顯示樣式會根據設備的電池狀態的改變而改變:</p> - -<pre class="brush: javascript">// Create the battery indicator listeners -(function() { - var battery = navigator.battery || navigator.mozBattery || navigator.webkitBattery, - indicator, indicatorPercentage; - - if(battery) { - indicator = document.getElementById('indicator'), - indicatorPercentage = document.getElementById('indicator-percentage'); - - // Set listeners for changes - battery.addEventListener('chargingchange', updateBattery); - battery.addEventListener('levelchange', updateBattery); - - // Update immediately - updateBattery(); - } - - function updateBattery() { - // Update percentage width and text - var level = (battery.level * 100) + '%'; - indicatorPercentage.style.width = level; - indicatorPercentage.innerHTML = 'Battery: ' + level; - // Update charging status - indicator.className = battery.charging ? 'charging' : ''; - } -})();</pre> - -<p>在上面的示例代碼中,一旦你確定設備支持<a href="https://developer.mozilla.org/en-US/docs/DOM/window.navigator.battery">Battery API</a>,你就可以為chargingchange 和 levelchange添加 event listeners 來更新元素的樣式。試試添加下面的指令到快速入門模板,你會看到你的工作效果。</p> - -<p>時常檢查<a href="https://wiki.mozilla.org/WebAPI">WebAPI</a> 頁面以確保更新設備API的狀態。</p> - -<h3 id="Install_API_功能">Install API 功能</h3> - -<p>在我們的快速入門應用模板範例中,我們已經實現了一個安裝按鈕,可以在你把應用當作一個標準網頁來瀏覽時可以單擊它來把那個網站當作一個應用安裝在Firefox OS上。按鈕標籤並沒有什麼特別的:</p> - -<pre class="brush: html"><button id="install-btn">Install app</button></pre> - -<p>按鈕的功能由Install API實現(見install.js):</p> - -<pre class="brush: js">var manifest_url = location.href + 'manifest.webapp'; - -function install(ev) { - ev.preventDefault(); - // define the manifest URL - // install the app - var installLocFind = navigator.mozApps.install(manifest_url); - installLocFind.onsuccess = function(data) { - // App is installed, do something - }; - installLocFind.onerror = function() { - // App wasn't installed, info is in - // installapp.error.name - alert(installLocFind.error.name); - }; -}; - -// get a reference to the button and call install() on click if the app isn't already installed. If it is, hide the button. -var button = document.getElementById('install-btn'); - -var installCheck = navigator.mozApps.checkInstalled(manifest_url); - -installCheck.onsuccess = function() { - if(installCheck.result) { - button.style.display = "none"; - } else { - button.addEventListener('click', install, false); - }; -}; -</pre> - -<p>我們來簡要的看一下發生了什麼:</p> - -<p>1. 我們得到一個安裝按鈕的引用並把它儲存在button變量中。<br> - 2. 我們使用navigator.mozApps.checkInstalled 來檢查這個由http://people.mozilla.com /~cmills/location-finder/manifest.webapp 這個表單來定義的應用是否已經安裝在設備上。這個測試結果被儲存在installCheck這個變量中。<br> - 3. 當測試被成功完成時,它的成功會完成事件被觸發,因此installCheck.onsuccess = function() { ... }會被執行。<br> - 4. 然後我們用一個if語句判斷installCheck.result是否存在?如果存在,以為著app已經被安裝了,我們就隱藏安裝按鈕。在應用已經被安裝的情況下不需要安裝按鈕。<br> - 5. 如果app沒有被安裝,為按鈕添加一個單擊事件監聽器。所以在按鈕被單擊的時候,install()函數會被執行。<br> - 6. 當單擊按鈕並且install()函數執行時,我們把表單檔案位置保存在一個叫manifest_url的變量中,然後利用navigator.mozApps.install(manifest_url)來安裝app,用一個installLocFind變量來儲存對那個安裝的app參考資訊。你會注意到安裝也會觸發success和error事件,所以你可以根據應用是否成功安裝來執行不同的動作。</p> - -<p>第一次遇到可安裝web apps時,你可能想要覈實<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/JavaScript_API">implementation state of the API</a> 的執行狀態。</p> - -<p>注意:可安裝開放web apps有一個「每個來源(origin,感覺就是URL的意思)就是一個app」的安全策略;基本上, 你不可以在一個來源上托管多個可安裝apps。這會讓檢測變得有一點複雜,但是仍有很多辦法解決這個問題,比如為應用創建多個子域名、用Firefox OS模擬器測試應用、或者在Firefox Aurora/Nightly上安裝測試功能,通過這種方式你可以在桌面環境上安裝開發web app。關於來源的跟多信息詳見<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/FAQs/About_app_manifests">FAQs about apps manifests</a>。</p> - - -<h2 id="WebRT_APIs_(基於權限的_APIs)">WebRT APIs (基於權限的 APIs)</h2> - -<p>有些WebAPI雖然可以使用但是需要特定的功能開啓才具有使用的權限。應用可能會像下面這樣在manifest.webapp中記錄權限請求:</p> - -<pre class="brush: js">// New key in the manifest: "permissions" -// Request access to any number of APIs -// Here we request permissions to the systemXHR API -"permissions": { - "systemXHR": {} -}</pre> - -<p>權限分為下面三個等級:</p> - -<ol> - <li> - <p>一般權限——不需要任何特定訪問權限的API。</p> - </li> - <li> - <p>特殊權限——只要開發者在app表單文件中設置了訪問權限就可以在應用中利用並通過可信任來源進行分發的API。</p> - </li> - <li> - <p>認證權限——控制力設備上關鍵功能的API,比如打電話和發短信的服務。這些一般不允許第三方開發者使用。</p> - - <p>關於應用權限等級的更多信息,請閱讀<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Packaged_apps#Types_of_packaged_apps" title="/en-US/docs/Web/Apps/Packaged_apps#Types_of_packaged_apps">Types of packaged apps</a>。你可以在應用權限中找到更多關於API要求權限和需要什麼樣的<a href="/en-US/docs/Web/Apps/App_permissions">App permissions</a>.。</p> - </li> -</ol> - -<div class="note"> -<p>有一點需要注意的很重要就是不是所有的Web API都可以在Firefox OS模擬器中執行。</p> -</div> - -<h2 id="工具_測試">工具 & 測試</h2> - -<p>測試在對移動應用的支持中是至關重要的。測試可安裝的開放web app有多種方式。</p> - -<h2 id="WebIDE_和_Firefox_OS_模擬器">WebIDE 和 Firefox OS 模擬器</h2> - -<p>安裝和使用Firefox OS模擬器是啓動和運行你的應用最簡單的方式。在你安裝模擬器之後,可以通過工具->web開發者->Firefox OS模擬器菜單來啓動。模擬器啓動時會有一個Javascript控制台,這樣你就可以在模擬器中調試你的應用。</p> - -<p>測試工具的新寵兒被稱為app管理器<a href="/en-US/docs/Tools/WebIDE">WebIDE</a>。這個工具允許你通過USB鏈接桌面火狐瀏覽器和一個可兼容性設備(或者一個Firefox OS模擬器),直接將app推送到設備上,驗證app並且像運行在設備上一樣的調試。</p> - -<h3 id="單元測試">單元測試</h3> - -<p>當在測試不同設備和版本時,單元測試就會非常有價值。jQuery的<a href="http://qunitjs.com">QUnit</a> 是一個流行的客戶端測試工具,當然你也可以使用任何你喜歡的測試工具。</p> - -<h3 id="在設備上安裝Firefox_OS">在設備上安裝Firefox OS</h3> - -<p>既然Firefox OS是一個開源平台,代碼和工具都可以用於在你自己的設備上構建和安裝Firefox OS。構建和安裝指南以及什麼設備可以安裝的注意事項可以在<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform">MDN</a>上發現。</p> - -<p>特定的Firefox OS開發者預覽版設備可以在<a href="https://marketplace.firefox.com/developers/dev_phone">Developer preview phone page</a>找到更多信息。<br> - 應用。</p> - -<h2 id="App_提交和分發">App 提交和分發</h2> - -<p>一旦你的app完成,你可以像標準網站或app一樣托管它(更多信息請閱讀<a href="/en-US/docs/Web/Apps/Publishing/Self-publishing_Apps">Self-publishing apps</a> ),或者可以<a href="https://marketplace.firefox.com/developers/submit/app/manifest">submitted</a>到<a href="https://marketplace.firefox.com">Firefox Marketplace</a>。你的app表單將被驗證並且你可以選擇你的應用將支持的設備(比如:Firefox OS、桌面版火狐瀏覽器、移動版火狐瀏覽器、平板火狐瀏覽器)。一旦驗證通過,你可以為你的app添加更多細節(截屏、描述、價格等)並且正式在火狐市場中提交app列表。提交成功後,你的應用可以被任何人購買和安裝。</p> - -<h3 id="更多商場_上市信息">更多商場 & 上市信息</h3> - -<p> 1. 向Firefox OS商場中提交應用 <a href="/en-US/docs/Web/Apps/Publishing/Submitting_an_app">Submitting an App to the Firefox OS Marketplace </a><br> - 2. 市場審查標準<a href="/en-US/docs/Web/Apps/Publishing/Marketplace_review_criteria"> Marketplace Review Criteria </a><br> - 3. 應用提交演練視頻 <a href="http://s.vid.ly/embeded.html?link=8k2n4w&autoplay=false">App Submission Video Walkthrough</a></p> -</article> diff --git a/files/zh-tw/archive/b2g_os/releases/1.2/index.html b/files/zh-tw/archive/b2g_os/releases/1.2/index.html deleted file mode 100644 index bc8f785f6b..0000000000 --- a/files/zh-tw/archive/b2g_os/releases/1.2/index.html +++ /dev/null @@ -1,465 +0,0 @@ ---- -title: Firefox OS 1.2 for developers -slug: Archive/B2G_OS/Releases/1.2 -translation_of: Archive/B2G_OS/Releases/1.2 ---- -<div class="summary"> -<p><span class="seoSummary">Firefox OS 1.2 is at a pre-release stage right now. Its Gecko component is based on Firefox 26 (encompassing all Gecko additions between Firefox 19 and Firefox 26; see <a href="/en-US/docs/Mozilla/Firefox/Releases/26">Firefox 26 release notes for developers</a> for the latest.) This page details the developer features newly implemented in Firefox OS 1.2.</span></p> -</div> - -<h2 id="Developer_Tools">Developer Tools</h2> - -<ul> - <li>Firefox OS versions 1.2 and above are compatible with the <a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_App_Manager">Firefox App Manager</a>.</li> -</ul> - -<h2 id="HTML">HTML</h2> - -<p>General Gecko:</p> - -<ul> - <li>The <code><a href="/zh-TW/docs/Web/HTML/Element/iframe#attr-srcdoc">srcdoc</a></code> attribute of <a href="/zh-TW/docs/Web/HTML/Element/iframe" title="The documentation about this has not yet been written; please consider contributing!"><code><iframe></code></a>, allowing the inline specification of the content of an <a href="/zh-TW/docs/Web/HTML/Element/iframe" title="The documentation about this has not yet been written; please consider contributing!"><code><iframe></code></a>, is now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=802895" title="FIXED: implement <iframe srcdoc=''> to allow document content in iframe to be specified inline">bug 802895</a>).</li> - <li>When used with a <code>"image/jpeg"</code> type, the method <code>HTMLCanvasElement.toBlob</code> now accepts a third attribute defining the quality of the image (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=891884" title="FIXED: toBlob should support the quality parameter as toDataURL does">bug 891884</a>).</li> - <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track" title="The track element is used as a child of the media elements—<audio> and <video>—and does not represent anything on its own. It lets you specify timed text tracks (or time-based data)."><code><track></code></a> element has been implemented behind the <code>media.webvtt.enabled</code> property (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833385" title="FIXED: [webvtt] Implement Track element and TextTrack* DOM classes">bug 833385</a>).</li> - <li>The <a href="/zh-TW/docs/Web/HTML/Element/blink" title="非標準元素 HTML Blink(<blink>)可以讓該元素裡面的文字緩慢閃爍。"><code><blink></code></a> element support is now completely dropped. The <code><blink></code> tag now implements the <a href="/zh-TW/docs/Web/API/HTMLUnknownElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLUnknownElement</code></a> interface (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857820" title="FIXED: Drop only blink effect from text-decoration: blink; and completely remove <blink> element">bug 857820</a>).</li> - <li>The <code>range</code> state of the <a href="/zh-TW/docs/Web/HTML/Element/input" title="The HTML <input> element is used to create interactive controls for web-based forms in order to accept data from the user."><code><input></code></a> element (<code><input type="range"></code>) has been switched on by default (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841950" title="FIXED: Flip the pref to enable <input type=range> for release builds">bug 841950</a>).</li> - <li>The HTML5 <a href="/zh-TW/docs/Web/HTML/Element/data" title="The documentation about this has not yet been written; please consider contributing!"><code><data></code></a> element has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=839371" title="FIXED: Implement HTML5 <data> element">bug 839371</a>).</li> - <li>The HTML5 <a href="/zh-TW/docs/Web/HTML/Element/time" title="HTML <time> element 用以表示時間,可以是24小時制時間或以公曆紀年的日期(日期可以添加時間和時區的資訊)"><code><time></code></a> element has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=629801" title="FIXED: Implement HTML5 <time> element">bug 629801</a>).</li> - <li>The <code>range</code> state of the <a href="/zh-TW/docs/Web/HTML/Element/input" title="The HTML <input> element is used to create interactive controls for web-based forms in order to accept data from the user."><code><input></code></a> element (<code><input type="range"></code>) has been implemented, behind the preference <code>dom.experimental_forms_range</code>, only enabled by default on Nightly and Aurora channel (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841948" title="FIXED: Flip the pref to enable <input type=range> on Nightly and Aurora">bug 841948</a>).</li> - <li>The support for the <a href="/zh-TW/docs/Web/HTML/Element/template" title="The documentation about this has not yet been written; please consider contributing!"><code><template></code></a> element, part of the Web component specification has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=818976" title="FIXED: Implement web components template.">bug 818976</a>).</li> - <li>The <code><a href="/zh-TW/docs/Web/HTML/Element/style#attr-scoped">scoped</a></code> attribute has been added to the <a href="/zh-TW/docs/Web/HTML/Element/style" title="The documentation about this has not yet been written; please consider contributing!"><code><style></code></a> element. It allows to include styles that are isolated from the rest of the document. Such styles can be selected using the <a href="/zh-TW/docs/Web/CSS/:scope" title="The documentation about this has not yet been written; please consider contributing!"><code>:scope</code></a> CSS pseudo-element introduced in Firefox 20. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=508725" title="FIXED: Implement HTML 5 scoped attribute on STYLE tag">bug 508725</a>).</li> - <li>The new HTML <a href="/zh-TW/docs/Web/HTML/Element/main" title="The documentation about this has not yet been written; please consider contributing!"><code><main></code></a> element has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=820508" title="FIXED: Add support for <main> element">bug 820508</a>).</li> - <li>Support for the <code><a href="/zh-TW/docs/Web/HTML/Element/a#attr-download">download</a></code> attribute on the <a href="/zh-TW/docs/Web/HTML/Element/a" title="HTML 的超連結元素(<a>,意為 Anchor)用來定義超連結或連結,至位在任何一個網頁(可以是自己)的目標位置。超連結元素同時也可以用來(儘管此方法已被淘汰)作為網頁中的錨點,此錨點可以讓其他超連結指向網頁中的某部份內容,讓超連結不只是單純連接到網頁的最頂端而已。"><code><a></code></a> and <a href="/zh-TW/docs/Web/HTML/Element/area" title="The documentation about this has not yet been written; please consider contributing!"><code><area></code></a> element has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=676619" title="FIXED: Implement proposed download attribute">bug 676619</a>).</li> - <li>The value <code>auto </code>for the <a href="/en-US/docs/HTML/Global_attributes" title="HTML/Global_attributes">global attribute</a> <a href="/en-US/docs/HTML/Global_attributes#attr-dir" title="HTML/Global_attributes"><code>dir</code></a> has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=548206" title="FIXED: Implement the auto value for the HTML dir attribute">bug 548206</a>).</li> -</ul> - -<h2 id="CSS">CSS</h2> - -<p>General Gecko:</p> - -<ul> - <li>@font-feature-values rule support (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=549861" title="FIXED: implement parsing of font feature properties">bug 549861</a>)</li> - <li>StyleRule{Added,Removed,Changed}, StyleSheetApplicableStateChange, StyleSheetChange events (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=839103" title="FIXED: Provide notifications for style sheet added and removed to chrome JS">bug 839103</a>)</li> - <li>The <a href="/zh-TW/docs/Web/CSS/text-decoration-line" title="The documentation about this has not yet been written; please consider contributing!"><code>text-decoration-line</code></a> property, still prefixed, now considers <code>'blink'</code> as a valid value, though it doesn't blink the content at all (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=812995" title="FIXED: add 'blink' to -moz-text-decoration-line and drop -moz-text-blink">bug 812995</a>).</li> - <li>The non-standard<code> </code><a href="/zh-TW/docs/Web/CSS/-moz-text-blink" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-text-blink</code></a> property has been removed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=812995" title="FIXED: add 'blink' to -moz-text-decoration-line and drop -moz-text-blink">bug 812995</a>).</li> - <li>Support for the <a href="/zh-TW/docs/Web/CSS/image-orientation" title="The documentation about this has not yet been written; please consider contributing!"><code>image-orientation</code></a> property, in its CSS Images & Values Level 4 version, that is with the <code>from-image</code> keyword and EXIF support, has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=825771" title="FIXED: [css3-images] implement 'image-orientation' property">bug 825771</a>).</li> - <li>Support for <code>position: sticky</code> can be enabled by pref <code>layout.css.sticky.enabled</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=886646" title="FIXED: implement position:sticky">bug 886646</a>).</li> - <li>The support for the keyword <code>local</code> as a value of the <a href="/zh-TW/docs/Web/CSS/background-attachment" title="The documentation about this has not yet been written; please consider contributing!"><code>background-attachment</code></a> CSS property has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=483446" title="FIXED: CSS3 background-attachment: local support">bug 483446</a>).</li> - <li>Support of a non-standard Mozilla-only media query to determine the operating system version has been added: <code><a href="/en-US/docs/Web/Guide/CSS/Media_queries#-moz-os-version" title="/en-US/docs/Web/Guide/CSS/Media_queries#-moz-os-version">-moz-os-version</a></code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=810399" title="FIXED: Add a CSS Media Query for Windows 8 Desktop theme">bug 810399</a>). The property is currently only implemented on Windows.</li> - <li>The <a href="/zh-TW/docs/Web/CSS/-moz-osx-font-smoothing" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-osx-font-smoothing</code></a> CSS property has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857142" title="FIXED: Add CSS property for author control over antialiasing on Mac OS X, for cases where fonts appear too heavy">bug 857142</a>)</li> - <li>The two values <code>-moz-zoom-in</code> and <code>-moz-zoom-out</code> of the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/cursor" title=""><code>cursor</code></a> property have been unprefixed to <code>zoom-in</code> and <code>zoom-out</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=772153" title="FIXED: unprefix CSS cursor: -moz-zoom-in | -moz-zoom-out">bug 772153</a>)).</li> - <li>The blink effect for <code><a href="/en-US/docs/CSS/text-decoration" title="/en-US/docs/CSS/text-decoration">text-decoration</a>: blink;</code> has no more effect, but is still a valid value (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=857820" title="FIXED: Drop only blink effect from text-decoration: blink; and completely remove <blink> element">bug 857820</a>).</li> - <li>In-flow <a href="/zh-TW/docs/Web/CSS/::after" title="The documentation about this has not yet been written; please consider contributing!"><code>::after</code></a> and <a href="/zh-TW/docs/Web/CSS/::before" title="The documentation about this has not yet been written; please consider contributing!"><code>::before</code></a> pseudo-elements are now flex items (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867454" title="FIXED: Support ::before, ::after as flex items">bug 867454</a>).</li> - <li>Following a spec change, the initial value for <a href="/zh-TW/docs/Web/CSS/min-width" title="The documentation about this has not yet been written; please consider contributing!"><code>min-width</code></a> and <a href="/zh-TW/docs/Web/CSS/min-height" title="The documentation about this has not yet been written; please consider contributing!"><code>min-height</code></a> has been changed back to <code>0</code>, even on flex items (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848539" title="FIXED: Remove support for "min-width: auto" and "min-height: auto", since they're being dropped from flexbox spec">bug 848539</a>).</li> - <li>Support for CSS Conditionals (<a href="/zh-TW/docs/Web/CSS/@supports" title="The documentation about this has not yet been written; please consider contributing!"><code>@supports</code></a> and <a href="/zh-TW/docs/Web/API/CSS/supports" title="The documentation about this has not yet been written; please consider contributing!"><code>CSS.supports</code></a>) has been enabled by default (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=855455" title="FIXED: enable @supports rule in all builds">bug 855455</a>).</li> - <li>Support for <a href="/zh-TW/docs/Web/CSS/background-clip" title="The documentation about this has not yet been written; please consider contributing!"><code>background-clip</code></a> and <a href="/zh-TW/docs/Web/CSS/background-origin" title="The documentation about this has not yet been written; please consider contributing!"><code>background-origin</code></a> properties in the <a href="/zh-TW/docs/Web/CSS/background" title="The documentation about this has not yet been written; please consider contributing!"><code>background</code></a> shorthand has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=570896" title="FIXED: add support for different background-origin and background-clip in background shorthand (css3-background)">bug 570896</a>).</li> - <li>The <code>none</code> value of <a href="/zh-TW/docs/Web/CSS/user-select" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-user-select</code></a> has now the same behavior than the <code>-moz-none</code> value, aligning Gecko on WebKit (Chrome, Safari), Presto (Opera) and Trident (Internet Explorer) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816298" title='FIXED: Change "-moz-user-select:none" to behave like WebKit, IE, and Opera (and "-moz-user-select:-moz-none")'>bug 816298</a>).</li> - <li>On XHTML content, the <code>auto</code> value of <a href="/zh-TW/docs/Web/CSS/hyphens" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-hyphens</code></a> incorrectly applied hyphenation rules when the language was not explicitly declared. This is fixed by (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=702121" title="FIXED: Incorrect hyphenation patterns used by CSS moz-hyphens in XHTML content (en-US patterns used, regardless of lang declaration)">bug 702121</a>).</li> - <li>An <code>auto</code> value has been added to the CSS <a href="/zh-TW/docs/Web/CSS/-moz-orient" title="The documentation about this has not yet been written; please consider contributing!"><code>-moz-orient</code></a> property. The <code>auto</code> value is equivalent to <code>horizontal</code> when applied to <a href="/zh-TW/docs/Web/HTML/Element/meter" title="The documentation about this has not yet been written; please consider contributing!"><code><meter></code></a> and <a href="/zh-TW/docs/Web/HTML/Element/progress" title="The documentation about this has not yet been written; please consider contributing!"><code><progress></code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835883" title="FIXED: Give the -moz-orient property an 'auto' value, and make that its initial value">bug 835883</a>).</li> - <li>The media query <a href="/en-US/docs/Web/Guide/CSS/Media_queries#-moz-windows-glass" title="/en-US/docs/Web/Guide/CSS/Media_queries#-moz-windows-glass"><code>-moz-windows-glass</code></a> has been added on Windows 7 and earlier Windows system (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816803" title="FIXED: Need a way to detect existence of Aero Glass via CSS">bug 816803</a>).</li> - <li><a href="/en-US/docs/CSS/Using_CSS_flexible_boxes" title="CSS/Using_CSS_flexible_boxes">CSS Flexbox</a> has been unprefixed, and is now enabled by default (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841876" title="FIXED: Re-enable flexbox pref (by default) in release builds">bug 841876</a>).</li> - <li>The <code>mask-type</code> property from the <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> has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793617" title="FIXED: implement mask-type property from CSS Masking">bug 793617</a>).</li> - <li>Experimental support for the <a href="/zh-TW/docs/Web/CSS/:scope" title="The documentation about this has not yet been written; please consider contributing!"><code>:scope</code></a> pseudo-class has been added. Enabled by default in Aurora and Nightly, it can be enabled in release and beta version by setting the <code>layout.css.scope-pseudo.enabled</code> about:config preference to <code>true</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=648722" title="FIXED: Add support for :scope as :-moz-scope">bug 648722</a>).</li> - <li>Support for the viewport-relative <a href="/zh-TW/docs/Web/CSS/length" title="The documentation about this has not yet been written; please consider contributing!"><code><length></code></a> units, <code>vh</code>, <code>vw</code>, <code>vmin</code>, and <code>vmax</code>, has landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=503720" title="FIXED: Implement vw/vh/vmin/vmax (viewport sizes) from CSS 3 Values and Units">bug 503720</a>).</li> - <li>The <code>-moz-initial</code> value has been unprefixed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=806068" title="FIXED: Unprefix -moz-initial">bug 806068</a>). <code>-moz-initial</code> will be kept for a while as an alias; however, authors are strongly encouraged to switch over to <code>initial</code>.</li> - <li>The CSS <a href="/zh-TW/docs/Web/CSS/text-transform" title="The documentation about this has not yet been written; please consider contributing!"><code>text-transform</code></a> property now supports the <code>full-width</code> keyword, which allows a more seamless inclusion of Latin characters in text using ideographic fixed-width characters, like Chinese or Japanese (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=774560" title="FIXED: Implement text-transform: full-width">bug 774560</a>).</li> - <li>The CSS <a href="/zh-TW/docs/Web/CSS/page-break-inside" title="The documentation about this has not yet been written; please consider contributing!"><code>page-break-inside</code></a> has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012" title="FIXED: Implement page-break-inside: avoid">bug 685012</a>).</li> - <li>The CSS <a href="/zh-TW/docs/Web/CSS/calc" title="The documentation about this has not yet been written; please consider contributing!"><code>calc()</code></a> function can now be used on <code><color-stop></code> (on <a href="/zh-TW/docs/Web/CSS/gradient" title="The documentation about this has not yet been written; please consider contributing!"><code><gradient></code></a>).</li> - <li>The CSS <a href="/zh-TW/docs/Web/CSS/@page" title="The documentation about this has not yet been written; please consider contributing!"><code>@page</code></a> at-rule is now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=115199" title="FIXED: @page in CSS2 not implemented">bug 115199</a>). Note that the pseudo-classes <a href="/zh-TW/docs/Web/CSS/:first" title="The documentation about this has not yet been written; please consider contributing!"><code>:first</code></a>, <a href="/zh-TW/docs/Web/CSS/:right" title="The documentation about this has not yet been written; please consider contributing!"><code>:right</code></a>, and <a href="/zh-TW/docs/Web/CSS/:left" title="The documentation about this has not yet been written; please consider contributing!"><code>:left</code></a> are not yet implemented.</li> - <li>The <a href="/zh-TW/docs/Web/CSS/:-moz-placeholder" title="The documentation about this has not yet been written; please consider contributing!"><code>:-moz-placeholder</code></a> pseudo-class is replaced by the <a href="/zh-TW/docs/Web/CSS/::-moz-placeholder" title="The documentation about this has not yet been written; please consider contributing!"><code>::-moz-placeholder</code></a> pseudo-<em>element</em> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=737786" title="FIXED: Switch from :-moz-placeholder to ::-moz-placeholder (pseudo-class to pseudo-element)">bug 737786</a>).</li> -</ul> - -<h2 id="JavaScript">JavaScript</h2> - -<p>General Gecko:</p> - -<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) implementation continues!</p> - -<ul> - <li>New mathematical methods have been implemented on <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math"><code>Math</code></a>: <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Math/fround" title="/en-US/docs/JavaScript/Reference/Global_Objects/Math/fround"><code>Math.fround()</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=900125" title="FIXED: Float32: add Math.fround to the interpreter">bug 900125</a>).</li> - <li>The method <code>Array.of()</code> is now implemented on <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=866849" title="FIXED: Implement ES6 Array.of">bug 866849</a>).</li> - <li>The methods <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt" title="The documentation about this has not yet been written; please consider contributing!"><code>Number.parseInt()</code></a> and <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat" title="The documentation about this has not yet been written; please consider contributing!"><code>Number.parseFloat()</code></a> have been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=886949" title="FIXED: Add Number.parseInt and Number.parseFloat">bug 886949</a>)</li> - <li>The methods <code>Map.prototype.forEach()</code> and <code>Set.prototype.forEach()</code> are now implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=866847" title="FIXED: Implement Map#forEach and Set#forEach">bug 866847</a>)</li> - <li>New mathematical methods have been implemented on <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math"><code>Math</code></a>: <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.trunc()</code>, <code>Math.sign()</code> and <code>Math.cbrt()</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=717379" title="FIXED: Implement the new ES6 math functions">bug 717379</a>).</li> - <li>Support for binary and octal integer literals has been added: <code>0b10101010</code>, <code>0B1010</code>, <code>0o777</code>, <code>0O237</code> are now valid (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=894026" title="FIXED: Implement BinaryIntegerLiteral and OctalIntegerLiteral">bug 894026</a>).</li> - <li>The machine epsilon constant, that is <font>the smallest representible number that added to 1 will not be 1,</font> is now available as <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON" title="The documentation about this has not yet been written; please consider contributing!"><code>Number.EPSILON</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=885798" title="FIXED: Add new ES6 Number constants: EPSILON, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER">bug 885798</a>).</li> - <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/arrow_functions" title="/en-US/docs/Web/JavaScript/Reference/arrow_functions">Arrow functions</a> are no longer automatically in strict mode unless explicitly requested with <code>"use strict"</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=852762" title="FIXED: Arrow functions are not automatically strict after all">bug 852762</a>)).</li> - <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat"><code>String.prototype.repeat</code></a> JS method has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=815431" title="FIXED: implement String.prototype.repeat">bug 815431</a>).</li> - <li>The <a href="/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="/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> - <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="/en-US/docs/JavaScript/Reference/arrow_functions" title="/en-US/docs/JavaScript/Reference/arrow_functions">Arrow Function</a> syntax has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=846406" title="FIXED: Implement arrow functions">bug 846406</a>).</li> - <li>The new <a href="/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 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=839979" title="FIXED: Implement Object.is">bug 839979</a>).</li> - <li><a href="/en-US/docs/E4X" title="E4X">E4X</a>, an ancient JavaScript extension, has been removed. Implemented only in Gecko, it never got significant traction (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=788293" title="FIXED: Remove E4X from SpiderMonkey">bug 788293</a>).</li> - <li><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt" title="">parseInt</a> no longer treats strings with leading "0" as octal (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=786135" title='FIXED: Make parseInt("042") === 42, now that other engines are moving that way'>bug 786135</a>).</li> - <li>Support for the <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/WeakMap" title="JavaScript/Reference/Global_Objects/WeakMap">Weakmap</a>.prototype.clear()</code> method, recently added to the Harmony (EcmaScript 6) draft proposal has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=814562" title="FIXED: Implement clear() on WeakMaps">bug 814562</a>).</li> - <li>Support for the <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Math/imul" title="JavaScript/Reference/Global_Objects/Math/imul"><code>Math.imul()</code></a> method, a C-style 32-bit multiplication function. Though proposed for Harmony (EcmaScript 6) it has not yet accepted and still is non-standard (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=808148" title="FIXED: prototype Math.imul">bug 808148</a>).</li> - <li>Web apps using draggable text with Kinetic 3.x are working, even when using the Cairo canvas backend (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835064" title="Firefox 18 won't drag text on some installations.">bug 835064</a>).</li> - <li>The <a href="/en-US/docs/JavaScript/Reference/Statements/for_each...in" title="JavaScript/Reference/Statements/for_each...in"><code>for each…in</code></a> statement has been deprecated and should not be used. Consider using the new <a href="/en-US/docs/JavaScript/Reference/Statements/for...of" title="JavaScript/Reference/Statements/for...of"><code>for…of</code></a> statement (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=804834" title='FIXED: Hide "for each" from content'>bug 804834</a>).</li> - <li>Support for the <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a>.prototype.keys</code>, <code><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a></code>.prototype.values</code>, and <code><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a></code>.prototype.entries</code> has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=817368" title="FIXED: Map.prototype.{keys,values,entries}">bug 817368</a>).</li> - <li><code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Map" title="JavaScript/Reference/Global_Objects/Map">Map</a></code> and <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Set" title="JavaScript/Reference/Global_Objects/Set">Set</a></code> objects have changed from having a <code>size()</code> method to a <code>size</code> property (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807001" title="FIXED: Map.prototype.size and Set.prototype.size should be accessor properties">bug 807001</a>).</li> - <li><code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Map" title="JavaScript/Reference/Global_Objects/Map">Map</a></code> and <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Set" title="JavaScript/Reference/Global_Objects/Set">Set</a></code> objects also have a clear() method now. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=805003" title="FIXED: Implement Map.prototype.clear and Set.prototype.clear methods">bug 805003</a>).</li> -</ul> - -<h2 id="Telephony-specific_additions_(mostly_API-related)">Telephony-specific additions (mostly API-related)</h2> - -<ul> - <li>Fuzzy matcher API for phone numbers (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=883923" title="FIXED: Provide a Fuzzy Matcher API for phone numbers">bug 883923</a>)</li> - <li>CDMA - <ul> - <li>Registration info (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=882984" title="FIXED: [B2G] [CDMA] Update nsIDOMMozMobileCellInfo to also report base station id, base station latitude, base station longitude, system id, network id">bug 882984</a>) - <ul> - <li>(<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=882984" title="FIXED: [B2G] [CDMA] Update nsIDOMMozMobileCellInfo to also report base station id, base station latitude, base station longitude, system id, network id">bug 882984</a>)</li> - <li>multiple new CDMA specific attributes in <code>MozMobileCellInfo</code></li> - <li>dom/network/interfaces/nsIDOMMobileConnection.idl</li> - </ul> - </li> - <li>Emergency callback mode support (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=887690" title="FIXED: B2G RIL: Support emergency callback mode">bug 887690</a>) - <ul> - <li>new method <code>exitEmergencyCbMode</code> and new event <code>emergencycbmodechange</code> in <code>MozMobileConnection</code></li> - <li>dom/network/interfaces/nsIDOMMozEmergencyCbModeEvent.idl</li> - </ul> - </li> - <li>OTASP (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=882983" title="FIXED: B2G RIL: Support for CDMA OTASP - expose ota status">bug 882983</a>) - <ul> - <li>new event <code>otastatuschange</code> in <code>MozMobileConnection</code></li> - <li>dom/network/interfaces/nsIDOMMozOtaStatusEvent.idl</li> - </ul> - </li> - <li>MDN/MIN (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=869778" title="FIXED: [B2G][CDMA]Get the CDMA subscription information.">bug 869778</a>) - <ul> - <li>new interface <code>MozGsmIccInfo</code> & <code>MozCdmaIccInfo</code></li> - <li>new attribute <code>iccType</code> in <code>MozIccInfo</code></li> - <li>dom/icc/interfaces/nsIDOMIccInfo.idl</li> - </ul> - </li> - <li>Preferred voice mode (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=869769" title="FIXED: [B2G][CDMA] Set and Query the preferred voice mode in CDMA">bug 869769</a>) - <ul> - <li>new methods <code>setVoicePrivacyMode</code> and <code>getVoicePrivacyMode</code> in <code>MozMobileConnection</code></li> - <li>dom/network/interfaces/nsIDOMMobileConnection.idl</li> - </ul> - </li> - <li>Roaming preference (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=869768" title="FIXED: [B2G][CDMA] Set and Query the roaming preference in CDMA">bug 869768</a>) - <ul> - <li>new methods <code>setRoamingPreference</code> and <code>getRoamingPreference</code> in <code>MozMobileConnection</code></li> - <li>dom/network/interfaces/nsIDOMMobileConnection.idl</li> - </ul> - </li> - <li>Call Waiting (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=822210" title="FIXED: B2G CDMA: support call waiting">bug 822210</a>) - <ul> - <li>new attribute <code>secondNumber</code> in <code>TelephonyCall</code></li> - <li>dom/webidl/TelephonyCall.webidl</li> - </ul> - </li> - </ul> - </li> - <li>Support Change Call Barring Password (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=905479" title="FIXED: B2G RIL: Support Change Call Barring Password">bug 905479</a>) - <ul> - <li>new method <code>changeCallBarringPassword</code> in <code>MozMobileConnection</code></li> - <li>dom/network/interfaces/nsIDOMMobileConnection.idl</li> - </ul> - </li> - <li>Move ICC functions out from <code>MobileConnection</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=875721" title="FIXED: B2G RIL: Move iccInfo related attribute/event from mozMobileConnection to mozIccManager">bug 875721</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=874744" title="FIXED: B2G RIL: Move card state related attribute/event from mozMobileConnection to mozIccManager">bug 874744</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=860585" title="FIXED: B2G RIL: Move cardLock related API from mozMobileConnection to mozIccManager">bug 860585</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859220" title="FIXED: B2G RIL: Separate MozIccManager from MozMobileConnection">bug 859220</a>) - <ul> - <li><code>MozIccInfo</code> - <ul> - <li><code>navigator.mozIccManager.iccInfo</code></li> - <li>new interface</li> - <li>dom/icc/interfaces/nsIDOMIccInfo.idl</li> - </ul> - </li> - <li><code>MozIccManager</code> - <ul> - <li><code>navigator.mozIccManager</code></li> - <li>new attributes, methods, and events</li> - <li>dom/icc/interfaces/nsIDOMIccManager.idl</li> - </ul> - </li> - <li><code>MozMobileConnection</code> - <ul> - <li><code>navigator.mozMobileConnection</code></li> - <li>numerous attributes, methods and events removed</li> - <li>dom/network/interfaces/nsIDOMMobileConnection.idl</li> - </ul> - </li> - <li><code>nsIDOMMozMobileICCInfo</code> - <ul> - <li><code>navigator.mozMobileConnection.iccInfo</code></li> - <li>interface removed</li> - </ul> - </li> - </ul> - </li> - <li>ICC card lock improvements - <ul> - <li>Rename <code>ICCCardLockErrorEvent</code> to <code>IccCardLockErrorEvent</code> - <ul> - <li>dom/webidl/IccCardLockErrorEvent.webidl</li> - </ul> - </li> - <li>Retry count (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=886239" title="FIXED: B2G RIL: Remove retryCount from MobileConnection">bug 886239</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=875710" title="FIXED: B2G RIL: Get PIN/PUK remaining retry count">bug 875710</a>) - <ul> - <li>attribute <code>retryCount</code> removed from <code>MozMobileConnection</code></li> - <li>new method <code>getCardLockRetryCount</code> in <code>MozIccManager</code></li> - <li>dom/network/interfaces/nsIDOMMobileConnection.idl</li> - <li>dom/icc/interfaces/nsIDOMIccManager.idl</li> - </ul> - </li> - </ul> - </li> - <li>Import/export SIM Contacts (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=847741" title="FIXED: B2G RIL: Move mozContact.getSimContacts to IccManager">bug 847741</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=847820" title="FIXED: B2G RIL: Support exporting contacts to SIM card in IccManager">bug 847820</a>) - <ul> - <li>new methods <code>readContacts</code>, <code>updateContact</code> in <code>MozIccManager</code></li> - <li>dom/icc/interfaces/nsIDOMIccManager.idl</li> - </ul> - </li> - <li>ICC Secure Elements (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=840780" title="FIXED: (webicc) WebICC - Secure Elements">bug 840780</a>) - <ul> - <li>new methods <code>iccOpenChannel</code>, <code>iccExchangeAPDU</code>, <code>iccCloseChannel</code> in <code>MozIccManager</code></li> - <li>dom/icc/interfaces/nsIDOMIccManager.idl</li> - </ul> - </li> - <li>STK improvements - <ul> - <li>'duration' for Display Text, Setup Call commands (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=831630" title="FIXED: B2G STK: Add 'duration' property for DISPLAY_TEXT and SET_UP_CALL">bug 831630</a>) - <ul> - <li>new attribute <code>duration</code> in both <code>MozStkTextMessage</code> and <code>MozStkSetUpCall</code></li> - <li>dom/icc/interfaces/SimToolKit.idl</li> - </ul> - </li> - <li>support "Language Selection Event" (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=831627" title='FIXED: B2G STK: Support "Language Selection Event" Envelope command.'>bug 831627</a>) - <ul> - <li>new dictionary <code>MozStkLanguageSelectionEvent</code></li> - <li>dom/icc/interfaces/SimToolKit.idl</li> - </ul> - </li> - <li>support "Idle Screen Available Event" (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=831628" title='FIXED: B2G STK: Support "Idle Screen Available Event" Envelope command'>bug 831628</a>) - <ul> - <li>new dictionary <code>MozStkGeneralEvent</code></li> - <li>dom/icc/interfaces/SimToolKit.idl</li> - </ul> - </li> - </ul> - </li> - <li>MobileMessage - <ul> - <li>Turn <code>getSegmentInfoForText</code> into an async call (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=903403" title="FIXED: [sms][mms] Make getSegmentInfoForText() Asynchronous to Improve Typing Performance">bug 903403</a>) - <ul> - <li>dom/mobilemessage/interfaces/nsIDOMMobileMessageManager.idl</li> - </ul> - </li> - <li>Remove navigator.mozSms (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=891235" title="FIXED: WebSMS: remove navigator.mozSms">bug 891235</a>)</li> - </ul> - </li> - <li>Telephony - <ul> - <li>support "Conference Call" (certified only) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=772765" title="FIXED: B2G telephony: support conference calls">bug 772765</a>) - <ul> - <li><code>navigator.mozTelephony.conferenceGroup</code></li> - <li>new interface</li> - </ul> - </li> - </ul> - </li> -</ul> - -<h2 id="DOMAPI">DOM/API</h2> - -<p>Firefox OS-specific:</p> - -<ul> - <li><span id="summary_alias_container"><span id="short_desc_nonedit_display">Device Storage API: When getting a cursor callback from <code>navigator.getDeviceStorage("sdcard").enumerate</code>, <code><span id="summary_alias_container"><span id="short_desc_nonedit_display">this.done</span></span></code> was undefined in Firefox <1.2 (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=902565" title='this.done in cursor callback of naviagtor.getDeviceStorage("sdcard").enumerate is undefined'>bug 902565</a>). This is now fixed. The referenced bug discusses possible compatibility checks/workarounds for this issue. </span></span></li> - <li>The <a href="/zh-TW/docs/Web/API/RTCPeerConnection" title="The documentation about this has not yet been written; please consider contributing!"><code>RTCPeerConnection</code></a> Interface from WebRTC is implemented, but currently disabled by default in B2G, as it is not yet functional on Firefox OS devices (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=942343" title="FIXED: Pref off media.peerconnection.enabled on Firefox OS">bug 942343</a>.)</li> - <li><a href="/zh-TW/docs/Web/API/Notification" title="Notifications API 的 Notification interface 是用來設置及顯示「桌面通知」給使用。"><code>Web notifications</code></a> are supported in Firefox 1.2, therefore the <code>Notification</code> object should be used in preference to the old deprecated <a href="/zh-TW/docs/Web/API/Window/navigator/mozNotification" title="The documentation about this has not yet been written; please consider contributing!"><code>mozNotification</code></a> object (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=899574" title="FIXED: Notification API follow-up: provide a way to get current Notification objects">bug 899574</a> .)</li> - <li><a href="/zh-TW/docs/Web/API/Window/navigator/mozInputMethod" title="The documentation about this has not yet been written; please consider contributing!"><code>mozInputMethod</code></a> has been added to allow for people to write 3rd party keyboards. See the test application in gaia/test_apps for a reference implementation.</li> - <li>The Media Recording API has been implemented (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=803414" title="FIXED: Media Recording - Web API & Implementation">bug 803414</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=889720" title="FIXED: Media Recording - implement Pause/Resume DOM API">bug 889720</a>)</li> - <li>KeyboardEvent.repeat now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=600117" title="FIXED: Implement DOM3 KeyboardEvent.repeat">bug 600117</a>)</li> - <li>3rd party keyboards now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816869" title="FIXED: [Meta] Enable third-party keyboards">bug 816869</a>)</li> -</ul> - -<div id="magicdomid15">New WebGL 1 extensions supported in Firefox OS 1.2:</div> - -<ul> - <li><a href="http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/">OES_element_index_uint</a></li> - <li><a href="http://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/">OES_texture_float_linear</a></li> - <li><a href="http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/">OES_vertex_array_object</a></li> - <li><a href="http://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/">WEBGL_draw_buffers</a></li> - <li id="magicdomid26"><a href="http://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/">ANGLE_instanced_arrays</a></li> -</ul> - -<div class="note"> -<div><strong>Note</strong>: availability of these extensions depends on device capabilities; not all extensions will be available on all devices.</div> -</div> - -<p>General Gecko:</p> - -<ul> - <li>A <code>.default</code> attribute has now been added to the DeviceStorage API (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=874213" title="FIXED: DeviceStorage: Add a .default attribute to the device storage object.">bug 874213</a>)</li> - <li>The TCP Socket API has landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=797561" title="FIXED: Expose a server tcp socket API to web applications">bug 797561</a>)</li> - <li>Make the last argument (doctype) to <a href="/zh-TW/docs/Web/API/DOMImplementation/createDocument" title="The documentation about this has not yet been written; please consider contributing!"><code>DOMImplementation.createDocument</code></a> optional (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=909859" title="FIXED: Make the doctype argument of createDocument optional">bug 909859</a>).</li> - <li>Implement the new <a href="/zh-TW/docs/Web/API/Element/classList" title="Element.classList 唯讀屬性代表了該元素所擁有之類別屬性(Class Attribute)的即時更新集-DOMTokenList。"><code>element.classList</code></a> specification which permits adding/removing several classes with one call (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=814014" title="FIXED: implement the new classList specification which permits adding/removing several classes with one call">bug 814014</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/URL/URL" title="The documentation about this has not yet been written; please consider contributing!"><code>URL()</code></a> constructor have been implemented on the <a href="/zh-TW/docs/Web/API/URL" title="URL 介面提供了建立 URL 物件的靜態方法。"><code>URL</code></a> interface (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=887364" title="FIXED: Implement URL API">bug 887364</a>).</li> - <li>The properties <a href="/zh-TW/docs/Web/API/URLUtils/origin" title="The documentation about this has not yet been written; please consider contributing!"><code>URLUtils.origin</code></a>, <a href="/zh-TW/docs/Web/API/URLUtils/password" title="The documentation about this has not yet been written; please consider contributing!"><code>URLUtils.password</code></a>, and <a href="/zh-TW/docs/Web/API/URLUtils/username" title="The documentation about this has not yet been written; please consider contributing!"><code>URLUtils.username</code></a> are now available to all interfaces implementing <a href="/zh-TW/docs/Web/API/URLUtils" title="The documentation about this has not yet been written; please consider contributing!"><code>URLUtils</code></a>: <a href="/zh-TW/docs/Web/API/URL" title="URL 介面提供了建立 URL 物件的靜態方法。"><code>URL</code></a>, <a href="/zh-TW/docs/Web/API/Location" title="The documentation about this has not yet been written; please consider contributing!"><code>Location</code></a>, <a href="/zh-TW/docs/Web/API/HTMLAnchorElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLAnchorElement</code></a>, and <a href="/zh-TW/docs/Web/API/HTMLAreaElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLAreaElement</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=887364" title="FIXED: Implement URL API">bug 887364</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/URL" title="URL 介面提供了建立 URL 物件的靜態方法。"><code>URL</code></a> interface is now accessible from Web Workers (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=887364" title="FIXED: Implement URL API">bug 887364</a>).</li> - <li>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 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=785884" title="FIXED: Implement support for temporary storage (aka shared pool)">bug 785884</a>).</li> - <li>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> - <li>The <a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/Web_Audio_API">Web Audio API</a> is now supported. An incomplete implementation was previously available behind a preference (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=779297" title="FIXED: Implement and ship Web Audio">bug 779297</a>).</li> - <li>Some IME related keys on Windows are supported by <code>KeyboardEvent.key</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=865565" title="FIXED: D3E KeyboardEvent.key values of IME related keys should be considered with keyboard layout locale">bug 865565</a>), see <a href="/en-US/docs/Web/API/KeyboardEvent#keyname_table_win" title="/en-US/docs/Web/API/KeyboardEvent#keyname_table_win">the key name table</a> for the detail.</li> - <li>Firefox for Metro now dispatches key events in the same way as the desktop version (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=843236" title="FIXED: Defect - Send the correct DOM keycodes in keyboard events from metro widget for US and non-US keyboards">bug 843236</a>).</li> - <li><code>keypress</code> event is no longer dispatched if <code>preventDefault()</code> of preceding <code>keydown</code> event is called (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=501496" title="FIXED: preventDefault on keydown does not cancel following keypress">bug 501496</a>), see <a href="/en-US/docs/Web/Reference/Events/keydown#preventDefault()_of_keydown_event" title="/en-US/docs/Web/Reference/Events/keydown#preventDefault()_of_keydown_event">the document of <code>keydown</code> event</a> for the detail.</li> - <li>Renamed the <code>Future</code> interface to <code>Promise</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=884279" title="FIXED: renaming future to promise">bug 884279</a>).</li> - <li>The <code>srcDoc</code> property on the <a href="/zh-TW/docs/Web/API/HTMLIFrameElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLIFrameElement</code></a> interface, allowing the inline specification of the content of an <a href="/zh-TW/docs/Web/HTML/Element/iframe" title="The documentation about this has not yet been written; please consider contributing!"><code><iframe></code></a>, is now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=802895" title="FIXED: implement <iframe srcdoc=''> to allow document content in iframe to be specified inline">bug 802895</a>).</li> - <li>The <code>createTBody()</code> method on the <a href="/zh-TW/docs/Web/API/HTMLTableElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLTableElement</code></a> interface, allowing to get its <a href="/zh-TW/docs/Web/HTML/Element/tbody" title="The documentation about this has not yet been written; please consider contributing!"><code><tbody></code></a>, is now supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=813034" title="FIXED: Implement table.createTBody">bug 813034</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/Range/collapse" title="The documentation about this has not yet been written; please consider contributing!"><code>Range.collapse()</code></a> method <code>toStart</code> parameter is now optional and default to <code>false</code>, like defined in the spec (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=891340" title="FIXED: Make Range.collapse optional and default to false">bug 891340</a>).</li> - <li>Support of <a href="/zh-TW/docs/Web/API/ParentNode" title="ParentNode 介面定義了可以擁有子節點之 Node 物件的方法。"><code>ParentNode</code></a> interface on <a href="/zh-TW/docs/Web/API/Document" title="Document 介面代表所有在瀏覽器中載入的網頁,也是作為網頁內容 DOM 樹"><code>Document</code></a> and <a href="/zh-TW/docs/Web/API/DocumentFragment" title="DocumentFragment 介面表示了一個沒有父節點的最小化文件物件。DocumentFragment 被當作一種輕量化的 Document,用如同標準文件一般的方式保存片段的文件結構(由節點組成)。關鍵的區別在於文件片段不是真實的 DOM 結構,文件片段的變動並不會影響目前的網頁文件,也不會導致回流(reflow)或引起任何影響效能的情況發生。"><code>DocumentFragment</code></a> has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=895974" title="FIXED: document.firstElementChild is not defined">bug 895974</a>).</li> - <li>The <code>previousElementSibling</code> and <code>nextElementSibling</code> have been moved to <a href="/zh-TW/docs/Web/API/ChildNode" title="childNodes 介面定義了可以擁有父節點之 Node 物件的方法。"><code>ChildNode</code></a> allowing them to be called not only on a <a href="/zh-TW/docs/Web/API/Element" title="Element 介面表示了一個在 Document 中的物件,其描述了各類型元素的共同屬性與方法,Element 的子介面則定義了不同類型元素的具體行為並增加額外的功能。"><code>Element</code></a> object but also on a <a href="/zh-TW/docs/Web/API/CharacterData" title="CharacterData 介面表示了含有字元的 Node 物件。CharacterData 為抽象介面,代表不會有型別為 CharacterData 的物件。物件是由其子介面,如 Text、Comment 或 ProcessingInstruction 等非抽象介面來實作。"><code>CharacterData</code></a> or <a href="/zh-TW/docs/Web/API/DocumentType" title="DocumentType 介面表示了一個代表文件類型的 Node 節點。"><code>DocumentType</code></a> object (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=895974" title="FIXED: document.firstElementChild is not defined">bug 895974</a>).</li> - <li>The <code>navigator.geolocation</code> property has been updated to match the spec. It never returns <code>null</code>. When the preference <code>geo.enabled</code> is set to <code>false</code>, it now returns <code>undefined</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=884921" title="FIXED: Align navigator.geolocation with spec">bug 884921</a>).</li> - <li>The <code>videoPlaybackQuality</code> attribute on the <a href="/zh-TW/docs/Web/API/HTMLVideoElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLVideoElement</code></a> interface has been changed to the <code>getVideoPlaybackQuality</code> method. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=889205" title="FIXED: Make HTMLVideoElement.videoPlaybackQuality a method">bug 889205</a>)</li> - <li>Support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Range.Range" title="The Range() constructor returns a newly created Range object whose start and end is the global Document object."><code>Range()</code></a> constructor has been added (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=868999" title="FIXED: Range should be constructable">bug 868999</a>).</li> - <li>Support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Text.Text" title="The Text() constructor returns a newly created Text object with the optional DOMString given in parameter as its textual content."><code>Text()</code></a> constructor has been added (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=869000" title="FIXED: Text should be constructable">bug 869000</a>).</li> - <li>Support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Comment.Comment" title="The Comment() constructor returns a newly created Comment object with the optional DOMString given in parameter as its textual content."><code>Comment()</code></a> constructor has been added (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=869006" title="FIXED: Comment should be constructable">bug 869006</a>).</li> - <li>Support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment.DocumentFragment" title="The DocumentFragment() constructor returns an empty newly created DocumentFragment object ."><code>DocumentFragment()</code></a> constructor has been added (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=869002" title="FIXED: DocumentFragment should be constructable">bug 869002</a>).</li> - <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent" title="The FocusEvent interface represents focus-related events like focus, blur, focusin, or focusout."><code>FocusEvent</code></a> interface has been implemented (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=855741" title="FIXED: FocusEvent interface is missing">bug 855741</a>).</li> - <li>Support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/ChildNode.remove" title="The ChildNode.remove method removes the object from the tree it belongs to."><code>ChildNode.remove()</code></a> method has been added (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=856629" title="FIXED: Implement ChildNode.remove()">bug 856629</a>).</li> - <li>The interfaces related to the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track" title="The track element is used as a child of the media elements—<audio> and <video>—and does not represent anything on its own. It lets you specify timed text tracks (or time-based data)."><code><track></code></a> element, <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement" title="The HTMLTrackElement interface provides access to the properties of <track> elements, as well as methods to manipulate them."><code>HTMLTrackElement</code></a>, <a class="new" href="https://developer.mozilla.org/en-US/docs/Web/API/TextTrack" title="The documentation about this has not yet been written; please consider contributing!"><code>TextTrack</code></a>, <a class="new" href="https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue" title="The documentation about this has not yet been written; please consider contributing!"><code>TextTrackCue</code></a>, <a class="new" href="https://developer.mozilla.org/en-US/docs/Web/API/TextTrackList" title="The documentation about this has not yet been written; please consider contributing!"><code>TextTrackList</code></a>, and <a class="new" href="https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCueList" title="The documentation about this has not yet been written; please consider contributing!"><code>TextTrackCueList</code></a> have been implemented behind the <code>media.webvtt.enabled</code> property, defaulting to <code>false</code> (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=833385" title="FIXED: [webvtt] Implement Track element and TextTrack* DOM classes">bug 833385</a>).</li> - <li>The <a class="new" href="https://developer.mozilla.org/en-US/docs/Web/API/Gamepad" title="The documentation about this has not yet been written; please consider contributing!"><code>Gamepad</code></a> interface, and <a class="new" href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getGamepads" title="The documentation about this has not yet been written; please consider contributing!"><code>Navigator.getGamepads</code></a> have been implemented behind the <code>dom.gamepad.enabled</code> property, defaulting to <code>false</code> (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=690935" title="FIXED: Implement navigator.getGamepads() method">bug 690935</a>).</li> - <li>On desktop Firefox only, <code>HTMLCanvasElement.getContext()</code> can now take the <code>webgl</code> value, in addition to <code>experimental-webgl</code> (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=870232" title='FIXED: Implement getContext("webgl") for Desktop FF'>bug 870232</a>).</li> - <li>The non-standard method <code>mozLoadFrom()</code> of <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement" title="The HTMLMediaElement interface has special properties and methods (beyond the properties and methods available for all children of HTMLElement), that are common to all media-related objects."><code>HTMLMediaElement</code></a> has been removed (<a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=877135" title="FIXED: Remove mozLoadFrom">bug 877135</a>).</li> - <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> is now supported, but only for non-printable keys (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=842927" title="FIXED: Implement DOM3 KeyboardEvent.key only for non-printable key, first">bug 842927</a>).</li> - <li>The <code>title</code> attribute of <a href="/zh-TW/docs/Web/API/DOMImplementation/createHTMLDocument" title="The documentation about this has not yet been written; please consider contributing!"><code>DOMImplementation.createHTMLDocument</code></a> is now optional as per updated DOM specification.</li> - <li>The ability to add a sidebar panel (<code>window.sidebar.addPanel</code>) has been dropped (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=691647" title="FIXED: clean up nsISidebar (remove window.sidebar.addPanel/addPersistentPanel)">bug 691647</a>).</li> - <li>The unprefixed <a href="/zh-TW/docs/Web/API/Window/requestAnimationFrame" title="The documentation about this has not yet been written; please consider contributing!"><code>Window.requestAnimationFrame</code></a> and <a href="/zh-TW/docs/Web/API/Window/cancelAnimationFrame" title="The documentation about this has not yet been written; please consider contributing!"><code>Window.cancelAnimationFrame</code></a> methods has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=704063" title="FIXED: Add unprefixed requestAnimationFrame">bug 704063</a>).</li> - <li>The callback for <a href="/zh-TW/docs/Web/API/Window/requestAnimationFrame" title="The documentation about this has not yet been written; please consider contributing!"><code>Window.requestAnimationFrame</code></a> now receives a <a href="/zh-TW/docs/Web/API/DOMHighResTimeStamp" title="The documentation about this has not yet been written; please consider contributing!"><code>DOMHighResTimeStamp</code></a> as argument instead of the less precise <a href="/zh-TW/docs/Web/API/DOMTimeStamp" title="The documentation about this has not yet been written; please consider contributing!"><code>DOMTimeStamp</code></a> used in the unprefixed version (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=753453" title="FIXED: requestAnimationFrame callback should return DOMHighResTimeStamp">bug 753453</a>).</li> - <li>The text argument for <a href="/zh-TW/docs/Web/API/Window/alert" title="The documentation about this has not yet been written; please consider contributing!"><code>window.alert</code></a> and <a href="/zh-TW/docs/Web/API/Window/confirm" title="The documentation about this has not yet been written; please consider contributing!"><code>window.confirm</code></a> is now optional (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=861605" title="FIXED: Make the arguments to Window.alert, Window.confirm optional">bug 861605</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/HTMLMediaElement/initialTime" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLMediaElement.initialTime</code></a> property, removed from the spec, is no more supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=742537" title="FIXED: Remove HTMLMediaElement.initialTime">bug 742537</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/AnimationEvent/AnimationEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>AnimationEvent()</code></a> constructor has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848293" title="FIXED: Update AnimationEvent to be compatible with the spec">bug 848293</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/AnimationEvent/pseudoElement" title="The documentation about this has not yet been written; please consider contributing!"><code>AnimationEvent.pseudoElement</code></a> property has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848293" title="FIXED: Update AnimationEvent to be compatible with the spec">bug 848293</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/TransitionEvent/TransitionEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>TransitionEvent()</code></a> constructor has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848291" title="FIXED: Update TransitionEvent to be compatible with the spec">bug 848291</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/TransitionEvent/pseudoElement" title="The documentation about this has not yet been written; please consider contributing!"><code>TransitionEvent.pseudoElement</code></a> property has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848291" title="FIXED: Update TransitionEvent to be compatible with the spec">bug 848291</a>).</li> - <li>The non-standard <a href="/zh-TW/docs/Web/API/TransitionEvent/initTransitionEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>TransitionEvent.initTransitionEvent()</code></a> and <a href="/zh-TW/docs/Web/API/AnimationEvent/initAnimationEvent" title='The AnimationEvent.initAnimationEvent() method Initializes an animation event created using the deprecated Document.createEvent("AnimationEvent") method.'><code>AnimationEvent.initAnimationEvent()</code></a> have been removed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=868751" title='FIXED: Remove support for document.createEvent("AnimationEvent"), document.createEvent("TransitionEvent"), AnimationEvent.initAnimationEvent, and TransitionEvent.initTransitionEvent'>bug 868751</a>).</li> - <li>Support for the <code>multipart</code> property on <code>XMLHttpRequest</code> and <code>multipart/x-mixed-replace</code> responses in <code>XMLHttpRequest</code> has been removed. This was a Gecko-only feature that was never standardized. <a href="/en-US/docs/Server-sent_events" title="Server-sent_events">Server-Sent Events</a>, <a href="/en-US/docs/WebSockets" title="WebSockets">Web Sockets</a> or inspecting <code>responseText</code> from progress events can be used instead.</li> - <li>Support for <a href="/en-US/docs/WebAPI/Using_Web_Notifications" title="/en-US/docs/WebAPI/Using_Web_Notifications">Web Notifications</a> has been landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=782211" title="FIXED: Implement notification API spec">bug 782211</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/FormData" title="FormData 介面提供了一個簡單的方式來建立表單欄位與其值的名值對(key/value)集合,還能方便的使用 XMLHttpRequest.send() 方法來送出表單資料。如果 <form> 元素的 enctype 屬性(attribute)值為 multipart/form-data 編碼,則 FormData 物件也會採用與表單相同的格式。"><code>FormData</code></a> <code>append</code> method now accepts a third optional <code>filename</code> parameter (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=690659" title="FIXED: filename parameter in the FormData.append method">bug 690659</a>).</li> - <li><a href="/zh-TW/docs/Web/API/Node/isSupported" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.isSupported</code></a> has been removed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801562" title="FIXED: Remove Node.isSupported">bug 801562</a>).</li> - <li><a href="/zh-TW/docs/Web/API/Node/setUserData" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.setUserData</code></a> and <a href="/zh-TW/docs/Web/API/Node/getUserData" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.getUserData</code></a> has been removed for web content and are deprecated for chrome content (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=842372" title="FIXED: Make getUserData and setUserData ChromeOnly">bug 842372</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/Element/attributes" title="The documentation about this has not yet been written; please consider contributing!"><code>Element.attributes</code></a> property has been moved there from <a href="/zh-TW/docs/Web/API/Node" title="Node 是一個被多種 DOM 類型繼承的介面,它讓各種類型的 DOM 都能以同樣的方式來操作。如繼承了相同的方法,或能以相同的方式測試。"><code>Node</code></a> as required by the spec (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=844134" title="FIXED: attributes should be defined on Element and not Node">bug 844134</a>).</li> - <li>The Mac OS X backend for <a href="/zh-TW/docs/Web/API/DeviceLightEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>Ambient Light Events</code></a> has been implemented.</li> - <li>Elements in the HTML namespace with local names <a href="/zh-TW/docs/Web/HTML/Element/bgsound" title="The documentation about this has not yet been written; please consider contributing!"><code><bgsound></code></a>, <a href="/zh-TW/docs/Web/HTML/Element/multicol" title="The documentation about this has not yet been written; please consider contributing!"><code><multicol></code></a>, and <a href="/zh-TW/docs/Web/HTML/Element/image" title="The documentation about this has not yet been written; please consider contributing!"><code><image></code></a> no longer implement the <a href="/zh-TW/docs/Web/API/HTMLSpanElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLSpanElement</code></a> interface. <a href="/zh-TW/docs/Web/HTML/Element/bgsound" title="The documentation about this has not yet been written; please consider contributing!"><code><bgsound></code></a> and <a href="/zh-TW/docs/Web/HTML/Element/bgsound" title="The documentation about this has not yet been written; please consider contributing!"><code><bgsound></code></a> implement <a href="/zh-TW/docs/Web/API/HTMLUnknownElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLUnknownElement</code></a> and <a href="/zh-TW/docs/Web/HTML/Element/image" title="The documentation about this has not yet been written; please consider contributing!"><code><image></code></a> implements <a href="/zh-TW/docs/Web/API/HTMLElement" title="HTMLElement 介面表示了所有的 HTML 元素。部分元素直接實作了此介面,其它則是實作繼承自 HTMLElement 的子介面。"><code>HTMLElement</code></a>.</li> - <li>The <a href="/zh-TW/docs/Web/API/NodeIterator/detach" title="The documentation about this has not yet been written; please consider contributing!"><code>NodeIterator.detach</code></a> method has been changed to do nothing (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=823549" title="FIXED: Make NodeIterator.detach() a no-op">bug 823549</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/BlobEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>BlobEvent</code></a> interface has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=834165" title="FIXED: Implement BlobEvent">bug 834165</a>).</li> - <li>The properties <code>HTMLMediaElement.crossorigin</code> and <code>HTMLInputElement.inputmode</code> has been removed to match the spec in <a href="/zh-TW/docs/Web/API/HTMLMediaElement/crossOrigin" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLMediaElement.crossOrigin</code></a> and <code>HTMLInputElement.inputMode</code>, respectively (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=847370" title="FIXED: HTMLMediaElement - crossOrigin vs crossorigin">bug 847370</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=850346" title="FIXED: inputmode vs inputMode for nsHTMLInputElement">bug 850346</a>).</li> - <li>WebRTC: the Media Stream API and Peer Connection API are now supported by default.</li> - <li>Web Components: the <a href="/zh-TW/docs/Web/API/Document/register" title="The documentation about this has not yet been written; please consider contributing!"><code>Document.register</code></a> method has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=783129" title="FIXED: Implement the document.register interface method">bug 783129</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/ProgressEvent/initProgressEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>ProgressEvent.initProgressEvent()</code></a> constructor method has been removed. Uses the standard constructor, <a href="/zh-TW/docs/Web/API/ProgressEvent/ProgressEvent" title="The documentation about this has not yet been written; please consider contributing!"><code>ProgressEvent()</code></a> to construc and initialize <a href="/zh-TW/docs/Web/API/ProgressEvent" title="The ProgressEvent interface represents events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>)."><code>ProgressEvent</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=843489" title='FIXED: [Progress Events] Remove support for ProgressEvent.initProgressEvent() and Document.createEvent("ProgressEvent")'>bug 843489</a>).</li> - <li>Manipulated data associated with a <code><a href="/zh-TW/docs/Web/Reference/Events/cut" title="/zh-TW/docs/Web/Reference/Events/cut">cut</a></code>, <code><a href="/zh-TW/docs/Web/Reference/Events/copy" title="/zh-TW/docs/Web/Reference/Events/copy">copy</a></code>, or <code><a href="/zh-TW/docs/Web/Reference/Events/paste" title="/zh-TW/docs/Web/Reference/Events/paste">paste</a></code> event can now be accessed via the <a href="/zh-TW/docs/Web/API/ClipboardEvent/clipboardData" title="The documentation about this has not yet been written; please consider contributing!"><code>ClipboardEvent.clipboardData</code></a> property (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=407983" title="FIXED: Add support clipboardData object for the onpaste, oncopy, oncut events">bug 407983</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/HTMLTimeElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLTimeElement</code></a> interface has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=629801" title="FIXED: Implement HTML5 <time> element">bug 629801</a>).</li> - <li>When a <a href="/zh-TW/docs/Web/API/Worker" title="The documentation about this has not yet been written; please consider contributing!"><code>Worker</code></a> constructor is passed an invalid URL, it now throws <a href="/zh-TW/docs/Web/API/DOMException" title="The documentation about this has not yet been written; please consider contributing!"><code>DOMException</code></a> of type <code>SECURITY_ERR</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=587251" title="FIXED: new Worker(badURL) should throw a SECURITY_ERR">bug 587251</a>).</li> - <li>The <code>origin</code> property has been added to the <a href="/zh-TW/docs/Web/API/Window/location" title="The documentation about this has not yet been written; please consider contributing!"><code>window.location</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=828261" title="FIXED: Implement `window.location.origin`.">bug 828261</a>).</li> - <li>The <code>valueAsDate</code> and <code>valueAsNumber</code> methods have been added for <code><input type="time"></code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=781570" title="FIXED: implement valueAsNumber and valueAsDate for input <input type=time>">bug 781570</a>).</li> - <li>The <code>min</code> and <code>max</code> attributes now apply to <code><input type="time"></code> too (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=781572" title="FIXED: implement the min and max attribute for <input type=time>">bug 781572</a>).</li> - <li>Some new keyCodes for volume control are supported (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=674739" title="FIXED: Implement DOM3 KeyboardEvent types for audio">bug 674739</a>).</li> - <li>Some new keyCodes for ancient keyboard layout such as AS/400 are now supported on Windows and Linux (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833719" title="FIXED: Some function keys are not working since Firefox Version 15">bug 833719</a>).</li> - <li>Various keyCode values for OEM sepecific keys on Windows are now supported again (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833719" title="FIXED: Some function keys are not working since Firefox Version 15">bug 833719</a>).</li> - <li>The function <a href="/en-US/docs/DOM/window.crypto.getRandomValues" title="DOM/window.crypto.getRandomValues"><code>window.crypto.getRandomValues</code></a> has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=440046" title="FIXED: expose secure PRNG in the DOM (window.crypto.getRandomValues)">bug 440046</a>).</li> - <li>The methods <a href="/zh-TW/docs/Web/API/NodeIterator/expandEntityReferences" title="The documentation about this has not yet been written; please consider contributing!"><code>NodeIterator.expandEntityReferences()</code></a> and <a href="/zh-TW/docs/Web/API/TreeWalker/expandEntityReferences" title="The documentation about this has not yet been written; please consider contributing!"><code>TreeWalker.expandEntityReferences()</code></a>, no more in the latest DOM spec, has been removed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=672190" title="FIXED: consider removing expandEntityReferences from NodeIterator and TreeWalker">bug 672190</a>).</li> - <li>CSSOM: the method <a href="/zh-TW/docs/Web/API/CSSKeyframesRule" title="The documentation about this has not yet been written; please consider contributing!"><code>CSSKeyframesRule</code></a><code>.insertRule</code> has been removed to <a href="/zh-TW/docs/Web/API/CSSKeyframesRule" title="The documentation about this has not yet been written; please consider contributing!"><code>CSSKeyframesRule</code></a><code>.appendRule</code> to match a spec change (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841896" title="FIXED: CSSKeyframesRule should have a `appendRule` method, not `insertRule`">bug 841896</a>).</li> - <li>CSSOM If the given parameter given to <a href="/zh-TW/docs/Web/API/CSSStyleSheet/insertRule" title="CSSStyleSheet.insertRule() 方法新增一個新的 CSS 規則,到當前的樣式表,他伴隨著一些限制."><code>CSSStyleSheet.insertRule</code></a> contains more than one rule, a <a href="/zh-TW/docs/Web/API/DOMException" title="The documentation about this has not yet been written; please consider contributing!"><code>DOMException</code></a> with a <code>SYNTAX_ERR</code> is now thrown (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=765599" title="FIXED: CSSStyleSheet.insertRule should throw when there are more than one rule">bug 765599</a>).</li> - <li>Until now, when the same headers were repeatedly set with <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#setRequestHeader" title="/en-US/docs/Web/API/XMLHttpRequest#setRequestHeader"><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 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=819051" title="FIXED: XMLHttpRequest.setRequestHeader() overwrites instead of combines values for the same header.">bug 819051</a>).</li> - <li><a href="/zh-TW/docs/Web/API/HTMLMediaElement" title="The documentation about this has not yet been written; please consider contributing!"><code>HTMLMediaElement</code></a> supports now <code>playbackRate</code> (both read and write), with pitch correction. Pitch correction can be controlled using the property <code>mozPreservesPitch</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=495040" title="FIXED: Implement playbackRate and related bits">bug 495040</a>).</li> - <li>CSSOM: Support for the new <a href="/zh-TW/docs/Web/API/CSSGroupingRule" title="The documentation about this has not yet been written; please consider contributing!"><code>CSSGroupingRule</code></a> and <a href="/zh-TW/docs/Web/API/CSSConditionRule" title="The documentation about this has not yet been written; please consider contributing!"><code>CSSConditionRule</code></a> has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=814907" title="FIXED: implement CSSGroupingRule and CSSConditionRule">bug 814907</a>).</li> - <li>CSSOM: On <a href="/zh-TW/docs/Web/API/CSSRule" title="The documentation about this has not yet been written; please consider contributing!"><code>CSSRule</code></a> the constant CSSRule.MOZ_KEYFRAME_RULE and CSSRule.MOZ_KEYFRAMES_RULE have been unprefixed to CSSRule.KEYFRAME_RULE and CSSRule.KEYFRAMES_RULE. The prefixed version are temporarily kept for helping Web author to transition their code <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816431" title="FIXED: unprefix CSSRule.MOZ_KEYFRAME{,S}_RULE constants">bug 816431</a>).</li> - <li>CSSOM: It is now possible to set the value of <code>conditionText</code> for <a href="/zh-TW/docs/Web/API/CSSMediaRule" title="The documentation about this has not yet been written; please consider contributing!"><code>CSSMediaRule</code></a> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=815021" title="FIXED: implement CSSMediaRule.conditionText assignment">bug 815021</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/DOMParser" title="DOMParser可以將XML或是HTML格式的字串轉成DOM 文件. DOMParser的規格請參閱DOM解譯與串流化."><code>DOMParser</code></a> <code>parseFromStream</code> and <code>parseFromBuffer</code> methods are no longer available from web content (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816410" title="FIXED: Convert XMLSerializer and DOMParser to WebIDL bindings">bug 816410</a>).</li> - <li>The <code><a href="/en-US/docs/XMLSerializer">XMLSerializer</a></code> <code>serializeToStream</code> method is no longer available from web content (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816410" title="FIXED: Convert XMLSerializer and DOMParser to WebIDL bindings">bug 816410</a>).</li> - <li><a href="/zh-TW/docs/Web/API/TextDecoder" title="The documentation about this has not yet been written; please consider contributing!"><code>TextDecoder</code></a> and <a href="/zh-TW/docs/Web/API/TextEncoder" title="The documentation about this has not yet been written; please consider contributing!"><code>TextEncoder</code></a> interfaces have been updated to match the latest spec (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801487" title="FIXED: Update StringEncoding API per the latest spec and fix some bugs">bug 801487</a>) and are now available in Workers (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=795542" title="FIXED: Implement StringEncoding API in Workers">bug 795542</a>).</li> - <li>Support for the <code>CSS.supports()</code> method has been added, behind the <code><code>layout.css.supports-rule.enabled</code></code> pref (off by default) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=779917" title="FIXED: Implement CSS.supports()">bug 779917</a>).</li> - <li>Support for UndoManager has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=617532" title='FIXED: implement the HTML5 "undo history" feature (UndoManager interface)'>bug 617532</a>).</li> - <li>The CSSOM <a href="/zh-TW/docs/Web/API/Document/caretPositionFromPoint" title="The documentation about this has not yet been written; please consider contributing!"><code>document.caretPositionFromPoint</code></a> method, which returns a <a href="/zh-TW/docs/Web/API/CaretPosition" title="The documentation about this has not yet been written; please consider contributing!"><code>CaretPosition</code></a> has been implemented.</li> - <li>The index argument of the <a href="/zh-TW/docs/Web/API/TableRow/insertCell" title="The documentation about this has not yet been written; please consider contributing!"><code>tableRow.insertCell</code></a> and <a href="/zh-TW/docs/Web/API/Table/insertRow" title="The documentation about this has not yet been written; please consider contributing!"><code>table.insertRow</code></a> methods has been made optional as per HTML specification.</li> - <li><a href="/zh-TW/docs/Web/API/Navigator/getUserMedia" title="The documentation about this has not yet been written; please consider contributing!"><code>Navigator.getUserMedia</code></a>, still prefixed as <code>Navigator.mozGetUserMedia</code> is now activated by default.</li> - <li>The third, optional, <code>transfer</code> argument of <a href="/zh-TW/docs/Web/API/Window/postMessage" title="The documentation about this has not yet been written; please consider contributing!"><code>Window.postMessage</code></a> is now supported. It allows to transfer a sequence of <a href="/zh-TW/docs/Web/API/Transferable" title="The documentation about this has not yet been written; please consider contributing!"><code>Transferable</code></a> objects to the destination (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=822094" title="FIXED: Implement transfer parameter of window.postMessage">bug 822094</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/Element/getElementsByTagName" title="The documentation about this has not yet been written; please consider contributing!"><code>element.getElementsByTagName</code></a> method will now return <code>HTMLCollection</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=799464" title="FIXED: Make Element.getElementsBy* return HTMLCollection">bug 799464</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/File" title="File 介面提供了檔案的資訊並且允許網頁中的 JavaScript 存取檔案的內容。"><code>File</code></a> <code>mozLastModifiedDate</code> property has been implemented. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793955" title="FIXED: [DeviceStorage] files returned by DeviceStorage.get() don't always have lastModifiedDate">bug 793955</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/File" title="File 介面提供了檔案的資訊並且允許網頁中的 JavaScript 存取檔案的內容。"><code>File</code></a> <code>lastModifiedDate</code> property returns the current date, when the date of the last modification is unknown. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793459" title="FIXED: Update File.lastModifiedDate to latest spec">bug 793459</a>.</li> - <li>The <a href="/zh-TW/docs/Web/API/CanvasRenderingContext2D" title='要取得此實作此介面的實體物件,可以於一個 &amp;lt;canvas> 元素上以 "2d" 為參數呼叫 getContext() 方法:'><code>CanvasRenderingContext2D</code></a> <code>isPointInStroke</code> method has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=803124" title="FIXED: Implement isPointInStroke">bug 803124</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/HTMLCanvasElement" title="HTMLCanvasElement 介面提供控制 canvas 元素的屬性和方法. HTMLCanvasElement 介面也繼承了 HTMLElement 介面的屬性和方法."><code>HTMLCanvasElement</code></a> <code>toBlob</code> method has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=648610" title="FIXED: Implement <canvas>.toBlob">bug 648610</a>).</li> - <li>The <a href="/zh-TW/docs/Web/API/Node/isSupported" title="The documentation about this has not yet been written; please consider contributing!"><code>Node.isSupported</code></a> and the <a href="/zh-TW/docs/Web/API/Document/implementation" title="The documentation about this has not yet been written; please consider contributing!"><code>document.implementation.hasFeature()</code></a> methods have been changed to always return <code>true</code> (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801425" title="FIXED: Make hasFeature() and isSupported() always return true">bug 801425</a>).</li> - <li>When calling <code>document.createElement(null)</code>, <code>null</code> will now be stringified and works like <code>document.createElement("null")</code>.</li> -</ul> - -<h2 id="SVG">SVG</h2> - -<p>General Gecko:</p> - -<ul> - <li>Inconsistent renderings of <code><a href="/zh-TW/docs/Web/MathML/Element/mmultiscripts" title="<mmultiscripts>"><mmultiscripts></a></code>, <code><a href="/zh-TW/docs/Web/MathML/Element/msub" title="<msub>"><msub></a></code>, <code><a href="/zh-TW/docs/Web/MathML/Element/msup" title="<msup>"><msup></a></code> and <code><a href="/zh-TW/docs/Web/MathML/Element/msubsup" title="<msubsup>"><msubsup></a></code> have been unified and the error handling of these elements has been improved (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=827713" title="FIXED: Inconsistent rendering of mub / mup / msubsup / mmultiscripts">bug 827713</a>).</li> - <li>The <a href="/en-US/docs/Web/SVG/Attribute/paint-order" title="/en-US/docs/Web/SVG/Attribute/paint-order">paint-order</a> attribute has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=828805" title="FIXED: implement paint-order property from SVG 2">bug 828805</a>).</li> - <li>The implementation of the <code>contentScriptType</code> and <code>contentStyleType</code> properties has been removed from <a href="https://developer.mozilla.org/en-US/docs/Web/API/SVGSVGElement" title="/en-US/docs/Web/API/SVGSVGElement"><code>SVGSVGElement</code></a> along with the removal from SVG2 (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=819731" title="FIXED: remove contentStyleType and contentScriptType from SVGSVGElement">bug 819731</a>).</li> -</ul> - -<h2 id="MathML">MathML</h2> - -<p>General Gecko:</p> - -<ul> - <li>The <code>dir</code> attribute for controlling directionality of formulas on e.g. <code><a href="https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math" title="<math>"><math></a></code> or <code><a href="https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mrow" title="<mrow>"><mrow></a></code> elements is now equivalent to using the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/direction" title=""><code>direction</code></a> CSS property.</li> - <li>The equal sign ("=") is now <a href="https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo#attr-stretchy">stretchable</a>.</li> - <li>The "<code>updiagonalarrow</code>" value for the <code>notation</code> attribute on <code><a href="https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose" title="<menclose>"><menclose></a></code> elements has been added.</li> - <li>Negative widths for the <code><a href="/zh-TW/docs/Web/MathML/Element/mspace" title="<mspace>"><mspace></a></code> element has been implemented (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=717546" title="FIXED: Implement mspace with negative width">bug 717546</a>).</li> - <li>The <code><a href="/zh-TW/docs/Web/MathML/Element/semantics" title="<semantics>"><semantics></a></code> element now determines the visible child as described in the MathML3 specification.</li> - <li>To help MathML authors debugging "invalid-markup" errors in their documents, MathML parsing errors (such as having too many / too few child elements) and warnings about deprecated attributes or wrong attribute values are now reported to the <a href="/en-US/docs/Error_Console" title="Error_Console">Error Console</a>.</li> - <li>The <code>scriptminsize</code> attribute now accepts unitless values and percent values. They are interpreted as multiples of the default value ("<code>8pt</code>").</li> - <li>Unitless values are now also allowed for the <code>mathsize</code> and <code>fontsize</code> attributes; they multiply the default value.</li> -</ul> - -<h2 id="Network">Network</h2> - -<p>General Gecko:</p> - -<ul> - <li>We continue to update our CSP implementation to match the CSP 1.0 spec, which reached Candidate Recommendation: - <ul> - <li>Support for the spec-compliant <code>Content-Security-Policy</code> HTTP header (in addition to the experimental <code>X-Content-Security-Policy</code>) has been added (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=783049" title="FIXED: CSP : use existing/old parser for X-Content-Security-Policy header, new/CSP 1.0 spec compliant parser for Content-Security-Policy header">bug 783049</a>). <strong>Note</strong>: the patch for this new header landed in Firefox 21, it is disabled on builds (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=842657" title="FIXED: Flip the pref to enable the CSP 1.0 parser for Firefox">bug 842657</a>).</li> - </ul> - </li> -</ul> - -<h2 id="Worker">Worker</h2> - -<p>General Gecko:</p> - -<ul> - <li>The functions <a href="/zh-TW/docs/Web/API/Window/URL/createObjectURL" title="The documentation about this has not yet been written; please consider contributing!"><code>URL.createObjectURL</code></a> and <a href="/zh-TW/docs/Web/API/Window/URL/revokeObjectURL" title="The documentation about this has not yet been written; please consider contributing!"><code>URL.revokeObjectURL</code></a> are now included in the set of <a href="/en-US/docs/DOM/Worker/Functions_available_to_workers" title="DOM/Worker/Functions_available_to_workers">functions available to workers</a>.</li> -</ul> - -<h2 id="Security">Security</h2> - -<p>General Gecko:</p> - -<ul> - <li>Mixed content blocking. Firefox will no longer load non-secure (http) resources on secure (https) pages (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=834836" title="FIXED: Turn on pref to block mixed active content">bug 834836</a>).</li> - <li>The standard syntax of <a href="/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> - -<h2 id="XForms">XForms</h2> - -<p>General Gecko:</p> - -<p>Support for <a href="/en-US/docs/XForms" title="XForms">XForms</a> has been <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>removed</strong></a> in Firefox 19.</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a href="http://www.mozilla.org/en-US/firefox/os/notes/1.2/" title="http://www.mozilla.org/en-US/firefox/os/notes/1.2/">Firefox OS 1.2 Notes</a></li> -</ul> - -<h2 id="Older_versions">Older versions</h2> - -<p></p><div class="multiColumnList"> -<ul> -<li><a href="/en-US/docs/Mozilla/Firefox_OS/Releases/1.1">Firefox OS 1.1 for developers</a></li><li><a href="/en-US/docs/Mozilla/Firefox_OS/Releases/1.0.1">Firefox OS 1.0.1 for developers</a></li></ul> -</div><p></p> - -<p> </p> - -<p>Share this article: <a href="http://mzl.la/1av9ZRr">http://mzl.la/1av9ZRr</a></p> diff --git a/files/zh-tw/archive/b2g_os/releases/index.html b/files/zh-tw/archive/b2g_os/releases/index.html deleted file mode 100644 index 3edbcd4c75..0000000000 --- a/files/zh-tw/archive/b2g_os/releases/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Firefox OS developer release notes -slug: Archive/B2G_OS/Releases -tags: - - Firefox OS - - NeedsTranslation - - TopicStub -translation_of: Archive/B2G_OS/Releases ---- -<h2 id="Firefox_OS_release_notes_by_version">Firefox OS release notes by version</h2> -<p>This section provides articles covering each new release of Gaia and Gecko for Firefox OS, explaining what features were added and bugs eliminated in each update. There is also a linked summary table showing what APIs are supported by each version of Firefox OS.</p> -<div class="multiColumnList"> - {{ListSubpages("",1,0,1)}}</div> -<h2 id="Other_supporting_information">Other supporting information</h2> -<dl> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/API_support_table">Firefox OS API support table</a></dt> - <dd> - Lists the different APIs available, and what versions of Firefox have support for them.</dd> - <dt> - <a href="/en-US/docs/Web/Apps/App_permissions">App permissions</a></dt> - <dd> - Lists hosted, privileged and certified APIs, along with information on the permissions they need to have set in the App Manifest of your installable apps, such as the manifest permission name, app type required, description, access property, and default permission.</dd> -</dl> diff --git a/files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html b/files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html deleted file mode 100644 index be4fefd747..0000000000 --- a/files/zh-tw/archive/b2g_os/running_custom_builds_in_the_app_manager/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: 在 WebIDE 中執行 Firefox OS/Gaia 自訂版本 -slug: Archive/B2G_OS/Running_custom_builds_in_the_App_Manager -translation_of: Archive/B2G_OS/Developing_Gaia/Running_custom_builds_in_WebIDE ---- -<div class="summary"> - <p><span class="seoSummary">Firefox OS 模擬器 (Firefox OS Simulator) 已於 2014 年 2 月新增功能,可執行自訂的 B2G 執行環境及/或 Gaia 設定檔 (Profile)。本文將說明相關設定方式,並透過 <a href="https://developer.mozilla.org/en-US/docs/Tools/WebIDE">WebIDE</a> 執行模擬器。</span></p> -</div> -<div class="note"> - <p><strong>注意:</strong>在本文發表之時,滑鼠事件尚未能正確對應觸控事件。例如回到主畫面鈕並無法回應滑鼠點擊的動作。但只要使用 B2G Desktop 鍵盤指令,即可解決此問題。可參閱「<a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_B2G_desktop_client">Using the B2G Desktop client</a>」。</p> -</div> -<div class="note"> - <p><strong>注意:</strong>如果你能提交 Try 版本,則可在各個 B2G 桌面平台的版本路徑中產生模擬器附加元件。如此可讓模擬器搭配自訂的 Gecko,或搭配對 Gaia 上進行的修改。在某些使用條件下可選用此較簡易的方式。</p> -</div> -<h2 id="必要條件">必要條件</h2> -<p>要在模擬器內執行自訂版本,必須齊備相關工具。</p> -<ol> - <li>安裝 Firefox 並確定其內有 <a href="https://developer.mozilla.org/en-US/docs/Tools/WebIDE">WebIDE</a> (工具<em> > </em>網頁開發者<em> > </em>WebIDE)。</li> - <li>安裝最新版 <a href="http://nightly.mozilla.org/">B2G Desktop Nightly</a>,或<a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_B2G_desktop_client#Building_the_desktop_client">建構自己的版本</a>。</li> - <li>安裝<a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/">最新版 Firefox OS 模擬器</a>套件,即 7.0pre7.20140113 或更高版本。或可將 FXOS_SIMULATOR=1 添增到自己的 mozconfig,並使用 ./mach build && ./mach package,從自己的 B2G Desktop 原始碼來建構。</li> - <li>用 <code>SIMULATOR=1 flag</code> 建立 Gaia 設定檔。舉例來說,你可在自己的 Gaia 路徑中執行 <code>make SIMULATOR=1 PROFILE_FOLDER=profile-b2g profile-b2g</code> 指令 (請參閱 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia/Hacking#Make_options">Hacking Gaia</a> 進一步了解)。</li> -</ol> -<h2 id="設定自己的模擬器">設定自己的模擬器</h2> -<p>你必須完成某些設定,才能讓模擬器找到你的 B2G Desktop 與自訂的 Gaia。</p> -<ol> - <li>打開附加元件管理分頁 (工具 > 附加元件;或在網址列中輸入 <code>about:addons</code>)。</li> - <li>點擊「擴充套件 (Extensions)」分頁,可列出現已安裝的套件。</li> - <li>在清單中找到新的 Firefox OS 模擬器擴充套件。應該會顯示如 <em>Firefox OS 1.3 Simulator 7.0pre.7.20140113</em>。</li> - <li>點擊此擴充套件內的「選項 (Preferences)」按鈕。<br> - <img alt="the Firefox OS simulator preferences: Preferences, disable and remove." src="https://mdn.mozillademos.org/files/7241/about-addon.png" style="width: 1247px; height: 63px; display: block; margin: 0px auto;"></li> - <li>如果你要使用自訂的可執行檔 (最新的 B2G Desktop 版本),以利於 WebIDE 中執行 Firefox OS,則點擊「<em>Select a custom runtime executable</em>」旁邊的「<em>Browse...</em>」按鈕,在檔案選擇介面中找到自己的 B2G Desktop 可執行檔。如果是 Windows/Linux 環境就很好找;而在 Mac 環境中,只要安裝於 <code>Applications</code> 路徑下,就可於 <code>/Applications/B2G.app/Contents/MacOS/b2g</code> 找到。</li> - <li>你也能在 WebIDE 中執行自訂的 Gaia 設定檔。同樣點擊「<em>Select a custom Gaia profile directory</em>」旁邊的「<em>Browse...</em>」按鈕,找到自訂的設定檔路徑 (應該是 <em>gaia/profile-b2g</em>)。</li> - <li>如果要回到非自訂的模擬器,只要重新設定組態值即可。但<strong>不能</strong>單純的刪除再重新安裝模擬器附加元件。你必須開啟新的分頁,在網址列中輸入「about:config」,繼續在該頁的搜尋欄位中輸入「fxos」或「simulator」,找到如「extensions.fxos_2_0_simulator@mozilla.org.customRuntime」,或「extensions.fxos_2_0_simulator@mozilla.org.gaiaProfile」。這時按下滑鼠右鍵並點選「Reset」。最後重新啟動模擬器版本,就能使用非自訂版本的模擬器。</li> -</ol> -<h2 id="使用自訂的模擬器">使用自訂的模擬器</h2> -<p>最後說明該如何使用自訂的模擬器。</p> -<ol> - <li>啟動 <a href="https://developer.mozilla.org/en-US/docs/Tools/WebIDE">WebIDE</a> (工具<em> > </em>網頁開發者<em> > WebIDE</em>);或可按下「Shift + F8」。</li> - <li>點擊右上方的按鈕,開啟「Runtime」選單。</li> - <li>點擊「Firefox OS 1.3」按鈕 (或你安裝的任何最新版本)。即使你的 B2G desktop/Gaia 版本比較新,仍建議點選 Firefox OS 1.3 版。</li> - <li>接著就會啟動模擬器,將載入 B2G Desktop 並執行你的 B2G Nightly 版本與自訂 Gaia!</li> -</ol> -<p><img alt="a screenshot of the b2g desktop simulator " src="https://mdn.mozillademos.org/files/7239/b2g-desktop.png" style="width: 434px; height: 616px; display: block; margin: 0px auto;"></p> diff --git a/files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html b/files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html deleted file mode 100644 index ae38c355ea..0000000000 --- a/files/zh-tw/archive/b2g_os/screencast_series_colon__app_basics_for_firefox_os/index.html +++ /dev/null @@ -1,208 +0,0 @@ ---- -title: 系列影片:Firefox OS App 開發入門 -slug: 'Archive/B2G_OS/Screencast_series:_App_Basics_for_Firefox_OS' -translation_of: 'Archive/B2G_OS/Firefox_OS_apps/Screencast_series:_App_Basics_for_Firefox_OS' ---- -<div class="summary"> -<p><span class="seoSummary"><a href="http://mozilla.com.tw/firefox/os/">Firefox OS</a> 這款作業系統,就是要將 Web 帶入行動裝置所設計。Firefox OS 不是以新技術或新開發環境所建構的全新 OS;而是以行之有年的標準化 Web 技術所打造而成。如果你本身就是 Web 開發者且想建構行動 App,那麼 Firefox OS 就能提供最適合的工具,且不會要求你改變自己以熟悉的工作流程,也不需再重新學習另一套開發環境。此系列短片是由 Mozilla 與 Telenor 在挪威共同錄製而成,將引領你入門 Firefox OS App 的開發作業。</span></p> -</div> - -<p>你可透過本系列影片了解:</p> - -<ul> - <li>該如何建構自己的第一個 Firefox OS App</li> - <li>該如何在桌機與實際裝置上測試 App 並除錯</li> - <li>該如何將 App 提交至 <a href="https://developer.mozilla.org/en-US/Marketplace">Firefox Marketplace</a> 中</li> - <li>該如何使用 API,以及 Firefox OS 針對 JavaScript 所提供的特殊介面,進而存取智慧型手機中的硬體</li> -</ul> - -<div class="note"> -<p><strong>注意:</strong>每部短片均極為精簡扼要,讓你短暫休息時也能欣賞。一口氣看完整個系列也不會超過一個小時。</p> -</div> - -<h2 id="程式碼與開發環境">程式碼與開發環境</h2> - -<p>除了短片之外,你也能<a href="https://github.com/comoyo/fxos-video-script/">從 GitHub 下載程式碼範例</a>。如果你想自己測試程式碼範例,就必須先設定簡易的開發環境。必備條件如下:</p> - -<ul> - <li>最新版本的 <a href="http://mozilla.com.tw/firefox/new/">Firefox</a> (內含現成的開發工具)─ 如果你真的要把玩最新技術,那我們建議可下載 <a href="http://www.mozilla.org/en-US/firefox/aurora/">Firefox Aurora</a> 或 <a href="https://nightly.mozilla.org/">Nightly</a> 版本</li> - <li>文字編輯器 ─ 短片中使用了 <a href="http://www.sublimetext.com/">Sublime Text</a>,但其實任何文字編輯器均可。如果你想直接在 Web 上編輯程式,則可嘗試 <a href="http://brackets.io/">Adobe Brackets</a></li> - <li>可供你推播自己 Demo 檔案的伺服器。某些展示用 App 需要 HTTP 連線,而不適用本地伺服器</li> -</ul> - -<h2 id="系列影片介紹">系列影片介紹</h2> - -<p>此系列短片是由 Telenor Digital 的 <a href="http://twitter.com/janjongboom">Jan Jongboom (@janjongboom)</a> 與 <a href="http://twitter.com/sergimansilla">Sergi Mansilla (@sergimansilla)</a>,以及 Mozilla 的 <a href="http://twitter.com/codepo8">Chris Heilmann (@codepo8)</a> 於 2014 年 2 月所錄製。地點位於挪威首都奧斯陸的 Telenor Digital 辦公室內。</p> - -<p>這三位接下來將為大家簡短介紹系列影片:</p> - -<p>{{EmbedYouTube("835Z2RTPdQk")}}</p> - -<h2 id="Section_1:建構並發佈">Section 1:建構並發佈</h2> - -<h2 id="自己的第一款_Firefox_OS_App">自己的第一款 Firefox OS App</h2> - -<p>接下來 5 支短片將說明如何建構 Firefox OS App、如何在電腦和實體裝置上測試 App 並除錯、如何將 App 發佈至 <a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 中。這看起來好像很複雜,但其實只要你已經知道怎麼寫網站,就等於能完成 90% 的 App。</p> - -<h3 id="不只是網站">不只是網站</h3> - -<p>Firefox OS App 就是 HTML5 App;其所使用的技術本質上也與網站技術相同。你可以先寫個網站,再提供 manifest 檔案 (可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F/Manifest-840092-dup#csp">App manifest</a>》進一步了解) 即可將網站轉為 App。這個動作就等於告知 Firefox OS 你在撰寫 App,並可讓你:</p> - -<ul> - <li>能把 App 發佈到 Marketplace 上</li> - <li>可存取裝置的硬體,蒐集如<a href="https://developer.mozilla.org/en-US/docs/Web/API/Geolocation">地理位置資訊 (Geolocation)</a> 與<a href="https://developer.mozilla.org/en-US/Apps/Build/gather_and_modify_data/Keep_it_level_responding_to_device_orientation_changes">裝置方向 (Device Orientation)</a> 等資訊</li> - <li>還有更多功能!</li> -</ul> - -<p>HTML5 App 其實是透過網站強化其功能,也同樣遵循相同的規則,如:</p> - -<ul dir="ltr"> - <li>「Progressive enhancement」,亦即先撰寫可用的配置,再視情況套用適合的版面。</li> - <li>因應當前的執行裝置環境。如透過 <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries">media queries</a> 與 <a href="https://developer.mozilla.org/en-US/Apps/app_layout/responsive_design_building_blocks#Responsive_images.2Fvideo">responsive images</a> 而最佳化 App,已配合不同的螢幕尺寸、解析度、可用網路的速度等。</li> - <li>採用 <a href="https://developer.mozilla.org/en-US/docs/Web/HTML">HTML</a>、<a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS</a>、<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a> 作為其核心技術。</li> -</ul> - -<p>若要將網頁轉為絕佳的 App,其中的差異就在於開發者就必須考量到行動裝置使用者。也代表 App 首先必須要能:</p> - -<ul dir="ltr"> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/Offline">離線作業</a></li> - <li>在讓使用者進行某個作業之餘,也要提供可輕鬆使用的介面</li> - <li>妥善利用有限的電池容量、處理器的速度、可用的螢幕空間而能盡情把玩 App</li> -</ul> - -<p>在大多數的情況下,開發者必須稍微讓網頁「瘦身」並簡化介面。而使用者也確實能因此獲得更好的經驗。</p> - -<p>{{EmbedYouTube("oUbOw2cQC4k")}}</p> - -<div class="note"> -<p><strong>注意:</strong>若要進一步設計出絕佳的 HTML5 App,可參閱 <a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup/Publishing/In-app_payments">MDN 上的《應用程式中心》</a>一文。</p> -</div> - -<h3 id="App_的_Manifest_檔案">App 的 Manifest 檔案</h3> - -<p><a href="https://developer.mozilla.org/en-US/Apps/Developing/Manifest">Firefox OS App 的 manifest 檔案</a> (你會在「應用程式管理員 App Manager」看到中文翻譯為「安裝資訊檔」),屬於簡易的 JSON 檔案,將告知作業系統該 App 的相關訊息;另外也可將網頁轉為 <a href="https://developer.mozilla.org/en-US/Apps/Quickstart/Build/Intro_to_open_web_apps">Open Web App</a>。開發者可於 manifest 定義 App 不同語系的名稱,也可要求作業系統存取不同的服務與硬體。當然亦可定義該 App 適合的方向 (直幅或橫幅),亦能依需要而鎖定畫面。</p> - -<p>{{EmbedYouTube("UTXIVg6sYtA")}}</p> - -<p>進一步了解 manifest 檔案與相關工具:</p> - -<ul> - <li><a href="https://marketplace.firefox.com/developers/validator">Open Web Apps Manifest Validator</a> ─ 亦可作為 <a href="http://firefox-marketplace-api.readthedocs.org/en/latest/">API</a></li> - <li><a href="https://developer.mozilla.org/en-US/Apps/Developing/Manifest">Open Web App 的 Manifest 檔案相關 MDN 文章 </a> ─ 另說明該如何從自己的伺服器提供 manifest 檔案</li> -</ul> - -<h3 id="應用程式管理員_(App_Manager)">應用程式管理員 (App Manager)</h3> - -<p>要想開始入門 Firefox OS,最簡單的方法就是使用「<a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">應用程式管理員 (App Manager)</a>」。應用程式管理員也是<a href="https://developer.mozilla.org/en-US/docs/Tools/">桌面版 Firefox 的開發者工具之一</a>,可在電腦上模擬 Firefox OS 裝置。開發者可盡情把玩 Firefox OS,也可像在實際裝置上安裝並測試 App。此外,你也能離線或上線編輯 App,進而體驗 App 並進行除錯,在模擬裝置中即時看到修改之後的結果。</p> - -<p>{{EmbedYouTube("oyAlYjpK-PE")}}</p> - -<p>若要進一步了解應用程式管理員:</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">MDN 上的《</a><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">App Manager</a><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">》說明文章</a></li> - <li><a href="https://hacks.mozilla.http://blog.mozilla.com.tw/posts/3965/">介紹「應用程式管理員」的部落格文章</a></li> -</ul> - -<h3 id="在實體裝置上測試">在實體裝置上測試</h3> - -<p>在模擬器上測試 App 當然不錯,但畢竟會受限於模擬的環境。如果想測試 App 互動時的效能或畫面呈現方向,就需要實體裝置。實機同樣可搭配既有的開發者工具,以及「應用程式管理員 (App Manager)」。在實機上使用 App 時,可透過上述 2 種工具進一步了解 App 所發生的作業。而且 App 不必更新,也不必解除安裝,即可即時看到 App 的變化。</p> - -<p>{{EmbedYouTube("T8sr9SHKDHE")}}</p> - -<h3 id="發佈至_Marketplace">發佈至 Marketplace</h3> - -<p><a href="http://marketplace.firefox.com/">Firefox Marketplace</a> 可供開發者提交 App,並讓消費者能夠接觸到自己的作品。Marketplace 亦可發佈如 Firefox 桌面版與行動版所適用的 App。而消費者只需要簡單的幾個步驟,就能對 App 評分、提出反饋意見、購買自己所需的 App。要發佈自己的 App 真的很簡單:</p> - -<ul> - <li>為 manifest 檔案 (你可能會看到中文翻譯為「安裝資訊檔」) 設定網址</li> - <li>為 App 填寫必要敘述說明 (可讓消費者更快找到自己需要的 App)</li> - <li>提供 App 的截圖或影片</li> - <li>為 App 挑選適合的分類</li> - <li>填寫自己的電子郵件,讓 Mozilla 能聯絡你</li> - <li>如果開發者有自己的隱私權政策與支援服務網站,也應提供給消費者知道</li> - <li>為自己的 App 設定內容分級</li> -</ul> - -<p>{{EmbedYouTube("kk3gYALtE0Q")}}</p> - -<p>App 在提交到 Marketplace 之後,均會由 Mozilla 審查團隊進行審閱,並在幾天內就會通知審查結果。如果 App 有任何問題,在提交期間就會收到相關的檢驗訊息。開發者也有可能收到詳細的問題說明,並獲得修復問題的方法。</p> - -<h2 id="Section_2:Firefox_OS_進階說明">Section 2:Firefox OS 進階說明</h2> - -<h3 id="引言">引言</h3> - -<p>在前幾支影片中,我們談了 Firefox OS 的基礎概念、打造自己第一個 App 的步驟、在桌機與 Firefox OS 實體裝置上進行 App 除錯,最後把自己的 App 提交到 Marketplace 上。</p> - -<p>而接下來的影片會再進一步說明 Firefox OS App 的技術;也會談談存取功能,讓開發者能妥善利用平板電腦與智慧型手機。但這些技術目前僅適用於 Firefox OS,還未能擴及其他平台。Firefox OS 內的所有程式,都是針對標準化與開放源碼的目標所設計。也就是說,我們很快就能在其他裝置或平台上看到 Firefox OS App 的蹤跡。</p> - -<h3 id="Web_API">Web API</h3> - -<p>智慧型手機具備 GPS、相機、加速規等的多樣高階功能。但問題是 Web 技術並無法碰觸到這些功能技術。如果要存取這些功能,就必須撰寫原生應用程式。為了克服這個問題,Mozilla 與合作夥伴定義了一系列 API,可讓開發者以安全的方式,透過 JavaScript 存取行動裝置所搭載的硬體。這些開放的 API 即所謂的<a href="https://wiki.mozilla.org/WebAPI"> Web API</a>,同樣也提供給他人建構更多功能。Firefox OS 也是第一個使用 Web API 的平台。開發者不需另外撰寫原生的應用程式,即可存取智慧型手機上所需的功能。</p> - -<p>{{EmbedYouTube("QkpH_qugrPk")}}</p> - -<p>若要進一步了解 Web API:</p> - -<ul> - <li>此 <a href="https://wiki.mozilla.org/WebAPI">Wiki 頁面說明目前 API 的建構情形</a>;也有作為該 API 基礎的其他標準</li> - <li><a href="https://hacks.mozilla.org/category/webapi/">Mozilla Hacks 上亦有其他文章</a>提及 WebAPI</li> -</ul> - -<h3 id="Web_Activities">Web Activities</h3> - -<p><a href="https://wiki.mozilla.org/WebAPI/WebActivities">Web Activities</a> 可視為 Web API 的替代方案,同樣可存取某些特定裝置的硬體。相較於 API 直接與裝置溝通,Web Activities 則是在裝置上建立所有 App 的生態系統,讓 App 彼此相互溝通。舉例來說,App 不會存取相機而是要求圖片,讓使用者可透過自己最愛用的 App 取得圖片。也就是說,App 不要求使用者存取硬體 (偏安全性的考量),而是讓使用者所信賴的 App 去取得圖片。此外,你也可以註冊特定 App 負責處理 OS 中的特定作業。Web Activities 其實就像對桌機裡的檔案按下滑鼠右鍵,你能在右鍵選單中看到有多種 App 可開啟檔案。而使用者可要求 OS 預設特定 App 開啟此一類型的檔案。Web Activities 可讓裝置上的 App 相互溝通,而不需再透過伺服器作為媒介。App 之間傳送的資料均已為最終資料。</p> - -<p>{{EmbedYouTube("RQbCyDd9ejE")}}</p> - -<p>進一步了解 Web Actitivies:</p> - -<ul> - <li><a href="https://wiki.mozilla.org/WebAPI/WebActivities">Web Activities 的 Wiki 頁面</a></li> - <li><a href="https://hacks.mozilla.org/2013/01/introducing-web-activities/">介紹 Web Activities 的相關 Hacks 文章</a></li> -</ul> - -<h3 id="推播通知">推播通知</h3> - -<p>使用 <a href="https://wiki.mozilla.org/WebAPI/SimplePush">SimplePush WebAPI</a> 的推播通知 (Push notification) 功能,可在裝置接收到特定訊息時喚醒 App。如此可在省電狀態下讓 App 保持待機,再隨時根據需求喚醒 App;此功能對行動裝置 App 格外重要。用這種方式所傳送的通知也有其優點:這種通知不會攜帶任何資料,Mozilla 不會取得 App 的資訊,而惡意攻擊者也無法監聽。</p> - -<p>{{EmbedYouTube("F5UF4dKojzw")}}</p> - -<p>若要進一步了解 SimplePush 所推播的通知:</p> - -<ul> - <li><a href="https://wiki.mozilla.org/WebAPI/SimplePush">SimplePush 的 Wiki 頁面 </a></li> - <li>Mozilla Hacks 對 <a href="https://hacks.mozilla.org/2013/07/dont-miss-out-on-the-real-time-fun-use-firefox-os-push-notifications/">SimplePush 的介紹</a></li> -</ul> - -<h3 id="離線功能">離線功能</h3> - -<p>如果 App 無法離線作業,那可用性就會大大降低。有部分使用者也因為這個理由,比較喜歡安裝 App 之後只要開啟瀏覽器,就能在裝置的瀏覽器上查看所需的內容。其實「Web App」這個詞看起來會有「需要網路連線才能運作」的感覺。但使用者總是有無法上網的時候:飛機上必須關機、地底下收不到訊號,甚或手機內沒留任何資料。開發者應該要確保自己的 App 能離線運作。而 HTML5 即具備幾項離線作業的技術,主要就是 <a href="https://developer.mozilla.org/en-US/docs/HTML/Using_the_application_cache">AppCache</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage">DOMStorage</a>。</p> - -<p>{{EmbedYouTube("Q_WmkCzEKho")}}</p> - -<p>進一步了解離線功能:</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage">DOMStorage 的 Wiki 頁面</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/HTML/Using_the_application_cache">AppCache 的 Wiki 頁面</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/IndexedDB/Using_IndexedDB">使用 IndexedDB</a> - 用戶端的進階儲存方式</li> - <li><a href="https://github.com/mozilla/localForage">LocalForage</a> 是 Firefox OS 中所使用的 wrapper,可兼顧 DOMStorage 的簡單易用,與 IndexedDB 的強大功能 (<a href="https://hacks.mozilla.org/2014/02/localforage-offline-storage-improved/">本篇 Mozilla Hacks 文章</a> 另外詳細說明)</li> -</ul> - -<h2 id="深入了解">深入了解</h2> - -<p>我們希望這一系列的影片,能夠順利帶領開發者建構出自己的第一款 Open Web App。如果你很感興趣也想了解更多細節,也有許多其他資源與管道可供你利用:</p> - -<p>{{EmbedYouTube("UVf2EVrLpl8")}}</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/docs/Apps/">MDN 上的「應用程式中心」</a>另提供有關絕佳 Open Web App 的設計訣竅、可供下載的範例程式碼,另有將自己 App 提交到 Marketplace 的詳細說明</li> - <li><a href="https://hacks.mozilla.org">Hacks 部落格</a>將持續提供 Firefox OS App 的文章 (當然也有像你的第三方開發者所撰寫的心得文),並有說明 WebAPI 等不同技術的進階文章,讓你能提早了解下一版 Firefox 與 Firefox OS 所將具備的特色功能</li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS">MDN 的 Firefox OS 區塊</a>以及 <a href="https://wiki.mozilla.org/B2G">B2G 的 Wiki 頁面</a>,均有 Firefox OS 的深入資訊</li> - <li>我們很多人都掛在 IRC 上;只要到 <a href="http://irc.mozilla.org">irc.mozilla.org</a> 並透過 #devrel、#b2g、#openwebapps、#marketplace 都能找到我們</li> -</ul> - -<p>歡迎大家多多交流</p> - -<p>影片錄製人:Chris、Sergi、Jan</p> diff --git a/files/zh-tw/archive/b2g_os/security/application_security/index.html b/files/zh-tw/archive/b2g_os/security/application_security/index.html deleted file mode 100644 index 3e8f8d576e..0000000000 --- a/files/zh-tw/archive/b2g_os/security/application_security/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: 應用程式安全 -slug: Archive/B2G_OS/Security/Application_security -translation_of: Archive/B2G_OS/Security/Application_security ---- -<div class="summary"> - <p>本文涵蓋 Firefox OS 應用程式安全模型細節內容。</p> -</div> -<p>Firefox OS Web app 核心安全控制如下:</p> -<ul> - <li>Web app 並非瀏覽器中的網頁,而是實際需要安裝後執行的,為了保護使用者更新和移除 app 都會有安全管理機制。</li> - <li>存取 Web API 都有權限系統管制,Web app 安裝前必須宣告會使用到那些權限,如果要存取功能更強大的 API,Web app 還得要符合特定條件、被檢驗、受到 Marketplace 簽署。</li> - <li>Web app 都在 sandbox 環境下運作,只能看到自己的資源 (cookies、離線 IndexedDB 資料庫等等)。即使剛好兩個 app 載入一樣網址的網頁,這兩份網頁也不會被視為來自同一個網域。</li> -</ul> -<h3 id="App_類別">App 類別</h3> -<p>Firefox OS 支援: "<strong>web</strong>", "<strong>privileged</strong>" 和 <strong>internal</strong> ("<strong>certified</strong>") 三種類別的 Web app,app 的類別宣告在 <a href="/en-US/docs/Apps/Manifest" title="/en-US/docs/Apps/Manifest">manifest</a> 裡 (另外使用權限也在裡面) 。</p> -<ul> - <li><strong>Web Apps:</strong> 大多數第三方 app 都屬於這一類;算是預設類別,沒有超出網頁可用的多餘權限。Web app 能自其他網站安裝而無須額外的驗證程序,也可以被<a href="/en-US/docs/Web/Apps/Packaged_apps" title="/en-US/docs/Web/Apps/Packaged_apps">封裝 (packaged)</a> 起來,但同樣沒有多餘權限。</li> - <li><strong>Privileged Apps</strong>: 要求提高權限的 app,一定要被驗證以及通過 Marketplace 簽署。</li> - <li><strong>Internal/Certified Apps: </strong>只能,如被 OEM 廠商,預裝的 app。</li> -</ul> -<div class="note"> - <p><strong>Note</strong>: 關於 App 類別,詳細說明請見 <a href="/en-US/docs/Apps/Manifest#type" title="/en-US/docs/Apps/Manifest#type">App Manifest</a>。</p> -</div> -<h3 id="App_下載">App 下載</h3> -<p>Firefox OS 共有兩種 App 下載機制:hosted 以及 packaged。一般 web app 兩種方式都能適用,但 privileged 和 certified apps 只能走 packaged 的方式。</p> -<h4 id="Hosted(託管式)_apps"><span class="mw-headline" id="Hosted_apps">Hosted(託管式</span><span class="mw-headline">) apps </span></h4> -<p>Hosted app 只包含開發者網站伺服器上的 <a class="external text" href="/en-US/docs/Apps/Manifest" rel="nofollow">application manifest</a> 檔案,Manifest 檔案裏面有 app 開啟時的<a href="/en-US/Apps/Build/Manifest#launch_path">啟動頁面路徑</a>。從安全性角度來看 hosted app 和網頁差不多,當打開 hosted app ,載入頁面的 URL 就是網頁在伺服器上的一般 URL,如果之前有 appcache 存檔的話則會從裝置上載入。</p> -<h4 id="Packaged(封裝式)_apps"><span class="mw-headline" id="Packaged_apps">Packaged(封裝式) apps</span></h4> -<p>Packaged app 將所有的資源 (HTML, CSS, JavaScript, app manifest 等等) 包在一份 zip 檔中,而非網頁伺服器,細節請見<a href="/en-US/docs/Apps/Packaged_apps" title="Apps/Packaged_apps"> Packaged apps</a>. </p> -<h3 id="App_來源">App 來源</h3> -<p>對於 hosted app,<a class="external text" href="/en-US/docs/Apps/Manifest" rel="nofollow">application manifest</a> 檔案所在地就是其來源。</p> -<p>至於 packaged apps,其來源就是安裝當下決定的應用程式識別,而 <a href="/en-US/Apps/Publishing/Packaged_Apps#Types_of_packaged_apps">Privileged 和 Internal apps </a>另外可以在 applications manifest 檔案裡用 <a href="/en-US/Apps/Build/Manifest#origin">origin</a> 參數請求使用特定來源。</p> -<h3 id="App_安裝"><strong>App 安裝</strong></h3> -<p>App 透過 <a href="/en-US/docs/JavaScript_API" title="/en-US/docs/JavaScript_API">Apps JavaScript API</a> 安裝:</p> -<ul> - <li>Hosted App: Hosted app 是藉由呼叫 <code>navigator.mozApps.<a href="/en-US/docs/Web/API/Apps.install" title="/en-US/docs/Web/API/Apps.install">install</a>(manifestURL)進行安裝,其中</code> manifestURL 是一個指向 app 位置的 URL。更多資訊請參考<a href="/en-US/docs/DOM/Apps.install">安裝 Apps</a>。</li> - <li>Packaged App: Packaged app 是藉由呼叫 <code>navigator.mozApps.<a href="/en-US/docs/Web/API/Apps.installPackage" title="/en-US/docs/Web/API/Apps.installPackage">installPackage</a>(packageURL) 進行安裝。</code>Packaged app 的主程式 manifest 檔經過簽署、存在封裝包之中,另外還會有一個用來發起安裝程序的 "mini-manifest" 檔。更多資訊請見<a href="/en-US/docs/DOM/Apps.installPackage">安裝 Packaged Apps</a> 和<a href="/en-US/docs/Apps/Packaged_apps" title="Apps/Packaged_apps"> Packaged apps</a>。</li> -</ul> -<p>App manifest 和 App 來源必須一致,這樣避免了未知的第三方冒用 App;另外為了避免網站被不小心或故意被偽裝成有 app manifest,manifest 檔必須以特定 mime-type,<code>application/x-web-app-manifest+json,</code> 發送。</p> -<h3 id="更新"><span class="mw-headline" id="Updates">更新</span></h3> -<p>更新程序請見<a href="/en-US/docs/Apps/Updating_apps" title="Apps/Updating_apps">更新 apps</a>。</p> -<h2 id="權限">權限</h2> -<p>App 能夠被授予比一般網頁更多的權限。基本上 app 擁有和網頁同等的權限,如果 app 需要更多額外權限,那麼 app 便需要在 manifest 檔裡明白列出需要的額外權限。</p> -<h3 id="Manifest_宣告">Manifest 宣告</h3> -<p>在 manifest 裡,每一個需要的額外權限必須加入供人閱讀的描述說明為何需要此額外權限,例如 app 想要 <a href="/en-US/docs/Web/API/window.navigator.geolocation" title="/en-US/docs/Web/API/window.navigator.geolocation">navigator.geolocation</a> API 使用權限,manifest 裡就必須如此宣告:</p> -<pre class="brush: html">"permissions": { - "geolocation":{ -<code class="language-js"><span class="token string"> "description"</span><span class="token punctuation">:</span> <span class="token string">"Required for autocompletion in the share screen"</span><span class="token punctuation">,</span></code> - } -}, -</pre> -<p>這樣 app 便可以如同網頁一般提示使用者來請求地理位置存取權限。更多細節請見 <a href="/en-US/docs/Apps/Manifest" title="Apps/Manifest">App manifest</a>。</p> -<div class="note"> - <p><strong>Note</strong>: 目前權限使用目的並不會呈現給使用者看 — 見 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=823385" title="https://bugzilla.mozilla.org/show_bug.cgi?id=823385">bug 823385</a>.</p> -</div> -<h3 id="權限授予">權限授予</h3> -<p>當權限需求在 manifest 中宣告後,依據權限不同,可能會直接被同意,但也可能需要在第一次相關 API 被存取時提示使用者徵詢其同意。一般來說會影響到使用者隱私的權限會需要額外徵詢使用者同意,而且這種情況下使用者也有理由知道甚麼權限被請求使用,例如存取通訊錄前會需要徵詢,但存取 TCP 連線則不需要。權限直接同意會經過 Marketplace 安全審核程序以確保安全性。</p> -<h3 id="權限駁回">權限駁回</h3> -<p>使用者可以在任何時候從設定駁回先前授予的權限,但這不包括那些直接同意的權限。</p> -<h2 id="Web_App_Sandbox">Web App Sandbox</h2> -<h3 id="App_資料獨立"><span class="mw-headline" id="Data_stored_per_app">App 資料獨立 </span></h3> -<p>每一個 app 都運行在 sandbox 之中,所以所有資料都和其他 app 隔離開來,這涵蓋了 cookie、localStorage、indexedDB 以及網站權限。</p> -<p><img alt="A diagram showing three Firefox OS apps all open is separate sandboxes, so none of them can affect each other." src="https://mdn.mozillademos.org/files/7091/sandbox.png" style="width: 1040px; height: 437px; display: block; margin: 0px auto;"></p> -<p>所以說即使 App A 和 App B 都開啟了指向同一來源 (如<a class="external free" href="http://www.mozilla.org" rel="nofollow"> http://www.mozilla.org</a>) 的 {{ htmlelement("iframe") }},但他們兩者的 cookie 資料還是會不同。結果就是當用 App A 登入 Facebook 帳號,開啟了 App B 前往 Facebook 時,因為 App B 無法存取 App A 的 cookie,所以 App B 還是必須要再執行登入作業,如此一來變確保了 App 之間不互相影響、資料安全。</p> -<h3 id="Apps_無法啟動彼此"><span class="mw-headline" id="Apps_can.27t_open_each_other">Apps 無法啟動彼此 </span></h3> -<p>App 不能利用 <iframe> 開啟另一個 App,如果 App A 開啟了一個指向 App B URL 的 iframe,這並不會啟動 App B,相反地這只會前往那個 URL 指向的網頁,任何 App B 的 cookie 都無法被存取,這就和 App B 沒有被安裝的情況一樣。</p> -<p>就算是 App A 嘗試開啟透過 packaged 式 App B 的 app:// URL,來將 App B 載入到 <iframe> 裡啟動,也會失敗,而且不論 App B 有沒有被安裝,失敗訊息都會一樣,所以說 App A 也無法推敲 App B 的安裝狀態。</p> -<p>當 App A 上層的 frame 前往 App B 所在的 URL,結果依然相同。我們永遠知道是哪個 frame 開啟哪個 app,所以說透過上層 frame 開啟其他 app 就和前述一樣會失敗,App 之間資料絕對獨立、無法被盜取。</p> -<h3 id="動機"><span class="mw-headline" id="Motivation">動機</span></h3> -<p>資料獨立的做法有好有壞,壞處是使用者必須每開一個 app 都要登錄一次同一個網站,或者是網站有存放一些資料於本地端,每個 app 都會儲存一份資料,同樣的資料可能被重複儲存,如果資料剛好又不小的話,將會相當佔儲存空間。</p> -<p>好處是這是比較安全的做法,app 之間不能透過第三方網站互相影響進而導致未預期的行為,或是一個 App A 移除後,另一個 App B 不會因為依賴 App B 的資料或功能而無法運作。更重要的是,資料獨立確保了惡意 app 難以利用漏洞竊取其他網站的資料。</p> -<p>最後資料獨立也確保了 app 無法得知使用者是否有裝甚麼其他 app、其他 app 的資料,保護了使用者隱私。</p> -<h3 id="權限_Sandbox"><span class="mw-headline" id="Sandboxed_Permissions">權限 Sandbox</span></h3> -<p>如同資料在 snadbox 下是獨立隔離開來的,權限亦然。App A 打開了 <a class="external free" href="http://maps.google.com" rel="nofollow">http://maps.google.com</a> 網頁,而使用者也准許永遠允許 <a class="external free" href="http://maps.google.com" rel="nofollow">http://maps.google.com</a> 使用地理位置服務,但這也只限於 App A,改天換 App B 打開 <a class="external free" href="http://maps.google.com" rel="nofollow">http://maps.google.com</a> 網頁,地理位置服務使用權限還是得再徵詢使用者同意。</p> -<p>如同一般網頁,每個來源的權限同樣獨立,App A 取得地理位置服務使用權限,但這不代表所有 App A 開啟的網頁都有權使用地理位置服務,如果說 App A 開啟 <a class="external free" href="http://maps.google.com" rel="nofollow">http://maps.google.com</a>,<a class="external free" href="http://maps.google.com" rel="nofollow">http://maps.google.com</a> 照樣需要取得使用者同意才能使用地理位置服務。</p> -<h3 id="瀏覽器_API_Sandbox">瀏覽器 API Sandbox</h3> -<p>對於會開啟大量 URL 的應用程式,如瀏覽器,我們引進了一個 <em>browserContent</em> 旗標來強化安全性,這個 browserContent 讓 app 可以有兩個 sandbox,一個供 app 本身使用,另一個給開啟的網頁使用,例如說:</p> -<p>有一個 MyBrowser app 自 <a class="external free" href="https://mybrowser.com" rel="nofollow">https://mybrowser.com</a> 載入,所以程式碼和資源都隸屬於這個網域。</p> -<p>當這個 app 建立一個 <code><iframe mozbrowser></code>,另一個 sandbox 便會產生,所以說 <code><iframe mozbrowser></code> 裡的 cookie、IndexedDB、localStorage 資料都會獨立隔離開來,兩者間不會互相影響。</p> -<p>從另一方面來看,如果 MyBrowser app 想要整合 Google Map 的地理位置功能,那麼從一般 <iframe> 裡載入 <a class="external free" href="http://maps.google.com" rel="nofollow">http://maps.google.com</a>,便可以存取 Google Map 網站的 cookie 資料;但若是從 <code><iframe mozbrowser></code> 裡載入的話,便無法取得 Google Map 的 cookie 資料了。</p> -<p>假設另一個情況,有一個類似 Yelp、會造訪餐廳網站的 app,這個 app 只要利用 <code><iframe mozbrowser></code> 來打開餐廳網站,就可以確保餐廳網站不能含有指回這個 app 的 <iframe> (例如指回 <a class="external free" href="http://yelp.com" rel="nofollow">http://yelp.com</a>),如果有的話,該餐廳網站將只能收到 Yelp 網站的資料,而非此 Yelp app,所以該餐廳網站便無法和 Yelp app 共享資料和權限,進而攻擊 Yelp app。</p> -<h2 id="App_安全性總結">App 安全性總結</h2> -<p>下表總結各類 Firefox OS App 的格式、安裝、更新特性:</p> -<table> - <caption> - Web App 類型</caption> - <thead> - <tr> - <th scope="col">類型</th> - <th scope="col">發布</th> - <th scope="col">權限</th> - <th scope="col">安裝</th> - <th scope="col">更新</th> - </tr> - </thead> - <tbody> - <tr> - <td>Web</td> - <td>Hosted 或 Packaged</td> - <td>較不敏感的權限,既使未驗證的網站取得也沒關係。</td> - <td>可以從各種來源安裝</td> - <td>依據安裝來源和發布機制可以背景更新或透過 marketplace 更新。</td> - </tr> - <tr> - <td>Privileged</td> - <td>Packaged 和 Signed</td> - <td>需要驗證和審核才可以取得特殊權限 API。</td> - <td>從可信任的 marketplace 安裝</td> - <td>從可信任的 marketplace 更新,需要使用者同意更新。</td> - </tr> - <tr> - <td>Internal</td> - <td>Packaged</td> - <td>第三方 app 無法存取高度敏感 API</td> - <td>裝置預裝</td> - <td>跟隨系統層級類別更新。</td> - </tr> - </tbody> -</table> -<div class="note"> - <p><strong>Note</strong>: 版本 1.0 的 Firefox OS,privileged app 只能從 Mozilla Marketplace 安裝,至於其他多種安全 marketplace 的支援尚未底定。</p> -</div> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/security/index.html b/files/zh-tw/archive/b2g_os/security/index.html deleted file mode 100644 index 468bab0472..0000000000 --- a/files/zh-tw/archive/b2g_os/security/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Firefox OS security -slug: Archive/B2G_OS/Security -tags: - - B2G - - Firefox OS - - Mobile - - NeedsTranslation - - Security - - TopicStub -translation_of: Archive/B2G_OS/Security ---- -<p>The following articles cover security-related topics about Firefox OS. This includes overall security features as well as application security and how the install process is kept secure.</p> -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 class="Documentation" id="Documentation" name="Documentation">Firefox OS security documentation</h2> - <dl> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Security/Security_model" title="/en-US/docs/Mozilla/Firefox_OS/Security/Security_model">The Firefox OS security model</a></dt> - <dd> - An overview of the Firefox OS security model.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Security/System_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Security_model">System security</a></dt> - <dd> - Details of security controls built-in to the FirefoxOS runtime.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security">Application security in Firefox OS</a></dt> - <dd> - An overview of how applications are made secure on Firefox OS.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Security/Installing_and_updating_applications" title="/en-US/docs/Mozilla/Firefox_OS/Security/Installing_and_updating_applications">Securely installing and updating applications</a></dt> - <dd> - How Firefox OS securely installs and updates applications.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Security/Software_permissions" title="/en-US/docs/Mozilla/Firefox_OS/Security/Software_permissions">Software permissions in Firefox OS</a></dt> - <dd> - A guide to what types of software have permission to perform various tasks on Firefox OS.</dd> - <dt> - <a href="/en-US/docs/Mozilla/Firefox_OS/Security/Debugging_and_security_testing#Marionette.3A_A_JavaScript_debugging_shell_for_Firefox_OS" title="/en-US/docs/Mozilla/Firefox_OS/Security/Debugging_and_security_testing#Marionette.3A_A_JavaScript_debugging_shell_for_Firefox_OS"><span style="display: none;"> </span>Debugging and security testing with Firefox OS</a></dt> - <dd> - This guide shows you the basic security testing steps, from opening a remote JavaScript debugger to setting up an intercepting HTTP(S) proxy against a desktop version of Firefox OS</dd> - </dl> - <p><span class="alllinks"><a href="/en-US/docs/tag/B2G" title="/en-US/docs/tag/B2G">View All...</a></span></p> - </td> - <td> - <h2 class="Community" id="Community" name="Community">Getting help from the community</h2> - <p>If you're working with Firefox OS, or developing applications you'd like to run on Firefox OS devices, there are community resources to help you!</p> - <ul> - <li>Consult the Boot to Gecko project forum: {{ DiscussionList("dev-b2g", "mozilla.dev.b2g") }}</li> - </ul> - <ul> - <li>Ask your question on Mozilla's Boot to Gecko IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/b2g" title="irc://irc.mozilla.org/b2g">#b2g</a></li> - </ul> - <p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html" title="http://www.catb.org/~esr/faqs/smart-questions.html">Don't forget about the <em>netiquette</em>...</a></span></p> - <br> - <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related topics</h2> - <ul> - <li><a href="/en-US/docs/Mobile" title="en-US/docs/Mobile">Mobile</a></li> - <li><a href="/en-US/docs/Security" title="/en-US/docs/Security">Security</a></li> - </ul> - </td> - </tr> - </tbody> -</table> -<p> </p> -<div id="cke_pastebin" style="position: absolute; top: 483px; width: 1px; height: 1px; overflow: hidden; left: -1000px;"> - <br> - Firefox OS</div> diff --git a/files/zh-tw/archive/b2g_os/security/security_model/index.html b/files/zh-tw/archive/b2g_os/security/security_model/index.html deleted file mode 100644 index d71380833f..0000000000 --- a/files/zh-tw/archive/b2g_os/security/security_model/index.html +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: Firefox OS 安全性概述 -slug: Archive/B2G_OS/Security/Security_model -translation_of: Archive/B2G_OS/Security/Security_model ---- -<p>此篇文章將概述 Firefox OS 的安全架構,可阻絕 App、平台、資料所挾帶的惡意威脅,進而保護行動裝置。Mozilla 建構了完整且多層次的安全模式,為行動電話提供絕佳的防護效果。</p> -<p> </p> -<h1 id="平台安全性">平台安全性</h1> -<p>Firefox OS 平台具備多層次安全模式,可將各層次的開發風險降至最低。第一線的保護機制更整合了深度防禦 (Defense-in-depth) 策略,進而達到完整的防護機制。</p> -<p> </p> -<h2 id="安全架構">安全架構</h2> -<p>Firefox OS 將銜接網路架構的應用與其底層硬體,而其整合式技術囊括了下列層級:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5023/platform.png" style="width: 678px; height: 478px;"></p> -<p>行動裝置 (Mobile device) 即是執行 Firefox OS 的智慧型手機。Gonk 則包含 Linux kernel、韌體、系統函式庫、裝置驅動程式。Gecko 屬於應用程式的執行時間層,為 App提供執行框架,另建構 Web API 以存取行動裝置的功能。Gaia 則是網頁 App (包含 HTML5、CSS、JavaScript、圖片、媒體等) 套件,可隨時改善使用者經驗。</p> -<p>Gecko 扮演守門人的角色,可強制執行安全策略,避免行動裝置遭到誤用;並可作為網頁 App (位於 Gaia) 之間的中介層 (Intermediary)。Gonk 則可將行動電話底層的硬體功能,直接提供予 Gecko 使用。只有在 Gecko 放行存取請求時,網頁 App 才能透過 Web API 而存取行動電話的功能;而不會有直接存取或「走後門」的情況發生。Gecko 將強制執行許可,並阻擋未經授權的請求。</p> -<p> </p> -<h2 id="佈署安全系統">佈署安全系統</h2> -<p>手機上的 Firefox OS 系統映像檔 (System image) 是由受信任的來源 (一般為該裝置的 OEM 廠商) 所提供,這些受信任的系統映像檔提供者負責發布檔案的組建、建置、測試以及數位簽章作業。</p> -<p>整個技術層均需經過安全驗證。由Linux 的存取控制清單 (ACL) 執行檔案系統的權限控制。系統 App 則安裝於唯讀 (僅於更新期間才暫時轉為可讀寫) 媒體之中;若是使用者相關內容的區域,則可能為讀寫性質。裝置硬體中的不同元件,均已內建了業界標準的防護機制。舉例來說,晶片製造商會加入安全防護技巧來提高安全性,我們同樣強化了核心平台 (Gecko 與 Gonk),以阻絕潛在的可能威脅,亦提升了相關編譯器的功能。可參閱<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security/Runtime_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Runtime_security">執行期間的安全性</a>進一步了解細節。</p> -<p> </p> -<h2 id="更新安全系統">更新安全系統</h2> -<p>Firefox OS 平台的後續升級與修正,將透過安全的 Mozilla 程序完成佈署,並確保行動電話上的系統映像保有其完整性。同樣由已知且受信任的來源 (一般為該裝置的 OEM 廠商) 提供更新作業,並負責更新封裝的組裝、建構、測試、數位簽章等作業。</p> -<p>系統更新可能牽涉 Firefox OS 部分或所有的層級。若更新作業必須變更 Gonk,則安裝作業將使用 FOTA (Firmware Over the Air)。FOTA 更新作業亦可能包含 Firefox OS 的其他層級,如 Gaia、Gecko、安全更新、裝置管理 (FOTA/韌體/驅動程式)、設定管理 (Firefox OS 的設定),還有更多修正檔。</p> -<p>若更新作業並未牽涉 Gonk,則僅需 Mozilla 系統更新公用程式 (System Update Utility) 即可完成。Firefox OS 所使用之更新架構、程序、Mozilla ARchive (MAR) 格式 (用於更新封裝),與 Firefox 桌面版產品完全相同。可參閱 <a href="https://wiki.mozilla.org/Software_Update">https://wiki.mozilla.org/Software_Update</a> 以進一步了解。</p> -<p>而行動電話所內建的更新服務 (亦可能由 OEM 廠商提供),將定期檢查是否有系統更新。一旦發佈系統封裝,更新服務隨即將偵測到該封裝,並提醒使用者完成安裝作業。在行動裝置安裝更新檔案之前,另將檢查裝置的儲存容量是否足夠,且將驗證下列分配空間:</p> -<ul> - <li>更新檔案來源 (驗證系統更新與 manifest 檔案的來源位置 protocol:domain:port)</li> - <li>檔案完整性 (SHA-256 雜湊檢查)</li> - <li>程式碼簽章 ─ 針對憑證簽發源頭 (Trusted Root) 進行憑證檢查</li> -</ul> -<p>更新期間應注意下列要點:</p> -<ul> - <li>Mozilla 建議透過 SSL 連線進行更新。</li> - <li>安裝韌體封裝之前,需要高強度的加密驗證作業。</li> - <li>開始更新程序之前,必須將完整更新檔案下載至特定且安全位置。</li> - <li>開始更新程序時,系統必須處於安全狀態且不執行任何 Web App。</li> - <li>必須將金鑰儲存於裝置中的安全位置。</li> -</ul> -<p>請確實完成相關檢查,讓行動電話確實完成更新作業。</p> -<p> </p> -<h1 id="App_的安全性">App 的安全性</h1> -<p>Firefox OS 使用深度防禦 (Defense-in-depth) 策略,可保護行動電話免受惡意應用程式的攻擊。此策略必須佈署多種機制,如根據 App 信任模式 (Trust model) 所建構的隱式許可 (Implicit permission) 層級;執行期間的沙箱執行作業 (Sandboxed execution);僅限 API 存取行動電話的底層硬體;健全的許可模型 (Permission model);安全的安裝與更新程序。若要進一步了解相關技術,可參閱<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security/Application_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security">應用程式安全性</a>。</p> -<p>在 Firefox OS 中的所有應用程式,均為 Web App ─ 即以 HTML5、JavaScript、CSS、媒體、其他開放式 Web 技術 (可於瀏覽器中執行的網頁,並不屬於本文所提的 Web App) 所撰寫的程式。由於這些 Web App 並非二進制 ─ 即所謂的「原生 (Native)」─ 應用,因此將由 Web API居中嚴格協調所有的系統存取作業。甚至檔案系統存取都只能透過 Web API 與後端的 SQLite 資料庫, App 不能直接存取 SD 記憶卡上的檔案。</p> -<p>Firefox OS 可限制 App 所能存取/使用的資源規模,同時又可針對多樣的 App 而支援不同的許可層級。Mozilla 嚴格控制各類 App 所能存取的 API。舉例來說,僅有 Certified App (隨手機出貨) 可存取 Telephony API。另外,Dialer App 必須存取 Telephony API 才能撥打電話,而非所有 Certified App 均可存取此 API。如此可避免安裝了任何第三方 App 之後,撥打出國際/長途電話而讓帳單金額暴增。但針對其他 OEM App,仍可選擇是否給予 Telephony API 存取權。舉例來說,電信服務商可提供系統管理應用程式,讓客戶能管理自己的帳戶,甚至能直接以電話送出電信服務帳單或支援辦公室作業。</p> -<p> </p> -<h2 id="受信任_(Trusted)_與未信任_(Untrusted)_的_App">受信任 (Trusted) 與未信任 (Untrusted) 的 App</h2> -<p>Firefox OS 將 App 分為下列類型:</p> -<table> - <thead> - <tr> - <th style="width: 82px;"> - <p>類型</p> - </th> - <th style="width: 102px;"> - <p>受信任層級</p> - </th> - <th style="width: 447px;"> - <p>說明</p> - </th> - </tr> - </thead> - <tbody> - <tr> - <td style="width: 82px;"> - <p>Certified</p> - </td> - <td style="width: 102px;"> - <p>受高度信任</p> - </td> - <td style="width: 447px;"> - <p>這類系統 App 經過電信服務商或 OEM (起因於裝置毀損或重要功能所產生的風險) 所核可。但僅限系統 App 與相關服務,並無第三方 App。<br> - 此信任層級僅用於極少部分的重要 App,例如 SMS、藍牙、相機、電話、系統時鐘、預設的電話播號鍵盤 (為了可確實用於緊急電話)。</p> - </td> - </tr> - <tr> - <td style="width: 82px;"> - <p>Privileged</p> - </td> - <td style="width: 102px;"> - <p>受信任</p> - </td> - <td style="width: 447px;"> - <p>由授權的商城審視、核可、數位簽章過的第三方 App。</p> - </td> - </tr> - <tr> - <td style="width: 82px;"> - <p>Web (與其他 App)</p> - </td> - <td style="width: 102px;"> - <p>未受信任</p> - </td> - <td style="width: 447px;"> - <p>屬於一般網頁內容。包含安裝式 App (儲存於行動電話中) 與托管式 (Hosted,儲存於遠端,僅有 manifest 檔案儲存於行動裝置中) App。另外也可以從 Marketplace 取得托管式 App 的 manifest 檔案。</p> - </td> - </tr> - </tbody> -</table> -<p>App 的受信任層級,某種程度上將決定其所能取用的行動電話功能。</p> -<ul> - <li>Certified App 可使用大多數的 Web API 作業。</li> - <li>針對 Certified App 所能存取的 Web API 作業,Privileged App 可使用這些 Web API 作業的子集。</li> - <li>針對 Privileged App 所能存取的 Web API 作業,未受信任的 App 則能使用這些 Web API 作業的子集。而相關 Web API 則具備必要的安全機制,以隨時因應未受信任的網頁內容。</li> -</ul> -<p>某些作業 (如網路存取) 均先假設為所有 App 的隱式許可。一般來說,越是高敏感性的作業 (如撥打電話號碼或取得通訊錄內容),就僅有更高信任度的 App 才能執行。</p> -<h3 id="最小權限原則_(Principle_of_Least_Permissions)">最小權限原則 (Principle of Least Permissions)</h3> -<p>針對 Web App,Firefox OS 安全架構則以《最小權限原則 (<em>principle of least permissions</em>)》為架構:先給予最低權限,僅在必要或合理的情況下,才選擇性的提高權限。依預設值,任一 App 均具備最低權限,以因應未受信任的網頁內容。如果 App 所呼叫的 Web API 需要額外權限,則其 <em>manifest </em>檔案 (本文稍後將敘述) 必須先列舉這些額外權限。而僅在 App 的 manifest 檔案明確要求 App 授權時,Gecko 才會給予 Web API 的存取權。此外,只有在 Web App 的類型 (即上述的 Certified 或 Trusted 或 Web 分類) 符合其存取層級,Gecko 才會給予必要的授權。</p> -<h3 id="Marketplace_對_Privileged_App_的審核程序">Marketplace 對 Privileged App 的審核程序</h3> -<p>若要達到 Privileged App,則 App 開發/供應商必須將之提交予經過授權的 Marketplace。而 Marketplace 隨即開始嚴格的程式碼審核程序:檢視其完整性與穩定性、審查其索取的授權是否符合其載明的用途、確認其隱式許可是否使用合宜、審核「Privileged App 的內容」與「未授權的外部內容」之間的介面,是否具備合適的緩衝,以避免權限提升 (Elevation of privilege) 的影響。Marketplace 另需負責確保 Web App 不會對其給予的權限進行惡意動作。</p> -<p>在 App 通過審核之後即許可使用,且 Marketplace 亦將以數位方式簽署其 manifest 檔案,以供行動裝置的使用者下載之。一旦 Marketplace 遭駭,數位簽章可確保駭客無法將任意內容或惡意程式碼,安裝於使用者的行動電話上。也基於此審查程序,Firefox OS 從 Marketplace 取得的 Privileged App,其可信任度亦高於一般的 (未受信任的) 網頁內容。</p> -<p> </p> -<h2 id="封裝式_(Packaged)_與托管式_(Hosted)_App">封裝式 (Packaged) 與托管式 (Hosted) App</h2> -<p>Firefox OS 可用封裝式 (儲存於行動電話中) 或托管式 (儲存於遠端伺服器中,僅有 manifest 檔案儲存於行動電話中) App。而此 2 種 App 的安全管理方式亦有所不同。封裝式與托管式 App 同可作為應用程式的封閉沙箱,本文稍後將說明。</p> -<h3 id="封裝式_(Packaged)_App">封裝式 (Packaged) App</h3> -<p>封裝式 App 是以 ZIP 壓縮檔所構成,內含應用程式的相關資源 (HTML5、CSS、JavaScript、影像、媒體),另以 manifest 檔案提供上述資源的清單,與其對應的 雜湊值 (Hash)。由於 Certified 與 Privileged App 的 manifest 檔案均需完成數位簽章,因此Certified/Privileged App 必為封裝式 App。只要使用者取得封裝式 App,就會將 ZIP 檔案下載至行動電話中,另從 ZIP 檔案內的已知位置讀取 manifest 檔案。系統將在安裝過程中驗證 App 的資源,其他則儲存於本端的封裝內。執行期間將請求所有的顯式許可 (Explicit permission)、顯示使用者 App 的資料儲存目標,最後依預設值完成保存。</p> -<p>若要清楚指明封裝式 App 中的資源,則 URL 應以 App 開頭並使用下列格式:</p> -<div class="note"> - <p><code>app://<em>identifier</em>/<em>path_within_zipfile</em>/file.html</code></p> -</div> -<p>這裡的「app://」代表 ZIP 檔案的掛載點 (Mount point)。於行動電話上安裝 App 時,隨即產生「<em>identifier</em>」作為 UUID。如此可確保以 :app 的 URL 指向了特定資源,且已納入於 ZIP 檔案中。而 app: 中的路徑為相對路徑,因此可於 ZIP 檔案中允許資源的相對鏈結。</p> -<p>封裝式 App 主要用於 Certified 與 Privileged App,不過一般的 Web App 亦可作為封裝式。但這些 Web App 不會因為封裝格式,就自動提高其信任度或存取權限。</p> -<h3 id="托管式_(Hosted)_App">托管式 (Hosted) App</h3> -<p>托管式 App 均儲存於網頁伺服器上,或需透過 HTTP 載入。僅有其 manifest 檔案儲存於行動電話中;其他所有檔案均儲存於遠端。僅 Privileged 與 Certified App 才能使用特定 API,以因應數位簽章作業而必須將 App 封裝。因此,即使 Web API 作業需要 Privileged/Certified App 的狀態,托管式 App 亦不需存取任何 Web API 作業。</p> -<p>從安全性的觀點來說,托管式 App 的作業方式比較像一般網頁。在該網頁伺服器上,必須以寫死 (Hard-coded) 的完整 URL 指向 App 根目錄中的起始頁面,才能載入托管式 App。一旦載入托管式 App 之後,行動電話將根據網頁瀏覽時的 URL,跟著連至相同頁面。</p> -<p> </p> -<h2 id="App_的_Manifest_檔案">App 的 Manifest 檔案</h2> -<p>Open Web App 的 manifest 檔案,將提供瀏覽器與 App 互動時的必要資訊。而 manifest 即為 JSON 檔案,至少均具備 App 的名稱與描述。可參閱 <a href="https://developer.mozilla.org/en-US/docs/Apps/FAQs/About_app_manifests" title="/en-US/docs/Apps/FAQs/About_app_manifests">App 的 manifest 檔案常見問題</a>以進一步了解。</p> -<h3 id="Manifest_範例">Manifest 範例</h3> -<p>下列程式碼則具備基礎設定的 manifest 範例:</p> -<table> - <tbody> - <tr> - <td> - <p>1</p> - <p>2</p> - <p>3</p> - <p>4</p> - <p>5</p> - <p>6</p> - <p>7</p> - <p>8</p> - <p>9</p> - <p>10</p> - <p>11</p> - <p>12</p> - <p>13</p> - </td> - <td> - <p><code>{</code></p> - <p><code> "name": "My App",</code></p> - <p><code> "description": "My elevator pitch goes here",</code></p> - <p><code> "launch_path": "/",</code></p> - <p><code> "icons": {</code></p> - <p><code> "128": "/img/icon-128.png"</code></p> - <p><code> },</code></p> - <p><code> "developer": {</code></p> - <p><code> "name": "Your name or organization",</code></p> - <p><code> "url": "http://your-homepage-here.org"</code></p> - <p><code> },</code></p> - <p><code> "default_locale": "en"</code></p> - <p><code>}</code></p> - </td> - </tr> - </tbody> -</table> -<h3 id="Manifest_檔案的安全性設定">Manifest 檔案的安全性設定</h3> -<p>manifest 檔案亦可具備其他設定,如下列的安全性設定:</p> -<table> - <thead> - <tr> - <th style="width: 152px;"> - <p>欄位</p> - </th> - <th style="width: 479px;"> - <p>說明</p> - </th> - </tr> - </thead> - <tbody> - <tr> - <td style="width: 152px;"> - <p>permissions</p> - </td> - <td style="width: 479px;"> - <p>App 的必要許可。任何 App 需列出所要使用的 Web API,以取得使用者的許可。Privileged/Certified App 可識別大多數的許可,但托管式 App 不適用。API 必具備的屬性:</p> - <ul> - <li><strong>description</strong> ─ 在請求使用此 API 時,此字串將指定其背後的目的地。必填。</li> - <li><strong>access</strong> ─ 此字串將指定許可所需的存取類型。安裝時即給予隱式許可 (Implicit permission)。僅數種 API 為必填欄位。僅接受:<strong>read</strong>、<strong>readwrite</strong><strong>、</strong><strong>readcreate</strong><strong>、</strong><strong>createonly</strong> 等數值。</li> - </ul> - </td> - </tr> - <tr> - <td style="width: 152px;"> - <p>installs_allowed_from</p> - </td> - <td style="width: 479px;"> - <p>App 的來源。而構成來源的陣列 (scheme+unique hostname) 則可觸發此 App 的安裝作業。另可讓 App 廠商限制僅授權過的 Marketplace (如 <a href="https://marketplace.firefox.com/">https://marketplace.firefox.com/</a>) 才可安裝 App。</p> - </td> - </tr> - <tr> - <td style="width: 152px;"> - <p>csp</p> - </td> - <td style="width: 479px;"> - <p>內容安全政策 (Content Security Policy),將套用至 App 所載入的所有頁面。可強化 App 而避免遭惡意插入任何程式碼。若未指定 CSP,則 Privileged 與 Certified App 均已預設了系統定義值,其語法為:<br> - <a href="https://developer.mozilla.org/en-US/docs/Apps/Manifest#csp">https://developer.mozilla.org/en-US/docs/Apps/Manifest#csp</a></p> - <p>另請注意,此指令僅能增加所套用的 CSP。舉例來說,此指令並無法減少 Privileged App 所套用的 CSP。</p> - </td> - </tr> - <tr> - <td style="width: 152px;"> - <p>type</p> - </td> - <td style="width: 479px;"> - <p>App 的類型,即 Web、Privileged、Certified 等類型。</p> - </td> - </tr> - </tbody> -</table> -<p>Firefox OS 要求 manifest 檔案必須為特定的 mime-type 格式 ("application/x-web-app-manifest+json"),而且必須與該 App 為相同來源的完整主機名稱 (即來源)。若「App 的 manifest 檔案」與「要求安裝 App 的頁面」兩者的來源相同,則將放寬此限制。此機制可確保不能偽裝網站並托管 App 的 manifest 檔案。</p> -<p> </p> -<h2 id="隔離式_(Sandboxed)_執行作業">隔離式 (Sandboxed) 執行作業</h2> -<p>本章節將說明 App 與執行作業的沙箱隔離區 (Sandbox)。</p> -<h3 id="App_隔離區">App 隔離區</h3> -<p>Firefox OS 的安全架構,即是將隔離區作為深度防禦 (Defense-in-depth,DID) 策略,以減少風險並保護資料、平台、行動電話。在執行期間,隔離區可為 App 產生邊界與限制。各個 App 僅於自己的工作空間 (Working space) 內執行,另僅經過授權可存取的 Web API 與資料,才能存取;工作空間相關的資訊 (IndexedDB 資料庫、Cookies、離線儲存等) 亦然。請參閱 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security/Security_model">https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security/Security_model</a> 以進一步了解。</p> -<p>下圖則簡略說明了安全模型:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5025/sandbox.png"></p> -<p>在隔離各個 App 之後,所產生的影響亦僅限於其工作空間之內,而不會受到工作空間之外的干擾 (如其他 App 或資料)。</p> -<h3 id="執行作業隔離區">執行作業隔離區</h3> -<p>B2G (Gecko) 在一個高授權度的系統程序 (可存取行動電話中的硬體功能) 中執行。在執行期間,各個執行環境裡的 App 皆是 B2G 系統程序的子程序。而各個子程序又具備嚴格的 OS 授權。舉例來說,子程序並無法直接讀寫檔案系統中的任意檔案。必須由 Web API 提供相關存取權限;且該權限又由 B2G 母程序所居中協調。在子程序要求授權過的 API 時,母程序將確認子程序具備必要的許可,以執行相關動作。</p> -<p>App 僅能透過 B2G 核心程序 (非其他程序或 App) 而相互溝通。App 無法於 B2G 之外獨立執行;各 App 亦無法互相開放。App 之間僅能間接「溝通」─ 例如接收器 (Listener) 程序偵測到其他程序所產生的事件,且必須由 B2G 程序居中協調。</p> -<h3 id="僅透過_Web_API_才能存取硬體">僅透過 Web API 才能存取硬體</h3> -<p>Web App 若要存取行動電話的功能,唯一管道只有以 Gecko 所建構的 Firefox OS Web API 。Gecko 是行動裝置與底層服務的單一出口,因此必須讓 Web API 進行呼叫作業,才能存取裝置的硬體功能。絕對沒有「原生 (Native)」的 API 或其他途徑可繞過此機制,而直接存取硬體或滲透至初階的軟體層。</p> -<p> </p> -<h1 id="安全架構_2">安全架構</h1> -<p>下圖則為安全架構的元件:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5027/securityframework.png" style="width: 979px; height: 591px;"></p> -<ul> - <li><strong>Permission Manager</strong>:可於 Web API 中存取功能的管道,是底層硬體唯一存取路徑。</li> - <li><strong>Access Control List</strong>:由角色 (Role) 與許可 (Permission) 所構成,存取 Web API 功能所必備。</li> - <li><strong>Credential Validation</strong>:App 與使用者的授權。</li> - <li><strong>Permissions Store</strong>:存取 Web API 功能所需的授權集合。</li> -</ul> -<p> </p> -<h2 id="許可的管理與強化">許可的管理與強化</h2> -<p>針對 Web App 所需的許可 (Permission),Firefox OS 安全機制將進一步驗證並強化。<br> - 僅當內容 (Content) 請求特殊許可,或當內容具備 manifest 所要求的適當許可時,系統才會發出特定許可至 App。若需要使用者進一步的授權,則某些許可亦將提出請求 (例如 App 要存取使用者目前的位置)。與傳統「角色為中心 (Role-centric)」的方式 (各個獨立角色將獲得一系列的許可)相較,這種「應用為中心 (app-centric)」的架構更能嚴密控管許可。</p> -<p>現有的 Web API 集合了一系列動作 (Action) 與接收器 (Listener)。各個 Web API 則具備必須的許可層級。每次只要呼叫 Web API,則 Gecko 檢查許可 (角色查找) 的基準為:</p> -<ul> - <li>呼叫中 App 的相關許可 (已於 manifest 檔案中指定,並以 App 類型為準)</li> - <li>執行必要作業 (Web API 呼叫) 所需的許可</li> -</ul> -<p>若該請求並不符合許可的準則,則 Gecko 隨即拒絕該請求。舉例來說,只要是受信任 App 所保留的 Web API,未受信任的 App 均無法執行。</p> -<p> </p> -<h2 id="要求使用者給予許可">要求使用者給予許可</h2> -<p>除了與 Web App 隱性關連 (Implicitly associated) 的許可之外,在執行特定作業之前需要使用者給予顯式許可。針對這些作業,Web App 必須在 manifest 檔案中表示索取許可的理由 (Justification)。這種「資料使用意圖 (Data usage intention)」,可讓使用者在給予許可之後,知道 Web App 處理資料的方式,亦將了解可能的風險,進而能做出決定並控管自己的資料。</p> -<p> </p> -<h2 id="安全的_App_更新程序">安全的 App 更新程序</h2> -<p><img alt="" src="https://mdn.mozillademos.org/files/5029/updateprocess.png" style="width: 979px; height: 102px;"></p> -<p>針對 Privileged app 的升級與修正,開發/供應商必須將更新封裝提交至授權過的 Marketplace,以供 Marketplace 進一步審查。而在核准之後,隨即完成數位簽章並提供予使用者。在搭載 Firefox OS 的裝置上,亦可透過 App 更新公用程式 (暫譯 App Update Utility) 定期檢查 App 是否有可用的更新。若發現可用的更新,系統隨即會詢問使用者是否安裝。在行動裝置安裝更新檔案之前,必將驗證封裝的:</p> -<ul> - <li>更新檔來源 (驗證更新與 manifest 檔案的來源位置 protocol:domain:port)</li> - <li>檔案完整性 (SHA-256 雜湊檢查)</li> - <li>程式碼簽章 ─ 針對憑證簽發源頭 (Trusted root) 而檢查認證</li> -</ul> -<p>透過適當且嚴格的檢查,可確保行動電話已正確套用了更新。<br> - 在開始更新程序之前,必須先下載完整的更新封裝至特定且安全的位置。安裝作業並不會覆寫任何使用者資料。</p> -<p> </p> -<h1 id="裝置安全性_(硬體)">裝置安全性 (硬體)</h1> -<p>行動裝置硬體的安全機制,一般均由 OEM 廠商所決定。舉例來說,OEM 廠商可能提供 SIM (Subscriber Identity Module) 卡的鎖定機制,另搭配 PUK (PIN Unlock Key) 密碼,以用於輸入錯誤 PIN 而遭鎖定的 SIM 卡。這部份需聯絡 OEM 廠商以了解細節。Firefox OS 則可讓使用者設定密碼與待機畫面,將於稍後說明。</p> -<p> </p> -<h1 id="資料安全性">資料安全性</h1> -<p>使用者可將個人資料儲存於手機中,並可設定其隱私性,包含聯絡資訊、金融資訊 (銀行與信用卡細節)、密碼、行事曆等。Firefox OS 則針對惡意 App (竊取、挖掘、破壞私密資料) 而設計了防護機制。</p> -<p> </p> -<h2 id="密碼與待機畫面">密碼與待機畫面</h2> -<p>Firefox OS 可供使用者設定行動電話的密碼,往後必須輸入正確密碼才能使用該行動電話。Firefox OS 另提供待機畫面的功能。只要設定特定時間內未使用行動電話,隨即顯示待機畫面。此時必須輸入密碼授權才能繼續使用手機。</p> -<p> </p> -<h2 id="隔離式_(Sandboxed)_資料">隔離式 (Sandboxed) 資料</h2> -<p>如之前所述,執行期間的 App 均進入隔離狀態。如此可避免 App 相互存取其內的資料;<strong>除非</strong>該筆資料已設為共享資料,且其他 App 擁有夠高的許可層級可存取之。</p> -<p> </p> -<h2 id="序列化_(Serialized)_資料">序列化 (Serialized) 資料</h2> -<p>Web App 並無法直接讀寫檔案系統。相反的,僅能透過 Web API 而存取儲存媒體。Web API 另將透過 SQLite 資料庫居中協調,才能進一步讀取、寫入儲存媒體。不會直接以 I/O 進行存取作業。各個 App 均擁有自己的資料儲存媒體,將經過資料庫而序列化至磁碟中。</p> -<p> </p> -<h2 id="資料銷毀">資料銷毀</h2> -<p>一旦使用者取消安裝 App,則將刪除該 App 所有的相關資料,如 cookies、localStorage、Indexeddb 等。</p> -<p> </p> -<h2 id="隱私性">隱私性</h2> -<p>根據隱私權原則 (<a href="https://www.mozilla.org/privacy/)%3c">https://www.mozilla.org/privacy/)</a>,Mozilla 致力保護使用者隱私與資料,同時可參閱 Mozilla Manifesto (<a href="https://www.mozilla.org/about/manifesto.html">https://www.mozilla.org/about/manifesto.html</a>)。而 Mozilla 的 Firefox Privacy Policy 則說明 Mozilla 將如何蒐集、利用 Mozilla Firefox 瀏覽器的使用者資訊,包含 Firefox 所傳送至網頁的資料、Mozilla 的資料保護方式、Mozilla 資料實務情況等。若要進一步了解相關細節,可參閱:</p> -<ul> - <li><a href="http://www.mozilla.org/en-US/legal/privacy/firefox.html">http://www.mozilla.org/en-US/legal/privacy/firefox.html</a></li> - <li><a href="https://blog.mozilla.org/privacy/">https://blog.mozilla.org/privacy/</a></li> - <li><a href="http://support.mozilla.org/en-US/kb/privacy-and-security-settings-firefox-os-phones">http://support.mozilla.org/en-US/kb/privacy-and-security-settings-firefox-os-phones</a></li> -</ul> -<p>在擬定 Firefox OS 的原則時,均將使用者資料的控制權交付給使用者本身。而使用者必須自己決定個人資訊的運用方法。Firefox OS 將提供下列功能:</p> -<ul> - <li>「不要追蹤我 (Do Not Track)」選項</li> - <li>可停用 Firefox 瀏覽器的 Cookies</li> - <li>可刪除 Firefox OS 的瀏覽記錄</li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/security/system_security/index.html b/files/zh-tw/archive/b2g_os/security/system_security/index.html deleted file mode 100644 index edb0e64697..0000000000 --- a/files/zh-tw/archive/b2g_os/security/system_security/index.html +++ /dev/null @@ -1,376 +0,0 @@ ---- -title: 系統安全 -slug: Archive/B2G_OS/Security/System_security -translation_of: Archive/B2G_OS/Security/System_security ---- -<div class="summary"> - <p><span class="seoSummary">本文旨在提供 Firefox OS 系統安全模型概觀,說明系統是如何保持安全性與實施權限管理。</span></p> -</div> -<h2 id="名詞解釋">名詞解釋</h2> -<p>在開始之前,有幾個名詞需要了解一下。</p> -<dl> - <dt> - 網頁應用程式 (Web application)</dt> - <dd> - 網頁應用程式 (<strong>web application, web app, open web app</strong>, <strong>moz app</strong>, <strong>application</strong>) 是運行在 Firefox OS (或其他支援平台)、用 <a href="/en-US/docs/HTML" title="/en-US/docs/HTML">HTML</a>, <a href="/en-US/docs/JavaScript" title="/en-US/docs/JavaScript">JavaScript</a>, 以及其他開源網頁技術所寫成的應用程式。所有 B2G 上使用者使用的應用程式都是網頁應用程式,例如撥號程式是一個 web app,但顯示在瀏覽中的網頁並不屬於網頁應用程式的範疇。</dd> - <dt> - b2g 程序 (b2g process)</dt> - <dd> - Firefox OS <strong>b2g process</strong> 通常會被叫做 "<strong>b2g</strong>" 或 "<strong>Gecko</strong>"。b2g 實際上是一個高權限 (root 權限) 應用程式,控制了所有 web app 對資源和硬體的存取。</dd> - <dt> - 內容程序 (Content process)</dt> - <dd> - b2g 產生的子程序,會和 b2g 溝通,代表了 web app。它擁有的權限較低 (一般使用者權限;受限的作業系統資源存取),透過 inter-process communication (IPC) 和 OS 核心溝通。</dd> - <dt> - IPDL</dt> - <dd> - Intercommunication Protocol Definition Language, 請參照 <a href="/en-US/docs/IPDL" title="/en-US/docs/">IPDL</a>.</dd> - <dt> - AOSP</dt> - <dd> - Android Open Source Project.</dd> - <dt> - System call</dt> - <dd> - 一個介於使用者空間 (user space) 和核心 (kernel) 的溝通介面,使用者空間只能透過這個介面和核心溝通。</dd> - <dt> - DAC, MAC</dt> - <dd> - 使用者可設定的自主存取控制 (Discretionary Access Control) 和 系統強制的<span class="st">強制存取控制 (</span>Mandatory Access Control)。</dd> - <dt> - FOTA</dt> - <dd> - 自動韌體更新機制 (Firmware Over The Air),透過無線網路"空中"更新韌體。</dd> - <dt> - MSU (Mozilla System Updater), MAR (Mozilla ARchive)</dt> - <dd> - 和 Firefox 桌面產品一樣的更新機制和檔案格式。</dd> -</dl> -<h2 id="Firefox_作業系統安全模型目標與範疇">Firefox 作業系統安全模型目標與範疇</h2> -<p>Firefox OS 安全模型的設計目標:</p> -<ul> - <li>限制 web app 所能存取的資源範疇。</li> - <li>確保作業系統各層安全措施正確執行。</li> - <li>從 Gonk 層起,限制與控管安全漏洞所造成之衝擊影響。</li> - <li>Web app 權限以及所有應用程式相關安全性特色都在<a href="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security">應用程式安全</a>模型詳述。</li> -</ul> -<p>下面將說明每一個目標以及 Firefox OS 如何達成個目標。</p> -<h2 id="權限強制">權限強制</h2> -<p><a href="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security">應用程式安全</a>模型描述了使用者如何直接或透過受信任第三方來授予應用程式權限,這些強制加諸於內容程序 (content process) 的權限是透過限制資源存取必須經過和核心程序 (core process) 之間的 IPC call。</p> -<ul> - <li>Firefox OS 核心程序, <code>b2g</code>, 的權限極高,同時能夠存取大部分硬體資源。</li> - <li>較低權限的 Web app 的內容程序只能透過 IPC 和 b2g 溝通;IPC 是用 <a href="/en-US/docs/IPDL" title="/en-US/docs/IPDL">IPDL</a> 實現。</li> - <li>內容程序無法存取系統層級的資源。</li> - <li>每一個 Web API 都有一個以上相關聯的 IPDL 協定宣告檔 (*.ipdl).</li> -</ul> -<h2 id="內容程序初始化"><a name="Content_processes">內容程序初始化</a></h2> -<p>所有的 web app 都運行在低權限、分開的內容程序。當 web app 載入到一個特別的 {{HTMLElement("iframe")}} 型態: <em><iframe mozapp></em> 時 b2g 程序會啟動內容程序,這樣會將 web app 和其他內容隔離開來,而且和 web app 的 manifest 高度相關 (請參照 <a href="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security" title="/en-US/docs/Mozilla/Firefox_OS/Security/Application_security">應用程式安全</a>模型),內容程序會在一個稱為 "out of process" (OOP) 的容器裡啟動,這個 OOP 即是 <code>plugin-container</code> 程序,並且和桌面 Firefox 所用的 <code>plugin-container</code> 程序有著相似的原始碼。</p> -<h3 id="風險">風險</h3> -<ul> - <li>當產生 web app 內容程序時的資訊外洩。</li> - <li>提高到和 b2g 一樣權限層級以及存取作業系統資源的意外可能性。</li> - <li>跳過內容程序初始化過程。</li> -</ul> -<h3 id="實作">實作</h3> -<h4 id="在_b2g_程序裡啟動">在 b2g 程序裡啟動</h4> -<p>順序如下:</p> -<ol> - <li><code>fork()</code></li> - <li><code>setuid(new, different, unused user id|nobody)</code> (無特權的使用者)</li> - <li><code>chrdir('/')</code></li> - <li><code>execve('plugin-container')</code></li> -</ol> -<p>這邊的啟動順序確保 OOP 程序運行在隔離的記憶體空間,同時只是低權限使用者,無法提高到 b2g 的高權限。</p> -<h4 id="File_descriptor_(檔案描述子)_管理">File descriptor (檔案描述子) 管理</h4> -<p>File descriptors 的管理方法是白名單;一份受允許的 file descriptors (FDs) 清單儲存在 <code>mFileMap</code> 物件,在呼叫 fork() 後 (FDs 複製前) 和呼叫 execve()前 (新 web app 開始運行),<code>LaunchApp()</code> 函數會強制關閉不在白名單上的 FD。</p> -<p>不同於傳統的黑名單作法 (close-on-exec flag: <code>CLOEXEC</code>),這種做法確保不會有多餘的開啟 FD,比較可靠。</p> -<h2 id="Content_process_sandboxing_(沙箱,低權限內容程序)"><a name="Content_process_sandboxing"></a>Content process sandboxing (沙箱,低權限內容程序)</h2> -<h3 id="風險_2">風險</h3> -<ul> - <li>記憶體錯誤或 Gecko 執行時期邏輯錯誤可能導致意外程式碼的執行。</li> - <li>作業系統,特別是核心,類似錯誤可能導致意外程式碼的執行。</li> - <li>資訊洩漏、檔案系統讀寫。</li> -</ul> -<p>下表為 sandbox 開啟下可能的威脅列表,附帶前述的可能風險。</p> -<div class="warning"> - <p dir="ltr"><strong>範疇</strong>: 當攻擊者以內容程序執行意外執行碼時,會出現下面的威脅,也就是說,攻擊者發現了 Gecko 的安全漏洞。</p> -</div> -<table class="standard-table"> - <thead> - <tr> - <th scope="col">威脅</th> - <th scope="col">潛在衝擊</th> - <th scope="col">可能性因子</th> - <th scope="col">建議對應作法</th> - </tr> - </thead> - <tbody> - <tr> - <td> - <p>惡意內容程序利用核心安全漏洞</p> - <p>"2 steps attack".</p> - </td> - <td><strong>嚴重</strong>:整個裝置都將受到控制</td> - <td><strong>低</strong>: 內容程序只有有限的方法呼叫系統。</td> - <td> - <ul> - <li>減少允許的系統呼叫數量到最低需要量。</li> - <li>用預防性修正檔保護核心,例如 PaX (Protection Against eXecution).</li> - </ul> - </td> - </tr> - <tr> - <td> - <p>提升到父程序權限</p> - <p>惡意內容程序利用和父程序之間的 IPDL 安全漏洞</p> - <p>"2 steps attack".</p> - </td> - <td><strong>高</strong>: 許多敏感的系統呼叫都可以被執行 (資料損失、相機存取、網路存取等等)</td> - <td><strong>中</strong>: 父程序大量的程式碼代表大範圍的可能攻擊點。少量的 IPDL 資料消毒,例如傳送指標。</td> - <td> - <ul> - <li>以非 root / 非特權使用者執行父程序</li> - <li>盡可能以 sandbox 方法執行父程序</li> - </ul> - </td> - </tr> - <tr> - <td> - <p>惡意內容程序利用父程序攻擊核心安全漏洞</p> - <p>"3 steps attack".</p> - </td> - <td><strong>嚴重</strong>:整個裝置都將受到控制</td> - <td> - <p><strong>低</strong>: 需要父程序有可以透過 IPDL 攻擊的 bug。</p> - <p>需要核心和父程序之間的系統呼叫可利用的漏洞 (相較內容程序,父程序有更多可行的系統呼叫)</p> - </td> - <td> - <ul> - <li>以非 root / 非特權使用者執行父程序</li> - <li>盡可能以 sandbox 方法執行父程序</li> - <li>用預防性修正檔保護核心,例如 PaX (Protection Against eXecution)</li> - </ul> - </td> - </tr> - <tr> - <td> - <p>惡意內容程序、父程序、web app 利用硬體裝置的 bug</p> - <p>"1 and 2 steps attack".</p> - </td> - <td> - <p><strong>高</strong>: 可以執行特別權限的作業 (如撥號、傳 SMS 簡訊等)</p> - <p><strong>嚴重</strong>:整個裝置都將受到控制或執行硬體程式碼。</p> - </td> - <td><strong>低</strong>: 需要硬體 bug 以及 IPDL 或系統呼叫授予的硬體溝通管道</td> - <td> - <ul> - <li>對硬體裝置實施模糊測試 (Fuzz testing)</li> - <li>利用核心或父程序 API 修正檔避開問題 (關閉不安全的硬體功能、消毒資料等等)</li> - </ul> - </td> - </tr> - </tbody> -</table> -<div class="note"> - <p><strong>Note</strong>:</p> - <p>* PaX (Protection Against eXecution) 是一個由 <a href="http://grsecurity.net/~paxguy1/" title="http://grsecurity.net/~paxguy1/">GrSecurity</a> (<a href="http://pax.grsecurity.net/docs" title="http://pax.grsecurity.net/docs">docs</a>) 所發佈的核心修正檔,實作了 PaX 以及額外的保護措施,如 UDEREF 和 SMAP。</p> - <p>* 未列出的安全性漏洞代表已被 snadbox 解決掉了。</p> -</div> -<h3 id="實作內容">實作內容</h3> -<p><img alt="Process Model Sandbox" src="https://mdn.mozillademos.org/files/5347/sq1ftZvuape-uCT8CDfJ10Q.png" style="width: 708px; height: 470px;"></p> -<div class="note"> - <p><strong>Note</strong>: 內容程序 (Content Processes) 就是運行中的 web app,也會被限制在 sandbox 環境。</p> -</div> -<h4 id="Gecko_APIs_實作">Gecko APIs 實作</h4> -<p>內容程序可見的 APIs 絕不應該直接存取檔案系統,取而代的是應該透過 IPDL,所以說會需要存取資源的 API 都需要在父程序中有一個對應的元件代表 API 存取資源。</p> -<p>實作相關部分時要特別小心,所有送到父程序的輸入都應該要先消毒,不可以相信內容程序以及來自內容程序的 IPDL 訊息。</p> -<div class="warning"> - <p><strong>Warning</strong>: 任何內容程序取得的受信任授權都可以被用來繞過 sandbox 所加諸的限制。</p> -</div> -<h4 id="何謂_seccomp">何謂 seccomp</h4> -<p>Seccomp 代表 secure computing mode (安全電腦模式),目前有兩種版本:</p> -<ol> - <li> - <p><code>seccomp</code>, 可見於 Linux kernel 2.6.12 以上版本:</p> - <ul> - <li> - <p>開啟 <code>seccomp</code> 會將程序的系統呼叫 (System call) 限制在 <code>read</code>, <code>write</code>, <code>sigreturn</code>, 和 <code>exit</code></p> - </li> - <li> - <p>使用 <code>prctl()</code> system call</p> - </li> - <li> - <p>可以在指定地方、程序初始化後啟動</p> - </li> - </ul> - </li> - <li> - <p><code>seccomp-bpf</code>, 又稱為 seccomp mode filter 或 mode 2, 可見於 Linux kernel 3.5 以上版本:</p> - <ul> - <li> - <p>如同 <code>seccomp</code>,但多了 BPF 過濾系統呼叫</p> - </li> - <li> - <p>可以使用系統呼叫白名單和啟動時傳入參數,而非單單預先寫死的作法</p> - </li> - <li> - <p>更有彈性,可以有"較多自由的 sandbox",對限制性較低的 sandbox 來說很有用,而且也可以移轉到限制性較高的 sandbox</p> - </li> - <li> - <p>多了一個安全性旗幟避免程序和子程序推翻既有權限限制</p> - </li> - </ul> - </li> -</ol> -<div class="note"> - <p><strong>Note</strong>: 基於 <code>seccomp-bpf 更有彈性,所以我們決定採用,並且替版本低於3.5 的 kernel (涵蓋了目前大部分的 Android kernel)提供向下相容移植。</code>目前已經有不會造成衝突、可供使用的移植包 (請見 bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=790923" title="https://bugzilla.mozilla.org/show_bug.cgi?id=790923">790923</a>).</p> -</div> -<h4 id="Seccomp-bpf_效能">Seccomp-bpf 效能</h4> -<p><code>seccomp-bpf</code> 會對每一次系統呼叫造成效能負擔,目前沒有一定的效能標竿準則,但我們預估大約最高 1% 的系統呼叫負擔會產生。</p> -<p>由於我們的程序模型減少許多系統呼叫,所以實際上我們預估效能負擔將會趨近於無。</p> -<p>不過因實作細節而異, IPDL 呼叫卻可能造成效能負擔以及增加延遲,建議對於資源需求密集的 API,如 OpenGL 呼叫,可以看一下 <a href="http://code.google.com/p/chromium/issues/detail?id=29120" style="text-decoration: none;">Chromium的實作細節</a>。和 <code>seccomp-bpf</code> 一樣,我們能夠最少化 IPDL 呼叫次數來最小化效能負擔。</p> -<h3 id="實作內容_2">實作內容</h3> -<p><code>seccomp</code> 在 Gecko 以 <em><code>--enable-content-sandbox </code></em>開啟。<em>.</em></p> -<p>預設上系統呼叫拒絕資訊不會被回報,我們可以透過 <code>--enable-content-sandbox-reporter 打</code>開回報機制。</p> -<p>程式碼放在<em> </em><code>gecko/security/sandbox</code>,白名單放在 <code>gecko/security/sandbox/seccomp_filter.h</code>。</p> -<h2 id="檔案系統安全強化"><a name="File_system_hardening"></a>檔案系統安全強化</h2> -<h3 id="風險_3">風險</h3> -<ul> - <li>讀、寫、刪除另一位使用者的檔案可能會導致資訊洩漏或未預期權限提升</li> - <li>經由應用程式漏洞執行本地編譯碼</li> - <li>setuid 程式的安全漏洞導致權限提升</li> -</ul> -<h3 id="實作內容_3">實作內容</h3> -<p>原則上只有使用者內容區域可以讀寫 (除非 OS 未來要求新的讀寫區域),而且一定要包含 <code>nodev</code>、<code>nosuid</code> 和 <code>noexec</code> 選項。標準檔案系統掛載點限制如下:</p> -<table class="standard-table"> - <thead> - <tr> - <th scope="col">掛載點</th> - <th scope="col">檔案系統</th> - <th scope="col">選項</th> - </tr> - </thead> - <tbody> - <tr> - <td><code>/</code></td> - <td>rootfs</td> - <td>read-only</td> - </tr> - <tr> - <td><code>/dev</code></td> - <td>tmpfs</td> - <td>read-write, nosuid, noexec, mode=0755</td> - </tr> - <tr> - <td><code>/dev/pts</code></td> - <td>ptsfs</td> - <td>read-write, nosuid, noexec, mode=0600</td> - </tr> - <tr> - <td><code>/proc</code></td> - <td>proc</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - <tr> - <td><code>/sys</code></td> - <td>sysfs</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - <tr> - <td><code>/cache</code></td> - <td>yaffs2 or ext4</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - <tr> - <td><code>/efs</code></td> - <td>yaffs2 or ext4</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - <tr> - <td><code>/system</code></td> - <td>ext4</td> - <td>read-only, nodev</td> - </tr> - <tr> - <td><code>/data</code></td> - <td>ext4</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - <tr> - <td><code>/mnt/sdcard</code></td> - <td>ext4 or vfat</td> - <td>read-write, nosuid, nodev, noexec, uid=1000, fmask=0702, dmask=0702</td> - </tr> - <tr> - <td><code>/acct</code></td> - <td>cgroup</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - <tr> - <td><code>/dev/cpuctl</code></td> - <td>cgroup</td> - <td>read-write, nosuid, nodev, noexec</td> - </tr> - </tbody> -</table> -<div class="note"> - <p><strong>Note:</strong> 實際的掛載點可能有所變更</p> -</div> -<h3 id="Linux_DAC_2"><span class="mw-headline" id="Linux_DAC">Linux DAC</span></h3> -<p>Linux DAC represents 是一個有名的 Linux 檔案系統權限模型。</p> -<div class="note"> - <p><strong>Note: </strong>這是傳統的 user/group/others 權限模型,而非 Linux POSIX 1.e ACLs.</p> -</div> -<ul> - <li>Web app 系統使用者沒有寫入任何檔案的權限</li> - <li>setuid 二進位檔只能在必要時使用</li> - <li>新內容程序以合理的 umask 啟動</li> -</ul> -<h2 id="安全系統更新"><a name="System_updates"></a>安全系統更新</h2> -<h3 id="風險_4">風險</h3> -<ul> - <li>受感染的更新檔案導致未受信任的更新檔被安裝</li> - <li>受感染的更新檢查 - <ul> - <li>使用者看不到更新</li> - <li>使用者更新到過時的更新檔,導致軟體降級</li> - </ul> - </li> - <li>安裝更新時受感染或未知的系統狀態可能導致: - <ul> - <li>遺失安裝檔案,例如一些安全性修正檔</li> - <li>安全性修正被受感染的系統推翻</li> - </ul> - </li> - <li>更新機制的安全漏洞</li> - <li>對已知漏洞缺乏更新或追蹤</li> -</ul> -<h3 id="實作內容_4">實作內容</h3> -<p>Firefox OS 的更新機制使用安全的 Mozilla 程序,更新檔是由受信任,通常是 OEM 廠商,組建、測試、簽署數位簽章。</p> -<h4 id="FOTA_(Firmware_over_the_air)_更新">FOTA (Firmware over the air) 更新</h4> -<p>系統更新可能涵蓋全部或部分 Firefox OS,如果更新涵蓋到 Gonk,那麼 <strong>FOTA</strong> (Firmware Over the Air) 安裝程序會被採用。FOTA 也可涵蓋到 OS 其他部分,例如裝置管理 (FOTA, firmware / drivers)、設定管理 (Firefox OS settings)、安全更新、Gaia、Gecko 等等。</p> -<h4 id="MSUMAR_更新">MSU/MAR 更新</h4> -<p>不牽涉到 Gonk 的更新可以透過 Mozilla 系統更新工具。Firefox OS 使用和桌面 FIrefox 一樣的更新架構、程序 Mozilla ARchive (MAR) 格式 (用於更新包)。</p> -<h4 id="更新服務">更新服務</h4> -<div class="note"> - <p><strong>Note: </strong>更新服務能由 OEM 廠商提供。</p> -</div> -<p>手機內建的更新系統會定期檢查更新,一但發現新更新,會提示使用者安裝更新,另外安裝前也會檢查手機儲存空間以及驗證發行者身分:</p> -<ul> - <li>更新來源 (驗證更新和 manifest 檔的來源位置,protocol:domain:port)</li> - <li>檔案完整性 (加密 hash checksums).</li> - <li>程式碼簽章</li> -</ul> -<p>下列安全性作法會用在更新程序:</p> -<ul> - <li>Mozilla 建議並且預期更新有受信任的證明以及通過 SSL 下載。</li> - <li>更新韌體需要高度加密驗證。</li> - <li>更新前完整的更新檔必須從特定、安全的來源下載。</li> - <li>當系統更新時,系統必須要在安全的狀態下,不可以運行任何 web app。</li> - <li>金鑰必須存在裝置上安全的地方。</li> -</ul> -<p>縝密的更新檢查確保正常地安裝更新。</p> -<div class="note"> - <p><strong>Note</strong>: 更多有關更新資訊,請見 <a href="/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Creating_Firefox_OS_update_packages">Creating and applying Firefox OS update packages</a>.</p> -</div> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/simulator/index.html b/files/zh-tw/archive/b2g_os/simulator/index.html deleted file mode 100644 index 3b5677a518..0000000000 --- a/files/zh-tw/archive/b2g_os/simulator/index.html +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Firefox OS 模擬器 -slug: Archive/B2G_OS/Simulator -translation_of: Archive/B2G_OS/Simulator ---- -<div class="note"> -<p>本文將針對 Firefox OS 1.2 或更高版本,說明 Firefox OS 模擬器 (Firefox OS Simulator) 相關使用方式。如果開發者目前正開發 Firefox OS 1.1 的 App,則請參閱 <a href="https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_1.1_Simulator">Firefox OS 1.1 Simulator</a> 的相關文章。</p> -</div> - -<p>Firefox OS 模擬器可於桌機中模擬 Firefox OS 裝置。開發者不用真的弄到實際設備就能夠測試 App 並進行除錯。模擬器會在視窗中以 Firefox OS 裝置的實際尺寸執行,亦包含 Firefox OS 使用者介面與已內建的 App,進而模擬多樣的 Firefox OS 裝置 API。</p> - -<p>Firefox OS 模擬器是以 Firefox 附加元件的格式發佈,可下載並安裝於 Firefox 瀏覽器之上,接著可透過<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/Using_the_App_Manager">應用程式管理員 (App Manager)</a> 來執行模擬器、將 App 送入模擬器、搭配其他開發者工具。</p> - -<h2 id="安裝"><span style="line-height: 1.5;">安裝</span></h2> - -<p>直接點擊下方按鈕即可安裝模擬器。現有多個版本可供安裝。我們也建議開發者能安裝所有版本,以達最佳開發靈活度。</p> - -<p><a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/" style="margin-bottom: 20px; padding: 10px; color: white; text-align: center; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; display: inline-block; background-color: rgb(129, 188, 46); white-space: nowrap; text-shadow: rgba(0, 0, 0, 0.247059) 0px 1px 0px; box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 0px 0px, rgba(0, 0, 0, 0.298039) 0px -1px 0px 0px inset;">安裝 Firefox OS Simulator</a></p> - -<p>另請參閱<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/Using_the_App_Manager">《應用程式管理員》中的說明</a>來啟動模擬器。一旦模擬器開始執行,開發者即可將 App 送入應用程式管理員進行除錯;就如同使用實際裝置一樣。</p> - -<div class="note" style="line-height: 21px;"> -<p><strong>注意:模擬器</strong> (1.2 與 1.3 版) 目前正回報 1 組錯誤的 Gecko user agent 字串:請參閱 {{ Bug("964598") }} 進一步了解。</p> -</div> - -<h2 id="模擬器的使用者介面_(UI)" style="line-height: 30px;">模擬器的使用者介面 (UI)</h2> - -<p>模擬器將另外顯示獨立的視窗,且模擬畫面則為 320x480 像素。若要模擬觸控事件,則可按下滑鼠按鈕不放並拖曳。只要在主畫面上按下滑鼠不放並從右向左拖曳,即可看到已內建的 App,還有開發者剛送入的 App:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/7173/simulator-1.2.png" style="display: block; height: 623px; margin: 0px auto; width: 810px;"></p> - -<p>在模擬器視窗底部的工具列共有 2 個按鈕:</p> - -<ul> - <li>左邊「<strong>主畫面</strong>」按鈕可回到主畫面;或長按不放則可關閉模擬器</li> - <li>右邊「<strong>畫面旋轉</strong>」按鈕可切換裝置的橫向、直向畫面;即產生 <a href="https://developer.mozilla.org/en-US/docs/WebAPI/Managing_screen_orientation#Listening_orientation_change" title="/en-US/docs/WebAPI/Detecting_device_orientation">orientationchange</a> 事件。</li> -</ul> - -<h2 id="模擬器的限制">模擬器的限制</h2> - -<p>請注意,Firefox OS 模擬器仍無法提供完美的模擬作業。</p> - -<h3 id="硬體限制"><strong>硬體限制</strong></h3> - -<p>模擬器除了螢幕尺寸的限制之外,也無法模擬 Firefox OS 裝置的硬體 (例如 CPU 速度或可用的記憶體容量)。</p> - -<h3 id="音訊視訊編碼">音訊/視訊編碼</h3> - -<p>下列編碼 (Codecs) 因硬體加速解碼而有所不同,因此尚未支援:</p> - -<ul> - <li>MP3</li> - <li>AAC</li> - <li>H.264 (MP4)</li> - <li>WebM</li> -</ul> - -<p>也就是說,若 App 或網站 (如 Youtube) 使用這些編碼,則模擬器將無法測試其中的視訊回播功能。</p> - -<h3 id="未支援的_API"><a name="Unsupported-APIs">未支援的 API</a></h3> - -<p>一般來說,因為桌上型電腦無法使用支援硬體,所以可於裝置上運作的特定 API,可能無法用於模擬器之上。我們另外針對某些 API (例如 Geolocation 地理位置定位) 建構了模擬功能,未來版本亦將新增更多模擬 API。但目前仍尚未支援下列 API。如果使用了這些 API,也只會得到錯誤的報告或結果:</p> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/WebAPI/WebTelephony" title="/en-US/WebAPI/WebTelephony">Telephony</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/WebAPI/WebSMS" title="/en-US/docs/WebAPI/WebSMS">WebSMS</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/WebAPI/WebBluetooth" title="/en-US/docs/WebAPI/WebBluetooth">WebBluetooth</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/WebAPI/Using_Light_Events" title="/en-US/docs/WebAPI/Using_Light_Events">Ambient Light</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/WebAPI/Proximity" title="/en-US/docs/WebAPI/Proximity">Proximity</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/WebAPI/Network_Information" title="/en-US/docs/WebAPI/Network_Information">Network Information</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Online_and_offline_events" title="/en-US/docs/Online_and_offline_events">navigator.onLine and offline events</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/WebAPI/Vibration" title="/en-US/docs/WebAPI/Vibration">Vibration</a></li> -</ul> - -<h2 id="獲得協助"><a name="Simulator-help"></a>獲得協助</h2> - -<p>如果有任何問題,請透過 <a href="https://lists.mozilla.org/listinfo/dev-developer-tools">dev-developer-tools 郵件群組</a>或到 <a href="irc://irc.mozilla.org/#devtools">#devtools on irc.mozilla.org</a> 上發問。</p> - -<h3 id="啟動詳細資訊_(verbose)_記錄的方法"><a name="Simulator-verbose-logging"></a>啟動詳細資訊 (verbose) 記錄的方法</h3> - -<p>開發者可到<a href="https://developer.mozilla.org/en-US/docs/Tools/Web_Console">網頁主控台 (Web Console)</a> 觀看 App 的記錄訊息,並透過<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/Using_the_App_Manager">應用程式管理員</a>將記錄附加到 App 上。如果想知道 App 啟動時的早期訊息,甚至早於主控台連線並開始作業的訊息,則開發者可啟動模擬器中的詳細資訊記錄功能。</p> - -<p>可透過 about:config 並建立新的 preference 設定。依照模擬器的版本,preference 的名稱也有所差異:</p> - -<ul> - <li>Firefox OS 1.3 為extensions.fxos_1_3_simulator@mozilla.org.sdk.console.logLevel</li> - <li>Firefox OS 1.2 為 extensions.fxos_1_2_simulator@mozilla.org.sdk.console.logLevel</li> -</ul> - -<p>針對「附加元件管理員 (Add-on Manager)」中的附加元件,可將字串值設為「all」、停用,再啟用。目前有關模擬器作業的額外訊息,均將出現於<a href="https://developer.mozilla.org/en-US/docs/Tools/Browser_Console">瀏覽器主控台 (Browser Console)</a> 中。</p> diff --git a/files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html b/files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html deleted file mode 100644 index 9e7fba8c07..0000000000 --- a/files/zh-tw/archive/b2g_os/simulator/simulator_walkthrough/index.html +++ /dev/null @@ -1,268 +0,0 @@ ---- -title: Firefox OS 模擬器簡易攻略 -slug: Archive/B2G_OS/Simulator/Simulator_Walkthrough -translation_of: Archive/B2G_OS/Simulator/Simulator_Walkthrough ---- -<p>這裡將透過 <a href="https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_Simulator" title="/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a> 對 Web Apps 進行很簡單的除錯 (但要找的 bug 有點多)。</p> -<p>整個簡易攻略分成 6 個部分,各自使用不同的診斷/除錯工具,包含 <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough#manifest_.E6.AA.A2.E9.A9.97.E5.8A.9F.E8.83.BD" title="#Using-manifest-validation">manifest 檢驗功能</a>、<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough#.E4.BD.BF.E7.94.A8.E7.B6.B2.E9.A0.81.E4.B8.BB.E6.8E.A7.E5.8F.B0_(Web_Console)">網頁主控台 (Web Console)</a>、<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough#.E4.BD.BF.E7.94.A8_JavaScript_.E9.99.A4.E9.8C.AF.E5.99.A8_(JavaScript_Debugger)" title="#Using-the-JavaScript-Debugger">JavaScript 除錯器 (JavaScript Debugger)</a>、<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough#.E4.BD.BF.E7.94.A8.E7.B6.B2.E8.B7.AF.E7.9B.A3.E6.B8.AC.E5.99.A8_(Network_Monitor)" title="#Using-the-NetworkMonitor">網路監測器 (Network Monitor)</a>、<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough#.E4.BD.BF.E7.94.A8.E6.A8.A3.E5.BC.8F.E7.B7.A8.E8.BC.AF.E5.99.A8_(Style_Editor)" title="#Using-the-StyleEditor">樣式編輯器 (Style Editor)</a>、<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough#.E4.BD.BF.E7.94.A8.E6.94.B6.E6.93.9A_(Receipts)_.E6.B8.AC.E8.A9.A6.E5.8A.9F.E8.83.BD" title="#Using-the-TestReceipts">收據 (Receipts) 測試</a>。</p> -<p>這 6 個部分各自獨立。就算你只挑其中幾段來看,應該也能看得懂而不會有銜接上的問題。</p> -<h3 id="manifest_檢驗功能"><a name="Using-manifest-validation">manifest 檢驗功能</a></h3> -<div class="note"> - <p>GitHub 上的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough" title="https://github.com/rpl/firefoxos-simulator-walkthrough">firefoxos-simulator-walkthrough</a> 現有不同版本的 App。如果你想從第一段開始了解 App 的修正程序,可從 App 的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-1" title="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-1">whereami-1</a> 版本著手,逐步完成此攻略。</p> - <p>這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。</p> - <p>此處假設你<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator#.E5.AE.89.E8.A3.9D.E6.A8.A1.E6.93.AC.E5.99.A8.E9.99.84.E5.8A.A0.E5.85.83.E4.BB.B6" title="/en-US/docs/Tools/Firefox_OS_Simulator#Installing_the_Simulator_add-on">已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)</a>,並開啟了 Dashboard。</p> -</div> -<p>首先我們點選「<strong>Add Directory</strong>」,將 App 新增至 Dashboard 中,再選擇 manifest 檔案。畫面如下:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5529/manifest-error-collapsed-4.0.png" style="width: 1044px; height: 680px;"><br> - <br> - 點選「<strong>(2 errors and 0 warnings)</strong><strong>」就會看到:</strong></p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5531/manifest-error-expanded-4.0.png" style="width: 1044px; height: 680px;"><br> - 畫面將清楚顯示錯誤訊息。此時看到「<strong>manifest.webapp</strong>」就會發現少了 1 組「<strong>name</strong><strong>」:</strong></p> -<pre>{ - "description": "A simple web app", - "launch_path": "/index.html", - "icons": { - "128": "/style/icons/earth.png" - } -}</pre> -<p><br> - 我們把「<strong>name</strong>」欄位加入 manifest 檔案之後儲存,再點選 Dashboard 中的「<strong>Refresh</strong>」:</p> -<pre>{ - "name": "Where am I?", - "description": "A simple web app", - "launch_path": "/index.html", - "icons": { - "128": "/style/icons/earth.png" - } -}</pre> -<p><br> - 此時 Dashboard 應該會告知沒有錯誤,也就能執行 App:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5533/whereami-no-map-4.0.png" style="width: 1044px; height: 478px;"></p> -<p>但這時就算你按下按鈕,模擬器也不會有任何動作。我們會在下一段中使用 WebConsole 診斷此問題。</p> -<h3 id="使用網頁主控台_(Web_Console)"><a name="Using-the-WebConsole">使用網頁主控台 (Web Console)</a></h3> -<div class="note"> - <p><strong>如果你要從這裡開始研讀攻略:</strong></p> - <p>這一段將透過 <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator" title="/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a>,對很簡單的 Web App 進行除錯。GitHub 上的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough" title="https://github.com/rpl/firefoxos-simulator-walkthrough">firefoxos-simulator-walkthrough</a> 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-2" title="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-2">whereami-2</a> 版本著手,逐步完成此攻略。</p> - <p>這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。</p> - <p>但此版本的 App 不會執行任何作業。本段透過 WebConsole 診斷出問題。</p> - 此處假設你<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator#.E5.AE.89.E8.A3.9D.E6.A8.A1.E6.93.AC.E5.99.A8.E9.99.84.E5.8A.A0.E5.85.83.E4.BB.B6" title="/en-US/docs/Tools/Firefox_OS_Simulator#Installing_the_Simulator_add-on">已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)</a>、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。</div> -<p>這裡必須按下 Dashboard 上的「<strong>Connect</strong>」按鈕:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5497/connect-to-app-button.png" style="width: 1044px; height: 650px;"></p> -<p>隨即自動開啟模擬器視窗並執行 App。而 Dashboard 分頁另將出現網頁主控台 (WebConsole)。</p> -<p>主控台的輸出結果會提示幾項錯誤、警告、訊息。但請注意最後一項:<br> - <br> - <img alt="" src="https://mdn.mozillademos.org/files/5535/webconsole-whereami-error.png" style="width: 1044px; height: 680px;"><br> - <br> - 看來是 App 的程式碼「whereami.js」明顯出了問題。這裡列出程式碼的前幾行:</p> -<pre class="brush: js">var whereami = document.getElementById('whereami'); - -whereami.onclick = function() { - navigator.geolocation.getCurrentPosition(getMap, error); -};</pre> -<p><br> - 若與 App 的「index.html」相較,則問題明顯是:</p> -<pre class="brush: html"><!DOCTYPE html> - -<html> - - <head> - <meta charset='utf-8'> - <script src="http://open.mapquestap.com/sdk/js/v7.0.s/mqa.toolkit.js"></script> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> - - </head> - - <body> - <button id ="where-am-i">Where am I?</button> - <div id="map"></div> - <script src="scripts/whereami.js"></script> - <link media="all" href="style/style.css" type="text/css" rel="stylesheet"> - </body> - -</html></pre> -<p><br> - 在 HTML 中的按鈕 ID 是「where-am-i」,而不是我們在前面 JavaScript 中所使用的「whereami」。所以我們修改為:</p> -<pre class="brush: js">var whereami = document.getElementById('where-am-i'); - -whereami.onclick = function() { - navigator.geolocation.getCurrentPosition(getMap, error); -};</pre> -<p>接著啟動 App 時雖然沒有問題,但仍未顯示地圖。這時主控台又出現新的訊息:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5537/webconsole-whereami-geolocation-error.png" style="width: 1044px; height: 680px;"></p> -<p>此訊息是由「whereami.js」程式碼所記錄,指出 Geolocation API 回傳了錯誤,卻沒有說明是哪種錯誤。接著我們可用 JavaScript 除錯器 (JavaScript Debugger) 找出錯誤類型。</p> -<h3 id="使用_JavaScript_除錯器_(JavaScript_Debugger)"><a name="Using-the-JavaScript-Debugger">使用 JavaScript 除錯器 (JavaScript Debugger)</a></h3> -<div class="note"> - <p><strong>如果你要從這裡開始研讀攻略:</strong></p> - <p>這一段將透過 <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator" title="/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a>,對很簡單的 Web App 進行除錯。GitHub 上的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough" title="https://github.com/rpl/firefoxos-simulator-walkthrough">firefoxos-simulator-walkthrough</a> 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-3" title="https://github.com/wbamberg/firefoxos-simulator-walkthrough/tree/master/whereami-1">whereami-3 </a>版本著手,逐步完成此攻略。</p> - <p>這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。</p> - <p>此版本 App 的 Geolocation API 將回傳錯誤。所以本段將透過 JavaScript 除錯器 (JavaScript Debugger) 找出到底是哪種問題。</p> - <p>此處假設你<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator#.E5.AE.89.E8.A3.9D.E6.A8.A1.E6.93.AC.E5.99.A8.E9.99.84.E5.8A.A0.E5.85.83.E4.BB.B6" title="/en-US/docs/Tools/Firefox_OS_Simulator#Installing_the_Simulator_add-on">已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)</a>、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。</p> -</div> -<p>在連上 App 的網頁主控台 (WebConsole) 中,點選 Geolocation 錯誤記錄的右側鏈結:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5539/webconsole-whereami-geolocation-error-annotated.png" style="width: 1044px; height: 680px;"><br> - 按下「<strong>whereami.js:8</strong>」鏈結之後,JavaScript 除錯器隨即自動載入相關檔案並跳到有問題的行數。</p> -<p>根據<a href="https://developer.mozilla.org/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition#PositionError" title="/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition#PositionError">這篇 Geolocation API 參考</a>所述,這裡將由錯誤處理器 (Error handler) 的 <code>error() 屬性送入 </code><code>code</code> 物件<code>,而我們再透過 </code><code>error 物件的</code><code> code</code><code> 屬性</code><code>獲知此特定錯誤的詳細資訊</code>。所以我們點選左側行數為 8 的那一行,即可於 <code>error()</code> 之內設定中斷點:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5541/webconsole-whereami-set-breakpoint.png" style="width: 1044px; height: 680px;"></p> -<p>在 App 之內點選「<strong>Where am I?</strong>」之後,執行作業就會停在中斷點:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5545/webconsole-whereami-hit-breakpoint.png" style="width: 1044px; height: 680px;"></p> -<p>此時只要按下「<strong>Add watch expression</strong>」的地方並鍵入「<strong>error.code</strong>」,就會立刻看到其值為「<strong>1</strong>」:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5547/webconsole-whereami-watch.png" style="width: 1044px; height: 680px;"><br> - 同樣根據 <a href="https://developer.mozilla.org/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition#PositionError" title="/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition#PositionError">Geolocation API 參考文件</a>所述,「1」即代表「權限已遭否決」。如果 Web Apps 尚未請求 <a href="https://developer.mozilla.org/en-US/docs/Apps/App_permissions" title="/en-US/docs/Apps/App_permissions">Geolocation 權限</a>,或使用者尚未許可該權限,都會發生這種錯誤。<br> - <br> - 這時來看「manifest.webapp」檔案,就會看到我們尚未要求權限:</p> -<pre>{ - "name": "Where am I?", - "description": "A simple web app", - "launch_path": "/index.html", - "icons": { - "128": "/style/icons/earth.png" - } -}</pre> -<p><br> - 接著修復如下:</p> -<pre>{ - "name": "Where am I?", - "description": "A simple web app", - "launch_path": "/index.html", - "icons": { - "128": "/style/icons/earth.png" - }, - "permissions": { - "geolocation": { - "description": "Needed to tell the user where they are" - } - } -}</pre> -<p><br> - 儲存「<strong>manifest.webapp</strong>」之後,再按下 Dashboard 中的「<strong>Refresh</strong>」。這裡記得要在除錯器停在中斷點時,才能繼續除錯。而當你點選「Where am I?」,App 隨即會要求你分享你的位置。而你允許分享之後仍看不到地圖,接著又在 WebConsole 中找到新的訊息:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5549/webconsole-whereami-mapquestapi-not-defined.png" style="width: 1044px; height: 680px;"></p> -<p>此訊息指出 MapQuest API (在 App 中以 script 標籤所指定) 並未正確載入。接著可使用網路監測器 (Network Monitor) 找出問題。</p> -<h3 id="使用網路監測器_(Network_Monitor)"><a name="Using-the-NetworkMonitor"></a>使用網路監測器 (Network Monitor)</h3> -<div class="note"> - <p><strong>如果你要從這裡開始研讀攻略:</strong></p> - <p>這一段將透過 <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator" title="/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a>,對很簡單的 Web App 進行除錯。GitHub 上的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough" title="https://github.com/rpl/firefoxos-simulator-walkthrough">firefoxos-simulator-walkthrough</a> 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-4" title="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-4">whereami-4 </a>版本著手,逐步完成此攻略。</p> - <p>這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。</p> - <p>此版本 App 的網頁主控台 (WebConsole) 將顯示「MQA is not defined」錯誤。所以本段將透過網路監測器 (Network Monitor) 找出未載入 MapQuest API 的原因。</p> - <p>此處假設你<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator#.E5.AE.89.E8.A3.9D.E6.A8.A1.E6.93.AC.E5.99.A8.E9.99.84.E5.8A.A0.E5.85.83.E4.BB.B6" title="/en-US/docs/Tools/Firefox_OS_Simulator#Installing_the_Simulator_add-on">已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)</a>、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。</p> -</div> -<div class="warning"> - <p><strong>警告:</strong><a href="https://hacks.mozilla.org/2013/06/network-monitor-now-in-firefox-beta/" title="https://hacks.mozilla.org/2013/06/network-monitor-now-in-firefox-beta/">需 Firefox 23.0 或更高版本才具備網路監測器</a>功能。</p> -</div> -<p>在連上 App 的開發者工具中,點選「<strong>Network</strong>」分頁就會看到下列面板。可以看到「<strong>open.mapquestap.com</strong>」網域針對「<strong>mqa.toolkit.js</strong>」資源所發出的請求,從未完全成功過:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5551/network-monitor-timing-panel.png" style="width: 1044px; height: 680px;"></p> -<p>成功的請求均標記為<strong>綠色</strong>。如果我們點選「<strong>open.mapquestap.com</strong><strong>」</strong>網域 (<strong>深灰色</strong>) 的請求之一,點選「<strong>Timings</strong>」的細節面板,就會看到 DNS 解析 (DNS resolution) 並未成功,因此該請求從未達到「<strong>Connecting</strong>」的狀態。</p> -<p>再看到「<strong>index.html</strong>」檔案,會發現 script 標籤指向錯誤網域。</p> -<p>這裡變更 script 標籤以使用正確的網域:<strong>open.mapquestapi.com</strong> (於網域名稱內加入缺少的「i」) 之後,即可修復此錯誤。</p> -<pre class="brush: html"><!DOCTYPE html> - -<html> - - <head> - <meta charset='utf-8'> - <script src="<span style="background-color: #ffff00;">http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js</span>"></script> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> - - </head> - - <body> - <button id ="where-am-i">Where am I?</button> - <div id="map"></div> - <script src="scripts/whereami.js"></script> - <link media="all" href="style/style.css" type="text/css" rel="stylesheet"> - </body> - -</html></pre> -<p>儲存「<strong>index.html</strong>」並點選 Dashboard 中的「<strong>Refresh</strong>」。在 App 執行時按下「Where am I?」,系統就會要求你分享你的位置。在你允許分享之後,App 終於顯示地圖:<br> - <img alt="" src="https://mdn.mozillademos.org/files/5553/whereami-map.png" style="width: 399px; height: 663px;"></p> -<h3 id="使用樣式編輯器_(Style_Editor)"><a name="Using-the-StyleEditor"></a>使用樣式編輯器 (Style Editor)</h3> -<div class="note"> - <p><strong>如果你要從這裡開始研讀攻略:</strong></p> - <p>這一段將透過 <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator" title="/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a> 客製化 App 的樣式表 (Stylesheets)。 GitHub 上的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough" title="https://github.com/rpl/firefoxos-simulator-walkthrough">firefoxos-simulator-walkthrough</a> 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-5" title="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-5">whereami-5</a> 版本著手,逐步完成此攻略。</p> - <p>這個 App 只會顯示 1 個「Where am I?」按鈕。只要使用者點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。</p> - <p>此版本的 App 已修復前述的所有錯誤。接著我們將透過樣式編輯器 (Style Editor),為執行中的 App 即時變更樣式並儲存之。</p> - <p>此處假設你<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator#.E5.AE.89.E8.A3.9D.E6.A8.A1.E6.93.AC.E5.99.A8.E9.99.84.E5.8A.A0.E5.85.83.E4.BB.B6" title="/en-US/docs/Tools/Firefox_OS_Simulator#Installing_the_Simulator_add-on">已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)</a>、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。</p> -</div> -<div class="warning"> - <p><strong>警告:</strong><a href="https://hacks.mozilla.org/2013/06/network-monitor-now-in-firefox-beta/" title="https://hacks.mozilla.org/2013/06/network-monitor-now-in-firefox-beta/">必須 Firefox 23.0 或更高版本才具備網路監測器</a> (目前 <a href="http://www.mozilla.org/en-US/firefox/beta/" title="http://www.mozilla.org/en-US/firefox/beta/">Firefox Beta 試用版才是 23.0 版</a>)</p> -</div> -<p>在連上 App 的開發者工具中,點選「<strong>Style Editor</strong>」分頁就會看到下列面板:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5555/whereami-style-editor.png" style="width: 1044px; height: 536px;"></p> -<p>點選左側樣式表清單中的「<strong>style/style.css</strong>」,並修改 CSS 規則。新的規則會立刻套用至已連線的 App 上:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5557/whereami-style-editor-changes.png" style="width: 1044px; height: 528px;"></p> -<p>現在點選樣式表「<strong>style/style.css</strong>」正下方的「<strong>Save</strong>」,即可將之儲存回專案中。</p> -<h3 id="使用收據_(Receipts)_測試功能"><a name="Using-the-TestReceipts"></a>使用收據 (Receipts) 測試功能</h3> -<div class="note"> - <p><strong>如果你要從這裡開始研讀攻略:</strong></p> - <p>這一段將透過 <a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator" title="/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a>,為 Web App 新增付款收據驗證碼。GitHub 上的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough" title="https://github.com/rpl/firefoxos-simulator-walkthrough">firefoxos-simulator-walkthrough</a> 已有不同版本的 App。如果你想從本段開始了解 App 的修正程序,可從 App 的 <a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-6" title="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-6">whereami-6</a> 版本著手,逐步完成此攻略。</p> - <p>這個 App 只會顯示 1 個「Where am I?」按鈕。只要點擊按鈕,則 App 就會透過 Geolocation API 取得使用者目前的位置,並於地圖上顯示。</p> - <p>我們要把此版本 App 變更為付費 Web App。</p> - <p>此處假設你<a href="https://developer.mozilla.org/zh-TW/docs/Tools/Firefox_OS_Simulator#.E5.AE.89.E8.A3.9D.E6.A8.A1.E6.93.AC.E5.99.A8.E9.99.84.E5.8A.A0.E5.85.83.E4.BB.B6" title="/en-US/docs/Tools/Firefox_OS_Simulator#Installing_the_Simulator_add-on">已經安裝了 Firefox OS 模擬器 (Firefox OS Simulator)</a>、開啟 Dashboard、點選 Dashboard 中的「Add Directory」而新增了 App,並點選 App 的「manifest.webapp」檔案。</p> -</div> -<p>目前你已經將 App 修改為無錯誤的 App,並已擁有合適的樣式。現在可新增付款收據驗證 (Payment Receipt Validation) 功能,確保使用者必須購買此 App。</p> -<p>Mozilla 另已提供小型的 JavaScript 函式庫,可協助 Apps 檢查自己的收據:<a href="https://github.com/mozilla/receiptverifier" title="https://github.com/mozilla/receiptverifier">http://github.com/mozilla/receiptverifier</a>。</p> -<p>為 App 新增 receiptverifier (把新的 script 標籤加入「index.html」檔案中):</p> -<pre class="brush: html"><!DOCTYPE html> - -<html> - - <head> - <meta charset='utf-8'> - <span style="background-color: #ffff00;"><script src="https://raw.github.com/mozilla/receiptverifier/master/receiptverifier.js"></script></span> - <script src="http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js"></script> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> - - </head> - - <body> - <button id ="where-am-i">Where am I?</button> - <div id="map"></div> - <script src="scripts/whereami.js"></script> - <link media="all" href="style/style.css" type="text/css" rel="stylesheet"> - </body> - -</html></pre> -<p>接著再以「<strong>mozmarket.receipts.Verifier</strong>」API 檢查「<strong>scripts/whereami.js</strong>」中的收據 (將於按下按鈕,或於載入 App 時檢查收據):</p> -<pre class="brush: js">... - -var verifier = new mozmarket.receipts.Verifier({ - installs_allowed_from: '*', - typsAllowed: 'test-receipt', - logLevel: mozmarket.receipts.Verifier.levels.DEBUG, - onlog: mozmarket.receipts.Verifier.consoleLogger -}); -verifier.clearCache(); - -function verifyPaymentReceipts(cb) { - verifier.verify(function (verifier) { - if (verifier.state instanceof verifier.states.OK) { - cb(null); // valid payment - } else { - cb("invalid-payment"); // invalid payment - } - }); - setTimeout(function checkNoReceipts() { - if (verifier.state instanceof verifier.states.NoReceipts) { - cb("no-receipts"); - } - }, 2000); -} - -whereami.onclick = function() { - verifyPaymentReceipts(function (err) { - if (err) { - alert("Invalid Payment Receipt."); - } else { - navigator.geolocation.getCurrentPosition(getMap, error); - } - }); -}; -</pre> -<p>正常情況需透過 Marketplace 與 Payment 服務,以加密方式簽署收據。但目前可先用模擬器 App 項目中的「<strong>Receipts</strong>」選單,點選所要安裝的收據類型 (預設為「<strong>None</strong>」),即可為 App 安裝測試收據。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5559/receipts-whereami-menu-annotated.png" style="width: 1044px; height: 742px;"></p> -<p>現在即可測試 App 具備「<strong>Valid</strong>」、「<strong>Invalid</strong>」、「<strong>Refunded</strong>」收據,或無收據時的行為。另可於網頁主控台觀看「<strong>receiptverifier</strong>」函式庫所產生的記錄,藉以了解相關結果:</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5561/whereami-receipt-invalid.png" style="width: 1044px; height: 539px;"></p> -<p><img alt="" src="https://mdn.mozillademos.org/files/5563/whereami-receipt-valid.png" style="width: 1044px; height: 535px;"></p> -<div class="note"> - <p><strong>注意:</strong><a href="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-7" title="https://github.com/rpl/firefoxos-simulator-walkthrough/tree/master/whereami-7">whereami-7 </a>版本即為最終完成的 App。</p> -</div> -<p> </p> diff --git a/files/zh-tw/archive/b2g_os/using_the_app_manager/index.html b/files/zh-tw/archive/b2g_os/using_the_app_manager/index.html deleted file mode 100644 index 8486eeb959..0000000000 --- a/files/zh-tw/archive/b2g_os/using_the_app_manager/index.html +++ /dev/null @@ -1,259 +0,0 @@ ---- -title: 應用程式管理員 (App Manager) -slug: Archive/B2G_OS/Using_the_App_Manager -translation_of: Archive/B2G_OS/Using_the_App_Manager ---- -<div class="summary"> -<p>「應用程式管理員 (App Manager)」為 Firefox 桌面版的新工具,具備多樣的有效工具,可透過開發者的瀏覽器,直接於 Firefox OS 手機與 Firefox OS 模擬器 (Firefox OS Simulator) 中進行 HTML5 Web App 的測試、佈署、除錯等作業。</p> - -<p>應用程式管理員適用於 Firefox OS 1.2 或更高版本。如果你正為 Firefox OS 1.1 開發 App,則請參閱《<a href="https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_1.1_Simulator">Firefox OS 1.1 Simulator</a>》一文。</p> -</div> - -<p>{{EmbedYouTube("z1Bxg1UJVf0")}}</p> - -<p>應用程式管理員具備下列元件:</p> - -<ul> - <li><a href="#Apps_panel">「Apps」面板</a>將管理本端 App (即位於你電腦上的 App 原始碼) 與托管 (Hosted) 於外部的 App,讓開發者能在自己的裝置或模擬器上進行封裝與安裝作業,並透過 Toolboxes 除錯。</li> - <li><a href="#Device_panel">「Device」面板</a>則顯示已連線裝置的相關資訊,包含 Firefox OS 的版本、所使用裝置 API 的必要權限、已安裝的 App 等。</li> - <li><a href="/en-US/docs/Tools_Toolbox">Toolboxes</a> 集合一系列的開發者工具 (網頁主控台、檢測器、除錯器等),將透過 Apps panel 而連上執行中的 App,以利執行除錯作業。</li> -</ul> - -<h2 id="快速設定:"><a name="Configuring_device">快速設定:</a></h2> - -<p>本段將協助開發者儘快設定並執行應用程式管理員。如果你需要進一步詳細資訊,則請略過本段文章而直接觀看下一段《裝置與系統設定》。若發生任何問題,亦可參閱本文最後一段《疑難排解》。</p> - -<ol> - <li>確認已安裝桌面版 Firefox 26 或更高版本</li> - <li>開啟應用程式管理員 (可於網址列中鍵入 <code>about:app-manager</code>)</li> - <li>若你手上並沒有實際的 Firefox OS 裝置: - <ol> - <li><a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/">先安裝 Firefox OS 模擬器 (Firefox OS Simulator)</a></li> - <li>在應用程式管理員底部的工具列中,點選 <em>Start Simulator</em> 再點選已安裝的模擬器名稱 (已安裝的模擬器均應出現)。</li> - </ol> - </li> - <li>若你擁有 Firefox OS 實體裝置: - <ol> - <li>確認目前為 Firefox OS 1.2 或更高版本</li> - <li>確認已在視窗系統中安裝該款手機的驅動程式</li> - <li>進入裝置的「Settings」,停用「Screen Lock (<code>Settings > <code>Screen Lock</code></code>)」並啟用「Remote Debugging (<code>Settings > Device information > More information > Developer</code>)」</li> - <li>另為 Firefox 桌面版<a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/adb-helper/">安裝 ADB Helper</a> 附加元件</li> - <li>使用 USB 纜線銜接裝置與電腦</li> - <li>接著應可於應用程式管理員的底部看到裝置名稱,點選該裝置</li> - </ol> - </li> - <li>底部應顯示「Connected to: xxx」</li> - <li>點選 Apps panel 並新增 App;封裝式 (Packaged) 或托管式 (Hosted) App 均可</li> - <li>Refresh 按鈕將驗證該 App 並安裝於裝置/模擬器中</li> - <li>Debug 按鈕則銜接開發者工具與執行中的 App</li> - <li>若遇上任何錯誤,可參閱〈疑難排解〉章節</li> -</ol> - -<h2 id="裝置與系統設定">裝置與系統設定</h2> - -<p>使用應用程式管理員前的第一件事,就是必須正確設定現有的系統與手機。本段將逐步說明各個步驟。</p> - -<h3 id="需要_Firefox_1.2_或更高版本">需要 Firefox 1.2 或更高版本</h3> - -<p>確認裝置目前為 Firefox OS 1.2/Boot2Gecko 1.2 或更高版本。若要檢查目前 Firefox OS 版本,可點選 <code>Settings > Device Information > Software</code>。</p> - -<p>如果尚未安裝必要的 Firefox OS 版本,則根據手機型號的不同,你可能必須安裝 Firefox 1.2 或更高的 nightly 版本,或自行透過原始碼進行設定與建置 (Build)。</p> - -<p>目前可用的建置:</p> - -<ul> - <li><a href="http://downloads.geeksphone.com/">Geeksphone Keon/Peak builds</a> (若要進一步了解使用方式,可參閱 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Developer_phone_guide/Updating_and_Tweaking_Geeksphone">Updating and Tweaking your Firefox OS Developer Preview phone/Geeksphone</a>)</li> - <li>敬請期待更多後續資訊</li> -</ul> - -<p>若要建構自己的 Firefox OS 1.2 或更高版本,請參閱 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Building_and_installing_Firefox_OS">Building and installing Firefox OS</a> 說明,並從 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Firefox_OS_build_prerequisites">Firefox OS build prerequisites</a> 著手開始。</p> - -<h3 id="遠端除錯_(Remote_debugging)">遠端除錯 (Remote debugging)</h3> - -<p>接著必須啟動 Firefox OS 中的遠端除錯 (Remote debugging) 功能。點選<code>Settings > Device information > More information > Developer</code>,最後勾選 Remote Debugging 方塊即可。</p> - -<h3 id="Adb_Helper_Add-on" name="Adb_Helper_Add-on">ADB 或 ADB helper</h3> - -<p>透過 Android Debug Bridge (ADB) 處理裝置與電腦之間的連線作業。現有 2 種 ADB 執行方式:</p> - -<ul> - <li> - <p>讓 Firefox 直接處理 ADB (建議使用)。<a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/adb-helper/">先安裝 ADB Helper 附加元件</a>可簡化相關流程。安裝 ADB Helper 之後就不需再安裝 ADB,也不需再輸入 <code>adb forward</code> 指令。此附加元件將處理所有作業。</p> - <a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/" style="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;" title="https://addons.mozilla.org">下載 ADB Helper 附加元件</a></li> - <li>手動操作 ADB。你必須自行下載並安裝 <code>adb</code> (可參閱 <a href="http://developer.android.com/sdk/index.html">Get the Android SDK</a>),再於終端機內鍵入下列指令,以啟動轉發通訊埠 (Port forwarding): - <pre>adb forward tcp:6000 localfilesystem:/data/local/debugger-socket</pre> - 另請注意,每次只要重新啟動或重新插拔手機,均必須重複上述動作 1 次。</li> -</ul> - -<div class="note"> -<p>注意:只要安裝 ADB Helper 附加元件,就不需執行此指令。</p> -</div> - -<h2 id="將裝置連上應用程式管理員">將裝置連上應用程式管理員</h2> - -<p>完成所有設定之後,就可將裝置連上電腦並啟動應用程式管理員:</p> - -<ol> - <li>以 USB 纜線銜接裝置與電腦。</li> - <li>進入 <code>Settings > Screen Lock</code> 並取消勾選 <code>Lock Screen</code><code>,以停用裝置的螢幕鎖定功能。一旦螢幕鎖定之後,手機與電腦的連線將隨之中斷,也就無法進行除錯作業。因此最好先停用此功能。</code></li> - <li>啟動應用程式管理員 — 到 Firefox 桌面版中點選「工具 (<code>Tools)」>「網頁開發者 (Web Developer)」>「</code>應用程式管理員 (<code>App Manager)」選單;或於網址列中鍵入</code> <code>about:app-manager</code>。</li> - <li>應用程式管理員分頁的底部可看到連線狀態顯示列 (如下圖所示)。只要點選「Connect to localhost:6000」按鈕即可連線裝置。</li> - <li>若連線成功,裝置畫面隨即出現「An incoming request to permit remote debugging connection was detected. Allow connection?」對話框。按下「OK」鈕 (你可能必須按下手機的電源鍵,才會看到該對話框)。接著應會更新連線狀態列並顯示「Connected to B2G」。此時也將出現「Disconnect」按鈕,以利隨時中斷連線。</li> -</ol> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6263/connection-status.png" style="width: 600px; height: 30px; display: block; margin: 0px auto;"></p> - -<div class="note"> -<p>另請注意,位於連線狀態列中的其他控制鈕,可讓你銜接模擬器與應用程式管理員 (將於下一段中說明),並更改連線所使用的通訊埠。若要更改通訊埠,則必須啟動該通訊埠的「轉發通訊埠 (Port forwarding)」功能。可參閱上述的<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Using_the_App_Manager#Enable_port_forwarding">啟動轉發通訊埠</a>。</p> -</div> - -<h2 id="使用_Firefox_OS_Simulator_附加元件"><a name="Simulator">使用 Firefox OS Simulator 附加元件</a></h2> - -<p>如果你手上還沒有實際的 Firefox OS 裝置可搭配 App Manager,也能透過 Firefox OS 模擬器 (Firefox OS Simulator) 附加元件體驗應用程式管理員。請先為自己的作業系統安裝合適的模擬器:</p> - -<p><a href="https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/" style="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;">安裝 Firefox OS 模擬器</a></p> - -<div class="note"> -<p><strong>注意:</strong>目前僅有 Firefox OS 1.2 模擬器。未來將提供更多版本選擇。</p> -</div> - -<p>安裝模擬器之後,請透過 about:app-manager 找到應用程式管理員分頁底部的連線狀態列,點選「Start simulator」按鈕。接著將出現至少 3 組按鈕:</p> - -<ul> - <li>「Firefox OS 1.3」、「Firefox OS 1.2」或類似的呈現方式:左邊按鈕將顯示目前安裝的模擬器版本。點選按鈕即可連線至模擬器。</li> - <li>「Add」:中間按鈕則提供本文所提到的模擬器安裝鏈結,讓你新增更多版本的模擬器 (Firefox OS 1.2、Firefox OS 1.3 等)。</li> - <li>「Cancel」:右邊按鈕可取消連線。</li> -</ul> - -<div class="note"> -<p><strong>注意:</strong>模擬器 (1.2 與 1.3 版) 目前回報 1 組錯誤的 Gecko user agent 字串:可參閱 {{ Bug("964598") }} 進一步了解。</p> -</div> - -<h2 id="「Apps」面板"><a name="Apps_panel">「Apps」面板</a></h2> - -<p>所有要件設定完畢之後,就從「Apps」面板開始了解應用程式管理員的功能吧。先透過 Apps 面板將現有 App 送入裝置中並進行除錯:</p> - -<ul> - <li>若要安裝本端 App,則請點選「Add Packaged App」按鈕旁的「+」加號按鈕,再從檔案選擇對話框中找到放置該 App 的目錄即可。</li> - <li>若要安裝外部的托管式 (Hosted) App,請將該 App manifest 檔案的絕對路徑輸入「Add Hosted App」對話框中,再點選「+」加號按鈕。</li> -</ul> - -<p>視窗右側隨即顯示 App 的相關資訊,如下圖所示:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6261/apps-panel.png" style="width: 600px; height: 375px; display: block; margin: 0px auto;"></p> - -<h3 id="Manifest_檔案編輯器_(Manifest_Editor)">Manifest 檔案編輯器 (Manifest Editor)</h3> - -<p>從 Firefox 28 開始,「Apps」面板即包含編輯器功能,可用於 App 的 manifest 檔案:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6613/apps-panel-fx-28.png" style="width: 600px; display: block; margin: 0px auto;"></p> - -<h3 id="除錯">除錯</h3> - -<p>此時點選「Update」就會更新 (或安裝) 裝置上的 App。點選「Debug」則會連上工具箱,以利直接對程式碼進行除錯:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6265/debug.png" style="width: 600px; height: 375px; display: block; margin: 0px auto;"></p> - -<div class="note"> -<p><strong>注意:</strong>你可能會玩工具箱玩到上癮 — 快試著修改 DOM、CSS 等。接著就能看到裝置即時反應出更新的效果。相關更新均將儲存於已安裝的 App 程式碼中,下次再開啟裝置中的 App 就能一目了然。</p> -</div> - -<p>若是 Firefox 28 之前的版本,這些工具將顯示於另一個獨立視窗中。從 Firefox 28 開始,這些工具均顯示於應用程式管理員之內的獨立分頁中;就接在「Apps」與「Device」分頁之下。此分頁將顯示目前 App 的圖示,因此極容易辨識:</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6615/toolbox-fx-28.png" style="width: 600px; height: 375px; display: block; margin: 0px auto;"></p> - -<h3 id="錯誤">錯誤</h3> - -<p>如果新增 App 失敗 (可能是 URL 錯誤,或選到了封裝式 App 的資料夾),則該頁仍會顯示所新增的 App 項目,也會包含錯誤資訊。</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6259/apps-error.png" style="width: 600px; height: 375px; display: block; margin: 0px auto;"></p> - -<p>另外只要將滑鼠游標移至視窗左邊的 App 名稱/說明之上,在「X」按鈕出現時按下,即可在此畫面中刪除該 App。請注意此動作並不會刪除裝置中的 App。必須從裝置上手動移除 App,才會真正刪除裝置中的 App。</p> - -<h2 id="「Device」面板"><a name="Device_panel">「Device」面板</a></h2> - -<p>「Device」面板將顯示已連線裝置的相關資訊。另可透過「Installed Apps」視窗中開啟裝置上的 App 並進行除錯。</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6267/device-tab.png" style="width: 600px; height: 375px; display: block; margin: 0px auto;"></p> - -<div class="note"> -<p><strong>注意:</strong>依預設值,此處並不會顯示 Certified App。<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Using_the_App_Manager#Debugging_Certified_Apps">可參閱 Certified App 的除錯方式</a>。</p> -</div> - -<p>「Permissions」視窗將針對目前裝置上的不同 <a href="https://developer.mozilla.org/zh-TW/docs/WebAPI">Web API</a>,顯示必要的權限。</p> - -<p><img alt="" src="https://mdn.mozillademos.org/files/6269/permissions.png" style="width: 600px; height: 375px; display: block; margin: 0px auto;"></p> - -<p>最後可按下「Screenshot」按鈕,即可對目前裝置的顯示項目拍下截圖。此截圖將以 Firefox 的新分頁開啟,讓你決定是否要儲存該圖。</p> - -<h2 id="Certified_App_的除錯"><a name="Debugging_Certified_Apps">Certified App 的除錯</a></h2> - -<p>目前僅限搭載 Firefox OS 1.2 開發版本的裝置,才能進行 Certified Apps 的除錯。若你手上的裝置正執行開發版本,則可將設定檔中的「 <code>devtools.debugger.forbid-certified-apps</code><code>」變更為「</code><code>false</code><code>」,即可開始 </code>Certified App<code> 的除錯。可參閱下列步驟:</code></p> - -<ol> - <li> - <p>在電腦的終端/主控台上輸入下列指令,以進入裝置的 filesystem:</p> - - <pre class="brush: bash">adb shell</pre> - - <p>接著命令列提示將轉為 <code>root@android</code>。</p> - </li> - <li> - <p>接著以下列指令暫停執行 B2G:</p> - - <pre class="brush: bash">stop b2g</pre> - </li> - <li> - <p>進入以下目錄:</p> - - <pre>cd /data/b2g/mozilla/*.default/</pre> - </li> - <li> - <p>以下列指令更改 prefs.js 檔案:</p> - - <pre class="brush: js">echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js</pre> - </li> - <li> - <p>在完成編輯並儲存檔案之後,再以下列指令重新啟動 B2G:</p> - - <pre class="brush: bash">start b2g</pre> - </li> - <li> - <p>輸入 <code>exit</code> 指令以退出 Android 的 filesystem 之後,就會回到正常的終端畫面。</p> - </li> - <li> - <p>最後再次連回應用程式管理員,就能看到 Certified App 出現,即可進行除錯。</p> - </li> -</ol> - -<div class="note"> -<p><strong>注意:</strong>如果你想把這個偏好設定加入自己的 Gaia 版本,則可執行 <code>DEVICE_DEBUG=1 reset-gaia</code></p> -</div> - -<h2 id="在應用程式管理員中執行自訂的版本">在應用程式管理員中執行自訂的版本</h2> - -<p>只要透過 Firefox OS 模擬器,即可於應用程式管理員中執行自訂的 B2G Desktop 與 Gaia 版本。可參閱《<a href="https://developer.mozilla.org/en-US/Firefox_OS/Running_custom_builds_in_the_App_Manager">Running custom Firefox OS/Gaia builds in the App Manager</a>》進一步了解。</p> - -<h2 id="疑難排解"><a name="Troubleshooting">疑難排解</a></h2> - -<p id="My_device_is_not_recognized">如果系統無法辨認裝置:</p> - -<ul> - <li>請先完整閱讀上方的《裝置與系統設定》段落,確認已完成所有步驟:</li> - <li>自己的裝置是否執行 Firefox OS 1.2 或更高版本?</li> - <li>是否已啟用手機的「Remote Debugging」設定?</li> - <li>如果你尚未使用 <a href="#Adb_Helper_Add-on">ADB Helper 附加元件</a>: - <ul> - <li>是否已成功執行 <code>adb forward</code> 指令?</li> - </ul> - </li> - <li>如果你正使用 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Using_the_App_Manager#Adb_Helper_Add-on">ADB Helper 附加元件</a>,但自己的裝置並未出現於底部的工具列中: - <ul> - <li>如果是使用 Linux,<a href="http://developer.android.com/tools/device.html#setting-up">請確認已正確設定 udev</a></li> - <li>如果是使用 Windows,<a href="http://developer.android.com/tools/device.html#setting-up">請確認已安裝正確的驅動程式</a></li> - </ul> - </li> - <li>你手機的螢幕解鎖了嗎?</li> -</ul> - -<p>還是無法讓自己的裝置連上應用程式管理員或啟動模擬器嗎?<a href="https://wiki.mozilla.org/DevTools/GetInvolved#Communication">快讓我們知道</a>或<a href="https://bugzilla.mozilla.org/enter_bug.cgi?alias=&assigned_to=nobody%40mozilla.org&attach_text=&blocked=&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_blocking_b2g=---&cf_crash_signature=&cf_status_b2g18=---&cf_status_b2g_1_1_hd=---&cf_status_b2g_1_2=---&cf_status_firefox24=---&cf_status_firefox25=---&cf_status_firefox26=---&cf_status_firefox27=---&cf_status_firefox_esr17=---&cf_status_firefox_esr24=---&cf_tracking_b2g18=---&cf_tracking_firefox24=---&cf_tracking_firefox25=---&cf_tracking_firefox26=---&cf_tracking_firefox27=---&cf_tracking_firefox_esr17=---&cf_tracking_firefox_esr24=---&cf_tracking_firefox_relnote=---&cf_tracking_relnote_b2g=---&comment=&component=Developer%20Tools%3A%20App%20Manager&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&defined_groups=1&dependson=&description=&flag_type-203=X&flag_type-37=X&flag_type-41=X&flag_type-5=X&flag_type-607=X&flag_type-720=X&flag_type-721=X&flag_type-737=X&flag_type-748=X&flag_type-781=X&flag_ty">到 bugzilla 回報錯誤</a>。</p> diff --git a/files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html b/files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html deleted file mode 100644 index 46fc57a972..0000000000 --- a/files/zh-tw/archive/b2g_os/using_the_b2g_desktop_client/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: 使用 Firefox OS 的電腦桌面 client 程式 -slug: Archive/B2G_OS/Using_the_B2G_desktop_client -translation_of: Archive/B2G_OS/Building_the_B2G_OS_simulator ---- -<p>Firefox OS 的 desktop client,也被稱為 <em>B2G desktop client</em>,讓您可以在一個以 Gecko 為基礎的環境-有點類似實際行動裝置的環境下執行 Gaia 和 web apps。它不會模擬行動裝置的硬體,因此它並不適合拿來測試行動裝置的 API,也不能取代在實際硬體上的測試。然而,它的確擁有一些 Firefox 上所沒有 APIs,像是聯絡人(Contacts)和設定(Settings)的 Apis。因此,當我們在開發應用程式、或是在操作 Gaia 使用者介面上可以派上用場。</p> - -<p>這篇文章不但涵蓋下載或是建置 Firefox desktop client,也包含了如何使用它。</p> - -<h2 id="下載_nightly_版本">下載 nightly 版本</h2> - -<p>如同 <a href="http://nightly.mozilla.org" title="http://nightly.mozilla.org">Firefox Nightlies</a> 一般,Firefox OS 的 desktop client 每天都會用最新的原始碼編譯出一個版本。最新的版本將 <a href="http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/" title="http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/">可以從 Mozilla FTP 伺服器取得</a>。請確定挑到最新的版本和對的封存給您的作業系統。</p> - -<p>我們現在可以略過下面內容,直接到「執行<a href="#Running_the_desktop_client" title="#Running_the_desktop_client"> desktop client</a>」。</p> - -<h2 id="建置_desktop_client">建置 desktop client</h2> - -<p>我們需要做的地一件事情是架起<a href="/En/Developer_Guide/Build_Instructions#Build_prerequisites" title="En/Developer_Guide/Build_Instructions#Build_prerequisites"> Mozilla 的標準建置環境</a>。一旦我們有了這個環境,我們可以降低我們所需要的原始碼,並且設定建置 Firefox OS 的 desktop client。</p> - -<h3 id="第一次下載原始碼">第一次下載原始碼</h3> - -<p>在我們要放置程式碼的目錄(資料夾)中,讓我們將包含所有 Gecko 的 <code>mozilla-central</code> 倉儲 (repository)給複製下來。</p> - -<pre> hg clone http://hg.mozilla.org/mozilla-central -</pre> - -<h3 id="更新程式碼">更新程式碼</h3> - -<p>當我們之後編譯後來的版本時,我們要確定我們有最新的原始碼。下列就是如何拉到最新的更新的指令:</p> - -<pre>cd mozilla-central -hg pull -u -</pre> - -<h3 id="建立_mozconfig">建立 mozconfig</h3> - -<p>接著,我們要在 <code>mozilla-central</code> 目錄下新增一個檔案 <code>mozconfig</code> 來設定建置系統去編譯 Boot to Gecko client 程式而不是 Firefox:</p> - -<pre>mk_add_options MOZ_OBJDIR=../build -mk_add_options MOZ_MAKE_FLAGS="-j9 -s" - -ac_add_options --enable-application=b2g -ac_add_options --disable-libjpeg-turbo - -# This option is required if you want to be able to run Gaia's tests -ac_add_options --enable-tests - -# turn on mozTelephony/mozSms interfaces -# Only turn this line on if you actually have a dev phone -# you want to forward to. If you get crashes at startup, -# make sure this line is commented. -#ac_add_options --enable-b2g-ril</pre> - -<h3 id="建置(編譯)">建置(編譯)</h3> - -<p>現在我們已經準備好要在目錄 <code>mozilla-central</code> 裡面、透過下面的指令來編譯 desktop client。</p> - -<pre class="brush: bash language-html"><code class="language-bash">./mach build</code></pre> - -<p>編譯好的 client 會被放在 <code>../build/dist </code>目錄下 (基本上是依照 <code>mozconfig </code>檔案裡面的 <code>MOZ_OBJDIR 參數</code>所指定的值)。</p> - -<h2 id="執行_desktop_client">執行 desktop client</h2> - -<p>預設 desktop client 會顯示空的畫面,因為它並不知道一開始要載入哪個 web app 來當做系統 app。系統 apps 和 Firefox OS 中預設會有的 apps 就被稱為 Gaia。</p> - -<h3 id="下載_Gaia">下載 Gaia</h3> - -<p>第一次下載 Gaia、讓我們從 GitHub 上複製原始碼的倉儲 (repository):</p> - -<pre> git clone https://github.com/mozilla-b2g/gaia</pre> - -<p>為了更新成 Gaia 的一個已存在的版本,我們可以從 GitHub 拉最新的更新:</p> - -<pre>cd gaia -git pull -</pre> - -<h3 id="產生_profile">產生 profile</h3> - -<p>接著我們需要設定 desktop client 中 Gaia 的 apps。這包括包裝行動裝置上也有的 Gaia apps,以及設定系統 apps 的權限。我們透過產生一個 profile 來做這些事情。接著的指令會做這些事情:新的 profile 包含一個客製的擴充以及其他 B2G 正常運作所需的設定。所以在 <code>gaia</code> 目錄裡執行下面的指令:</p> - -<pre>cd gaia -make -</pre> - -<p>這應該會在 <code>gaia </code>目錄下面建立一個 <code>profile</code> 目錄。</p> - -<h3 id="在_Linux_上執行">在 Linux 上執行</h3> - -<p>只要在啟動 <code>b2g</code> 執行檔的時候加上 profile 參數,就可以使用我們剛剛產生的 profile 來啟動 desktop client 。如果是自己編譯的話,執行檔的位置會在早先下載下來的 tarball 裡面,如果是自己編譯的話,就會在 <code>../build/dist/bin 的目錄裡。</code></p> - -<pre>.../b2g -profile gaia/profile -</pre> - -<p>您可能會碰到惱人的 rendering 問題。只要在 <code>gaia/profile/prefs.js</code> 裡面加上下面這行就可以避開這個問題:</p> - -<pre>user_pref("layers.acceleration.disabled", true); -</pre> - -<h3 id="在_Mac_上執行">在 Mac 上執行</h3> - -<p>在 Mac 上,<code>b2g 執行檔的位置和需要指定 profile 的絕對路徑,因此指令比較複雜:</code></p> - -<pre>.../B2G.app/Contents/MacOS/b2g -profile /full/path/to/gaia/profile -</pre> - -<h2 id="指令的選項(或參數)">指令的選項(或參數)</h2> - -<p>在使用 desktop client 時,你可以使用一些指令的參數來調校執行時的體驗。您可以用 <code>-help</code> 這個參數來列出參數的列表。這一節涵蓋一些特別的參數。</p> - -<h3 id="option-screen" name="option-screen">明確指定螢幕大小</h3> - -<p>您可以用 <code>--screen</code> 來指定您想要模擬的行動裝置的螢幕大小:</p> - -<pre>b2g --screen=<em><width></em>x<em><height></em>[@<em><dpi></em>]</pre> - -<p><em><width></em>, <em><height></em>, and <em><dpi></em> 都是相當不用解釋的參數:行動裝置以 pixels 為單位的長和寬以及 DPI 解析度。舉例來說:</p> - -<pre>b2g --screen=320x480 -b2g --screen=320x480@160 -</pre> - -<p>或者,您可以使用某些行動裝置的名字來模擬他們的螢幕大小和解析度:</p> - -<ul> - <li><code>iphone</code></li> - <li><code>ipad</code></li> - <li><code>nexus_s</code></li> - <li><code>galaxy_nexus</code></li> - <li><code>galaxy_tab</code></li> - <li><code>wildfire</code></li> - <li><code>tattoo</code></li> - <li><code>salsa</code></li> - <li><code>chacha</code></li> -</ul> - -<h3 id="option-console" name="option-console">開啟 JavaScript console</h3> - -<p>在您開啟 B2G 的 desktop client 時,您可以藉由加上 <code>-jsconsole</code> 這個記號來開啟<br> - JavaSCript console。在編譯之後,只要:</p> - -<pre>.../b2g -jsconsole -profile <em>/path/to/your/profile</em></pre> - -<p>如果您已經在 Mac 上安裝了 nightly 版本的話,您可以照著下面的指令:</p> - -<pre>/Applications/B2G.app/Contents/MacOS/b2g -jsconsole -profile <em>/path/to/your/profile</em></pre> - -<h3 id="option-runapp" name="option-runapp">在 B2G 啟動時,指定開啟一個應用程式</h3> - -<p>您現在可以指定一個應用程式在 b2g desktop client 開始運作時,自動執行起來。這會在其他系統程式被掛載起來之後,馬上讓指定的應用程式被執行起來。只要加上 <code>--runapp</code> 這個參數、後面在加上要執行應用程式的名字,就可以做到了。如下:</p> - -<pre> .../b2g -profile <em>/path/to/your/gaia/profile</em> --runapp email</pre> - -<p>在尋找要執行的 app 之前,指定的名字要被正規化為全部小寫、且不能帶有 - 和空白的符號。接著這個正規化過的名字會被拿來和 app 的 manifest 的名字做比較。</p> - -<p>舉例來說,現在 email app 的名字是「E-mail」,但是因為正規化的效果, <code>--runapp</code> <code>email</code> 這個參數是 ok<u> 且</u>可以執行的。</p> - -<p>如果您加了 <code>--runapp</code> 參數但是卻沒有帶後面的 app 名字、或是帶了空的名字的話,b2g client 會列出一串列表,其中包括已知的應用程式和簡短的使用訊息。</p> - -<div class="note"> -<p><strong>Note:</strong> 用 <code>--runapp</code> 參數會有關閉螢幕鎖的副作用,且不會再度啟用螢幕鎖。這是假設您不會用這個指令加上 profile 來測試螢幕鎖,否則您會重新打開這個選項。如果這個行為會造成問題的話,也歡迎提供 patch 來改變這個它。</p> -</div> - -<h2 id="Usage_tips">Usage tips</h2> - -<p>這一節提供一些在使用 B2G desktop client 時,有幫助的技巧。</p> - -<ul> - <li>ESC 鍵提供了和 "back" 一樣的功能。</li> - <li>Home 鍵提供了和 "home" 按鈕一樣的功能;如果您用的是 Mac 的話,Home 鍵是 Fn+← (Fn + 左鍵)。</li> -</ul> - -<h2 id="Next_steps">Next steps</h2> - -<p>現在您有一個執行 Boot to Gecko 的 desktop 版本了,您可以在上面測試、開發以及做其他事情:</p> - -<ul> - <li><a href="/en/Mozilla/Boot_to_Gecko/Debugging_on_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Debugging_on_Boot_to_Gecko">在 Boot to Gecko 上除錯</a></li> - <li><a href="/en/Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko">測試 Boot to Gecko</a></li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html b/files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html deleted file mode 100644 index 6dccacbe06..0000000000 --- a/files/zh-tw/archive/b2g_os/using_the_b2g_emulators/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: 使用 B2G 模擬器 -slug: Archive/B2G_OS/Using_the_B2G_emulators -translation_of: Archive/B2G_OS/Using_the_B2G_emulators ---- -<p>這篇文章提供簡潔的指南,包括使用 Boot to Gecko 模擬器時需要知道的一些重要的事情。這不意味著這是一個完整的使用手冊;相反地,它只告訴您一些有用的事情,讓您不必自己去學。</p> -<p>這篇指南假設您已經編譯了一個模擬器;如果您還沒編譯的話,請跳回「<a href="/en/Mozilla/Boot_to_Gecko/Building_and_installing_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Building_and_installing_Boot_to_Gecko">建置和安裝 Boot to Gecko</a>」!</p> -<h2 id="關於_B2G_模擬器">關於 B2G 模擬器</h2> -<p>有兩種 B2G 模擬器。第一種是 x86 行動裝置的模擬器,使用 "emulator-x86" 設定以 <code>config.sh</code> 編譯而成。雖然這遠比模擬 ARM 處理器快多了,但是它執行的沒有那麼接近一個實體行動裝置的結果。而第二種則是 ARM 行動裝置的模擬器,使用 "emulator" 的設定編譯。</p> -<p>一旦你選擇、設定及編譯模擬器,就使用者而言,剩下來要做的事情都是一樣的,所以這篇導覽剩下的共同部分是兩種模擬器都適用的。</p> -<div class="note"> - <strong>Note:</strong> 在 Mac OS X 上,B2G 模擬器需要 Core 2 Duo 或更快 CPU;也就是說,一個相容於 Mac OS X 10.7 "Lion" 的系統。你不必一定得使用 Lion,只是要在和 Lion 相容的系統上面執行就可以了。</div> -<h2 id="啟動模擬器">啟動模擬器</h2> -<p>執行下列指令,就可以打開 B2G 模擬器了:</p> -<pre>./run-emulator.sh -</pre> -<p>這個指令將會會您操作所有模擬器的起始作業。現在就耐心等模擬器啟動以及 Boot to Gecko 在上面開始運作起來。啟動會花好幾分鐘,所以請耐心等候。</p> -<h2 id="當模擬器掛了">當模擬器掛了</h2> -<p>有時候模擬器會啟動失敗。歡迎來到尖端科技的前緣。這裡有一些派的上用場的技巧,可用來解決問題。</p> -<h3 id="確定_adb_server_是不是還活著">確定 adb server 是不是還活著</h3> -<p>adb server 處理與模擬的行動裝置之間的互動,而這裡常常出問題的原因是 adb server 不是沒在執行就是故障。</p> -<div class="note"> - <p><strong>Note:</strong> 舉例來說,如果您使用 B2G 版本所編譯出的 <code>adb</code> 的話,它的位置會在 <code>$B2G/out/host/<platform>/bin</code> 目錄裡。在 Mac 上的話,則是在 <code>$B2G/out/host/darwin-x86/bin</code> 目錄下。</p> -</div> -<p>使用下列指令來看 <code>adb</code> 是否還在運作中:</p> -<pre>ps aux | grep adb -</pre> -<p>If it's there, do this to kill it, because it's probably not working correctly.</p> -<pre>adb kill-server -</pre> -<p>If it's not there, do this:</p> -<pre>adb start-server -</pre> -<p>接著試試看再執行模擬器一次看看。如果還是沒辦法運作的話, 就是時候到 irc.mozilla.org 使用 <a class="link-irc" href="irc://irc.mozilla.org/b2g" title="irc://irc.mozilla.org/b2g">#b2g</a> 搜尋尋求幫助了。</p> -<h3 id="抹掉_configuration_設定值">抹掉 configuration 設定值</h3> -<p>有時候,在模擬的行動裝置上使用過期的設定檔的設定值也會讓它暴走。你可以砍掉 indexedDB 資料庫來解決這個問題,如下:</p> -<ol> - <li>確定 adb 在執行中,如同 <a href="#Make_sure_the_adb_server_is_running">Make sure the adb server is running</a> 中所描述的一般。</li> - <li>啟動模擬器。</li> - <li>先打開電腦裡的 terminal,然後切換到編譯模擬器的主目錄 (root code build directory),接著打:「<code>out/host/<platform>/bin/adb -e shell</code>」;在 Mac 上使用「<code>out/host/darwin-x86/bin/adb -e shell</code>」。</li> - <li>現在你已經在 adb 的 shell 裡面、且可以直接在模擬器的行動 裝置上執行 shell 指令 (commands)了。讓我們使用「<code>stop b2g</code>」來停止裝置上的 B2G。</li> - <li>刪除 indexedDB 資料庫:<code>rm -rf /data/local/indexedDB</code>。</li> - <li>在模擬的行動裝置上重新啟動 B2G:<code>start b2g</code>。</li> -</ol> -<p>希望此時您所打開 Gaia 介面一切都恢復正常。</p> -<h2 id="設定模擬器">設定模擬器</h2> -<p>如果您想要調整模擬器更接近您想要模擬的裝置的話,有幾個選項可以改改看。這一節提供一些關於「如何調校」的基本資訊。您可以編輯 <code>run-emulator.sh</code> (觀念上還是複製一份來編輯)這個 script 來調校模擬器的設定。這裡指會討論到一些最常用到的參數;您可以 <a class="external" href="http://www.qemu.org/" title="http://www.qemu.org/">連到 qemu 網站</a> 來看其他部分的細節。</p> -<div class="note"> - <strong>Tip:</strong> 您可以為每個想要模擬的裝置建立一個 <code>run-emulator.sh 的</code>複製版本;這會您比較容易以不同的設定啟動模擬器。</div> -<h3 id="改變外觀">改變外觀</h3> -<p>模擬器預設會以 HVGA 模式啟動;VGA 的一半、也就是 320x480 pixels 的外觀。在啟動時,我們可以給模擬器加上 -skin 的參數來指定外觀。您可以編輯 <code>run-emulator.sh 來</code>切換成不同的顯示模式來執行模擬器。可以使用的外觀列表如下:</p> -<ul> - <li>HVGA (320x480)</li> - <li>QVGA (240x320)</li> - <li>WQVGA (240x400)</li> - <li>WQVGA432 (240x432)</li> - <li>WSVGA (1024x600)</li> - <li>WVGA800 (480x800)</li> - <li>WVGA854 (480x854)</li> - <li>WXGA720 (1280x720)</li> - <li>WXGA800 (1280x800)</li> -</ul> -<p>外觀的存放位置在 <code>B2G/development/tools/emulator/skins</code> 目錄。外觀的格式很簡單;如果您打開來看的話,他們只是一些資料夾,裝著一些使用者介面物件的 PNG 檔案以及一個描述使用者介面的配置及螢幕區域的文字檔 <code>layout。如果需要建立客製化的外觀的話,是還蠻簡單的。</code></p> -<h3 id="改變記憶體的大小">改變記憶體的大小</h3> -<p>另一個您可能想要/需要改變的選項就是行動裝置的記憶體大小。預設是 512MB;然而,如果您要模擬的行動裝置的記憶體比較大或小的話,或許對您而言,將記憶體調整成一樣的大小是很重要的,這樣才能確定您的 app 會在您想要執行的基礎裝置上執行。您可以將 <code>-memory</code> 參數的數值修改成您需要的數字(以 MB 為單位),就可以改變執行時的記憶體大小。除了預設的 512MB 之外,您可能會想要以 256MB 和 1024MB 來做測試。</p> -<p>而如果想要改變模擬裝置的儲存容量大小的話 (就是 local 資料的儲存空間,像是行動電話的內建快閃記憶體或是電腦的硬碟),可以改變 <code>-partition-size</code> 參數的數值。預設是 512MB,但是您可以改成任何大小 (以 MB 為單位)來模擬想要測試的行動裝置。</p> -<h3 id="網路連線">網路連線</h3> -<p>如果因為某些原因,您沒辦法將您的模擬器連上網際網路 (internet)的話,您可以從命令提示字元來執行下面的指令 (commandline):</p> -<pre>adb shell setprop net.dns1 10.0.2.3</pre> diff --git a/files/zh-tw/archive/b2g_os/web_telephony_api/index.html b/files/zh-tw/archive/b2g_os/web_telephony_api/index.html deleted file mode 100644 index c9e0c9516b..0000000000 --- a/files/zh-tw/archive/b2g_os/web_telephony_api/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Web Telephony -slug: Archive/B2G_OS/Web_Telephony_API -translation_of: Archive/B2G_OS/Web_Telephony_API ---- -<p>WebTelephony API 可透過 JavaScript 程式碼,讓網頁內容處理一般音訊電話。</p> -<p>透過 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozTelephony" title="Returns a Telephony object you can use to initiate and control telephone calls from the browser."><code>window.navigator.mozTelephony</code></a> 即可存取此 API。另請參閱下列的完整介面列表:</p> -<h2 id="DOM_介面">DOM 介面</h2> -<ul> - <li>{{domxref("window.navigator.mozTelephony")}}</li> - <li><a href="/en-US/docs/Web/API/Telephony"><code>Telephony</code></a></li> - <li><a href="/en-US/docs/Web/API/TelephonyCall"><code>TelephonyCall</code></a></li> - <li><a href="/en-US/docs/Web/API/CallEvent"><code>CallEvent</code></a></li> -</ul> -<h2 id="範例程式碼與介紹">範例程式碼與介紹</h2> -<div> - <ul> - <li><a href="https://developer.mozilla.org/en-US/docs/Web/Guide/Telephony/Introduction_to_WebTelephony">WebTelephony 介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/docs/Web/Guide/Telephony/Using_the_Telephony_API">使用 Telephony API</a></li> - </ul> -</div> -<h2 id="另可參閱">另可參閱</h2> -<ul> - <li><a class="link-https" href="https://wiki.mozilla.org/WebAPI/WebTelephony">WebTelephony API</a> (設計文件)</li> -</ul> diff --git a/files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html b/files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html deleted file mode 100644 index a38efda16e..0000000000 --- a/files/zh-tw/archive/b2g_os/writing_apps_for_boot_to_gecko/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: 寫 Boot to Gecko 的 apps -slug: Archive/B2G_OS/Writing_apps_for_Boot_to_Gecko -translation_of: Archive/B2G_OS/Firefox_OS_apps/Building_apps_for_Firefox_OS ---- -<p>B2G apps 不外乎是安裝於 B2G 手機的 <a href="/en/Apps" title="https://developer.mozilla.org/en/Apps">Open Web apps</a>。</p> -<ul> - <li><a href="/en/Apps/Getting_Started" title="Getting started with making apps">從製作 apps 開始上手</a>。</li> - <li><a href="/en/Mozilla/Boot_to_Gecko/Writing_a_web_app_for_B2G" title="Writing a web app">寫一個 B2G 的 Web app。</a></li> -</ul> -<div class="note"> - <strong>Note:</strong> B2G 現在和 Fennec 用相同的 UA (User Agent) 來分辨。例如:"Mozilla/5.0 (Android; Mobile; rv:15.0) Gecko/15.0 Firefox/15.0a1".</div> diff --git a/files/zh-tw/archive/css3/index.html b/files/zh-tw/archive/css3/index.html deleted file mode 100644 index 85374e3a65..0000000000 --- a/files/zh-tw/archive/css3/index.html +++ /dev/null @@ -1,584 +0,0 @@ ---- -title: CSS3 -slug: Archive/CSS3 -translation_of: Archive/CSS3 ---- -<p><span class="seoSummary"><strong>CSS3</strong> 是<em>層疊樣式表語言</em>的最新版且目標是為了延伸 CSS2.1。它有許多久違的新東西,像是圓角、陰影、<a href="/en-US/docs/Web/Guide/CSS/Using_CSS_gradients" title="Using CSS gradients">漸層</a>、或是<a href="/en-US/docs/Web/Guide/CSS/Using_CSS_animations" title="CSS animations">動畫</a>, 還有像是<a href="/en-US/docs/Web/Guide/CSS/Using_multi-column_layouts" title="Using CSS multi-column layouts">多列</a>, 有彈性的盒子或是網格佈局之類的。</span> 實驗的部分會有供應商前綴且應該在生產環境中盡可能地避免,使用那些未來可能會改變的語法或語義都要格外小心。</p> - -<h2 id="模組及標準化程序">模組及標準化程序</h2> - -<p>CSS Level 2 需要 9 年(2002年八月~2011年六月),以達到建議的狀態。 This was due to the fact that a few secondary features hold back the whole specification. In order to accelerate the standardization of non-problematic features, the <a class="external" href="http://www.w3.org/blog/CSS/" title="http://www.w3.org/blog/CSS/">CSS Working Group</a> of the W3C, in a decision referred as the <a class="external" href="http://fantasai.inkedblade.net/weblog/2011/inside-csswg/modules" title="http://fantasai.inkedblade.net/weblog/2011/inside-csswg/modules">Beijing doctrine</a> , divided CSS in smaller components called <em>modules</em> . Each of these modules is now an independent part of the language and moves towards standardization at its own pace. While some modules are already W3C Recommendations, other still are early Working Drafts. New modules are also added when new needs are identified.</p> - -<p><a href="/@api/deki/files/6120/=CSS_Modules_and_Snapshots.png" title="CSS_Modules_and_Snapshots.png"><img alt="CSS Modules and Snapshots as defined since CSS3" class="internal lwrap" src="/files/3623/CSS_Modules_and_Snapshots.png" style="float: left; width: 550px;"> </a> Formally, there is no CSS3 standard <em>per se</em> . Each module being standardized independently, the standard CSS consists of CSS2.1 amended and extended by the completed modules, not necessary all with the same level number. At each point of time, a snapshot of the CSS standard can be defined, listing CSS2.1 and the mature modules.</p> - -<p>The W3 consortium periodically publishes such snapshots, like in <a class="external" href="http://www.w3.org/TR/css-beijing/" title="http://www.w3.org/TR/css-beijing/">2007</a> or <a class="external" href="http://www.w3.org/TR/css-2010/" title="http://www.w3.org/TR/css-2010/">2010.</a></p> - -<p>Though today no module with a level greater than 3 is standardized, this will change in the future. Some modules, like Selectors 4 or CSS Borders and Backgrounds Level 4 already have an Editor's Draft, though they haven't yet reached the First Published Working Draft status.</p> - -<h2 id="CSS_模組狀態" style="">CSS 模組狀態</h2> - -<h3 id="穩定模組">穩定模組</h3> - -<p>A few CSS modules are already fairly stable and have reached one of the three recommendation level of the CSSWG: Candidate Recommendation, Proposed Recommendation or Recommendation. These can be used without prefixed and are pretty stable, though a few features can still be dropped at the Candidate Recommendation stage.</p> - -<p>These modules extend and amend the CSS2.1 specification which build the core of the specification. Together with it, they are the current snapshot of the CSS specification.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td class="thirdColumn greenBg"><strong>{{ SpecName("CSS3 Colors", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Colors") }} 自 2011 年 6 月 7 號起</td> - </tr> - <tr> - <td colspan="2"> - <p>增加 {{ cssxref("opacity") }} 屬性,還有 <code>hsl</code><code>()</code>, <code>hsla()</code>, <code>rgba()</code> <code>和 rgb()</code> 函式來創造 {{cssxref("<color>")}} 值。它也定義了關鍵字 <code>currentColor</code> 唯有效的顏色。</p> - - <p>現在透明色是一個真實的顏色(因為支援了 alpha 通道)。若想要使用透明度,請使用 <code>rgba(0,0,0,0.0)</code>。</p> - - <p><a href="http://www.w3.org/TR/CSS2/ui.html#system-colors">關鍵字 system-color 不應該繼續使用</a>,因為他已經被棄用。</p> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(128,255,128);"><strong>{{ SpecName("CSS3 Selectors", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Selectors") }} 自 2011 年 9 月 29 號起</td> - </tr> - <tr> - <td colspan="2"> - <p>Adds:</p> - - <ul> - <li>Substring matching attribute selectors, <code>E[attribute^="value"]</code> , <code>E[attribute$="value"]</code> , <code>E[attribute*="value"]</code> .</li> - <li>New pseudo-classes: {{ cssxref(":target") }}, {{ cssxref(":enabled") }} and {{ cssxref(":disabled") }}, {{ cssxref(":checked") }}, {{ cssxref(":indeterminate") }}, {{ cssxref(":root") }}, {{ cssxref(":nth-child") }} and {{ cssxref(":nth-last-child") }}, {{ cssxref(":nth-of-type") }} and {{ cssxref(":nth-last-of-type") }}, {{ cssxref(":last-child") }}, {{ cssxref(":first-of-type") }} and {{ cssxref(":last-of-type") }}, {{ cssxref(":only-child") }} and {{ cssxref(":only-of-type") }},{{ cssxref(":empty") }}, and {{ cssxref(":not") }}.</li> - <li>Pseudo-elements are now characterized by two colons rather then one: <code>:after</code> becomes {{ cssxref("::after") }}, <code>:before</code> becomes {{ cssxref("::before") }}, <code>:first-letter</code> becomes {{ cssxref("::first-letter") }}, and <code>:first-line</code> becomes {{ cssxref("::first-line") }}.</li> - <li>The new <em>general sibling combinator</em> ( <code>h1~pre</code> ).</li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p>The <a class="external" href="http://dev.w3.org/csswg/selectors4/" title="http://dev.w3.org/csswg/selectors4/">next iteration of the Selectors specification</a> is already in progress, though it still hasn't reached the First Public Working Draft stage.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(128,255,128);"><strong>{{ SpecName("CSS3 Namespaces", "", "") }}</strong></td> - <td> - <p>{{ Spec2("CSS3 Namespaces") }} 自 2011 年 9 月 29 日起</p> - </td> - </tr> - <tr> - <td colspan="2"> - <p>Adds the support for the XML Namespaces by defining the notion of <em>CSS qualified name</em> , using the ' <code>|</code> ' syntax and adding the {{ cssxref("@namespace") }} CSS at-rule.</p> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(128,255,128);"><strong>{{ SpecName("CSS3 Media Queries", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Media Queries") }} 自 2012 年 6 月 19 日起</td> - </tr> - <tr> - <td colspan="2"> - <p>Extends the former media type ( <code>print</code>, <code>screen</code>, <code>…</code> ) to a full language allowing <a href="/en/CSS/Media_queries" title="en/CSS/Media_queries">queries on the device media capabilities</a> like <code>only screen and (color)</code> .</p> - - <p>Media queries are not only used in CSS document but also in some attributes of HTML Elements, like the {{ htmlattrxref("media","link") }} attribute of the {{ HTMLElement("link") }} element.</p> - </td> - </tr> - </tbody> -</table> - -<p>The <a href="http://dev.w3.org/csswg/mediaqueries4" title="http://dev.w3.org/csswg/mediaqueries4">next iteration of this specification</a> is in the work, allowing to tailor a Web site regarding the input methods available on the user agent, with new media features like <code>hover</code> or <code>pointer</code>. Detection of EcmaScript support, using the <code>script</code> media features is also proposed.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(128,255,128);"><strong>{{ SpecName("CSS3 Style", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Style") }} 自 2013 年 11 月 7 日起</td> - </tr> - <tr> - <td colspan="2">Formally defines the syntax of the content of the HTML <a href="/en/HTML/Global_attributes#attr-style" title="en/HTML/Global_attributes#attr-style"> <code>style</code> </a> global attribute.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Backgrounds", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Backgrounds") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Adds:</p> - - <ul> - <li>Support, on backgrounds, for any type of {{cssxref("<image>")}}, and not only for <code>uri()</code> defined ones.</li> - <li>Support for multiple background images.</li> - <li>The {{ cssxref("background-repeat") }} <code>space</code> and <code>round</code> values, and for the 2-value syntax of this CSS property.</li> - <li>The {{ cssxref("background-attachment") }} <code>local</code> value.</li> - <li>The CSS {{ cssxref("background-origin") }}, {{ cssxref("background-size") }}, and {{ cssxref("background-clip") }} properties.</li> - <li>Support for curved border corners, with the CSS {{ cssxref("border-radius") }}, {{ cssxref("border-top-left-radius") }}, {{ cssxref("border-top-right-radius") }}, {{ cssxref("border-bottom-left-radius") }}, and {{ cssxref("border-bottom-right-radius") }} properties.</li> - <li>Support for the use of an {{cssxref("<image>")}} as the border with the CSS {{ cssxref("border-image") }}, {{ cssxref("border-image-source") }}, {{ cssxref("border-image-slice") }}, {{ cssxref("border-image-width") }}, {{ cssxref("border-image-outset") }}, and {{ cssxref("border-image-repeat") }} properties.</li> - <li>Support for shadows of the element with the CSS {{ cssxref("box-shadow") }} property.</li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p>The <a class="external" href="http://dev.w3.org/csswg/css4-background/" title="http://dev.w3.org/csswg/css4-background/">CSS4 iteration of the Backgrounds and Borders specification</a> is already in progress, though it still hasn't reached the First Public Working Draft stage, it plans to add the ability to clip a border (with the CSS {{ cssxref("border-clip") }}, {{ cssxref("border-clip-top") }}, {{ cssxref("border-clip-right") }}, {{ cssxref("border-clip-bottom") }}, and {{ cssxref("border-clip-left") }} properties) or to control the shape of the border in a corner (using the CSS {{ cssxref("border-corner-shape") }} property).</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Multicol", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Multicol") }}</td> - </tr> - <tr> - <td colspan="2">Adds support for easy multi-column layouts using the CSS {{ cssxref("columns") }}, {{ cssxref("column-count") }}, {{ cssxref("column-fill") }}, {{ cssxref("column-gap") }}, {{ cssxref("column-rule") }}, {{ cssxref("column-rule-color") }}, {{ cssxref("column-rule-style") }}, {{ cssxref("column-rule-width") }}, {{ cssxref("column-span") }}, {{ cssxref("column-width") }}, {{ cssxref("break-after") }}, {{ cssxref("break-before") }}, and {{ cssxref("break-inside") }}.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table" style="width: 100%;"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Speech", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Speech") }}</td> - </tr> - <tr> - <td colspan="2">Defines the <code>speech</code> media type, an aural formatting model and numerous properties specific for speech-rendering user agents.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Images", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Images") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Defines the {{cssxref("<image>")}} data type.</p> - - <p>Extends the <code>url()</code> syntax to support image slices using media fragments.</p> - - <p>Adds:</p> - - <ul> - <li>The <code>dppx</code> unit to the {{cssxref("<resolution>")}} data type.</li> - <li>The <code>image()</code> function as a more flexible alternative to <code>url()</code> to define an image from an url.<br> - <em><strong>At risk</strong> </em> <strong> <em>:</em> </strong> <em> due to insufficient browser support, standardization of the <code>image()</code> function may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - <li>Support for <code>linear-gradient()</code>, <code>repeating-linear-gradient()</code>, <code>radial-gradient()</code> and <code>repeating-radial-gradient()</code>.</li> - <li>The ability to define how a replaced element should fit in its element, using the CSS {{ cssxref("object-fit") }} property.<br> - <em><strong>At risk</strong> </em> <strong> <em>:</em> </strong> <em> due to insufficient browser support, standardization of the {{ cssxref("object-fit") }} and property may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - <li>The ability to override the resolution and orientation of an external image using the CSS {{ cssxref("image-resolution") }} and {{ cssxref("image-orientation") }} properties.<br> - <em><strong>At risk</strong> </em> <strong> <em>:</em> </strong> <em> due to insufficient browser support, standardization of the {{ cssxref("image-resolution") }} and {{ cssxref("image-orientation") }} properties may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p>The <a href="#Images_(Level_4)">CSS Image Values and Replaced Content Level 4</a> which will supersede CSS Image Level 3 is in development and is a {{Spec2("CSS4 Images")}}.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220, 255, 220);"><strong>{{ SpecName("CSS3 Values", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Values") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Makes <code>initial</code> and <code>inherit</code> keywords usable on any CSS property.</p> - - <p>Formally defines the CSS data types of CSS 2.1, that were implicitely defined by their grammar token and some textual precisions.</p> - - <p>Adds:</p> - - <ul> - <li>Definition for new font-relative length units: <code>rem</code> and <code>ch</code> .</li> - <li>Definition for viewport-relative length units: <code>vw</code>, <code>vh</code>, <code>vmax</code>, and <code>vmin</code> .</li> - <li>Precision about the real size of the absolute length units, which are not really absolute, but defined in relation with the <em>reference pixel</em> .</li> - <li>Definition for {{ cssxref("<angle>") }}, {{cssxref("<time>")}}, {{cssxref("<frequency>")}}, {{cssxref("<resolution>")}}.</li> - <li>Normative value to the definition of {{cssxref("<color>")}}, {{cssxref("<image>")}}, and {{ cssxref("<position>") }}.</li> - <li>Definition for the {{ cssxref("calc", "calc()") }}, {{ cssxref("attr", "attr()")}}, and <code>toggle()</code> functional notations.<br> - <em><strong>At risk:</strong> due to insufficient browser support, standardization of the <code>calc()</code>, <code>attr()</code>, and <code>toggle()</code> functional notations may be postponed to </em> <em>the next iteration of this module</em><em>.</em></li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p>Several types definition, like <code><ident></code> and <code><custom-ident></code>, have been deferred to CSS Values and Units Module Level 4.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Flexbox", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Flexbox") }}</td> - </tr> - <tr> - <td colspan="2">Add a flexbox layout to the CSS {{ cssxref("display") }} property and several new CSS properties to control it: {{ cssxref("flex") }}, {{ cssxref("flex-align") }}, {{ cssxref("flex-direction") }}, {{ cssxref("flex-flow") }}, {{ cssxref("flex-item-align") }}, {{ cssxref("flex-line-pack") }}, {{ cssxref("flex-order") }}, {{ cssxref("flex-pack") }}, and {{ cssxref("flex-wrap") }}.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220, 255, 220);"><strong>{{ SpecName("CSS3 Conditional", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Conditional") }}</td> - </tr> - <tr> - <td colspan="2">Adds features for conditional processing of parts of style sheets, conditioned on capabilities of the browser or the document the style sheet is being applied to. It consists mainly in allowing nested at-rules inside {{ cssxref("@media") }} and the adding of a new CSS at-rule, {{ cssxref("@supports") }}, and a new DOM method {{domxref("CSS.supports()")}}.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220, 255, 220);"><strong>{{ SpecName("CSS3 Text-decoration", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Text-decoration") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Extends:</p> - - <ul> - <li>the CSS {{ cssxref("text-decoration") }} property by making it a shorthand for the CSS {{ cssxref("text-decoration-line") }}, {{ cssxref("text-decoration-color") }}, and {{ cssxref("text-decoration-style") }} properties. And adds the {{ cssxref("text-decoration-skip") }}, and {{ cssxref("text-underline-position") }} properties.</li> - </ul> - - <p>Adds:</p> - - <ul> - <li>Support for East-Asian-script emphasis marks with the CSS {{ cssxref("text-emphasis") }}, {{ cssxref("text-emphasis-style") }}, {{ cssxref("text-emphasis-color") }}, and {{ cssxref("text-emphasis-position") }} properties.</li> - <li>Support for script shadows with the CSS {{ cssxref("text-shadow") }} property.</li> - </ul> - - <p>Precises:</p> - - <ul> - <li>The paint order of the decorations.</li> - </ul> - - <p><em><strong>At risk:</strong> due to insufficient browser support, standardization of the <code>text-decoration-skip</code>, line positioning rules and the ability to place both emphasis marks and ruby above the same base text may be postponed to </em> <em>the next iteration of this module</em><em>.</em></p> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Fonts", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Fonts") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Amends the CSS2.1 Font matching algorithm to be closer to what is really implemented.</p> - - <p>Adds:</p> - - <ul> - <li>Support for downloadable fonts via the CSS {{ cssxref("@font-face") }} at-rule.</li> - <li>The control of the contextual inter-glyph spacing via the CSS {{ cssxref("font-kerning") }} property.</li> - <li>The choice of language-specific glyphs via the CSS {{ cssxref("font-language-override") }} property.</li> - <li>The choice of glyphs with specific OpenType features via the CSS {{ cssxref("font-feature-settings") }} property.</li> - <li>The control of the aspect ratio to use when fallback fonts are selected via the CSS {{ cssxref("font-size-adjust") }} property.</li> - <li>The choice of alternative font faces using the CSS {{ cssxref("font-stretch") }}, {{ cssxref("font-variant-alternates") }}, {{ cssxref("font-variant-caps") }}, {{ cssxref("font-variant-east-asian") }}, {{ cssxref("font-variant-ligatures") }}, {{ cssxref("font-variant-numeric") }}, and {{ cssxref("font-variant-position") }} properties. It also extends the related CSS {{ cssxref("font-variant") }} shorthand property and introduces the {{ cssxref("@font-features-values") }} at-rule.</li> - <li>The control of the automatic generation of an oblique or bold face when none are found via the CSS {{ cssxref("font-synthesis") }} property.</li> - </ul> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(220,255,220);"><strong>{{ SpecName("CSS3 Syntax", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Syntax") }}</td> - </tr> - <tr> - <td colspan="2">Precises how charsets are determined; minor changes in parsing and tokenization algorithms.</td> - </tr> - </tbody> -</table> - -<h3 id="Modules_in_the_refining_phase">Modules in the refining phase</h3> - -<p>Specifications that are deemed to be in the <em>refining phase</em> are already fairly stable. Though changes are still expected, they shouldn't create incompatibilities with current implementations; they should mainly define behavior in edge cases.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,255,220);"><strong>{{ SpecName("CSS3 Basic UI", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Basic UI") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Adds:</p> - - <ul> - <li>The ability to tweak the box model using the CSS {{ cssxref("box-sizing") }} property.<br> - <strong><em>At risk:</em> </strong> <em> due to insufficient browser support, standardization of the <code>padding</code><code>-box</code> value may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - <li>Allow the styling of forms according their content using the CSS {{ cssxref(":indeterminate") }}, {{ cssxref(":default") }}, {{ cssxref(":valid") }}, {{ cssxref(":invalid") }}, {{ cssxref(":in-range") }}, {{ cssxref(":out-of-range") }}, {{ cssxref(":required") }}, {{ cssxref(":optional") }}, {{ cssxref(":read-only") }}, and {{ cssxref(":read-write") }} pseudo-classes and the {{ cssxref("::value") }}, {{ cssxref("::choices") }}, {{ cssxref("::repeat-item") }}, and {{ cssxref("::repeat-index") }} pseudo-elements.<br> - <em><strong>At risk:</strong> due to insufficient browser support, standardization of the pseudo-elements {{ cssxref("::value") }}, {{ cssxref("::choices") }}, {{ cssxref("::repeat-item") }}, and {{ cssxref("::repeat-index") }} may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - <li>Support for icons, defined by the CSS {{ cssxref("icon") }} property simultaneously with the new <code>icon</code> value of the CSS {{ cssxref("content") }} property.<br> - <em><strong>At risk:</strong> due to insufficient browser support, standardization of the {{ cssxref("icon") }} property and the <code>icon</code> value may be postponed to CSS4. </em></li> - <li>Support for the CSS {{ cssxref("outline-offset") }} property giving more control on the position of the outline.</li> - <li>Support for the CSS {{ cssxref("resize") }} property allowing Web authors to control if and how elements should be resized.</li> - <li>Support for the CSS {{ cssxref("text-overflow") }} property defining how text overflows, if needed.<br> - <em><strong>At risk:</strong> due to insufficient browser support, the 2-value syntax of this property as well as the support for {{cssxref("<string>")}} values may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - <li>The ability to define the hotspot of a cursor as well as the new <code>none</code>, <code>context-menu</code>, <code>cell</code>, <code>vertical-text</code>, <code>alias</code>, <code>copy</code>, <code>no-drop</code>, <code>not-allowed</code>, <code>nesw-</code><code>resize</code>, <code>nwse-</code><code>resize</code>, <code>col-resize</code>, <code>row-resize</code>, <code>all-scroll</code>, <code>zoom-in</code>, <code>zoom-out</code>, extending the {{ cssxref("cursor") }} property.</li> - <li>The ability to specify the sequential navigation order (that is the <em>tabbing order</em> ) using the CSS {{ cssxref("nav-index") }}, {{ cssxref("nav-up") }}, {{ cssxref("nav-right") }}, {{ cssxref("nav-left") }}, {{ cssxref("nav-down") }} properties.<br> - <em><strong>At risk:</strong> due to insufficient browser support, standardization of the navigation properties may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - <li>The ability to control the usage of an IME editor, using the CSS {{ cssxref("ime-mode") }} property.<br> - <em><strong>At risk:</strong> due to insufficient browser support, standardization of the {{ cssxref("ime-mode") }} property may be postponed to </em> <em>the next iteration of this module</em> <em>.</em></li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p>An early list of what could be in the next iteration of the CSS Basic User Interface Module is <a class="external" href="http://wiki.csswg.org/spec/css4-ui" title="http://wiki.csswg.org/spec/css4-ui">available</a>.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,255,220);"><strong>{{ SpecName("CSS3 Transitions", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Transitions") }}</td> - </tr> - <tr> - <td colspan="2">Allows the definition of transitions effects between two properties values by adding the CSS {{ cssxref("transition") }}, {{ cssxref("transition-delay") }}, {{ cssxref("transition-duration") }}, {{ cssxref("transition-property") }}, and {{ cssxref("transition-timing-function") }} properties.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,255,220);"><strong>{{ SpecName("CSS3 Animations", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Animations") }}</td> - </tr> - <tr> - <td colspan="2">Allows the definition of animations effects by adding the CSS {{ cssxref("animation") }}, {{ cssxref("animation-delay") }},{{ cssxref("animation-direction") }}, {{ cssxref("animation-duration") }}, {{ cssxref("animation-fill-mode") }}, {{ cssxref("animation-iteration-count") }}, {{ cssxref("animation-name") }}, {{ cssxref("animation-play-state") }}, and {{ cssxref("animation-timing-function") }} properties, as well as the {{ cssxref("@keyframes") }} at-rule.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,255,220);"><strong>{{ SpecName("CSS3 Transforms", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Transforms") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Adds:</p> - - <ul> - <li>the support of bi-dimensional transforms to be applied to any element using the CSS {{ cssxref("transform") }} and {{ cssxref("transform-origin") }} properties. The supported transforms are: <code>matrix</code><code>()</code>, <code>translate()</code>, <code>translateX()</code>, <code>translateY()</code>, <code>scale()</code>, <code>scaleX()</code>, <code>scaleY()</code>, <code>rotate()</code>, <code>skewX()</code>, and <code>skewY()</code>.</li> - <li>the support of tri-dimensional transforms to be applied to any element by adding the CSS {{ cssxref("transform-style") }}, {{ cssxref("perspective") }}, {{ cssxref("perspective-origin") }}, and {{ cssxref("backface-visibility") }} properties and extended the {{ cssxref("transform") }} property with the following transforms are: <code>matrix</code> <code>3d()</code>, <code>translate3d()</code>, <code>translateZ()</code>, <code>scale3d()</code>, <code>scaleZ()</code>, <code>rotate3d()</code>, <code>rotateX</code><code>()</code> ,<code>rotateY</code><code>()</code>, <code>rotateZ()</code>, and <code>perspective()</code>.</li> - </ul> - - <p><em><strong>Note:</strong> this specification is a merge of CSS 2D-Transforms, CSS 3D-Transforms and SVG transforms. </em></p> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255, 255, 220);"><strong>{{ SpecName("CSS3 Fragmentation", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Fragmentation") }}</td> - </tr> - <tr> - <td colspan="2">Defines how partitions of a Web page should happen, that is page, column breaks, and widows and orphans handling. - <p>Adds:</p> - - <ul> - <li>Support for defining the behavior of decorations, that is borders and background colors or images, when a box is breaked (at a page, column or line-break) with the CSS {{ cssxref("box-decoration-break") }} property.</li> - </ul> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,255,220);"><strong>{{ SpecName("CSS3 Text", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Text") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Extends:</p> - - <ul> - <li>the CSS {{ cssxref("text-transform") }} property with the value <code>full-width</code>.</li> - <li>the CSS {{ cssxref("text-align") }} property with the value <code>start</code>, <code>end</code>, <code>start end</code>, and <code>match-parent</code> for a better support of documents with multiple directionalities of text.</li> - <li>the CSS {{ cssxref("text-align") }} property with a {{cssxref("<string>")}} value to align on that character. This is useful to align number on the decimal point.</li> - <li>the CSS {{ cssxref("word-spacing") }} and {{ cssxref("letter-spacing") }} properties with range constraints to control flexibility in justification.</li> - </ul> - - <p>Adds:</p> - - <ul> - <li>Control on how whitespaces are displayed using the CSS {{ cssxref("text-space-collapse") }} and {{ cssxref("tab-size") }} properties.</li> - <li>Control on line breaks and word boundaries using the CSS {{ cssxref("line-break") }}, {{ cssxref("word-break") }}, {{ cssxref("hyphens") }}, {{ cssxref("text-wrap") }}, {{ cssxref("overflow-wrap") }}, and {{ cssxref("text-align-last") }} properties.</li> - <li>Control on how justification is happening, in order to support more type of scripts, using the CSS {{ cssxref("text-justify") }} property.</li> - <li>Control on edge effect using the CSS {{ cssxref("text-indent") }} and {{ cssxref("hanging-punctuation") }} properties.</li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p>A few features present in early CSS Text Level 3 draft have being <a class="external" href="http://dev.w3.org/csswg/css3-text/#recent-changes" title="http://dev.w3.org/csswg/css3-text/#recent-changes">postponed to the next iteration of this module</a> .</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,255,220);"><strong>{{ SpecName("CSS3 Variables", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Variables") }}</td> - </tr> - <tr> - <td colspan="2">Defines a mechanism allowing to define variables in CSS.</td> - </tr> - </tbody> -</table> - -<h3 id="Modules_in_the_revising_phase">Modules in the revising phase</h3> - -<p>Modules that are in the revising phase are much less stable than those in the refining phase. Often the syntax is still under scrutiny and may evolve a lot, in a non-compatible way. Alternative syntax are tested and often implemented.</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: rgb(255,160,100);"><strong>{{ SpecName("CSS3 Writing Modes", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Writing Modes") }}</td> - </tr> - <tr> - <td colspan="2">Defines the writing modes of both horizontal and vertical scripts and precises how the CSS {{ cssxref("direction") }} and {{ cssxref("unicode-bidi") }} properties interact with the new CSS {{ cssxref("text-orientation") }} property, and extends them where needed.</td> - </tr> - </tbody> -</table> - -<h3 id="Modules_in_the_exploring_phase">Modules in the exploring phase</h3> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS4 Images", "", "") }}</strong></td> - <td>{{ Spec2("CSS4 Images") }}</td> - </tr> - <tr> - <td colspan="2"> - <p>Extends:</p> - - <ul> - <li>the <code>image()</code> functional notation to describe the directionality of the image (<code>rtl</code> or <code>ltr</code>), allowing for bidi-sensitive images.</li> - <li>the {{ cssxref("image-orientation") }} property by adding the keyword <code>from-image</code>, allowing to follow EXIF data stored into images to be considered.</li> - </ul> - - <p>Adds:</p> - - <ul> - <li>the <code>image-set()</code> functional notation to allow the definition to equivalent images at different resolution allowing for resolution-negotiated selection of images.</li> - <li>the <code>element()</code> functional notation allowing the use of part of the page as image.</li> - <li>the <code>cross-fade()</code> functional notation allowing to refer to intermediate images when transitioning between two images and defines the interpolation between two images.</li> - <li>the <code>conic-gradient()</code> and <code>repeating-conic-gradient()</code> functional notation describing a new type of gradient.</li> - <li>the {{cssxref("image-rendering")}} property that allow to define how resize of the object should be handled.</li> - </ul> - </td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table" style="width: 100%;"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS3 Device", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Device") }}</td> - </tr> - <tr> - <td colspan="2">Adds a new at-rule, {{ cssxref("@viewport") }}, allowing to specify the size, zoom factor, and orientation of the viewport that is used as the base for the initial containing block.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table" style="width: 100%;"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS3 Grid", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Grid") }}</td> - </tr> - <tr> - <td colspan="2">Add a grid layout to the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/display" title=""><code>display</code></a> property and several new CSS properties to control it: {{cssxref("grid")}}, {{cssxref("grid-area")}}, {{cssxref("grid-auto-columns")}}, {{cssxref("grid-auto-flow")}}, {{cssxref("grid-auto-position")}}, {{cssxref("grid-auto-rows")}}, {{cssxref("grid-column")}}, {{cssxref("grid-column-start")}}, {{cssxref("grid-column-end")}}, {{cssxref("grid-row")}}, {{cssxref("grid-row-start")}}, {{cssxref("grid-row-end")}}, {{cssxref("grid-template")}}, {{cssxref("grid-template-areas")}}, {{cssxref("grid-template-rows")}}, and {{cssxref("grid-template-columns")}}.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS3 GCPM", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 GCPM") }}</td> - </tr> - <tr> - <td colspan="2">Adds the ability to tailor printed version of a document by allowing to control header, footer but also references tables like indexes or tables of content.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS3 Exclusions and Shapes", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Exclusions and Shapes") }}</td> - </tr> - <tr> - <td colspan="2">Extends the floats mechanism to define exclusion regions in any positioning scheme. Adds the notion of shapes, in which content must flows.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS3 Lists", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Lists") }}</td> - </tr> - <tr> - <td colspan="2">Extends the list counter mechanism so that list markers can be styled and Web developers can define new list counter schemes.</td> - </tr> - </tbody> -</table> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td style="width: 30%; background-color: #F66;"><strong>{{ SpecName("CSS3 Regions", "", "") }}</strong></td> - <td>{{ Spec2("CSS3 Regions") }}</td> - </tr> - <tr> - <td colspan="2">Defines a new mechanism allowing content to flow across, eventually non-contiguous, multiple areas called regions.</td> - </tr> - </tbody> -</table> - -<p> </p> diff --git a/files/zh-tw/archive/index.html b/files/zh-tw/archive/index.html deleted file mode 100644 index 6766a22f6e..0000000000 --- a/files/zh-tw/archive/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: 過時內容的存檔 -slug: Archive -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive ---- -<p>在 MDN,我們盡量避免直接刪除內容,因為那些內容可能對要找出遺留平台、作業系統、瀏覽器相關資料的人而言很有用:也許你的目標人群在用很老舊的硬體、使他們的瀏覽器無法升級到最新版本;或著因為某些「原因」,你的公司要用非常老舊的軟體、而你建置的網路內容需要在那個軟體上運行;也可能是你對過時的功能或 API 歷史與運行方法感到興趣。</p> - -<p>出於很多原因,老文件非常有用。因此,我們開闢了這個地方,用以保存老文件。這裡的內容<strong>不該</strong>用作建置面向現代瀏覽器的新網站或 apps 參考。這裡存在的目的,只有作為歷史參考。</p> - -<div class="note"> -<p><strong>給編者的筆記:</strong>我們要盡可能維持子頁面的組織化、而不該把所有東西都丟到一個大資料夾。試著給內容歸類。另外,只把<strong>非常</strong>老舊的內容移到這裡。若可能有人切實需要還在使用的軟體資訊,就不該移這裡。在你把任何內容移動到這裡以前,最好在 <a href="https://chat.mozilla.org/#/room/#mdn:mozilla.org">MDN Web Docs</a> 頻道討論。</p> -</div> - -<p>{{SubpagesWithSummaries}}</p> - -<h2 id="子頁面">子頁面</h2> - -<p>{{ListSubpages("/zh-TW/docs/Archive", 2, 0, 1)}}</p> diff --git a/files/zh-tw/archive/mdn/index.html b/files/zh-tw/archive/mdn/index.html deleted file mode 100644 index f99cd4e169..0000000000 --- a/files/zh-tw/archive/mdn/index.html +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: MDN Archive -slug: Archive/MDN -tags: - - Archive - - MDN -translation_of: Archive/MDN ---- -<p>{{MDNSidebar}}</p> - -<div class="blockIndicator obsolete"> -<p><strong>Obsolete</strong><br> - 此文件已過時。</p> -</div> - -<p>The documentation listed below is archived, obsolete material about MDN itself.</p> - -<p>{{LandingPageListSubpages}}</p> diff --git a/files/zh-tw/archive/mdn/persona_sign-ins/index.html b/files/zh-tw/archive/mdn/persona_sign-ins/index.html deleted file mode 100644 index 7c65870878..0000000000 --- a/files/zh-tw/archive/mdn/persona_sign-ins/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: MDN and Persona sign-ins -slug: Archive/MDN/Persona_sign-ins -tags: - - '3081911' -translation_of: Archive/MDN/Persona_sign-ins ---- -<div>{{MDNSidebar}}</div><div class="warning"> -<p>Please <a href="/en-US/docs/MDN/Contribute/Howto/Link_a_GitHub_account">link your GitHub account to your MDN profile now</a> so you can continue to sign in to MDN.</p> -</div> - -<p>Currently, MDN lets contributors sign in using two different authentication providers: Mozilla Persona and GitHub. Starting on November 1, 2016, we will remove Persona as an option for logging in. Therefore, you must enable Github authentication on your profile to avoid losing login access to MDN.</p> - -<p>We recognize that this is an inconvenience, and we do apologize for it. Unfortunately, this is out of our control.</p> - -<h2 id="Why_is_Persona_being_removed">Why is Persona being removed?</h2> - -<p>Mozilla has shut down the Persona project, and its servers will be turned off in November, 2016. You can <a href="https://wiki.mozilla.org/Identity/Persona_Shutdown_Guidelines_for_Reliers#FAQs">learn more about Mozilla's decision</a> to shut down Persona on the Mozilla wiki.</p> - -<h2 id="When_will_Persona_be_removed">When will Persona be removed?</h2> - -<p>We will disable Persona as an authentication provider on November 1, 2016; in other words, the last day you'll be able to sign in to MDN using Persona will be October 31, 2016. We will be issuing increasingly frequent and increasingly urgent notifications to <a href="/en-US/docs/MDN/Contribute/Howto/Link_a_GitHub_account">add a GitHub account to your MDN profile</a> starting now. Please do this as soon as you can, in order to avoid any risk of losing access to your MDN account.</p> - -<h2 id="Will_MDN_offer_another_authentication_provider">Will MDN offer another authentication provider?</h2> - -<p>We would very much like to do so, but have not yet identified another provider which meets our requirements; in addition, we don't currently have the developer resources to integrate another provider. For the time being, your <em>only</em> option to keep contributor access to MDN is to <a href="/en-US/docs/MDN/Contribute/Howto/Link_a_GitHub_account">link your MDN profile to your GitHub account</a>.</p> - -<p>Keep in mind, of course, that you don't need to sign in to MDN in order to read our content. But if you have an account for contributing, and wish to be able to contribute at any time in the future, be sure to <em><strong>add a GitHub account to your profile as soon as you can,</strong></em> before October 31, 2016.</p> diff --git a/files/zh-tw/archive/meta_docs/custom_classes/index.html b/files/zh-tw/archive/meta_docs/custom_classes/index.html deleted file mode 100644 index 0aa624f2fd..0000000000 --- a/files/zh-tw/archive/meta_docs/custom_classes/index.html +++ /dev/null @@ -1,189 +0,0 @@ ---- -title: 自訂 CSS 類別 -slug: Archive/Meta_docs/Custom_classes -tags: - - MDC_專案 -translation_of: Archive/Meta_docs/Custom_classes ---- -<p> 以下是 MDC Wiki 上自行定義的樣式類別,若你也想新增類別,請聯絡 <a href="/User:Dria">Dria</a>。</p> - -<h3 id=".E7.8F.BE.E6.9C.89_CSS_.E9.A1.9E.E5.88.A5" name=".E7.8F.BE.E6.9C.89_CSS_.E9.A1.9E.E5.88.A5">現有 CSS 類別</h3> - -<table class="fullwidth-table"> - <tbody> - <tr> - <td class="header">樣式</td> - <td class="header">使用結果</td> - </tr> - <tr> - <td><code>div.tip</code></td> - <td>顯示網頁內容中的小技巧文字。</td> - </tr> - <tr> - <td><code>div.bug</code></td> - <td>顯示網頁內容中的程式錯誤文字。</td> - </tr> - <tr> - <td><code>.float-left</code></td> - <td>製作向左浮動的元素(通常是圖片)。</td> - </tr> - <tr> - <td><code>.float-right</code></td> - <td>製作向右浮動的元素(通常是圖片)。</td> - </tr> - <tr> - <td><code>.figure</code></td> - <td>這個樣式目前還沒有實際作用,是為日後使用準備的。</td> - </tr> - <tr> - <td><code>.standard-table</code></td> - <td>標準的表格樣式。</td> - </tr> - <tr> - <td><code>.standard-table td.header</code></td> - <td>標準表格的標題樣式。</td> - </tr> - <tr> - <td><code>.fullwidth-table</code></td> - <td>寬度設定為 100% 的表格(就像現在這個表格一樣)。</td> - </tr> - <tr> - <td><code>.fullwidth-table td.header</code></td> - <td>寬度設為 100% 之表格的標題樣式。</td> - </tr> - <tr> - <td><code>div.breadcrumbs</code></td> - <td>頁面導覽的樣式。</td> - </tr> - <tr> - <td><code>div.breadcrumbs a.breadcrumbs</code></td> - <td>頁面導覽字串中連結部分的樣式。</td> - </tr> - <tr> - <td><code>div.breadcrumbs span.breadcrumbs</code></td> - <td>頁面導覽字串中目前頁面標題的樣式。</td> - </tr> - <tr> - <td><code>div.side-note-left div.side-note-right</code></td> - <td>用以建立文章內的邊欄。此區域之寬度將佔其母元素(通常就是文件本體)的 50%。若要建立邊欄請使用這個樣式,以確保內容顯示上容易閱讀。</td> - </tr> - <tr> - <td><code>div.highlight</code></td> - <td>在區段左側放上 3 個像素寬的藍色邊框。/td></td> - </tr> - <tr> - <td><code>.highlightred</code></td> - <td>將文字改以紅色顯示。</td> - </tr> - <tr> - <td><code>.highlightblue</code></td> - <td>將文字改以藍色顯示。</td> - </tr> - <tr> - <td><code>.highlightgreen</code></td> - <td>將文字改以綠色顯示。</td> - </tr> - </tbody> -</table> - -<h3 id=".E7.AF.84.E4.BE.8B" name=".E7.AF.84.E4.BE.8B">範例</h3> - -<h4 id=".E6.A8.99.E7.A4.BA.E9.83.A8.E5.88.86.E7.A8.8B.E5.BC.8F.E7.A2.BC" name=".E6.A8.99.E7.A4.BA.E9.83.A8.E5.88.86.E7.A8.8B.E5.BC.8F.E7.A2.BC">標示部分程式碼</h4> - -<p>通常我們會讓程式碼以特別的區塊顯示,這可以利用 span 搭配 MediaWiki 系統「行前空一格就自動縮排」的功能。須注意的是在 <span class="nowiki"><pre></span> 區段中不能用 span 元素,因為此時 MediaWiki 會直接把 span 元素當成要顯示的內容而輸出。</p> - -<pre><span class="highlightred">這樣是沒用的</span> -</pre> - -<p>這種狀況下就應該將程式碼縮排,然後在其中使用 span 元素。如果程式中有空白行,該行也必須縮排,否則系統會認為空白行的前後為分開的兩個區段。</p> - -<pre class="eval">像這樣, - 程式碼的空白行<span class="highlightred">並沒有</span>縮排, -</pre> - -<pre class="eval"> 所以就顯示成<span class="highlightblue">兩個區段</span>了。 -</pre> - -<p>顯然這樣跟我們想要的有所差異,所以你應該這麼做:</p> - -<pre class="eval">像這樣, - 空白行前<span class="highlightred">也加了個空白字元</span>以示縮排, - - 這樣系統就將其顯示為<span class="highlightblue">同一個</span>區段。 -</pre> - -<h4 id=".E5.B0.8E.E8.A6.BD" name=".E5.B0.8E.E8.A6.BD">導覽</h4> - -<p> </p> - -<ul> - <li><a href="/zh_tw/JavaScript_1.5_參考/關於本文" title="zh_tw/JavaScript_1.5_參考/關於本文">JavaScript 1.5 參考:關於本文</a>文件中有一段關於在網頁上添加導覽列的範例。</li> -</ul> - -<h4 id="table.standard-table" name="table.standard-table">table.standard-table</h4> - -<p><tr> <td>此為</td> <td><code>table.standard-table</code></td> <td>的範例</td> </tr> </table></p> - -<h4 id="table.fullwidth-table" name="table.fullwidth-table">table.fullwidth-table</h4> - -<table class="standard-table"> - <tbody> - <tr> - <th>表格標題 1</td> - <p><th>表格標題 2</td> <th>表格標題 3</td></p> - </th> - </tr> - </tbody> -</table> - -<p><tr> <td>此為</td> <td><code>table.fullwidth-table</code></td> <td>的範例</td> </tr> </table></p> - -<h4 id="DIV_.E5.8D.80.E6.AE.B5" name="DIV_.E5.8D.80.E6.AE.B5">DIV 區段</h4> - -<h5 id=".E5.B0.8F.E6.8A.80.E5.B7.A7" name=".E5.B0.8F.E6.8A.80.E5.B7.A7">小技巧</h5> - -<p>小技巧區段以 <code>div class="note"</code> 標示,例如:</p> - -<div class="note">這就是個小技巧</div> - -<h5 id=".E7.A8.8B.E5.BC.8F.E9.8C.AF.E8.AA.A4" name=".E7.A8.8B.E5.BC.8F.E9.8C.AF.E8.AA.A4">程式錯誤</h5> - -<p>已知的程式錯誤可用 <code>div class="bug"</code> 標示參照,內含 bugzilla 上的對應資訊連結,例如:</p> - -<div class="bug"><a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=176320">Bug 176320:彈出視窗 innerWidth 及 innerHeight 的最小值</a></div> - -<h5 id=".E8.AD.A6.E5.91.8A" name=".E8.AD.A6.E5.91.8A">警告</h5> - -<p>請使用 <code>div class="warning"</code> 來標示文件中的警告文字,很快我們會為此樣式加上圖示等特殊效果。</p> - -<div class="warning">此段為警告文字</div> - -<h5 id=".E6.B3.A8.E9.87.8B" name=".E6.B3.A8.E9.87.8B">注釋</h5> - -<p>請使用 <code>div class="note"</code> 來標示文件中的注釋文字。</p> - -<div class="note">這是注釋,雖然沒什麼意思但還是個注釋。</div> - -<h5 id=".E6.A8.99.E7.A4.BA.E5.8D.80.E6.AE.B5" name=".E6.A8.99.E7.A4.BA.E5.8D.80.E6.AE.B5">標示區段</h5> - -<p>以下為 <code>div class="highlight"</code> 的範例:</p> - -<div class="highlight"> -<p>此為以 CSS 標示區段的範例,您可用這個方法讓某個程式碼區段更加顯眼。這個樣式最先是為 <a href="/zh_tw/XUL_教學" title="zh_tw/XUL_教學">XUL 教學</a>而加進 MDC 的。</p> - -<pre>而這是 - 標示之區段中 - 文字預先格式化的 - 範例 -</pre> -</div> - -<table class="fullwidth-table"> - <tbody> - <tr> - <th>表格標題 1</td> - <p><th>表格標題 2</td> <th>表格標題 3</td></p> - </th> - </tr> - </tbody> -</table> diff --git a/files/zh-tw/archive/meta_docs/index.html b/files/zh-tw/archive/meta_docs/index.html deleted file mode 100644 index 52de2c8447..0000000000 --- a/files/zh-tw/archive/meta_docs/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: MDN "meta-documentation" archive -slug: Archive/Meta_docs -tags: - - Archive - - MDN - - NeedsTranslation - - TopicStub -translation_of: Archive/Meta_docs ---- -<p>Here you'll find archived "meta-documentation"; that is, documentation about how to write documentation on MDN. The articles here are obsolete and should no longer be referenced; we are retaining them here for reference while we migrate some content to new places, but very little of this is useful.</p> -<p>{{LandingPageListSubpages}}</p> diff --git a/files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html b/files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html deleted file mode 100644 index 590a003de0..0000000000 --- a/files/zh-tw/archive/misc_top_level/creating_a_web_based_tone_generator/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: 製作一個 Web 上的音調產生器 -slug: Archive/Misc_top_level/Creating_a_Web_based_tone_generator -translation_of: Archive/Misc_top_level/Creating_a_Web_based_tone_generator ---- -<p>這是一個簡單的音調產生器的範例。<code>requestSoundData()</code> 是產生音頻樣本的函式,這個函式在經過某個特定的時間間隔會透過 <code>setInterval()</code> 被呼叫。<code>mozWriteAudio()</code> 是在被呼叫時,把樣本寫入音頻串流的函式。為了確保總是有可以播放的樣本,這個範例設置了一個 500 ms 的緩衝。<code>mozCurrentSampleOffset()</code> 是一個用來知道正在被播放的樣本所在位置的函式,這的函式被這個範例用來確保我們填進緩衝的總是正在被播放後的 500 ms。</p> -<pre class="brush: js"><!DOCTYPE html> -<html> - <head> - <title>JavaScript 音頻寫入範例</title> - </head> - <body> - <input type="text" size="4" id="freq" value="440"><label for="hz">Hz</label> - <button onclick="start()">play</button> - <button onclick="stop()">stop</button> - - <script type="text/javascript"> - function AudioDataDestination(sampleRate, readFn) { - // 音頻輸出的初使化 - var audio = new Audio(); - audio.mozSetup(1, sampleRate); - - var currentWritePosition = 0; - var prebufferSize = sampleRate / 2; // 緩衝 500ms - var tail = null; - - // 這個函數會被定期呼叫以填充音頻輸出緩衝 - setInterval(function() { - var written; - // 看看之前也沒有留下未被寫入的資料 - if(tail) { - written = audio.mozWriteAudio(tail); - currentWritePosition += written; - if(written < tail.length) { - // 並非所有資料都被寫入了,把剩下的存下來... - tail = tail.slice(written); - return; // ... 並結束這個函式 - } - tail = null; - } - - // 看看是不是有需要再加新資料至音頻輸出 - var currentPosition = audio.mozCurrentSampleOffset(); - var available = currentPosition + prebufferSize - currentWritePosition; - if(available > 0) { - // 從回撥函式(callback)要一些音效資料 - var soundData = new Float32Array(parseFloat(available)); - readFn(soundData); - - // 寫這些資料 - written = audio.mozWriteAudio(soundData); - if(written < soundData.length) { - // 不是所有資料都被寫入了,存下剩下的部份。 - tail = soundData.slice(written); - } - currentWritePosition += written; - } - }, 100); - } - - // 控制並製造聲音 - - var frequency = 0, currentSoundSample; - var sampleRate = 44100; - - function requestSoundData(soundData) { - if (!frequency) { - return; // 已被靜音 - } - - var k = 2* Math.PI * frequency / sampleRate; - for (var i=0, size=soundData.length; i<size; i++) { - soundData[i] = Math.sin(k * currentSoundSample++); - } - } - - var audioDestination = new AudioDataDestination(sampleRate, requestSoundData); - - function start() { - currentSoundSample = 0; - frequency = parseFloat(document.getElementById("freq").value); - } - - function stop() { - frequency = 0; - } - </script> - </body> -</html> -</pre> -<p>{{ languages( { "en": "en/Creating_a_Web_based_tone_generator"} ) }}</p> diff --git a/files/zh-tw/archive/misc_top_level/index.html b/files/zh-tw/archive/misc_top_level/index.html deleted file mode 100644 index 0959a3b10b..0000000000 --- a/files/zh-tw/archive/misc_top_level/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Misc top level -slug: Archive/Misc_top_level -translation_of: Archive/Misc_top_level ---- -<p>In progress. These pages were moved from the top level of MDN in a spate of furious reorganization.</p> - -<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html b/files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html deleted file mode 100644 index b0fd952355..0000000000 --- a/files/zh-tw/archive/misc_top_level/same-origin_policy_for_file_colon__uris/index.html +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: '檔案同源政策 (Same-origin policy for file: URIs)' -slug: 'Archive/Misc_top_level/Same-origin_policy_for_file:_URIs' -translation_of: 'Archive/Misc_top_level/Same-origin_policy_for_file:_URIs' ---- -<p>在 Gecko 1.8 之前,任兩份檔案都會被視為同源(same-origin),換句話說本機端的任一份HTML檔可以讀取任一份檔案。</p> - -<p>自 Gacko 1.9 起,檔案讀取檔案開始受到限制:唯有當主檔案父資料夾是被讀取檔案的祖先資料夾 (<span style="line-height: 19.0909080505371px;">ancestor directory) 的情況之下,檔案讀取才會被允許,但資料夾載入並非以此規範。</span></p> - -<p>舉例來說,我們從 index.html 進入同一層資料夾的另一個 foo.html 檔,而這個 <span style="line-height: 19.0909080505371px;">foo.html 檔</span>想要讀取 bar.html 檔,只有當 bar.html 存放於 index.html 所在資料夾或是 index.html 所在資料夾底下的子資料夾中,foo.html 才能讀取 bar.html。</p> - -<p>檔案同源政策會影響到包括 <a class="internal" href="/en/DOM/XMLHttpRequest" title="En/XMLHttpRequest"><code>XMLHttpRequest</code></a>, XSLT, 與 XBL 等同源政策的檢查。</p> - -<p>至於跨 window 的 DOM 存取,基本上各檔案都被視為不同源,除了以下例外:若是檔案 B 被另一個檔案 A 載入(例如透過 iframe 或 <a class="internal" href="/en/DOM/window.open" style="text-decoration: underline; line-height: 19.0909080505371px;" title="En/DOM/Window.open"><code>window.open()</code></a>),而檔案 A、B 遵照此份檔案同源政策可以被判定屬於同源,那麼當發生<span style="line-height: 19.0909080505371px;">跨 window 的 DOM 存取時,也可以視為同源。</span></p> - -<p>比如說 <code>/home/user/</code><span style="font-family: consolas,monaco,andale mono,monospace; line-height: 19.0909080505371px;">subdir/</span><code>foo.html</code> 是一個 frameset,而它下嵌了 另一個 <span style="font-family: consolas,monaco,andale mono,monospace; line-height: 19.0909080505371px;">/home/user/subdir/subdir2/bar.html </span><span style="line-height: 19.0909080505371px;">的 </span><span style="font-family: consolas,monaco,andale mono,monospace; line-height: 19.0909080505371px;">frame</span>, 那麼 foo.html 和 bar.html 可以視為同源,但如果 bar.html 的位置變成 /home/user/bar.html,<span style="line-height: 19.0909080505371px;">那麼 foo.html 和 bar.html 便不可以視為同源。</span></p> - -<p>另外當使用者想要關閉這些檔案同源政策檢查,可以變更 <code>security.fileuri.strict_origin_policy</code> 偏好設定為從預設 true 到 false。</p> diff --git a/files/zh-tw/archive/mozilla/creating_a_microsummary/index.html b/files/zh-tw/archive/mozilla/creating_a_microsummary/index.html deleted file mode 100644 index 40afef30b6..0000000000 --- a/files/zh-tw/archive/mozilla/creating_a_microsummary/index.html +++ /dev/null @@ -1,214 +0,0 @@ ---- -title: 製作即時摘要 -slug: Archive/Mozilla/Creating_a_microsummary -tags: - - 即時摘要 -translation_of: Archive/Mozilla/Creating_a_microsummary ---- -<p> - 即時摘要來源(microsummary generator)內含一組從網頁中製出即時摘要的指令,而網頁能在 <code><head></code> 元素中放入 <code><link rel="microsummary"></code> 以指定適用的摘要來源。即時摘要來源檔案中如含有適用頁面列表,則也可以獨立安裝。</p> -<p> - 在這份教學文件中,我們將建立 <a class="external" href="http://www.spreadfirefox.com/">Spread Firefox 首頁</a>的即時摘要來源,藉以顯示目前 Firefox 的總下載數。 (例: <cite>Fx 下載數: 174475447</cite>)。</p> -<p> - 接下來我們會用一份 XSLT 樣式表將該網頁轉換為即時摘要、指定此摘要來源的適用頁面並了解摘要來源傳佈方式,讓使用者能下載及安裝。在這份文件中每階段新增的程式碼會以粗體顯示,方便您辨識。</p> -<h2 id=".E9.96.8B.E5.A7.8B" name=".E9.96.8B.E5.A7.8B"> - 開始</h2> -<p> - 摘要來源是 XML 文件的一種,而其根元素為 <code><generator></code>、名稱空間 (namespace) 需指定為 <cite><a class="external" href="http://www.mozilla.org/microsummaries/0.1" rel="freelink">http://www.mozilla.org/microsummaries/0.1</a></cite>,所以要建立一份摘要來源就先得在空的純文字檔中放入 XML 宣告及空的 <code><generator></code> 標籤:</p> -<pre class="eval"><b><?xml version="1.0" encoding="UTF-8"?></b> -<b><generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>"></b> -<b></generator></b> -</pre> -<h2 id=".E5.91.BD.E5.90.8D" name=".E5.91.BD.E5.90.8D"> - 命名</h2> -<p> - 每個即時摘要來源都必須有個名字,該名稱以 <code>name</code> 屬性記載、明確說明此摘要來源所建立的摘要主題。由於我們要建立的摘要來源將顯示 Firefox 總下載數,所以便命名為「Firefox 下載計數」:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - <b>name="Firefox 下載計數"</b>> -</generator> -</pre> -<h2 id=".E5.8A.A0.E4.B8.8A_XSLT_.E6.A8.A3.E5.BC.8F.E8.A1.A8" name=".E5.8A.A0.E4.B8.8A_XSLT_.E6.A8.A3.E5.BC.8F.E8.A1.A8"> - 加上 XSLT 樣式表</h2> -<p> - 即時摘要來源檔案中必須含有一份 XSLT 樣式表,以便將網頁依樣式表設定轉換為即時摘要。同一份資料碰上不同的 XSLT 樣式便能轉換為「相貌」不同的文件,這便是 XSLT 威力所在。</p> -<p> - 以下示範以 <code><template></code> 元素在摘要來源中添加 XSLT 樣式表:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <b><template></b> - <b><transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"></b> - <b></transform></b> - <b></template></b> -</generator> -</pre> -<p> - 即時摘要來源中可以放任何形式的 XSLT,設定為產生超文件也行,但 Firefox 目前只會顯示純文字內容。</p> -<h2 id=".E8.A8.AD.E5.AE.9A.E8.BC.B8.E5.87.BA.E6.A0.BC.E5.BC.8F" name=".E8.A8.AD.E5.AE.9A.E8.BC.B8.E5.87.BA.E6.A0.BC.E5.BC.8F"> - 設定輸出格式</h2> -<p> - 由於 XSLT 樣式表會產岀文字摘要,所以 XSLT 的 <code><output></code> 元素需設定如下:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <template> - <transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"> - <b><output method="text"/></b> - </transform> - </template> -</generator> -</pre> -<h2 id=".E4.BD.BF.E7.94.A8_XSLT_.3Ctemplate.3E" name=".E4.BD.BF.E7.94.A8_XSLT_.3Ctemplate.3E"> - 使用 XSLT <code><template></code></h2> -<p> - XSLT 處理器會分別比對 XSLT 樣式表中每組 <code><template></code> 元素及文件中的節點。當 <code><template></code> 的 <code>match</code> 屬性設定與節點相符,處理器便依設定轉換文件。</p> -<p> - 這種處理方式可以循序檢查網頁中每個節點,依據設定條件顯示內容,非常有用。不過本例只是要顯示 Spread Firefox 網站上的即時摘要,僅用一個 <code><template></code> 元素來找一回根元素下的內容即可:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <template> - <transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"> - <output method="text"/> - <b><template match="/"></b> - <b></template></b> - </transform> - </template> -</generator> -</pre> -<h2 id=".E5.8A.A0.E4.B8.8A.E4.B8.8B.E8.BC.89.E6.AC.A1.E6.95.B8" name=".E5.8A.A0.E4.B8.8A.E4.B8.8B.E8.BC.89.E6.AC.A1.E6.95.B8"> - 加上下載次數</h2> -<p> - 若想將下載次數放到 XSLT 輸出的文件中,我們得在 XSLT 中的 <code>template</code> 元素加上 <code><value-of></code> 元素,而此 <code>template</code> 元素的 <code>select</code> 屬性中指定的 XPath 必須指向涵括計數器的節點。</p> -<p> - XPath 是用來指定 HTML/XML 文件節點的語言,也有基本的節點內容處理函式。要得知能指向此節點的 XPath 陳述式,最輕鬆的方法就是使用 <a class="link-https" href="https://addons.mozilla.org/firefox/1095/">XPath Checker 擴充套件</a>。</p> -<p> - 安裝 XPath Checker 並重新啟動 Firefox 之後,先到 <a class="external" href="http://www.spreadfirefox.com/">Spread Firefox 首頁</a>去,找到 Firefox 下載次數(網頁右邊欄最下方的數字),在上頭按下右鍵,於快捷選單中選擇 <cite>View XPath</cite>。此時 XPath Checker 會開啟一個新視窗,其中 <cite>XPath</cite> 欄位包含方才所選節點的 XPath 陳述式: <cite>id('download-count')</cite> 。</p> -<p> - 在 XSLT 的 <code><template></code> 元素中加上一個 <code><value-of></code> 元素,其中 <code>select</code> 屬性便設為此 XPath 陳述式,如下:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <template> - <transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"> - <output method="text"/> - <template match="/"> - <b><value-of select="id('download-count')"/></b> - </template> - </transform> - </template> -</generator> -</pre> -<h2 id=".E5.8A.A0.E4.B8.8A.E6.96.87.E5.AD.97" name=".E5.8A.A0.E4.B8.8A.E6.96.87.E5.AD.97"> - 加上文字</h2> -<p> - 為了在即時摘要中加上 <cite>Fx 下載數:</cite> 這段文字,我們必須將 <code><text></code> 元素放到 <code><template></code> 元素中文字該出現的地方。以下範例便放進一個內容為 <cite>Fx 下載數:</cite> 的 <code><text></code> 元素:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <template> - <transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"> - <output method="text"/> - <template match="/"> - <b><text>Fx 下載數: </text></b> - <value-of select="id('download-count')"/> - </template> - </transform> - </template> -</generator> -</pre> -<p> - 此處須留心 XSLT 標籤之間的空白字元並不會出現在輸出結果中,不像 HTML 會合併顯示為一個空格,所以要在字串後多加上一個空白以便區隔下載次數及字串。</p> -<p> - 這麼一來,這個轉換 Spread Firefox 首頁為即時摘要的 XSLT 樣式便完成了。</p> -<h2 id=".E6.8C.87.E5.AE.9A.E6.91.98.E8.A6.81.E4.BE.86.E6.BA.90.E7.9A.84.E9.81.A9.E7.94.A8.E7.AF.84.E5.9C.8D" name=".E6.8C.87.E5.AE.9A.E6.91.98.E8.A6.81.E4.BE.86.E6.BA.90.E7.9A.84.E9.81.A9.E7.94.A8.E7.AF.84.E5.9C.8D"> - 指定摘要來源的適用範圍</h2> -<p> - 摘要來源的轉換樣式已大工告成,接下來要指定此樣式適用的網頁。如果我們是 Spread Firefox 的網站管理員,可以在網頁上的 <code><head></code> 元素中直接加入 <code><link rel="microsummary"></code> 標籤,以便指定此網頁對應的摘要來源:</p> -<pre class="eval"><head> - ... - <b><link rel="microsummary" href="path/to/our/generator.xml"></b> -</head> -</pre> -<p> - 不過,由於我們並非該站網管,所以就得在檔案中規定此摘要來源的適用網頁,然後把摘要來源檔放到網路上供人下載。為了要指定適用網頁範圍,我們在 <code><generator></code> 元素中放上 <code><pages></code> 元素:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <template> - <transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"> - <output method="text"/> - <template match="/"> - <text>Fx 下載數: </text> - <value-of select="id('download-count')"/> - </template> - </transform> - </template> - <b><pages></b> - <b></pages></b> -</generator> -</pre> -<p> - <code><pages></code> 元素中可以放進多個 <code><include></code> 及 <code><exclude></code> 元素。元素正如其名,<code><include></code> 元素能以規則運算式(regular expression)指定適用網頁,而 <code><exclude></code> 元素則以規則運算式指定不適用網頁。</p> -<p> - 若無另加規定,則摘要來源預設不適用所有網頁。也就是說,你必須明確指定摘要來源之適用範圍,但如無必要可不必以 <code><exclude></code> 排除其他網頁。</p> -<p> - 此處加上個 <code><include></code> 元素指定 Spread Firefox 首頁為適用範圍:</p> -<pre class="eval"><?xml version="1.0" encoding="UTF-8"?> -<generator xmlns="<span class="nowiki">http://www.mozilla.org/microsummaries/0.1</span>" - name="Firefox 下載計數"> - <template> - <transform xmlns="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>" version="1.0"> - <output method="text"/> - <template match="/"> - <text>Fx 下載數: </text> - <value-of select="id('download-count')"/> - </template> - </transform> - </template> - <pages> - <b><include><span class="nowiki">http://(www\.)?spreadfirefox\.com/(index\.php)?</span></include></b> - </pages> -</generator> -</pre> -<p> - 不熟悉規則運算式的話,可以參考<a href="zh_tw/%e5%bb%ba%e7%ab%8b%e5%8d%b3%e6%99%82%e6%91%98%e8%a6%81%e7%9a%84%e8%a6%8f%e5%89%87%e9%81%8b%e7%ae%97%e5%bc%8f">建立即時摘要的規則運算式</a>一文。</p> -<h2 id=".E5.AE.89.E8.A3.9D.E5.8D.B3.E6.99.82.E6.91.98.E8.A6.81.E4.BE.86.E6.BA.90" name=".E5.AE.89.E8.A3.9D.E5.8D.B3.E6.99.82.E6.91.98.E8.A6.81.E4.BE.86.E6.BA.90"> - 安裝即時摘要來源</h2> -<p> - 現在萬事俱備,只差讓人能下載此摘要來源的機制。我們得先將摘要來源檔上傳到網路,接著再以一段 JavaScript 連結呼叫 Firefox 的 <cite>window.sidebar.addMicrosummaryGenerator()</cite> 方法以便下載安裝。</p> -<p> - 舉例而言,如果摘要來源檔的位置在 <a class="external" href="http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml" rel="freelink">http://people.mozilla.com/~myk/micro...-generator.xml</a>,而我們希望使用者能從 <a class="external" href="http://people.mozilla.com/~myk/microsummaries/tutorial/index.html" rel="freelink">http://people.mozilla.com/~myk/micro...ial/index.html</a> 上下載安裝,就應該在 <cite>index.html</cite> 網頁上加上此段程式碼:</p> -<pre class="eval"> <strong><button onclick="window.sidebar.addMicrosummaryGenerator('<span class="nowiki">http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml</span>')">安裝 SpreadFirefox 首頁即時摘要來源!</button></strong> -</pre> -<p> - 不過,如果是不支援即時摘要的瀏覽器,按下此按鈕之後會產生 JavaScript 錯誤,所以我們應該幫使用者點忙、檢查他們的瀏覽器是否支援即時摘要,若不支援則顯示說明訊息:</p> -<pre class="eval"><strong><script></strong> -<strong> const warning = "不好意思ㄋㄟ,你得用支援即時摘要的瀏覽器 (如 Firefox 2.0) 才能安裝這玩意喔!";</strong> -<strong> function addGenerator(url) {</strong> -<strong> if (typeof window.sidebar == "object" &&</strong> -<strong> typeof window.sidebar.addMicrosummaryGenerator == "function")</strong> -<strong> window.sidebar.addMicrosummaryGenerator(url);</strong> -<strong> else</strong> -<strong> alert(warning);</strong> -<strong> }</strong> -<strong></script></strong> -<strong><button onclick="</strong><strong><strong>addGenerator</strong></strong><strong>('<span class="nowiki">http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml</span>')">安裝 SpreadFirefox 首頁即時摘要來源!</button></strong> -</pre> -<p> - 附帶一提:</p> -<ul> - <li> - 由於 {{ Bug(341283) }} 的關係,目前 <cite>addMicrosummaryGenerator()</cite> 無法支援相對位置的 URL。</li> - <li> - 如果存放摘要來源檔的伺服器無法送出正確的 MIME Type (例: Google Pages 的空間),則摘要來源將無效,您可以在網址列輸入 javascript: 來查閱錯誤。</li> - <li> - 如果摘要來源檔案中的 XML 或 XSLT 格式有誤,則摘要來源將無效,一樣可以在網址列輸入 javascript: 來查閱錯誤。</li> -</ul> -<h2 id=".E7.B5.90.E8.AA.9E" name=".E7.B5.90.E8.AA.9E"> - 結語</h2> -<p> - 現在你應該瞭解怎麼製作能顯示 Firefox 下載次數的即時摘要了。試著將 Spread Firefox 首頁存為書籤,然後在<cite>新增書籤</cite>對話方塊中按下<cite>名稱</cite>下拉式選單、選擇<cite>即時標題</cite>之後的項目即可。</p> -<p> - 其他關於即時摘要的相關資訊,可以參考 <a class="external" href="http://wiki.mozilla.org/Microsummaries">Microsummaries 主題頁</a>。</p> diff --git a/files/zh-tw/archive/mozilla/drag_and_drop/index.html b/files/zh-tw/archive/mozilla/drag_and_drop/index.html deleted file mode 100644 index b963b08118..0000000000 --- a/files/zh-tw/archive/mozilla/drag_and_drop/index.html +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: Drag and Drop -slug: Archive/Mozilla/Drag_and_drop -tags: - - NeedsTranslation - - TopicStub - - XUL -translation_of: Archive/Mozilla/Drag_and_drop ---- -<p>{{ Next("Drag and Drop JavaScript Wrapper") }}</p> -<p>{{ deprecated_header("gecko1.9.1") }}</p> -<div class="warning"> - As of Gecko 1.9.1 (Firefox 3.5), these APIs are officially deprecated <a href="/En/DragDrop/Drag_and_Drop" title="en/DragDrop/Drag and Drop">the newer, simpler, portable API</a> should be used in their place.</div> -<p>This section describes how to implement objects that can be dragged around and dropped onto other objects.</p> -<h3 id="The_Drag_and_Drop_Interface" name="The_Drag_and_Drop_Interface">The Drag and Drop Interface</h3> -<p>Many user interfaces allow one to drag particular objects around within the interface. For example, dragging files to other directories, or dragging an icon to another window to open the document it refers to. Mozilla and <a href="/en/XUL" title="en/XUL">XUL</a> provide a number of events that can handle when the user attempts to drag objects around.</p> -<p>A user can start dragging by holding down the mouse button and moving the mouse. The drag stops when the user releases the mouse. Event handlers are called when the user starts and ends dragging, and at various points in-between.</p> -<p>Mozilla implements dragging by using a drag session. When a user requests to drag something that can be dragged, a drag session should be started. The drag session handles updating the mouse cursor and where the object should be dropped. If something cannot be dragged, it should not start a drag session. Because the user generally has only one mouse, only one drag session is in use at a time.</p> -<p>Note that drag sessions can be created from within Mozilla itself or from other applications. Mozilla will translate the data being dragged as needed.</p> -<p>The list below describes the event handlers that can be called, which may be placed on any element. You only need to put values for the handlers where you need to do something when the event occurs.</p> -<dl> - <dt> - ondrag {{ Fx_minversion_inline(3) }}</dt> - <dd> - Called periodically throughout the drag and drop operation.</dd> - <dt> - ondraggesture </dt> - <dd> - Called when the user starts dragging the element, which normally happens when the user holds down the mouse button and moves the mouse. The script in this handler should set up a drag session.</dd> - <dt> - ondragstart {{ Fx_minversion_inline(3) }} </dt> - <dd> - An alias for <code>ondraggesture</code>; this is the HTML 5 spec name for the event and may be used in HTML or XUL; however, for backward compatibility with older versions of Firefox, you may wish to continue using <code>ondraggesture</code> in XUL.</dd> - <dt> - ondragover </dt> - <dd> - This event handler is called for an element when something is being dragged over top of it. If the object can be dropped on the element, the drag session should be notified.</dd> - <dt> - ondragenter </dt> - <dd> - Called for an element when the mouse pointer first moves over the element while something is being dragged. This might be used to change the appearance of the element to indicate to the user that the object can be dropped on it.</dd> - <dt> - ondragexit </dt> - <dd> - Called for an element when the mouse pointer moves out of an element while something is being dragged. The is also called after a drop is complete so that an element has a chance to remove any highlighting or other indication.</dd> - <dt> - ondragdrop </dt> - <dd> - This event handler is called for an element when something is dropped on the element. At this point, the user has already released the mouse button. The element can simply ignore the event or can handle it some way, such as pasting the dragged object into itself.</dd> - <dt> - ondragend {{ Fx_minversion_inline(3) }} </dt> - <dd> - Called when the drag operation is finished.</dd> -</dl> -<p>There are two ways that drag and drop events can be handled. This first involves using the drag and drop <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> interfaces directly. The second is to use a <a href="/en/Drag_and_Drop_JavaScript_Wrapper" title="en/Drag_and_Drop_JavaScript_Wrapper">JavaScript wrapper</a> object that handles some of this for you. The code for this wrapper can be found in a file named {{ Source("toolkit/content/nsDragAndDrop.js nsDragAndDrop.js") }} which is contained in the widget-toolkit (or global) package.</p> -<h3 id="XPCOM_Drag_and_Drop_interfaces" name="XPCOM_Drag_and_Drop_interfaces">XPCOM Drag and Drop interfaces</h3> -<p>Two interfaces are used to support drag and drop. The first is a drag service, <a href="/en/XPCOM_Interface_Reference/nsIDragService" title="en/nsIDragService">nsIDragService</a> and the second is the drag session, <a href="/en/XPCOM_Interface_Reference/nsIDragSession" title="en/nsIDragSession">nsIDragSession</a>.</p> -<p>The <a href="/en/XPCOM_Interface_Reference/nsIDragService" title="en/nsIDragService">nsIDragService</a> is responsible for creating drag sessions when a drag starts, and removing the drag session when the drag is complete. The function <code>invokeDragSession</code> should be called to start a drag inside an <code>ondraggesture</code> event handler. Once this function is called, a drag has started.</p> -<p>The function invokeDragSession takes four parameters, as described below:</p> -<pre class="eval">invokeDragSession(element,transferableArray,region,actions) -</pre> -<dl> - <dt> - element </dt> - <dd> - A reference to the element that is being dragged. This can be retrieved by getting the property <code>event.target</code> during the event handler.</dd> - <dt> - transferableArray </dt> - <dd> - An array of <a href="/en/NsITransferable" title="en/NsITransferable">nsITransferable</a> objects, one for each item being dragged. An array is used because you might want to drag several objects at once, such as a set of files.</dd> - <dt> - region </dt> - <dd> - A region used for feedback indication. This should usually be set to null.</dd> - <dt> - actions </dt> - <dd> - The actions that the drag uses. This should be set to one of the following constants, or several added together. The action can be changed during the drag depending on what is being dragged over.</dd> -</dl> -<dl> - <dt> - nsIDragService.DRAGDROP_ACTION_NONE </dt> - <dd> - <dl> - <dt> - Used to indicate that no drag is valid.</dt> - <dt> - nsIDragService.DRAGDROP_ACTION_COPY </dt> - <dd> - The item being dragged should be copied to its dropped location.</dd> - <dt> - nsIDragService.DRAGDROP_ACTION_MOVE </dt> - <dd> - The item being dragged should be moved to its dropped location.</dd> - <dt> - nsIDragService.DRAGDROP_ACTION_LINK </dt> - <dd> - A link (or shortcut or alias) to the item being dragged should be created in the dropped location.</dd> - </dl> - </dd> -</dl> -<p>The interface {{ interface("nsIDragService") }} also provides the function <code>getCurrentSession</code> which can be called from within the drag event handlers to get and modify the state of the drag. The function returns an object that implements {{ interface("nsIDragSession") }}.</p> -<p>The interface <a href="/en/XPCOM_Interface_Reference/nsIDragSession" title="en/nsIDragSession">nsIDragSession</a> is used to get and set properties of the drag that is currently occuring. The following properties and methods are available:</p> -<dl> - <dt> - canDrop </dt> - <dd> - Set this property to <code>true</code> if the element the mouse is currently over can accept the object currently being dragged to be dropped on it. Set the value to <code>false</code> if it doesn't make sense to drop the object on it. This should be changed in the <code>ondragover</code> and <code>ondragenter</code> event handlers.</dd> - <dt> - dragAction </dt> - <dd> - Set to the current action to be performed, which should be one or more of the constants described earlier. This can be used to provide extra feedback to the user.</dd> - <dt> - numDropItems </dt> - <dd> - The number of items being dragged. For example, this will be set to 5 if five bookmarks are being dragged.</dd> - <dt> - getData(transfer,index) </dt> - <dd> - Get the data being dragged. The first argument should be an <a href="/en/NsITransferable" title="en/NsITransferable">nsITransferable</a> object to hold the data. The second argument, <code>index</code>, should be the index of the item to return.</dd> - <dt> - sourceDocument </dt> - <dd> - The document where the drag started.</dd> - <dt> - sourceNode </dt> - <dd> - The <a href="/en/DOM" title="en/DOM">DOM</a> node where the drag started.</dd> - <dt> - isDataFlavorSupported(flavor) </dt> - <dd> - Returns <code>true</code> if the data being dragged contains data of the specified flavor.</dd> -</dl> -<p>{{ Next("Drag and Drop JavaScript Wrapper") }}</p> -<div class="originaldocinfo"> - <h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2> - <ul> - <li>Author(s): <a class="link-mailto" href="mailto:enndeakin@sympatico.ca">Neil Deakin</a></li> - <li>Original Document:</li> - <li>Copyright Information: Copyright (C) <a class="link-mailto" href="mailto:enndeakin@sympatico.ca">Neil Deakin</a></li> - </ul> -</div> diff --git a/files/zh-tw/archive/mozilla/firefox/index.html b/files/zh-tw/archive/mozilla/firefox/index.html deleted file mode 100644 index c87802d82f..0000000000 --- a/files/zh-tw/archive/mozilla/firefox/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Firefox -slug: Archive/Mozilla/Firefox -translation_of: Archive/Mozilla/Firefox ---- -<p>In progress. Out-of-date information about the Firefox project.</p> - -<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html b/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html deleted file mode 100644 index 6e7260a691..0000000000 --- a/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Firefox 3 Using Microformat -slug: Archive/Mozilla/Firefox/Using_microformats -translation_of: Archive/Mozilla/Firefox/Using_microformats ---- -<p>Microfotmats 讓網站可以提供語意化的資料給瀏覽器,這是為了讓瀏覽器不需知道如何剖析(parse)文件就可以呈現網頁資訊的摘要。Firefox 3 實做了一個全域的 microformats 物件(global microformats object) 以提供 microformats 的存取。這個物件與其 API 簡化了尋找、讀取 microfotmats 的工作。</p> -<h3 id=".E8.BC.89.E5.85.A5_microformats_API" name=".E8.BC.89.E5.85.A5_microformats_API">載入 microformats API</h3> -<p>Microformats 物件是用 Firefox 3 新加入的 JavaScript script loader 建立的。要使用這個 API,你首先需要載入這個物件:</p> -<pre>Components.utils.import("resource://gre/modules/Microformats.js");</pre> -<p>一旦載入了這個 microformats API,你就可以使用列在這裡的方式來管理 microformats,詳見 <a class="external" href="http://developer.mozilla.org/en/docs/Parsing_microformats_in_JavaScript">Parsing microformats in JavaScript</a>。</p> -<h3 id=".E9.A0.90.E5.85.88.E5.AE.9A.E7.BE.A9.E5.A5.BD.E7.9A.84_microformats" name=".E9.A0.90.E5.85.88.E5.AE.9A.E7.BE.A9.E5.A5.BD.E7.9A.84_microformats">預先定義好的 microformats</h3> -<p>Firefox 3 實做了好幾種常見的 microformats,以下是其定義:</p> -<dl> - <dt> - adr</dt> - <dd> - 代表住址 (例如一條街或郵寄住址)。</dd> - <dt> - geo</dt> - <dd> - 代表使用緯度、經度表示的地理位置。</dd> - <dt> - hCard</dt> - <dd> - 代表個人的聯絡方式。</dd> - <dt> - hCalendar</dt> - <dd> - 代表行事曆上的一個約會。</dd> - <dt> - tag</dt> - <dd> - 用於新增標籤給其他 microformats。 - <h3 id=".E6.96.B9.E5.BC.8F" name=".E6.96.B9.E5.BC.8F">方式</h3> - <h4 id="add.28.29" name="add.28.29">add()</h4> - <p>新增一個 microformat 到一個 microformat module。</p> - <p class="note">如果指定的名稱和現存的 microformat 相同,這個原來存在的 microformat 會被新增的所取代。</p> - <pre>add(name, definition);</pre> - <h5 id="Parameters" name="Parameters">Parameters</h5> - <p> </p> - <dl> - <dt> - name</dt> - <dd> - 新增到 microformat module 的 microformat 名稱。</dd> - <dt> - definition</dt> - <dd> - 描述 microformat 的 JavaScript 結構,詳見 <a class="external" href="http://developer.mozilla.org/en/docs/Describing_microformats_in_JavaScript">Describing microformats in JavaScript</a></dd> - </dl> - <h4 id="count.28.29" name="count.28.29">count()</h4> - <p>計算文件中符合我們指定的類型的 microformats 的數量</p> - <pre>numMicroformats = Microformats.count(name, rootElement, recurseFrames)</pre> - <h5 id="Parameters_2" name="Parameters_2">Parameters</h5> - <p> </p> - <dl> - <dt> - name</dt> - <dd> - 要計算的 microformat 名稱。</dd> - <dt> - rootElement</dt> - <dd> - 可加可不加。代表由此開始搜尋的 DOM 元素,預設是 content.document (換句話說,也就是整份文件)。</dd> - <dt> - recurseFrames</dt> - <dd> - 可加可不加。如果是 true,搜尋時會連 child frames 一起搜尋,預設是 true</dd> - </dl> - <h5 id=".E5.9B.9E.E5.82.B3.E5.80.BC_.28Return_value.29" name=".E5.9B.9E.E5.82.B3.E5.80.BC_.28Return_value.29">回傳值 (Return value)</h5> - <p>是一個整數值,代表符合指定類型的 microformats 數量。</p> - <h4 id="debug.28.29" name="debug.28.29">debug()</h4> - <h4 id="get.28.29" name="get.28.29">get()</h4> - <h4 id="getNamesFromNode.28.29" name="getNamesFromNode.28.29">getNamesFromNode()</h4> - <h4 id="getParent.28.29" name="getParent.28.29">getParent()</h4> - <h4 id="isMicroformat.28.29" name="isMicroformat.28.29">isMicroformat()</h4> - </dd> -</dl> diff --git a/files/zh-tw/archive/mozilla/index.html b/files/zh-tw/archive/mozilla/index.html deleted file mode 100644 index 0acec76e6d..0000000000 --- a/files/zh-tw/archive/mozilla/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Archived Mozilla and build documentation -slug: Archive/Mozilla -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla ---- -<p>These articles are archived, obsolete documents about Mozilla, Gecko, and the process of building Mozilla projects.</p> -<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/apis/index.html b/files/zh-tw/archive/mozilla/marketplace/apis/index.html deleted file mode 100644 index ead011ed63..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/apis/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: 公用程式函式庫與 API -slug: Archive/Mozilla/Marketplace/APIs -translation_of: Archive/Mozilla/Marketplace/APIs ---- -<div class="summary"> -<p><span class="seoSummary">如果要將 Firefox Marketplace 的功能寫進 App 與 Web 頁面之中,就必須透過 Marketplace Utility Libraries、Web API、Marketplace API。本文將說明上述方式、使用時機,並提供進一步的說明文件連結。</span></p> -</div> - -<h2 id="Marketplace_Utility_Library">Marketplace Utility Library</h2> - -<p>Marketplace Utility Library 可讓開發者避開複雜的 Web API 與 Marketplace API,進而簡化每天的程式撰寫作業。目前雖然只有 1 組函式庫,但隨著 Marketplace 功能不斷擴充,將會陸續提供其他函式庫:</p> - -<ul> - <li><code><a href="https://github.com/mozilla/receiptverifier">receiptverifier</a></code> — 此函式庫可驗證付款收據。可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Monetization/Validating_a_receipt">驗證收據</a>》以了解使用方式。</li> -</ul> - -<h2 id="Web_API">Web API</h2> - -<p>Marketplace App 必須透過 Web API 才能提供特定功能:</p> - -<ul> - <li><code><a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay">navigator.mozPay</a></code> 及其相關的<a class="external external-icon" href="https://wiki.mozilla.org/WebAPI/WebPaymentProvider"> Web Payment Provider</a> — 此 API 即用以處理 App 內的付款機制 (In-app payments)。同樣可參閱《<a href="/en-US/Marketplace/Monetization/In-app_payments">In-app payments</a>》以了解使用方式。</li> -</ul> - -<h2 id="Marketplace_API">Marketplace API</h2> - -<p>針對大多數的一般 App 撰寫需要,其實並用不到 Marketplace API。但某些 Activities (如<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Publishing/Creating_a_store">設立自己的 App 商店</a>) 就需要此 API。但根據開發者自己的需求,也許 Marketplace Utility Library 還是比較好用。</p> - -<p>Marketplace API 的相關說明文件,均已置於 readthedocs.org 的<a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html">這個網址上</a>。如果你需要進一步了解這些 API,亦可加入 <a href="https://lists.mozilla.org/listinfo/dev-marketplace">dev-marketplace</a> 郵件群組。</p> - -<div class="note"> -<p>Marketplace API 說明文件,均記錄了正在開發中的 Marketplace API。所以內含的 API 細節尚未公開於 Marketplace 之上。</p> -</div> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/faq/index.html b/files/zh-tw/archive/mozilla/marketplace/faq/index.html deleted file mode 100644 index ba8aa7493a..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/faq/index.html +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: Firefox Marketplace 常見問題 -slug: Archive/Mozilla/Marketplace/FAQ -translation_of: Archive/Mozilla/Marketplace/FAQ ---- -<div class="summary"> -<p>本篇文章將解答 <a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 多個常見的發佈問題。</p> -</div> - -<h2 id="帳戶管理">帳戶管理</h2> - -<h3 id="我該如何變更開發者帳戶的資訊?">我該如何變更開發者帳戶的資訊?</h3> - -<p>進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上,點選「Edit Account Settings」即可。</p> - -<h3 id="我該如何變更開發者付款的資訊?">我該如何變更開發者付款的資訊?</h3> - -<p>進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上。點選「My Apps」之後,找到你想變更付款資訊的 App,再點擊「Set Up Payments」即可。</p> - -<h3 id="我該到哪找到自己的銷售報表與對帳資訊?">我該到哪找到自己的銷售報表與對帳資訊?</h3> - -<p>進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上。點選「My Apps」之後,找到你需要相關資料的 App 即可。</p> - -<h3 id="如果我們是多人組成的開發團隊或公司,該如何管理帳戶資訊?">如果我們是多人組成的開發團隊或公司,該如何管理帳戶資訊?</h3> - -<p>進入 Firefox Marketplace 並登入自己的帳戶,將滑鼠游標置於齒輪圖示 (即設定選單) 之上。點選「My Apps」之後,找到你想變更團隊細節的 App 即可。</p> - -<h3 id="我該如何重新命名_App?">我該如何重新命名 App?</h3> - -<p>如果你想在 Marketplace 審查之後變更 App 的名稱,就必須再次提交 App 通過審查才行。請參閱<a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Updating_apps">更新 App</a> 以進一步了解。</p> - -<h3 id="我該如何進入_Firefox_Marketplace_除錯設定?">我該如何進入 Firefox Marketplace 除錯設定?</h3> - -<p>登入之後進入 Firefox Marketplace,在搜尋列中輸入「:debug」。</p> - -<p>接著你就會看到自己 Marketplace 帳戶的除錯畫面。你可在此畫面中清除 Marketplace 網站、提交記錄、檢視設定、活動記錄等等相關的 cookies<code> 與 localStorage。</code></p> - -<h3 id="如果我把_App_提交到自己目前所在地以外的地方,我該如何檢視這些_App?">如果我把 App 提交到自己目前所在地以外的地方,我該如何檢視這些 App?</h3> - -<p>如果你自己目前所在之處或擁有手機 SIM 卡的地區,和你 App 發佈地區並不相同,則可透過下列步驟檢視該 App:</p> - -<ol> - <li>進入 Firefox Marketplace 除錯設定 (可參閱上一題)。</li> - <li>透過「Region Override」與「Carrier Override」選項,選出自己的所在地區或營運商 (只要選完就會立刻更新這些設定)。</li> - <li>重新整理/載入 Marketplace。</li> -</ol> - -<p>你可以先試著為 App 隨便選個分類,確認系統更新過了相關設定。</p> - -<h2 id="App_提交與審查程序">App 提交與審查程序</h2> - -<h3 id="我該如何提交新的_App?">我該如何提交新的 App?</h3> - -<p>可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup/Publishing/Submitting_an_app">將 App 提交至 Firefox Marketplace</a>》中的詳細步驟。</p> - -<h3 id="App_核准程序為何?">App 核准程序為何?</h3> - -<p>請參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Submission/Marketplace_review_criteria">Marketplace 審查準則</a>》以了解審查程序的相關準則。</p> - -<h3 id="是否有快速審查程序?所採用的準則是否不同?">是否有快速審查程序?所採用的準則是否不同?</h3> - -<p>如果開發者正好有絕佳的商機需求,或必須儘快釋出重要修復檔案,即可申請快速審查 App。若需 Marketplace 進行快速審查,可寄發電子郵件到 <a href="https://groups.google.com/forum/#%21forum/mozilla.appreview" title="appreview@lists.mozilla.org">mozilla.appreview</a>,或加入 <a href="https://wiki.mozilla.org/IRC">irc.mozilla.org</a> 中的「#app-reviewers」IRC 頻道。我們會儘快完成快速審查,但不保證審查人員能配合任何特定時間。</p> - -<div class="note"> -<p><strong>注意:</strong>對 App 審查團隊來說,「App 快速審查」也算是額外的工作之一。若你有興趣協助我們的審查作業,歡迎透過 <a href="https://docs.google.com/spreadsheet/viewform?formkey=dEdVWVhWUzdIZ1hWTzRvdkJiLXF5dHc6MQ">Firefox App 審查者申請表</a>申請。</p> -</div> - -<h3 id="我的_App_需要遵守內容政策嗎?">我的 App 需要遵守內容政策嗎?</h3> - -<p>當然!請參閱<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Submission/Marketplace_review_criteria#.E5.85.A7.E5.AE.B9">《Marketplace 審查準則》中的〈內容〉一章</a>,了解 Mozilla 的內容政策。</p> - -<h3 id="如果_App_遭退回或移除,我該如何上訴?">如果 App 遭退回或移除,我該如何上訴?</h3> - -<p>如果想為遭退回的 App 上訴,則可直接回覆 App 退回通知的電子郵件 (所有 Marketplace 通知郵件的末端,均告知開發者可直接回覆該電子郵件以提出問題);或可透過 <a href="https://wiki.mozilla.org/IRC">irc.mozilla.org</a> 上的「#app-reviewers」IRC 頻道向我們溝通。</p> - -<h2 id="付款">付款</h2> - -<h3 id="Firefox_Marketplace_如何運作付款作業?">Firefox Marketplace 如何運作付款作業?</h3> - -<p>Mozilla 提供多種付款方式,包含付費 App、免費增值 (Freemium) App、App 內部付費機制 (In-app payments)。若需進一步資訊,可參閱《<a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Marketplace_Payments">Marketplace Payments guide</a>》。</p> - -<h3 id="開發者收益的拆帳方式為何?">開發者收益的拆帳方式為何?</h3> - -<p>開發者將收到預扣增值稅 (Value Added Tax,VAT) 與費用之後金額的 70%。我們先假設美金訂價 $.99 (Tier 10),歐元訂價則為 €.89;而增值稅率為 20% (根據英國標準增值稅率) 為例,則預扣增值稅之後的價格為 €.74,亦約為 $.99 (有時匯兌之後的價格點數可能變高,有時也會變低)。開發者最後將收到 €.74 的七成金額。</p> - -<p>若需價格點數與訂價的相關資訊,可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Monetization/App_pricing">制定 App 的價格</a>》。</p> - -<h3 id="Mozilla_也會拆得一部分的帳嗎?">Mozilla 也會拆得一部分的帳嗎?</h3> - -<p>會。為了維持 Firefox Marketplace 的運作、持續強化 App 平台、支付每次購買行為所產生的交易費用。Mozilla 將收取預扣增值稅後金額的三成,再拆分給 Mozilla、行動網路營運商、付款服務供應商 (如 Bango) 共三方收取。</p> - -<h3 id="我一定要使用_Firefox_Marketplace_的付款系統嗎?">我一定要使用 Firefox Marketplace 的付款系統嗎?</h3> - -<p>若要讓消費者從 Firefox Marketplace 下載付費 App,就必須使用 Firefox Marketplace 付款系統。我們不會要求 In-app payments 也同樣使用 Marketplace 付款系統,但目前 Firefox OS 中僅建構了 <a href="https://developer.mozilla.org/en-US/docs/Web/API/navigator.mozPay" title="The mozPay function is used to perform payments. It enables an app to use in-app payments."><code>navigator.mozPay()</code></a> 函式 (用於 In-app payments),而該函式就採用 Firefox Marketplace 付款系統。我們以後會讓開發者針對 In-app payments 選用任何付款系統。</p> - -<h3 id="將自己的_App_放上_Firefox_Marketplace_後的交易費用?">將自己的 App 放上 Firefox Marketplace 後的交易費用?</h3> - -<p>需支付預扣稅額訂價的 30%。換句話說,因為 Marketplace 提供的含稅價格點數已經納入了增值稅 (針對需課增值稅的地區),所以在完成交易之後隨即扣除增值稅,讓開發者取得訂價金額的 70%。</p> - -<h3 id="我需要自行設定銷售稅或增值稅率嗎?">我需要自行設定銷售稅或增值稅率嗎?</h3> - -<p>不用。針對需課稅的地區,Marketplace 的價格點數均已包含了增值稅。而銷售稅的部分,均另由付款服務供應商列入帳單之中。</p> - -<h3 id="我該如何分開付款?">我該如何分開付款?</h3> - -<p>Firefox Marketplace 目前尚未提供分開付款的功能。</p> - -<h3 id="我能提交免費_App_嗎?會向我收費嗎?">我能提交免費 App 嗎?會向我收費嗎?</h3> - -<p>當然。歡迎開發者在 Firefox Marketplace 中提交免費 App,且 Mozilla 不會對免費 App 收取任何費用。</p> - -<h3 id="付費_App_還能搭配_In-app_payments_嗎?">付費 App 還能搭配 In-app payments 嗎?</h3> - -<p>可以。</p> - -<h3 id="退款程序為何?">退款程序為何?</h3> - -<p>根據付款方式的不同,退款程序可能由電信營運商、信用卡公司,或付款服務供應商 (如 Bango) 進行。若消費者選用電信帳單代繳的方式,則依照電信營運商的退款政策處理。目前尚無營運商提供退款服務。Bango 則是針對信用卡提供前端支援服務。任何退款均將從開發者的收益之中扣除。</p> - -<p>服務條款與<a href="https://developer.mozilla.org/en-US/Marketplace/Submission/Submitting_an_app#Step_1.3A_Agreement">開發者協議</a>均提供了退款政策。一般來說,Marketplace 不會支付退款,但會要求 Bango 進行退款程序。若消費者選用電信帳單代繳的方式,就必須要求電信營運商退款並修正電信帳單。</p> - -<h3 id="如何處理詐騙的購買行為?">如何處理詐騙的購買行為?</h3> - -<p>尚待完善討論。</p> - -<h3 id="Marketplace_如何處理多樣的幣別?">Marketplace 如何處理多樣的幣別?</h3> - -<p>根據消費者所選的所在地區,即顯示該地區的預設幣別。另針對付款作業,若消費者目前身處於原本設定的地區之外,就會根據他們收取帳單的地區 (即 SIM 卡所在地),或根據其所在位置收款。如此可避免詐欺行為。</p> - -<h3 id="付款時程為何?開發者多久能收到銷售_App_的應得款項?">付款時程為何?開發者多久能收到銷售 App 的應得款項?</h3> - -<p>根據付款服務供應商而有所不同;而目前仍由 Bango 負責所有地區的付款作業。開發者可直接與 Bango 洽詢,且每個月均會收到自行對帳用的發票。因為行動服務營運商必須向消費者收取並匯出相關款項,所以支付日期也各有差異。各個國家又會有所不同。而消費者如果採用信用卡付款,都能讓開發者迅速收取款項。若選用電信帳單代繳方式,可能需時 30 ~ 90 天不等。</p> - -<h3 id="開發者應如何處理退款?">開發者應如何處理退款?</h3> - -<p>請參閱《<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Publishing/Marketplace_Payments">Marketplace payments</a>》中的〈<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Publishing/Marketplace_Payments#Refunds">Refunds</a>〉一章。</p> - -<h3 id="Firefox_Marketplace_可進行臨時銷售或變更訂價嗎?">Firefox Marketplace 可進行臨時銷售或變更訂價嗎?</h3> - -<p>我們正規劃價格點數的變更功能,讓開發者能針對「試用期」或「正式銷售」而設定不同的價格。</p> - -<h3 id="開發者能銷售_Firefox_的附加元件_(add-ons)_嗎?">開發者能銷售 Firefox 的附加元件 (add-ons) 嗎?</h3> - -<p>目前 Firefox Marketplace 僅供銷售 App。我們希望很快就能提供其他內容的銷售服務。</p> - -<h2 id="技術問題">技術問題</h2> - -<h3 id="誰將可托管_App?">誰將可托管 App?</h3> - -<p>開發者可在自己的伺服器上托管 App 的所有檔案。但將 App 提交到 Firefox Marketplace 之後,就必須提供 App 的 manifest 檔案網址,以利 Marketplace 進行讀取並檢驗。開發者另可上傳圖示、截圖等元素,以能順利在 Firefox Marketplace 推銷自己的 App。可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup/Publishing/Submitting_an_app">將 App 提交至 Firefox Marketplace</a>》進一步了解。</p> - -<h3 id="如何從_App_直接啟動_Marketplace?">如何從 App 直接啟動 Marketplace?</h3> - -<p>開發者可透過 <a href="https://developer.mozilla.org/en-US/docs/WebAPI/Web_Activities">Web Activities</a>,從自己的 App 或網站啟動 Marketplace。而 Marketplace 所支援的 activities 均<a href="https://github.com/mozilla/fireplace/wiki/Web-Activities">記錄於 Github 之上</a>。</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/index.html b/files/zh-tw/archive/mozilla/marketplace/index.html deleted file mode 100644 index 5ce3b790b0..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/index.html +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Firefox Marketplace -slug: Archive/Mozilla/Marketplace -tags: - - Apps - - B2G - - Firefox OS - - Marketplace - - Mobile - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace ---- -<div class="summary">Firefox Marketplace 為開放且非專利的線上商城,針對以 HTML5 所撰寫的 Web App 所建構。若開發者準備在 Firefox Marketplace 上發佈 App,均可於此專區中找到相關資訊。另有其他指南可帶領你成功打造 App、提供其他選項、將自己的心血轉為實質收益、發佈\更新 App,更有函式庫與 API 可確實發揮 Marketplace 的特色。</div> - -<div class="row topicpage-table"> -<div class="section"> -<p class="Community">透過標準的 Web 技術、語言、工具,<a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 可供你發佈免費\付費的 <a href="https://developer.mozilla.org/en-US/Apps">Open Web App</a>。這些可為封裝式 (Packaged) App,於 Firefox 中執行;或可為托管\架設式 (Hosted) App,置於你自己的伺服器之上。已上架的 App 則可用於 Firefox 桌機版、Android 裝置、Firefox OS 手機。而使用者可透過 App 的精選、分類、搜尋等區塊,輕鬆找到自己喜愛的 App。接著就能立刻安裝免費 App,或透過目前持續成長中的信用卡付款\電信帳單代收的功能,購買付費 App。</p> - -<div class="row topicpage-table"> -<div class="section"> -<h2 class="Community" id="Community" name="Community"><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare">準備發佈 App</a></h2> - -<dl> - <dd>不論你撰寫 App 是純粹好玩或想創造收益,你都會希望有許多人發現、使用、享受你的作品。本章節將解釋該如何拓展能見度,並建立消費者社群。</dd> -</dl> - -<h2 class="Community" id="Community" name="Community"><a href="https://developer.mozilla.org/en-US/Marketplace/Options">App 發佈選項</a></h2> - -<dl> - <dd>到底要用封裝式或托管\架設式 App?了解應如何發表自己 App 的內容。且除了 Firefox OS 之外,亦可讓 App 躍上 Android 裝置與桌上型電腦。</dd> - <dt><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Creating_a_store">建立自己的 App 商城</a></dt> - <dd>你不一定要透過 Firefox Marketplace 發佈自己的 App。了解應如何建立自己的 App 商城,或為其他開發者的 App 建立商城。</dd> -</dl> - -<h2 class="Community" id="Community" name="Community"><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Profiting_from_your_app">轉為實質收益</a></h2> - -<dl> - <dd>如果你負責撰寫 App,則可透過本章節了解 Open Web App 與 Firefox Marketplace 所提供的收益選項。另亦提供 App 內付款 (In-app payments) 的詳細資訊。</dd> -</dl> -</div> - -<div class="section"> -<h2 class="Community" id="Community" name="Community"><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Introduction">發佈 App</a></h2> - -<dl> - <dd>快向世界發佈你的 App。了解應如何讓 Firefox Marketplace 發佈 App,包含 App 提交程序、審查程序、更新程序、了解上架後的效益,並觀看消費者的反應意見。</dd> -</dl> - -<h2 class="Tools" id="Tools" name="Tools">App 開發工具</h2> - -<dl> - <dt><a href="https://developer.mozilla.org/en-US/Marketplace/APIs">Firefox Marketplace 函式庫與 API</a></dt> - <dd>概略了解目前可用的函式庫與 API,為自己在 Marketplace 上的 App 添增功能。</dd> - <dt><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">Firefox OS 的「應用程式管理員 (App Manager)」</a></dt> - <dd>從桌上型電腦為 Open Web App 測試、佈署、除錯的主要工具。</dd> - <dt><a href="https://developer.mozilla.org/en-US/Apps/Tools_and_frameworks/App_developer_tools">App 開發工具</a></dt> - <dd>完整工具清單,可供你有效率的開發 Open Web App 並樂在其中。</dd> -</dl> -</div> -</div> -</div> -</div> - -<h2 id="Subnav">Subnav</h2> - -<ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare">準備發佈 App</a> - - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Introduction">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Deciding_what_to_build">決定所要撰寫的東西</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare_For_Success/Getting_to_know_your_users">了解目標消費者</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Choosing_your_business_model">選擇自己的營運模式</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare_For_Success/Quality_and_your_app">撰寫高品質 App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Localizing_your_apps">當地語系的 App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Promoting_your_app">推銷自己的 App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Creating_your_community">建立自己的群組</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options">發佈選項</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Introduction">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Packaged_apps">封裝式 (Packaged) App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Hosted_apps">托管\架設式 (Hosted) App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Packaged_or_hosted_">要封裝抑或托管?</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_android">適合 Android 的 Open Web App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_desktop">適合桌上型電腦的 Open Web App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing">自行發佈 App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Options/Creating_a_store">建立自己的商城</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization">產生實質收益</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Introduction_Monetization">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Profiting_from_your_app" title="This guide contains introductory materials on how to monetize your apps, including tools needed, and a monetization calculator.">用自己的 App 創造收益</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/App_payments_guide">App 付款指南</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/In-app_payments_section/Introduction_In-app_Payments" title="A guide to implementing support for in-app payments in your Web app.">應用程式內付款 (In-app payments)</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/In-app_payments_section/Introduction_In-app_Payments">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/In-app_payments_section/mozPay_iap">透過 mozPay</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/In-app_payments_section/fxPay_iap">透過 fxPay</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/validating_a_receipt" title="A guide to when—and how—to validate your app's purchase receipt.">驗證收據</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/App_pricing" title="A round up of fixed price points you can choose for your paid apps, and how these vary across different currencies, along with useful supporting information on dealing with app payments.">App 定價表</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Payments_Status" title="An at-a-glance summary of what countries have got our app payment services set up in them — where paid apps can be distributed">付款服務狀態</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing">App 發佈概述</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Introduction">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submission_checklist">提交作業檢查清單</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Marketplace_review_criteria" title="An explanation of the criteria an app must meet in order to be published on the Firefox Marketplace">Marketplace 審查準則</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Adding_a_subdomain" title="For security reasons, each app must have its own domain (or subdomain) on the Web. This article covers how to go about creating a subdomain for your app.">為 App 添增子網域</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines">策略與指南</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Introduction">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Marketplace_screenshot_criteria" title="Some guidelines on how to create an effective screenshot for marketplace submission">Marketplace 截圖準則</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Privacy_policies" title="Your users' privacy is very important, so you need to develop and adhere to a reasonable privacy policy to engender their trust. This article provides a guide to developing privacy policies.">隱私權政策</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Testing_and_troubleshooting">App 測試與疑難排解</a></li> - </ol> - </li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit">提交 App</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Overview">概述</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Sign-in_to_your_developer_account" title="This step-by-step guide will help you successfully submit your app to the Firefox Marketplace.">Step 1:登入</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Load_your_app">Step 2:上傳</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Enter_your_apps_details">Step 3:列出細節</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Next_steps">Step 4:後續步驟</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Rating_Your_Content">Step 5:App 評分</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing">Step 6:制定 App 的價格</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing/Introduction">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing/Payment_Accounts">付款帳戶</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing/Providers/Bango">Bango</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing/Providers/Boku">Boku</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing/Promote_as_upgrade_to_free_version">用「升級」的方式推廣</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Pricing/In-app_products">fxPay 的 App 產品</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Define_your_team">Step 7:定義團隊成員</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/View_your_listing">Step 8:檢視列表</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Edit_other_localizations">Step 9:編輯其他本地化的內容</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Managing_your_apps">管理並更新已發佈的 App</a> - <ol> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Managing_your_apps/Introduction_Managing_your_apps">介紹</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Managing_your_apps/Status___Versions">App 的狀態</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Updating_apps" title="Information about how both hosted and packaged app updates are handled, and what you need to do to ensure that your app properly supports updating.">更新 App</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Managing_your_apps/App_Statistics">App 狀態</a></li> - </ol> - </li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/APIs">函式庫與 API</a></li> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/FAQ">Firefox Marketplace 常見問題</a></li> -</ol> diff --git a/files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html b/files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html deleted file mode 100644 index 372284a029..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/marketplace_apis/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Firefox Marketplace API -slug: Archive/Mozilla/Marketplace/Marketplace_APIs -translation_of: Archive/Mozilla/Marketplace/Marketplace_APIs ---- -<div class="summary"> - <p><span class="seoSummary">提供 Firefox Marketplace API 的主要參考文章,可協助你進行 App 提交作業、設定 App 的付款帳戶,及其他更多相關重要步驟。</span></p> -</div> -<div class="row topicpage-table"> - <div class="section"> - <dl> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/Marketplace_utility_library">Marketplace 公用程式函式庫</a></dt> - <dd> - 可協助你順利進行 Firefox Marketplace 的相關作業。你可將內含的 JavaScript 函式庫用於自己的 App 之內,以輕鬆處理應用程式內付款 (In-app payments) 並驗證付款收據。</dd> - <dt> - <a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/submission.html" title="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/submission.html">Submission API</a></dt> - <dd> - Submission API 可讓你檢驗並更新 App,並在安裝之前提取 App 的可用資訊。</dd> - <dt> - <a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html" title="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html">Payment API</a></dt> - <dd> - Payment API 可讓你取得 In-app payments 的資訊,以及不同國家的訂價情形。</dd> - <dt> - <a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html" title="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html">其他 Marketplace API</a></dt> - <dd> - Firefox Marketplace API 的完整說明文件。</dd> - </dl> - </div> - <div class="section"> - <h5 class="Tools" id="Tools" name="Tools">Tools for app developers</h5> -<ul> - <li><a href="https://marketplace.firefox.com/developers/">Visit Firefox Marketplace Developer Hub</a></li> - <li><a href="/en-US/docs/Mozilla/Firefox_OS/Using_Firefox_OS_Simulator">Firefox OS Simulator</a></li> - <li><a href="/en-US/docs/Apps/App_developer_tools">App developer tools</a></li> -</ul> -<h5 class="Documentation" id="Documentation" name="Documentation">Technology reference documentation</h5> -<div class="twocolumns"> - <ul> - <li><a href="/en-US/docs/Web/CSS">CSS</a></li> - <li><a href="/en-US/docs/DOM">DOM</a></li> - <li><a href="/en-US/docs/Web/HTML">HTML</a></li> - <li><a href="/en-US/docs/JavaScript">JavaScript</a></li> - <li><a href="/en-US/docs/WebAPI">WebAPI</a></li> - <li><a href="/en-US/docs/Web/WebGL">WebGL</a></li> - <li><a href="/en-US/docs/SVG">SVG</a></li> - <li><a href="https://www.mozilla.org/en-US/apps/">Open Web Apps overview site</a></li> - <li><a href="https://wiki.mozilla.org/Apps">Apps project wiki page</a></li> - </ul> -</div> -<h5 class="Community" id="Community" name="Community">Getting help from the community</h5> -<p>If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!</p> -<ul> - <li>Consult the webapps forum: <ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-webapps"> 郵件討論</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.webapps"> 新聞群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.webapps/feeds"> feed 消息來源</a></li> -</ul> - <ul> - <li>Ask your question on the Open Web Apps IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/openwebapps">#openwebapps</a></li> - </ul> - </li> -</ul> -<p><span class="alllinks"><a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="external">Don't forget about the <em>netiquette</em>...</a></span></p> - </div> -</div> -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html deleted file mode 100644 index a1f464f224..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/app_payments_guide/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: 建構付費 App -slug: Archive/Mozilla/Marketplace/Monetization/App_payments_guide -translation_of: Archive/Marketplace/Monetization/App_payments_guide ---- -<div class="summary"> - <p style="margin: 0px 0px 1.286em; padding: 0px; line-height: 1.5em;">Firefox Marketplace 的消費者有兩種需要付款的情形:<br> - 1). 購買 App 需付款 (付費 App)<br> - 2). 在安裝 App 之後另外購買某樣東西需付款;即 App 內付款機制 (In-app payment)<br> - 本文即提供付費 App 所需的程式碼與作業流程,另外將有另一篇文章說明 <a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/In-app_payments">In-app payments</a>。</p> -</div> -<h2 id="選擇封裝方式_(Packaged_或_Hosted)"><strong>選擇封裝方式</strong> (Packaged <strong>或</strong> Hosted)</h2> -<p>在了解付款方式之前,先決定自己的 App 應該是封裝式 (Packaged),或架設/托管式 (Hosted)。如果想處理為封裝式 App,就必須遵守內容安全政策 (Content Security Policy,CSP)。可參閱下列說明以進一步了解。</p> -<ul> - <li><a href="https://developer.mozilla.org/zh-TW/Apps/Developing/Packaged_apps/Packaged_apps">封裝式 App</a>:了解封裝式與架設/托管式 App 之間的不同。其中也初步說明封裝式 App 所需的內容安全政策。</li> - <li><a href="https://wiki.mozilla.org/Apps/Security#Default_CSP_policy">內容安全政策 (CSP)</a>:解釋 CSP 之含意。</li> -</ul> -<h2 id="建構付費_App"><strong>建構付費 A</strong>pp</h2> -<div> - <p>任何 App 都能設定為付費 App,也都能是封裝式或架設/托管式 App;完全不需特別的權限。在將 App 提交到 Firefox Marketplace 時,只要勾選使其成為付費 App 即可。但開發者需讓 App 驗證自己的銷售收據,才能確認收到帳款。接下來就是應進行的步驟。</p> - <h3 id="將_installs_allowed_from_添增到_manifest.webapp"><strong>將</strong> installs_allowed_from <strong>添增到</strong> manifest.webapp</h3> - <p>首先必須將 <code>installs_allowed_from</code> 欄位添增到 <a href="/en-US/Apps/Developing/Manifest">App 的 manifest 檔案</a>中。另給予如下的 Firefox Marketplace 網址:</p> - <pre class="brush: js">"installs_allowed_from": [ "https://marketplace.firefox.com" ]</pre> - <p>這個步驟屬於收據驗證作業的一部分,才能讓系統確認 App 來自於收款的商店。</p> -</div> -<h3 id="驗證收據">驗證收據</h3> -<p>只要從 Marketplace 售出 App 之後,隨即會產生該筆銷售的數位收據。開發者應該為自己的 App 植入程式碼,讓 App 執行時能一併驗證銷售收據。我們強烈建議,但不強制驗證收據。此查核作業可避免消費者安裝了 App 卻未付費。</p> -<p>Mozilla 另負責維護 JavaScript 輔助函式庫 (Helper),即所謂的 <a href="https://github.com/mozilla/receiptverifier" title="https://github.com/mozilla/receiptverifier">receiptverifier</a>,只要少量程式碼即可驗證收據。只要將下列 <code>receiptverifier</code> 函式庫加入 App 即可:</p> -<ul> - <li><a href="https://github.com/mozilla/receiptverifier/blob/master/receiptverifier.js" style="line-height: 1.572;">receiptverifier.js</a></li> - <li><a href="https://github.com/mozilla/receiptverifier/blob/master/receiptverifier-ui.js">receiptverifier-ui.js</a></li> -</ul> -<p>再將下列程式碼加入 App (更改內文以符合自己的 App),即可驗證收據:</p> -<pre class="brush: js" style="font-size: 14px;">mozmarket.receipts.Prompter({ - storeURL: "https://marketplace.firefox.com/app/your-app", - supportHTML: '<a href="mailto:you@yourapp.com">email you@yourapp.com</a>', - verify: true -});</pre> -<p>正常只要啟動 App 就會開始驗證收據。如果確認收據有效,即可釋放 App 的資源;反之可停止 App 執行。</p> -<div class="note"> - <p><strong>注意:</strong>若要進一步建立自己的收據驗證器,可參閱<a href="/en-US/Marketplace/Monetization/Validating_a_receipt">驗證收據</a>。</p> -</div> -<h2 id="另可參閱">另可參閱</h2> -<ul> - <li><a href="https://hacks.mozilla.org/2013/02/building-a-paid-app-for-firefox-os" title="https://hacks.mozilla.org/2013/02/building-a-paid-app-for-firefox-os">建構 Firefox OS 的付費 App</a>:內有更多付費 App 相關資訊的連結。</li> - <li><a href="https://github.com/mozilla/receiptverifier" title="https://github.com/mozilla/receiptverifier">receiptverifier</a> 函式庫:使用上述函式庫的說明文件與範例。</li> - <li><a href="https://wiki.mozilla.org/Apps/WebApplicationReceipt" title="https://wiki.mozilla.org/Apps/WebApplicationReceipt">Web App 收據</a>:數位收據的詳細說明資訊。</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html deleted file mode 100644 index 4d7c3fbc32..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/app_pricing/index.html +++ /dev/null @@ -1,3698 +0,0 @@ ---- -title: 制定 App 的價格 -slug: Archive/Mozilla/Marketplace/Monetization/App_pricing -translation_of: Archive/Marketplace/Monetization/App_pricing ---- -<div class="summary"> -<p>本文將為開發者說明在 Firefox Marketplace 中制定 App 價格與收款的方法。因為開發者可能在 Firefox Marketplace 中跨國制定不同的價格,所以定價方式有點複雜。本文即提供相關資訊,如訂價、拆帳、課稅、付款方式、應收帳款、防止詐騙等等。</p> -</div> - -<h2 id="以「價格點數」定價"><strong>以「價格點數」定價</strong></h2> - -<p>在 Firefox Marketplace 中,開發者必須透過固定的「價格點數 (Price point)」完成定價。開發者可選擇任一價格點數,而該價格點數隨即套用為各地區通用貨幣的等值定價。針對開發者所選定 App 或應用程式內部付費 (In-app Payments) 的販售地區,當地消費者就能透過系統得知 App 的定價。價格點數範圍從 US$0.10 (點數 1) 到 US$49.99 (點數 140)。Firefox Marketplace 中的 App 與 In-app Payments,均適用價格點數的定價方式。</p> - -<p><strong>範例:</strong>若 App 設定為「10」價格點數,則在流通美金的地區就是售價 US$0.99 (未含當地銷售稅);流通歐元的地區就是售價 €0.89 (已含歐洲增值稅)。在哥倫比亞的電信帳單代繳售價為 COP$2060.00 (包含哥倫比亞區的增值稅),信用卡繳款的售價則為 US$0.99。</p> - -<h3 id="價格點數表"><strong>價格點數表</strong></h3> - -<table class="standard-table"> - <thead> - <tr> - <th rowspan="2">Price point</th> - - <th>Austria</th> - - <th>Belgium</th> - - <th>Brazil</th> - - <th>Chile</th> - - <th>Colombia</th> - - <th>Cyprus</th> - - <th>Estonia</th> - - <th>Finland</th> - - <th>France</th> - - <th>Germany</th> - - <th>Greece</th> - - <th>Hungary</th> - - <th>Ireland</th> - - <th>Italy</th> - - <th>Latvia</th> - - <th>Lithuania</th> - - <th>Luxembourg</th> - - <th>Malta</th> - - <th>Mexico</th> - - <th>Netherlands</th> - - <th>Peru</th> - - <th>Poland</th> - - <th>Portugal</th> - - <th>Slovakia</th> - - <th>Slovenia</th> - - <th>Spain</th> - - <th>United Kingdom</th> - - <th>United States</th> - - <th>Uruguay</th> - - <th>Venezuela</th> - - <th>Rest of World</th> - - </tr><tr> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - <th></th> - - </tr> - </thead> - <tbody> - <tr> - <th>VAT/Tax included in price</th> - - <td>unknown</td> - - <td>unknown</td> - - <td>no</td> - - <td>yes&nbsp;(19%)</td> - - <td>yes&nbsp;(16%)</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>yes&nbsp;(19%)</td> - - <td>yes&nbsp;(23%)</td> - - <td>yes&nbsp;(27%)</td> - - <td>unknown</td> - - <td>yes&nbsp;(22%)</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>yes&nbsp;(16%)</td> - - <td>unknown</td> - - <td>yes&nbsp;(18%)</td> - - <td>yes&nbsp;(23%)</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>unknown</td> - - <td>yes&nbsp;(21%)</td> - - <td>yes&nbsp;(20%)</td> - - <td>no</td> - - <td>yes&nbsp;(22%)</td> - - <td>yes&nbsp;(12%)</td> - - <td>no</td> - - </tr> - - - <tr> - <th>Tier 0</th> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - $0 - - </td> - - <td> - - $0 - - </td> - - <td> - - $0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - Ft&nbsp;0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - $0 - - </td> - - <td> - - €0 - - </td> - - <td> - - $0 - - </td> - - <td> - - 0&nbsp;zł - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - €0 - - </td> - - <td> - - £0 - - </td> - - <td> - - $0 - - </td> - - <td> - - $0 - - </td> - - <td> - - $0 - - </td> - - <td> - - $0 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 1</th> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - €0.1 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - €0.1 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - Ft&nbsp;25 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - 0.49&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - </tr> - - <tr> - <th>Tier 5</th> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - €0.25 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - €0.25 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - Ft&nbsp;70 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - $3.75 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - 0.98&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - </tr> - - <tr> - <th>Tier 7</th> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - €0.4 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - €0.4 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - Ft&nbsp;135 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - $7.51 - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - 1.99&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_2" title="Purchase via carrier only">[2]</a></span> - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - <td> - - n/a - - </td> - - </tr> - - <tr> - <th>Tier 10</th> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2060 - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - - </td> - - <td> - - €0.89 - - </td> - - <td> - - Ft&nbsp;270 - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $15 - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 3.99&nbsp;zł - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €0.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £0.75 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $0.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 20</th> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4150 - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - - </td> - - <td> - - €1.89 - - </td> - - <td> - - Ft&nbsp;545 - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $30 - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 7.69&nbsp;zł - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €1.89 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £1.5 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $1.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 30</th> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6240 - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - - </td> - - <td> - - €2.79 - - </td> - - <td> - - Ft&nbsp;820 - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $45 - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 11.59&nbsp;zł - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €2.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £2.25 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $2.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 40</th> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $8320 - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - - </td> - - <td> - - €3.79 - - </td> - - <td> - - Ft&nbsp;1095 - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $60 - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 15.49&nbsp;zł - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €3.79 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £3 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $3.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 50</th> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $10420 - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - - </td> - - <td> - - €4.69 - - </td> - - <td> - - Ft&nbsp;1360 - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $75 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 19.5&nbsp;zł - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €4.69 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £3.75 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $4.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 60</th> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14600 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - - </td> - - <td> - - €6.59 - - </td> - - <td> - - Ft&nbsp;1900 - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $105 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 26.99&nbsp;zł - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €6.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £5.25 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $6.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 70</th> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $20840 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - - </td> - - <td> - - €9.49 - - </td> - - <td> - - Ft&nbsp;2720 - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $150 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 38.79&nbsp;zł - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €9.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £7.5 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $9.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 80</th> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $26070 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - - </td> - - <td> - - €11.59 - - </td> - - <td> - - Ft&nbsp;3400 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $185 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 48.49&nbsp;zł - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €11.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £9.5 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $12.49 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 90</th> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $31280 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - - </td> - - <td> - - €14.19 - - </td> - - <td> - - Ft&nbsp;4080 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $225 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 57.99&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €14.19 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £11.25 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $14.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 100</th> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $41720 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - - </td> - - <td> - - €18.99 - - </td> - - <td> - - Ft&nbsp;5450 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $300 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 77.49&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €18.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £15 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $19.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 110</th> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $52160 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - - </td> - - <td> - - €23.59 - - </td> - - <td> - - Ft&nbsp;6800 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $375 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 96.99&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €23.59 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £18.75 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $24.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - <tr> - <th>Tier 120</th> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $62580 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - - </td> - - <td> - - €28.39 - - </td> - - <td> - - Ft&nbsp;8170 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $450 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - 116.49&nbsp;zł - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - €28.39 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - £22.5 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - <td> - - $29.99 - <span class="footnote"><a href="#pricetable_fn_1" title="Credit card purchase only">[1]</a></span> - - </td> - - </tr> - - - </tbody> - <caption><small>Last updated: 1519101168023.</small></caption> - -</table> -<ul style="list-style-type: none;"> - <li id="pricetable_fn_1">[1] Credit card purchase only.</li> - <li id="pricetable_fn_1">[2] Carrier billing only, no credit card purchase.</li> - -</ul> - -<h2 id="制定自己產品的價格">制定自己產品的價格</h2> - -<p>如果要為自己的 App 或 In-app 產品定價,就必須選擇價格點數與想要銷售的地區。對 App 來說,選擇銷售國家並不會限制其他國家的消費者購買 App,只會決定 App 所將上架的國家 (可能不只一個國家)。即使消費者身處其他國家,只要付款方式亦適用 App 的上架國家,就同樣可購買該 App。</p> - -<h2 id="價格點數表如何運作?"><strong>價格點數表如何運作?</strong></h2> - -<p>Marketplace 將針對各種幣別預先設定匯率,再轉換為美金以外的計價並四捨五入,以更為貼近市場友善的數字。四捨五入的價格與外幣匯率的波動,都代表美金以外的定價不會隨時等值於美金現價。除非需穩定多國換匯之後的相對價格,否則美金以外的定價均將保持不動。Mozilla 也不會刻意常常調整定價,且最快每六個月才會調價一次。價格點數一般均保持在美金定價的 1% ~ 2% 之內。而由於某些國家定價另納入了增值稅,因此可能超出此範圍。</p> - -<h3 id="含稅價與未稅價的價格點數"><strong>含稅價與未稅價的價格點數</strong></h3> - -<p>顯示於不同地區的價格可能含稅或未稅。含稅價代表該價格已含稅 (一般為增值稅,VAT) 並顯示給消費者知道。未稅價則代表稅額 (若有對應稅額) 將另外再加至顯示的價格中。</p> - -<p>各國家與地區的增值稅略有不同,但一般均依照 App 販售國家 (由電信營運商收取) 的增值稅率而定;或是在英國適用增值稅的地區以信用卡付款,則為 20% 增值稅率。一旦消費者確定付款之後,就會根據其付款資訊中登記地區的幣別,或目前所在地區的幣別計算。</p> - -<p>如果消費者所在地區顯示的是未稅價,則當地稅額與費用將再加入 App 售價之中。消費者可能要收到發票,或由銀行/電信營運商寄發對帳單之後,才會看到實際的稅額。</p> - -<h2 id="如何拆帳?"><strong>如何拆帳?</strong></h2> - -<p>在將自己設定為「開發者」的付款帳戶之後,即可選擇往後收款的幣別。目前支援的付款幣別包含美金 ($)、歐元 (€)、英鎊 (£)。若是含稅價格,則開發者在正常情況下會收到「消費者購買 App 金額扣除稅額與特定費用」的 70%。若是未稅價格,則會收到「消費者針對 App 定價表付款」的 70%;應付稅額另再加到消費者實際付款額之中。由於匯率浮動與增殖稅率的差異,各地區的實收金額也有所變動。</p> - -<p>而上述金額的另外 30%,將由 Mozilla、電信營運商、第三方支付供應商拆帳。其內包含商業交易程序的相關交易與服務費用。根據目前既定的分配方式,Mozilla 約將收取 5% ~ 7.5%。</p> - -<div class="note"> -<p>若選用電信帳單代繳方式,則開發者所能收到的款項可能又有差異。請到<a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Payments_Status">付款狀態</a>了解相關細節,進一步了解該國電信營運商的拆帳規定。</p> -</div> - -<h2 id="付款方式:電信帳單代繳與信用卡"><strong>付款方式:電信帳單代繳與信用卡</strong></h2> - -<p>透過 Firefox Marketplace 販售自己 App 的絕佳優點之一,就是能直接讓消費者透過行動電話帳單付款。對信用卡尚未普及的新興市場而言,此特色絕對是目前行動付款的重要媒介。</p> - -<p>目前為止,電信營運商必須與 Mozilla 簽訂合約之後,才能在所屬地區提供電信帳單代繳的服務。消費者必須申請該電信營運商的 SIM 卡並預繳特定金額,以順利支付 App 或 In-app Payment 的款項。當然,消費者亦可透過信用卡購買 App。</p> - -<p>針對客戶透過自己行動電話號碼付費的機制,某些電信營運商另設有最低與最高額度,而且各家營運商均有不同。若 App 定價超出該額度,則款項預設轉為信用卡支付;但又並非所有消費者均擁有信用卡。又有些地區並無法和營運商值接建立帳單服務,而必須透過信用卡付款,如此就限定需以美金、歐元、英鎊購買 App。</p> - -<div class="note"> -<p><strong>注意:</strong>針對信用卡部分,目前最低收費款項為 10 價格點數 (即美金 $0.99 元整);而最高款項為美金 $30.00 元整。接受 Visa® 與 MasterCard® 信用卡。</p> -</div> - -<h2 id="慎防詐騙"><strong>慎防詐騙</strong></h2> - -<p>第三方支付供應商應已有多種防止詐騙的方式。為了減少詐騙行為,目前僅限消費者實際所在地銀行發行的信用卡,才能用以支付 App 購買款項。因此,消費者若持巴西境內銀行所發行的信用卡,就只能在巴西國內使用該信用卡,而不能跑到哥倫比亞境內購買 App。</p> - -<h2 id="取得自己的收益:設定收款帳戶"><strong>取得自己的收益:設定收款帳戶</strong></h2> - -<p>開發者若要能確實收到自己 App 或 In-app Payments 所創造的營收,必須先針對自己所選擇的 App 販售地區,開好當地支付供應商所提供的帳戶。各家支付供應商都具備服務條款,與 Mozilla 的服務條款不盡相同。開發者必須同意供應商的條款之後,才能透過 Firefox Marketplace 銷售自己的 App 或取得 In-app Payments 款項。</p> - -<p>你也可在 Firefox Marketplace 中設定開發者的收款帳戶。先找到 App 的「Compatibility & Payments」之後,針對你所選擇的販售地區新增收款帳戶即可。</p> - -<div class="note"> -<p><strong>注意:</strong>Bango 則是 Firefox Marketplace 的支付供應商。</p> -</div> - -<h2 id="收取屬於自己的款項"><strong>收取屬於自己的款項</strong></h2> - -<p>開發者可直接與支付供應商往來,以順利取得屬於自己的款項。你會收到「自行對帳發票 (Self Billing Invoice,SBI)」,其中將列舉開發者銷售總額、消費者退費總額、開發者實際收取總額。若你的 App 販售地區可退增值稅,則總額也將包含增值稅額。</p> - -<p>你可透過自己在 Firefox Marketplace 中的開發者帳戶,找到支付供應商的付款入口網頁。由於各國電信營運商入帳時程各有不同,且消費法規也可能影響退款速度,所以帳戶的收款條件與時程也有所差異。請自行了解第三方支付供應商的相關條件與說明。</p> - -<h2 id="稅額"><strong>稅額</strong></h2> - -<p>本章節將說明銷售稅的處理方式。</p> - -<h3 id="增值稅_(Value_Added_Tax,VAT)"><strong>增值稅 (Value Added Tax,</strong>VAT<strong>)</strong></h3> - -<p>Bango 可針對當地的稅捐機關,處理增值稅 (VAT) 的退稅問題。根據各個國家與地區的法律規定,相關徵稅與退稅的條件均有不同。開發者可向會計師或稅捐機關諮詢。而自行對帳發票 (SBI) 將根據增值稅稅前金額,開立發票給 Bango。開發者到時候觀看支付清單即可了解運作情形。如果開發者身處不屬於「販售者需支付增值稅」的地區,則應該會收到當地稅捐機關的退稅。相關細節請向會計師諮詢。</p> - -<h3 id="預扣稅額與換匯費用"><strong>預扣稅額與換匯費用</strong></h3> - -<p>Bango 可支付美金 ($)、歐元 (€)、英鎊 (£),讓開發者自行選擇適合的幣別。Bango 可能會因法條規範,為開發者預扣或繳付當地稅額,因此會從支付帳款中扣除應付稅額。各國的預扣稅率均不相同,也可能必須支付換匯費用。在將當地貨幣換成等值的美金、歐元、英鎊時,就可能產生 1.9% ~ 2.5% 的換匯費用。這項費用對開發者並不友善,而 Mozilla 也正研究是否有替代方案。</p> - -<h2 id="開發者的收益"><strong>開發者的收益</strong></h2> - -<p>因所在國家、當地貨幣、付款方式的不同,開發者販售 App 所獲得的收益也有所差異。可參閱<a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Payments_Status">付款狀態</a>以進一步了解各國的付款細節。</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html deleted file mode 100644 index 35e3fe4117..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/in-app_payments/index.html +++ /dev/null @@ -1,332 +0,0 @@ ---- -title: 應用程式內部付費 (In-app payments) -slug: Archive/Mozilla/Marketplace/Monetization/In-app_payments -translation_of: Archive/Marketplace/Monetization/In-app_payments_section/mozPay_iap ---- -<div class="summary"> - <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay">navigator.mozPay</a> API 可讓網頁內容執行數位貨品的付款作業,並能接收由付款服務商所傳來的購買確認訊息。我們也針對此 API 建構了 <a href="https://wiki.mozilla.org/WebAPI/WebPaymentProvider">Web 付款服務商</a>,讓你能取得數位貨品的款項。本文將說明該如何使用<span class="seoSummary"> <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay">navigator.mozPay</a> API 與 <a href="https://wiki.mozilla.org/WebAPI/WebPaymentProvider">Web 付款服務商</a>的服務,以達到應用程式內付款 (In-app payments)。</span></p> - <div class="note"> - <p>另外現正開發「<a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/In-app_payments_section/fxPay_iap">fxPay</a>」付款處理機制。FxPay 不會要求開發者必須架設伺服器以進行購買行為驗證,可算是更完整的付款方式。</p> - </div> -</div> -<h2 id="In-app_payments_概述">In-app payments 概述</h2> -<p>讓你為自己的 App 添加 In-app payments 機制,與其運作的方法:</p> -<ul> - <li>登入 <a href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心 (Developer Hub)。</a></li> - <li><a href="https://marketplace.firefox.com/developers/submit/">上傳 App</a>、將 App 設定為 Paid 或 In-app 付款、產生應用程式金鑰 (Application Key) 與應用程式安全金鑰 (Application Secret)。</li> - <li>App 將透過上述的安全金鑰 (Secret) 簽署 <a href="http://openid.net/specs/draft-jones-json-web-token-07.html">JWT</a> 請求,並呼叫 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay"><code>navigator.mozPay(...)</code></a> 而開始付款作業</li> - <li>系統將另開一個特殊視窗執行付款流程 - <ul> - <li>消費者若尚未登入,則以 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Persona">Mozilla Persona</a> 登入</li> - <li>消費者輸入自己的 PIN 碼</li> - <li>消費者透過電信帳單或信用卡付費</li> - </ul> - </li> - <li>消費者關閉視窗之後,你的 App 就會收到 JavaScript 回呼 (Callback)</li> - <li>你的 App <strong>伺服器</strong>將接收已簽署的 POST 請求,內含的 Mozilla 交易 ID 將指出已成功完成購買程序</li> - <li>所得金額將直接匯入你的銀行帳戶</li> -</ul> -<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay"><code>navigator.mozPay</code></a> API 目前限用於 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS">Firefox OS</a>。你同樣可透過 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">Firefox OS 應用程式管理員 (App Manager)</a> 測試此 API。</p> -<div class="note"> - <p><strong>注意:</strong>如果是在 Firefox OS 1.2 裝置上測試,只要該裝置內並無 SIM 卡,則 <code>mozPay</code> 呼叫將失敗。但消費者只要裝入 SIM 卡就可解決此問題。目前市面上販售的 Firefox OS 裝置均未安裝 Firefox 1.2。若要進一步了解,可參閱 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=989022">bug 989022</a>。</p> -</div> -<h2 id="逐步設定_In-app_payment">逐步設定 In-app payment</h2> -<p>接著說明該如何設定 In-app payment。</p> -<h3 id="取得測試用的付款金鑰_(Payment_Key)"><strong>取得測試用的付款金鑰 (Payment Key)</strong></h3> -<p>在登入至 <a href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心</a>時,可前往 <a href="https://marketplace.firefox.com/developers/in-app-keys/">In-App Payment Keys</a> 頁面取得應用程式金鑰與安全金鑰以利測試。雖然金鑰只能讓你<strong>模擬</strong> In-app payments,但已足以因應相關測試。在將自己的 App 提交至 Marketplace 審核之前,應該先多嘗試相關模擬。請參閱付款模擬的相關說明。</p> -<h3 id="取得真正的付款金鑰"><strong>取得真正的付款金鑰</strong></h3> -<p>在將自己的 App 提交至 <a href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心</a>時, 系統將要求你設定付款條件。此時請選擇 App 的價格 (你也可能想免費提供),接著勾選你接受 In-app payments 的選項。在設定自己的銀行帳戶之後,前往「Manage In-App Payments」頁面取得應用程式金鑰與安全金鑰,才能執行真正的付款作業。</p> -<p>透過隱私設定或類似檔案,可在自己的 App 伺服器中儲存應用程式安全金鑰。</p> -<div class="note"> - <strong>重要:</strong>請確認沒有任何人可讀取你的應用程式安全金鑰。絕對不要在用戶端披露該項資訊。</div> -<h3 id="設定_App"><strong>設定 A</strong>pp</h3> -<p>先假設你在設計某個 <a href="https://developer.mozilla.org/en-US/docs/Web/Apps">Open Web App </a>的冒險遊戲,而你想販售「魔力獨角獸」物品,讓玩家能擁有遊戲優勢。你可設定美金 $1.99、歐元 €1.89,或任何幣值均可。接著將說明該如何設定後端伺服器,並撰寫前端程式碼而透過 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay">navigator.mozPay</a> 銷售產品。</p> -<h3 id="設定自己的伺服器以簽署_JWT"><strong>設定自己的伺服器以簽署</strong> JWT</h3> -<p>因為用來簽署的應用程式安全金鑰絕對不能公開,所以你必須在伺服端簽署 <a href="http://openid.net/specs/draft-jones-json-web-token-07.html">JSON Web Tokens (JWTs)</a>;而非用戶端。回到剛剛冒險遊戲要賣魔力獨角獸的例子,你要在自己的伺服器上建立如 <code>/sign-jwt</code> 的網址。如此可建立 JSON 物件以定義產品名稱、定價等。可參閱 <a href="https://wiki.mozilla.org/WebAPI/WebPayment">Web Payment API 規格</a>以了解完整的 JWT 格式。範例如下:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"iss"</span><span class="token punctuation">:</span> APPLICATION_KEY<span class="token punctuation">,</span> - <span class="token string">"aud"</span><span class="token punctuation">:</span> <span class="token string">"marketplace.firefox.com"</span><span class="token punctuation">,</span> - <span class="token string">"typ"</span><span class="token punctuation">:</span> <span class="token string">"mozilla/payments/pay/v1"</span><span class="token punctuation">,</span> - <span class="token string">"iat"</span><span class="token punctuation">:</span> <span class="token number">1337357297</span><span class="token punctuation">,</span> - <span class="token string">"exp"</span><span class="token punctuation">:</span> <span class="token number">1337360897</span><span class="token punctuation">,</span> - <span class="token string">"request"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">"915c07fc-87df-46e5-9513-45cb6e504e39"</span><span class="token punctuation">,</span> - <span class="token string">"pricePoint"</span><span class="token punctuation">:</span> <span class="token number">10</span><span class="token punctuation">,</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magical Unicorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game item"</span><span class="token punctuation">,</span> - <span class="token string">"icons"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"64"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-64.png"</span><span class="token punctuation">,</span> - <span class="token string">"128"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-128.png"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"productData"</span><span class="token punctuation">:</span> <span class="token string">"user_id=1234&my_session_id=XYZ"</span><span class="token punctuation">,</span> - <span class="token string">"postbackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/postback"</span><span class="token punctuation">,</span> - <span class="token string">"chargebackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/chargeback"</span><span class="token punctuation">,</span> - <span class="token string">"defaultLocale"</span><span class="token punctuation">:</span> <span class="token string">"en"</span><span class="token punctuation">,</span> - <span class="token string">"locales"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"de"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magisches Einhorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game Artikel"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p><a href="https://wiki.mozilla.org/WebAPI/WebPayment">Web Payment API 規格</a>將詳細解釋格式。此處列出幾個重點:</p> -<ul> - <li><code>iss</code> (issuer) 將對應你從 <a href="http://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心</a>所取得的 App 金鑰。</li> - <li><code>aud</code> (audience) 應設定為 <code>marketplace.firefox.com</code>。</li> - <li><code>request.id</code> 均專屬對應至你的各個 App 產品。</li> - <li>在購買當下,<code>request.pricePoint</code> 將展開為價格與幣別。你必須將之設定為有效的<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Publishing/App_pricing#Pricing_with_price_points" title="/en-US/docs/Web/Apps/Publishing/App_pricing#Pricing_with_price_points">價格點數</a>。</li> - <li><code>request.productData </code><code>最多</code><code>可容納 255 個字元的字串。當你接收到回傳的</code> postback 時,可讓你核對 App 的狀態。</li> - <li><code>request.postbackURL</code> 與 <code>request.chargebackURL</code> 需指向你伺服器網址的有效、絕對路徑。在 Mozilla 正式上線的服務環境中,網址均必須是 HTTPS。</li> - <li><code>request.icons</code> 物件 (選填) 是你販售商品的圖示網址,其值為寬/高像素值 (圖像需為正方形)。Mozilla 的付款服務商將於付款確認頁面上使用你的 64 像素圖像。若你並未指定 64 像素的圖像,則將依照字型取得最大的圖示並將之縮放。針對首次購買該 App 的消費者,則由付款服務商在背景取得圖示,所以消費者不會立刻看到圖示。若你變更圖示,則將於 24 小時之內顯示新圖示。</li> - <li><code>request.defaultLocale</code> 將敘述 In-app 產品目前的語言。除非必須定義 <code>locales</code> ,否則此亦為選填物件。</li> - <li><code>request.locales</code> 物件 (選填) 將對應一或多個地區而重新定義 In-app 產品所內含的資料,且此處 UI 將根據存取裝置的語言而提供翻譯過的內容。舉例來說,如果有義大利消費者安裝了你的 App,你應該也想提供義大利文的 UI 介面。各個地區語言的輸入項均已鍵入語言標籤 (<a href="http://www.ietf.org/rfc/rfc4646.txt">RFC 4646</a>) ,並包含你所要取代的標籤。你可以只重新定義 <code>name</code> 與 <code>description</code> 就好。但若定義了 <code>locales</code> 也就必須定義 <code>defaultLocale</code>。</li> -</ul> -<p>在 Python (使用 <a href="https://github.com/progrium/pyjwt">PyJWT</a>) 程式碼中,你可簽署並編碼上述的請求路徑如下:</p> -<pre class="brush: python language-html"><code class="language-python">import jwt -signed_request = jwt.encode(request_dict, application_secret, algorithm='HS256')</code></pre> -<p>此程式碼將為 JWT (使用應用程式安全金鑰) 進行簽章,並使用 HMAC SHA 256 演算法。在編碼過後就如下列:</p> -<pre class="language-html"><code class="language-html">eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.IntcImF1ZFwiOiBcIm1hcmtldHBsYWNlLm1vemlsbGEub3JnXCIsIFwiaXNzXCI6IFwiQVBQLTEyM1wiLCBcInJlcXVlc3RcIjoge1wiY3VycmVuY3lcIjogXCJVU0RcIiwgXCJwcmljZVwiOiBcIjAuOTlcIiwgXCJuYW1lXCI6IFwiVmlydHVhbCAzRCBHbGFzc2VzXCIsIFwicHJvZHVjdGRhdGFcIjogXCJBQkMxMjNfREVGNDU2X0dISV83ODkuWFlaXCIsIFwiZGVzY3JpcHRpb25cIjogXCJWaXJ0dWFsIDNEIEdsYXNzZXNcIn0sIFwiZXhwXCI6IFwiMjAxMi0wMy0yMVQxMTowOTo1Ni43NTMxNDFcIiwgXCJpYXRcIjogXCIyMDEyLTAzLTIxVDEwOjA5OjU2LjgxMDQyMFwiLCBcInR5cFwiOiBcIm1vemlsbGEvcGF5bWVudHMvcGF5L3YxXCJ9Ig.vl4E31_5H3t5H_mM8XA69DqypCqdACVKFy3kXz9EmTI</code></pre> -<p>如上面章節所述,在 JWT 經過編碼/簽章之後,即可透過其用戶端碼而供你的 App 所使用。</p> -<h3 id="設定購買按鈕">設定購買按鈕</h3> -<p>現在你已經有後端可為自己的產品產生 JWT 了。接著透過 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay"><code>navigator.mozPay</code></a> 提供前端程式碼的撰寫範例。請確實在自己的 App 中提供按鈕,以利消費者購買產品。例如:</p> -<pre class="brush: html language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>button</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>purchase<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Purchase Magical Unicorn<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>button</span><span class="token punctuation">></span></span></code></pre> -<p>點選購買按鈕之後,你的 App 應會簽署 <a href="http://openid.net/specs/draft-jones-json-web-token-07.html">JSON Web Token (JWT)</a> 並呼叫 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay"><code>navigator.mozPay</code></a>。下列為 <a href="http://jquery.com/">jQuery</a> 使用範例:</p> -<pre class="brush: js language-js"><code class="language-js">$<span class="token punctuation">(</span><span class="token string">'#purchase button'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click<span class="token punctuation">(</span></span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token comment"> // The purchase is now pending... -</span> $<span class="token punctuation">.</span><span class="token function">post<span class="token punctuation">(</span></span><span class="token string">'/sign-jwt'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> - <span class="token punctuation">.</span><span class="token function">done<span class="token punctuation">(</span></span><span class="token keyword">function</span><span class="token punctuation">(</span>signedJWT<span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token keyword">var</span> request <span class="token operator">=</span> navigator<span class="token punctuation">.</span><span class="token function">mozPay<span class="token punctuation">(</span></span><span class="token punctuation">[</span>signedJWT<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> - request<span class="token punctuation">.</span>onsuccess <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token function">waitForPostback<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span><span class="token punctuation">;</span> - request<span class="token punctuation">.</span>onerror <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - console<span class="token punctuation">.</span><span class="token function">log<span class="token punctuation">(</span></span><span class="token string">'navigator.mozPay() error: '</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span>error<span class="token punctuation">.</span>name<span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span><span class="token punctuation">)</span> - <span class="token punctuation">.</span><span class="token function">fail<span class="token punctuation">(</span></span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - console<span class="token punctuation">.</span><span class="token function">error<span class="token punctuation">(</span></span><span class="token string">'Ajax post to /sign-jwt failed'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> -<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> - -<span class="token keyword">function</span> <span class="token function">waitForPostback<span class="token punctuation">(</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token comment"> // Poll your server until you receive a postback with a JWT. -</span> <span class="token comment"> // If the JWT signature is valid then you can dispurse the Magical Unicorn -</span> <span class="token comment"> // product to your customer. -</span> <span class="token comment"> // For bonus points, use Web Sockets :) -</span><span class="token punctuation">}</span></code></pre> -<p>上列程式碼將送出 Ajax 請求至你伺服器上的 <code>/sign-jwt</code> 網址。該網址所簽署的 JSON blob 將包含產品/價格資訊,並以純文字檔回傳 JWT。而 Ajax 處理器 (Handler) 將傳送該 JWT 進入 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay"><code>navigator.mozPay</code></a> 並等待,直到付款服務商將購買確認訊息送至你的伺服器上。若送過來的 JWT 簽章通過驗證為有效,你就可將虛擬商品交付給消費者。</p> -<h3 id="於伺服器上處理_Postback"><strong>於伺服器上處理</strong> Postback</h3> -<p>在正式販售出出自己的 App 產品之前,必須先等待 Marketplace 回傳購買確認訊息;此及所謂的「Postback」。此由 <code>marketplace.firefox.com</code> 傳送出「POST」確認通知 (即 1 組 <a href="http://openid.net/specs/draft-jones-json-web-token-07.html">JWT</a>),至原始付款請求所指定的 <code>request.postbackURL</code>。</p> -<p>而此「POST」具備 <code>application/x-www-form-urlencoded</code> 的 <code>Content-Type</code>,且亦可於 <strong><code>notice</code></strong> 參數中找到此 JWT。在你的伺服器框架中,你可透過如 <strong>request.POST['notice']</strong> 來存取此 JWT。</p> -<p>此 JWT 通知具備所有的付款請求欄位與 1 組交易 ID,並以 <a href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心</a>取得的應用程式安全金鑰而完成簽章。當你收到 Postback 並驗證簽章之後,隨即完成購買程序。若你無法辨別 JWT 的簽章,就可能不是 Marketplace 所傳送的 JWT,你可逕行忽略。</p> -<p><a href="https://wiki.mozilla.org/WebAPI/WebPayment">Web Payment API 規格</a>即解釋了 Postback 的細節。Postback 內含原始請求,且添增的新反應參數亦包含 Mozilla 的特定交易 ID。範例如下:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"iss"</span><span class="token punctuation">:</span> <span class="token string">"marketplace.firefox.com"</span><span class="token punctuation">,</span> - <span class="token string">"aud"</span><span class="token punctuation">:</span> APPLICATION_KEY<span class="token punctuation">,</span> - <span class="token string">"typ"</span><span class="token punctuation">:</span> <span class="token string">"mozilla/payments/pay/postback/v1"</span><span class="token punctuation">,</span> - <span class="token string">"exp"</span><span class="token punctuation">:</span> <span class="token number">1337370900</span><span class="token punctuation">,</span> - <span class="token string">"iat"</span><span class="token punctuation">:</span> <span class="token number">1337360900</span><span class="token punctuation">,</span> - <span class="token string">"request"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">"915c07fc-87df-46e5-9513-45cb6e504e39"</span><span class="token punctuation">,</span> - <span class="token string">"pricePoint"</span><span class="token punctuation">:</span> <span class="token number">10</span><span class="token punctuation">,</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magical Unicorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game item"</span><span class="token punctuation">,</span> - <span class="token string">"icons"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"64"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-64.png"</span><span class="token punctuation">,</span> - <span class="token string">"128"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-128.png"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"productData"</span><span class="token punctuation">:</span> <span class="token string">"user_id=1234&my_session_id=XYZ"</span><span class="token punctuation">,</span> - <span class="token string">"postbackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/postback"</span><span class="token punctuation">,</span> - <span class="token string">"chargebackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/chargeback"</span><span class="token punctuation">,</span> - <span class="token string">"defaultLocale"</span><span class="token punctuation">:</span> <span class="token string">"en"</span><span class="token punctuation">,</span> - <span class="token string">"locales"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"de"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magisches Einhorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game Artikel"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"response"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"transactionID"</span><span class="token punctuation">:</span> <span class="token string">"webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9"</span><span class="token punctuation">,</span> - <span class="token string">"price"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token string">"amount"</span><span class="token punctuation">:</span> <span class="token string">"0.99"</span><span class="token punctuation">,</span> <span class="token string">"currency"</span><span class="token punctuation">:</span> <span class="token string">"CAD"</span><span class="token punctuation">}</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p>列出 Postback 的幾項重點:</p> -<ul> - <li>必將納入你的原始付款請求。</li> - <li><code>iss</code> (issuer) 必為 marketplace.firefox.com。</li> - <li><code>aud</code> (audience) 設定為你的應用程式金鑰。</li> - <li>以你的應用程式安全金鑰簽署 JWT。</li> - <li><code>response.transactionID</code> 專屬於 Mozilla 的 <a href="https://github.com/mozilla/webpay">Web Payment Provider。</a></li> - <li><code>response.price </code>則為客戶實際使用的金額與幣別。</li> -</ul> -<h3 id="回應_Postback">回應 Postback</h3> -<p>App 必須透過純文字的 HTTP 回應 (其內僅含交易 ID),對 Postback 做出回應。例如:</p> -<pre class="language-html"><code class="language-html">HTTP/1.1 200 OK -Content-Type: text/plain - -webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9</code></pre> -<h3 id="於伺服器上處理_Chargeback"><strong>於伺服器上處理</strong> Chargeback</h3> -<p>如果交易過程發生問題 (如消費者帳戶的餘額不足),則 Marketplace 將傳送退款通知 (即 POST 過的 <a href="http://openid.net/specs/draft-jones-json-web-token-07.html">JWT</a>)。Chargeback 與 Postback 同樣都會傳送到 App,但 Chargeback 送達的時間較晚。該 POST 具備 <code>application/x-www-form-urlencoded</code> 的 <code>Content-Type</code>,且可於 <code>notice</code> 參數中找到該 JWT。下列為解碼後的 Chargeback 通知範例:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"iss"</span><span class="token punctuation">:</span> <span class="token string">"marketplace.firefox.com"</span><span class="token punctuation">,</span> - <span class="token string">"aud"</span><span class="token punctuation">:</span> APPLICATION_KEY<span class="token punctuation">,</span> - <span class="token string">"typ"</span><span class="token punctuation">:</span> <span class="token string">"mozilla/payments/pay/chargeback/v1"</span><span class="token punctuation">,</span> - <span class="token string">"exp"</span><span class="token punctuation">:</span> <span class="token number">1337370900</span><span class="token punctuation">,</span> - <span class="token string">"iat"</span><span class="token punctuation">:</span> <span class="token number">1337360900</span><span class="token punctuation">,</span> - <span class="token string">"request"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">"915c07fc-87df-46e5-9513-45cb6e504e39"</span><span class="token punctuation">,</span> - <span class="token string">"pricePoint"</span><span class="token punctuation">:</span> <span class="token number">10</span><span class="token punctuation">,</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magical Unicorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game item"</span><span class="token punctuation">,</span> - <span class="token string">"icons"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"64"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-64.png"</span><span class="token punctuation">,</span> - <span class="token string">"128"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-128.png"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"productData"</span><span class="token punctuation">:</span> <span class="token string">"user_id=1234&my_session_id=XYZ"</span><span class="token punctuation">,</span> - <span class="token string">"postbackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/postback"</span><span class="token punctuation">,</span> - <span class="token string">"chargebackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/chargeback"</span><span class="token punctuation">,</span> - <span class="token string">"defaultLocale"</span><span class="token punctuation">:</span> <span class="token string">"en"</span><span class="token punctuation">,</span> - <span class="token string">"locales"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"de"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magisches Einhorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game Artikel"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"response"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"transactionID"</span><span class="token punctuation">:</span> <span class="token string">"webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9"</span><span class="token punctuation">,</span> - <span class="token string">"reason"</span><span class="token punctuation">:</span> <span class="token string">"refund"</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p>此 JWT 和 Postback 類似,可於 <a href="https://wiki.mozilla.org/WebAPI/WebPayment">Web Payment API 規格</a>中參閱其定義細節。此處列出幾項重點:</p> -<ul> - <li>必納入原始付款請求。</li> - <li><code>iss</code> (issuer) 必為 <code>marketplace.firefox.com</code>。</li> - <li><code>aud</code> (audience) 需設為你的應用程式金鑰。</li> - <li>JWT 需以你的應用程式安全金鑰完成簽章。</li> - <li><code>response.transactionID</code> 專屬於 Mozilla 的 Web Payment Provider。</li> - <li><code>response.reason</code> 必設為 <code>refund</code> 或 <code>reversal。</code> - <ul> - <li><code>refund</code> 代表已根據消費者或管理員的要求而退回款項。</li> - <li><code>reversal</code>代表消費者要求信用卡發卡銀行取消交易。在爭議款項發生時,消費者亦可能透過信用卡公司取消交易。</li> - </ul> - </li> -</ul> -<div class="note"> - <p><strong>注意:</strong>目前 in-app payments 尚未支援退款作業。</p> -</div> -<p>App 必須透過純文字的 HTTP 回應 (其內僅含交易 ID),對 Chargeback 做出回應。舉例來說:</p> -<pre class="language-html"><code class="language-html">HTTP/1.1 200 OK -Content-Type: text/plain - -webpay:84294ec6-7352-4dc7-90fd-3d3dd36377e9</code></pre> -<h3 id="Postbackchargeback_錯誤">Postback/chargeback 錯誤</h3> -<p>若 App 伺服器是以不成功的狀態碼回應 HTTP 請求,則 Mozilla 的 Web Payment Provider 將重新嘗試 URL 數次。若仍未能接收成功回應,則 App 開發者就會收到通知,且該 App 將暫時停用。若 App 伺服器未能以交易 ID 回應 Postback 或 Chargeback,就會將該伺服器處理為錯誤並會重新嘗試。</p> -<h3 id="使用_HTTPS_Postbackchargeback_網址">使用 HTTPS Postback/chargeback 網址</h3> -<p>於正式環境中執行 App 時,可依需要而嘗試使用安全的 HTTPS 網址。如此一來,在將 Postbacks 從 Mozilla 伺服器傳輸至自己的 App 伺服器時,可避免 Postback 資料遭他人讀取。目前並未強制使用 HTTPS 來保護付款請求,其實 JWT 簽章即可達到相同效果。</p> -<div class="warning"> - <p><strong><strong>注意:</strong></strong>若你並未使用安全的 HTTPS Postback 網址,則請確認自己的付款請求<strong><strong><strong>並未包含個人識別資訊</strong></strong></strong>,以免遭第三方所攔截。舉例來說<strong><strong>,需確認自己的</strong></strong> <em>productData</em> 值並未揭露任何高敏感性的使用者資料。Mozilla 預設的付款請求亦未包含任何個人識別資訊。</p> -</div> -<h3 id="Postbackchargeback_IP">Postback/chargeback IP</h3> -<p>如果你依照上述方式而確實檢查了 JWT 簽章,就不需為 Firefox Marketplace 伺服器 (傳送 postback/chargeback 通知給你) 的 IP 設定許可清單。但如果你想再另加額外保險 (例如防止鍵盤側錄),則 Marketplace 也能從下列 IP 位址寄發 postback/chargeback 通知給你。只要這些 IP 位址變更,都會發佈到 <a href="https://lists.mozilla.org/listinfo/dev-marketplace">dev-marketplace 郵件群組</a>之中。</p> -<pre class="language-html"><code class="language-html">63.245.216.100</code></pre> -<h3 id="模擬付款">模擬付款</h3> -<p>上面的「概述」部分提到,你可從 <a href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心</a>取得特殊的應用程式金鑰 (Application Key) 與應用程式安全金鑰 (Application Secret),進而模擬 In-app payments。而這個安全金鑰亦可簽署如下的客製 JWT:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"iss"</span><span class="token punctuation">:</span> APPLICATION_KEY<span class="token punctuation">,</span> - <span class="token string">"aud"</span><span class="token punctuation">:</span> <span class="token string">"marketplace.firefox.com"</span><span class="token punctuation">,</span> - <span class="token string">"typ"</span><span class="token punctuation">:</span> <span class="token string">"mozilla/payments/pay/v1"</span><span class="token punctuation">,</span> - <span class="token string">"iat"</span><span class="token punctuation">:</span> <span class="token number">1337357297</span><span class="token punctuation">,</span> - <span class="token string">"exp"</span><span class="token punctuation">:</span> <span class="token number">1337360897</span><span class="token punctuation">,</span> - <span class="token string">"request"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">"915c07fc-87df-46e5-9513-45cb6e504e39"</span><span class="token punctuation">,</span> - <span class="token string">"pricePoint"</span><span class="token punctuation">:</span> <span class="token number">10</span><span class="token punctuation">,</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Magical Unicorn"</span><span class="token punctuation">,</span> - <span class="token string">"description"</span><span class="token punctuation">:</span> <span class="token string">"Adventure Game item"</span><span class="token punctuation">,</span> - <span class="token string">"icons"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"64"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-64.png"</span><span class="token punctuation">,</span> - <span class="token string">"128"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/img/icon-128.png"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"productData"</span><span class="token punctuation">:</span> <span class="token string">"user_id=1234&my_session_id=XYZ"</span><span class="token punctuation">,</span> - <span class="token string">"postbackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/postback"</span><span class="token punctuation">,</span> - <span class="token string">"chargebackURL"</span><span class="token punctuation">:</span> <span class="token string">"https://yourapp.com/payments/chargeback"</span><span class="token punctuation">,</span> - <span class="token string">"simulate"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"result"</span><span class="token punctuation">:</span> <span class="token string">"postback"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p>額外的 <code>request.simulate</code> 屬性可要求 Payment Provider 模擬相關結果,而不會真正收費。使用者介面亦不會要求登入或 PIN 碼。在開發 App 時,可透過此屬性而確認「購買」鈕已正確掛上 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay">navigator.mozPay</a>,且自己的伺服器可正確運作 Postbacks 與 Chargebacks 的網址。</p> -<p>下列範例將模擬 1 筆成功的購買作業,並傳送簽署過的通知至你的 Postback 網址:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> - <span class="token string">"request"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> - <span class="token string">"simulate"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"result"</span><span class="token punctuation">:</span> <span class="token string">"postback"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p>下列則模擬 1 筆 Chargeback 退款:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> - <span class="token string">"request"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> - <span class="token string">"simulate"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"result"</span><span class="token punctuation">:</span> <span class="token string">"chargeback"</span><span class="token punctuation">,</span> - <span class="token string">"reason"</span><span class="token punctuation">:</span> <span class="token string">"refund"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p>將如同真正的購買作業一般,將有 1 筆 JWT 通知傳送到你的處理器,但不會有隨機產生的 transactionID。模擬作業亦可使用 non-HTTPS 網址。</p> -<div class="note"> - <p><strong>注意:</strong>模擬的付款 JWT 不該用於正式的服務環境中,否則你的消費者將免費取得產品。</p> -</div> -<h2 id="除錯">除錯</h2> -<p>如果你並未正確使用 in-app payment API,則付款畫面將顯示錯誤訊息,以協助使用者進行後續步驟。付款畫面亦將提供錯誤程式碼,協助開發者找出相關錯誤。你可透過 Mozilla 的 <a href="https://webpay.readthedocs.org/en/latest/services.html#error-legend">Error Legend API</a>,在自己慣用的程式語言中觀看錯誤代碼。舉例來說,錯誤代碼 <code>INVALID_JWT</code> 即表示 JWT 簽章無效,或 JWT 格式混亂。</p> -<h2 id="保護應用程式安全金鑰"><strong>保護應用程式安全金鑰</strong></h2> -<div class="warning"> - <p><strong><strong>警告:</strong></strong>請確認沒有任何人可讀取你的應用程式安全金鑰。<strong>絕對不要在用戶端披露該項資訊</strong>。</p> -</div> -<h3 id="撤銷遭盜用的應用程式安全金鑰"><strong>撤銷遭盜用的應用程式安全金鑰</strong></h3> -<p>雖然遭盜用的機率極低,但你的安全金鑰仍可能外洩或遭盜用,這時應儘快進行下列撤銷步驟:</p> -<ol> - <li>登入 <a href="https://marketplace.mozilla.org/">Firefox Marketplace</a>。</li> - <li>前往「My Submissions」並找到自己的 App。</li> - <li>前往「Manage In-App Payments」頁面;就是產生自己所屬憑證 (Credentials) 的相同頁面。</li> - <li>點擊「Reset Credentials」按鈕。</li> -</ol> -<p>在重設自己的憑證之後,其他人就無法以舊憑證處理付款作業。你會看到新的應用程式金鑰與安全金鑰,並可立刻用來處理自己 App 中的付款流程。</p> -<p>若要回報任何安全性問題,請<a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Marketplace;component=Payments%2FRefunds">填寫 Payments/Refunds 分類下的錯誤</a>。</p> -<h2 id="程式碼函式庫"><strong>程式碼函式庫</strong></h2> -<p>下列為 Mozilla 的 <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.navigator.mozPay"><code>navigator.mozPay</code></a> 專屬函式庫:</p> -<ul> - <li>Python: <a href="https://mozpay.readthedocs.org/en/latest/">mozpay</a> module</li> - <li>node.js: <a href="https://github.com/mozilla/mozpay-js">mozpay</a> module</li> -</ul> -<p>Here are some generic <a href="http://openid.net/specs/draft-jones-json-web-token-07.html">JSON Web Token</a> (JWT) libraries for encoding/decoding and signature verification:</p> -<ul> - <li>Python: <a href="https://pypi.python.org/pypi/PyJWT-mozilla">PyJWT-mozilla</a></li> - <li>Ruby: <a href="https://github.com/progrium/ruby-jwt">ruby-jwt</a></li> - <li>node.js: <a href="https://github.com/hokaccha/node-jwt-simple">node-jwt-simple</a></li> - <li>PHP: <a href="https://github.com/luciferous/jwt">luciferous/jwt</a></li> - <li>Java: <a href="http://code.google.com/p/jsontoken/">jsontoken</a></li> - <li>.NET: <a href="https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet">IdentityModel Extensions for .Net</a></li> -</ul> -<h2 id="範例程式碼"><strong>範例程式碼</strong></h2> -<ul> - <li>這裡提供 <a href="https://github.com/jlongster/webfighter">Web Fighter</a> 原始碼。此遊戲是以 NodeJS 建構 In-app payments 功能。你可到 Marketplace 的<a href="https://marketplace.firefox.com/app/webfighter?src=search">這裡</a>安裝。</li> - <li>此為診斷與測試用 App,將呈現 JWT 請求的簽署方式,並以 Python 撰寫 Postbacks 與 Chargebacks 的檢驗器 (Verifier) 程式碼:<a href="https://github.com/kumar303/inapp-pay-test">In-app Payment Tester</a></li> -</ul> -<h2 id="尋求協助"><strong>尋求協助</strong></h2> -<ul> - <li>你可透過 <a href="https://lists.mozilla.org/listinfo/dev-webapps">dev-webapps</a> 郵件群組,或在 <a href="https://wiki.mozilla.org/IRC">irc.mozilla.org</a> 的 #payments 頻道上討論 In-app payments 的相關問題。</li> - <li>若發現任何錯誤,請在 Payments/Refunds 分類下回報 <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Marketplace;component=Payments%2FRefunds">Marketplace bug</a>。</li> -</ul> -<h2 id="類似的付款系統"><strong>類似的付款系統</strong></h2> -<ul> - <li><a href="https://developers.google.com/commerce/wallet/digital/docs/">Google 的 In-App Payments API</a></li> - <li><a href="http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/APIOverview/OverviewoftheStoreKitAPI.html">iOS 的 in-app purchases</a></li> - <li><a href="http://developer.android.com/google/play/billing/billing_overview.html">Android 的 in-App billing API</a></li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/index.html deleted file mode 100644 index ed0b227445..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: 讓 App 產生實質收益 -slug: Archive/Mozilla/Marketplace/Monetization -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Marketplace/Monetization ---- -<div class="summary"> - <p>你努力打造出自己的 App,又該如何在發佈之後取得實質收益呢?不論你選用 Marketplace 付款或應用程式內部付費機制 (In-app payments),本頁將提供所有相關的 App 付款資訊。</p> -</div> -<div class="row topicpage-table"> - <div class="section"> - <dl> - <dt> - <a href="https://developer.mozilla.org/en-US/docs/Apps/Tutorials/General/Profiting_from_your_app">用自己的 App 獲益</a></dt> - <dd> - 透過自己 App 獲益的相關要素介紹,包含所需的工具。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/Marketplace_Payments">Marketplace 付款</a></dt> - <dd> - 了解 App 將如何搭配 Firefox Marketplace,以強化自己的銷售模式 (如果你的是付費 App,更能提升自己的收入)。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/In-app_payments">In-app payments</a></dt> - <dd> - 說明應如何在自己的 Web App 中建構 In-app payments</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/Validating_a_receipt">檢驗收據</a></dt> - <dd> - 檢驗自己 App 購買收據的時機與方式。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/App_pricing" title="/en-US/docs/Web/Apps/Publishing/App_pricing">App 定價列表</a></dt> - <dd> - 內有價格點數 (Price point),可讓開發者為自己的付費 App 設定售價,並根據不同的幣別各對應不同的價格點數;另有處理 App 付款的相關資訊。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/Payments_Status" title="/en-US/docs/Web/Apps/Publishing/Payments_Status">付款狀態</a></dt> - <dd> - 提供目前有哪些國家已經設定 Marketplace 的 App 付款服務完畢,基本上也代表這些國家已可銷售付費 App。</dd> - </dl> - </div> - <div class="section"> - <h5 class="Tools" id="Tools" name="Tools">Tools for app developers</h5> -<ul> - <li><a href="https://marketplace.firefox.com/developers/">Visit Firefox Marketplace Developer Hub</a></li> - <li><a href="/en-US/docs/Mozilla/Firefox_OS/Using_Firefox_OS_Simulator">Firefox OS Simulator</a></li> - <li><a href="/en-US/docs/Apps/App_developer_tools">App developer tools</a></li> -</ul> -<h5 class="Documentation" id="Documentation" name="Documentation">Technology reference documentation</h5> -<div class="twocolumns"> - <ul> - <li><a href="/en-US/docs/Web/CSS">CSS</a></li> - <li><a href="/en-US/docs/DOM">DOM</a></li> - <li><a href="/en-US/docs/Web/HTML">HTML</a></li> - <li><a href="/en-US/docs/JavaScript">JavaScript</a></li> - <li><a href="/en-US/docs/WebAPI">WebAPI</a></li> - <li><a href="/en-US/docs/Web/WebGL">WebGL</a></li> - <li><a href="/en-US/docs/SVG">SVG</a></li> - <li><a href="https://www.mozilla.org/en-US/apps/">Open Web Apps overview site</a></li> - <li><a href="https://wiki.mozilla.org/Apps">Apps project wiki page</a></li> - </ul> -</div> -<h5 class="Community" id="Community" name="Community">Getting help from the community</h5> -<p>If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!</p> -<ul> - <li>Consult the webapps forum: <ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-webapps"> 郵件討論</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.webapps"> 新聞群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.webapps/feeds"> feed 消息來源</a></li> -</ul> - <ul> - <li>Ask your question on the Open Web Apps IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/openwebapps">#openwebapps</a></li> - </ul> - </li> -</ul> -<p><span class="alllinks"><a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="external">Don't forget about the <em>netiquette</em>...</a></span></p> - </div> -</div> -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html deleted file mode 100644 index 1c5993a876..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/introduction_monetization/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: 介紹 ─ 應如何讓 App 創造收益 -slug: Archive/Mozilla/Marketplace/Monetization/Introduction_Monetization -translation_of: Archive/Marketplace/Monetization/Introduction_Monetization ---- -<div class="summary"> - <p>你努力打造出自己的 App,又該如何在發佈之後取得實質收益呢?不論你選用 Marketplace 付款,或是應用程式內部付費機制 (In-app payments),本頁將提供所有相關的 App 付款資訊。</p> -</div> -<div class="row topicpage-table"> - <div class="section"> - <dl> - <dt> - <a href="https://developer.mozilla.org/en-US/docs/Apps/Tutorials/General/Profiting_from_your_app">用自己的 App 創造收益</a></dt> - <dd> - 將說明該如何用自己的 App 創造收益,包含付費式 App、定價、付款作業處理。</dd> - <dt> - <a href="/en-US/Marketplace/Monetization/App_payments_guide">App 付款指南</a></dt> - <dd> - 說明付費式 App 的相關技術。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/In-app_payments">應用程式內付款 (In-app payments)</a></dt> - <dd> - 說明該如何在自己的 Web App 中建構 In-app payments 功能。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/Validating_a_receipt">檢驗收據</a></dt> - <dd> - 檢驗自己 App 購買收據的時機與方式。你可自行建構檢驗機制,亦可使用現有的函式庫。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/App_pricing" title="/en-US/docs/Web/Apps/Publishing/App_pricing">制定 App 的價格</a></dt> - <dd> - 可為自己的 App 選擇固定的「價格點數 (Price points)」,且價格點數跨不同幣別也有所差異。本文將提供 App 付費資訊。</dd> - <dt> - <a href="/en-US/docs/Web/Apps/Publishing/Payments_Status" title="/en-US/docs/Web/Apps/Publishing/Payments_Status">付款服務狀態</a></dt> - <dd> - 總結目前有哪些國家已經支援我們的 App 付款服務。另提供可發佈 App 上架的國家列表。</dd> - </dl> - </div> - <div class="section"> - <h5 class="Tools" id="Tools" name="Tools">Tools for app developers</h5> -<ul> - <li><a href="https://marketplace.firefox.com/developers/">Visit Firefox Marketplace Developer Hub</a></li> - <li><a href="/en-US/docs/Mozilla/Firefox_OS/Using_Firefox_OS_Simulator">Firefox OS Simulator</a></li> - <li><a href="/en-US/docs/Apps/App_developer_tools">App developer tools</a></li> -</ul> -<h5 class="Documentation" id="Documentation" name="Documentation">Technology reference documentation</h5> -<div class="twocolumns"> - <ul> - <li><a href="/en-US/docs/Web/CSS">CSS</a></li> - <li><a href="/en-US/docs/DOM">DOM</a></li> - <li><a href="/en-US/docs/Web/HTML">HTML</a></li> - <li><a href="/en-US/docs/JavaScript">JavaScript</a></li> - <li><a href="/en-US/docs/WebAPI">WebAPI</a></li> - <li><a href="/en-US/docs/Web/WebGL">WebGL</a></li> - <li><a href="/en-US/docs/SVG">SVG</a></li> - <li><a href="https://www.mozilla.org/en-US/apps/">Open Web Apps overview site</a></li> - <li><a href="https://wiki.mozilla.org/Apps">Apps project wiki page</a></li> - </ul> -</div> -<h5 class="Community" id="Community" name="Community">Getting help from the community</h5> -<p>If you still aren't sure how to do what you're trying to get done, feel free to join the conversation!</p> -<ul> - <li>Consult the webapps forum: <ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-webapps"> 郵件討論</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.webapps"> 新聞群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.webapps/feeds"> feed 消息來源</a></li> -</ul> - <ul> - <li>Ask your question on the Open Web Apps IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/openwebapps">#openwebapps</a></li> - </ul> - </li> -</ul> -<p><span class="alllinks"><a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="external">Don't forget about the <em>netiquette</em>...</a></span></p> - </div> -</div> -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html deleted file mode 100644 index 25726a4fb5..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/payments_status/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 付款服務狀態 -slug: Archive/Mozilla/Marketplace/Monetization/Payments_Status -translation_of: Archive/Marketplace/Monetization/App_pricing ---- -<div class="summary"> - <p><span class="seoSummary"><a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 付款服務均以「國家」為單位進行,且各國有不同的定價與付款方式。本文列出已開始 Marketplace 付款服務的國家,並附上進一步資訊的連結。</span></p> -</div> -<div class="note"> - <p><strong>注意:</strong>另請參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Monetization/App_pricing">制定 App 的價格</a>》以了解價格點數,並<a href="http://firefox-marketplace-api.readthedocs.org/en/latest/topics/payment.html#pay-tiers">可透過 API 取得</a>。</p> -</div> -<h2 id="各國的付款服務">各國的付款服務</h2> -<p>下列為 Marketplace 目前提供付款服務的國家。我們亦隨時努力於更多國家提供付款服務。若需要現已支援付款服務的國家清單,可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Monetization/App_pricing">制定 App 的價格</a>》。</p> -<h2 id="App_支付">App 支付</h2> -<p>下列頁面將提供各國的付款服務資訊。另請注意,目前出帳作業僅支援當地貨幣;信用卡付款僅接受英鎊、美金、歐元計價。</p> -<ul> - <li><a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/App_pricing/Payout_Brazil">Brazil (洽談中)</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_Colombia">哥倫比亞</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_Germany">德國</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_Hungary">匈牙利</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_Mexico">墨西哥</a></li> - <li><a href="/Marketplace/Monetization/App_pricing/Payout_Poland">波蘭</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_Spain">西班牙</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_UK">英國</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_US">美國</a></li> - <li><a href="/en-US/Marketplace/Monetization/App_pricing/Payout_Venezuela">委內瑞拉</a></li> -</ul> -<h2 id="進一步了解收費費率">進一步了解收費費率</h2> -<p>若要進一步了解收費費率,請至 Firefox Marketplace 找到你自己的 App 頁面。點擊「相容性與付款 (<em>Compatibility & Payments)</em>」→「新增、管理或檢視您的付款帳號中的交易 (<em>Add manage or view transactions for your payment account</em>)」→「檢視交易 (<em>View Transactions)</em>」連結,即如下所示。</p> -<p><img alt="Transactions link" src="https://mdn.mozillademos.org/files/6567/transactions.png" style="width: 600px; height: 104px;"></p> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html deleted file mode 100644 index b66295dcee..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/profiting_from_your_app/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: 用自己的 App 創造收益 -slug: Archive/Mozilla/Marketplace/Monetization/Profiting_from_your_app -translation_of: Archive/Marketplace/Monetization/Profiting_from_your_app ---- -<div class="summary"> -<p>開發 Web App 不只有趣,也是將自己熱情轉為實質收益的絕佳方式!本篇文章將介紹 App 付款的相關主題、說明目前已經建構的付款類型 ─ 包含付款購買 App 與應用程式內部付費 (In-app payments),以及該如何處理不同國家內所發生的交易。</p> -</div> - -<p><a class="link-https" href="https://marketplace.firefox.com/">Firefox Marketplace</a> 是專為 Web App 開發者所設計的絕佳市集,可支援付費/免費 App 與 In-app payments、多款裝置平台的 App,還有更多特色。Firefox Marketplace 具備高競爭力的定價系統,讓消費者能選用自己喜歡的付款方式。並由付款服務供應商處理付款程序,可透過消費者的信用卡或行動電話帳單收取款項。</p> - -<div class="note"> -<p><strong>注意:</strong>可參閱<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/FAQ">《Marketplace 常見問題》的〈付款〉一章</a>,了解 Marketplace 付款方面的常見問題。</p> -</div> - -<h2 id="設定付費_App">設定付費 App</h2> - -<p>完全可由開發者自行決定 App 收費與否,而且<a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup/Publishing/Submitting_an_app">將 App 提交至 Firefox Marketplace</a> 的程序極為相似。Firefox Marketplace 目前支援二種 App 付款模式:</p> - -<ul> - <li>付費 App或免費增值 App (免費下載之後再購買 App 內建的物品);消費者在安裝 App 之前即付費完畢</li> - <li>續約訂閱 (已規劃完畢)</li> -</ul> - -<p>若將 App 定位為付費 App,則開發者會有不同的選擇並需制定價格;消費者也會在開始下載時完成付費。另請注意,因為必須經過 Marketplace 驗證並正確安裝 App,所以目前僅有 Firefox OS 才支援付費 App。在建構付費 App 時,可參閱《<a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/App_payments_guide">App 付款指南</a>》進一步了解其內部的必要程式碼。</p> - -<p>如果開發者是透過 Marketplace 收款,則消費者付款之後即可收到電子收據。開發者必須負責查驗電子收據,確認自己的 App 已正確收款。一般只要啟動 App 時就完成了查驗作業。可參閱《<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Publishing/Validating_a_receipt">查驗收據</a>》以進一步了解。</p> - -<p>Mozilla 強烈建議開發者應在收費之前,讓消費者能預覽/試用 App 的功能。只要同時提供單一 App 的免費與付費版本,或透過 In-app payments 都能達到上述目的。</p> - -<h3 id="In-app_payments">In-app payments</h3> - -<p>In-app payments 讓消費者可在 App 中付款,亦即透過 App 而靈活收取多樣數位版商品與服務的款項。且 In-app payments 讓開發者強化現有 App 即可獲得更高收益;而消費者也不需再另外購買新的 App。</p> - -<p>舉例來說,In-app payments 可用於:</p> - -<ul> - <li>在遊戲中銷售特殊的功能、物品、升級系統</li> - <li>升級或解鎖額外的 App 功能</li> - <li>建構有時間限制的免費試用版</li> - <li>補充 App 中的虛擬貨幣或儲值金額</li> -</ul> - -<p>Mozilla 與 <a href="https://developers.google.com/in-app-payments/docs/">Google 的 In-Apps Payments</a> 系統運作模式極為相似。Firefox Marketplace 系統如下:</p> - -<ul> - <li>App 將簽署 JWT 請求並呼叫 JavaScript 函式,即開始付款程序。</li> - <li>將在 <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe" title="The HTML <iframe> Element (or HTML inline frame element) represents a nested browsing context, effectively embedding another HTML page into the current page. In HTML 4.01, a document may contain a head and a body or a head and a frame-set, but not both a "><code><iframe></code></a> 中啟動購買流程: - <ul> - <li>消費者透過 Mozilla Persona 登入</li> - <li>消費者完成購買程序</li> - </ul> - </li> - <li>消費者關閉視窗時,App 隨即收到 JavaScript 的回呼 (callback)</li> - <li>App 伺服器將接收簽署過的 <code>POST</code> 請求,其內並包含 Mozilla 交易 ID,確認本次購買行為完成</li> -</ul> - -<p>Firefox Marketplace 另提供 JavaScript 公用程式函式庫,可協助完成購買程序。</p> - -<h3 id="免費增值_(Freemium)_App">免費增值 (Freemium) App</h3> - -<p>若開發者想將付費版本的 App 拿掉數項功能而成為免費版本,以供消費者可預覽/試用該 App,則 Mozilla 也同樣支援此一需求。開發者可在「免費版 App」的「詳細資訊」區塊中,找到「upsell」加入付費升級的功能,即可銜接免費與付費版本的 App 並簡化此「免費增值」模式。</p> - -<h3 id="退款">退款</h3> - -<p>一旦消費者要求退款,則可能由 Mozilla、付款服務供應商,或電信營運商授權退款作業。根據各地的消費規範、信用卡退款政策、電信營運商退款政策等的差異,退款授權方式亦有所不同。此外,Mozilla 並無法處理 In-app payments 的退款作業。</p> - -<p>一旦 App 購買行為退款完畢,所對應的收據也隨即失效。因此,開發者應隨時<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Publishing/Validating_a_receipt">查驗收據</a>以確保 App 是否正確授權批准。若任何 App 發生不尋常的大量退款要求,將由 Mozilla 進一步查驗。</p> - -<div class="note"> -<p><strong>注意:</strong>《<a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup/Publishing/In-app_payments">應用程式內部付費 (In-app payments)</a>》提供 In-app payments 作業的豐富訊息與範例程式碼。目前 In-app payment 程序尚在實測階段,請隨時參閱更新訊息。</p> -</div> - -<div class="note"> -<p><strong>注意:</strong>若 App 使用 In-app payments 機制,則 Mozilla 建議該 App 可設定為免費下載 App。當然付費 App 同樣可使用此機制。</p> -</div> - -<h2 id="定價與款項給付">定價與款項給付</h2> - -<p>App 內部應使用正確的程式碼,且最好透過 Marketplace 檢驗 App 較為穩當。但你心裡可能還是會想著系統是如何跨國處理這些款項。</p> - -<p>Firefox Marketplace 所列出的 App,都是由付款服務供應商負責販售。這些付款服務供應商將負責處理交易、收取營業稅與增值稅 (VAT)、確認符合當地消費法規、相關出納/退款作業,以及其他應盡的零售作業。Mozilla 則是提供買家 (即 App 使用者) 與賣家 (App 開發者) 的交流場所,但完全不參與交易活動。而 <a href="http://www.bango.com">Bango</a> 則是 Firefox Marketplace 的付款服務開發商。</p> - -<p>付款處理商另負責買家 (即 App 使用者) 與賣家 (App 開發者) 之間的交易過程,包含信用卡處理在內的大小事。付款處理商一般會逐筆交易收取服務費用。開發者必須透過 <a href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心 (Firefox Marketplace Developer Hub)</a>,於各家付款處理商建立自己的帳戶。</p> - -<p>為了維持 Firefox Marketplace 的運作、不斷提升 App 平台、實踐<a href="http://www.mozilla.org/about/">我們的使命</a>,Mozilla 與合作夥伴將針對各筆交易拆帳,並另外支付交易費用。目前,若開發者是透過 Marketplace 進行交易,則每筆 App 或 In-app 銷售活動均可獲得 70% 的銷售金額 (此為必要費用與稅後總額,均已包含於消費者所看到價格之中)。而 Mozilla 與合作夥伴則收取 30%。</p> - -<p>Firefox Marketplace 未來將支援更多國家、語言、幣別。我們亦將設法提供多個語系的 Marketplace,並搭配各國所適用的付款方式。</p> - -<p>進一步了解:</p> - -<ul> - <li>《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Monetization/App_pricing">制定 App 的價格</a>》將進一步說明應如何透過「價格點數」定價,以及定價將如何搭配信用卡並扣繳稅額等事項。</li> - <li>《<a href="https://developer.mozilla.org/en-US/Marketplace/Monetization/Payments_Status">Payments status</a>》可了解目前哪些國家已經開始 App 付款作業、使用的匯率為何、開發者在各國所應注意的事項。</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html b/files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html deleted file mode 100644 index 8ad877280b..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/monetization/validating_a_receipt/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: 驗證收據 -slug: Archive/Mozilla/Marketplace/Monetization/Validating_a_receipt -translation_of: Archive/Marketplace/Monetization/Validating_a_receipt ---- -<div class="summary"> - <p><span class="seoSummary">如果你的是付費 App,就應該檢查消費者的收據是否有效。如果開發者完全不檢查,則可能會有消費者購買 App 之後立刻退款,就變成免費取得 App 了;或可能直接從你的網站參照 manifest 檔案,就能安裝 App。如果開發者要建構收據驗證機制,可參閱本文提供的程式碼與作業流程。</span></p> -</div> -<p>收據 (Receipt) 即為消費者的 App 購買證明。收據將經由付款處理機制 (由消費者完成的交易) 產生確認資料 (Affirmation),以取得特定的數位產品。在消費者付費購買 <a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 上的 App 之後,收據就隨即傳送到消費者的裝置之中。位於消費者裝置上的收據,將用在 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.install"><code>mozApps.install()</code></a> 函式的第二組參數之上。Firefox Marketplace 將使用該筆收據資料,進而呼叫 <code>install() 以完成 </code>App 的安裝。</p> -<h2 id="驗證收據的時機">驗證收據的時機</h2> -<p>開發者必須決定 App 該何時驗證收據。一般都是在消費者啟動 App 時開始驗證。如果是屬於長時間執行 App,則可以定時/定期進行驗證。例如影片串流 App 就可以每隔 20 分鐘檢查收據 1 次。</p> -<p>另請注意,如果消費者為離線狀態,App 也就無法驗證收據。開發者可決定 App 在離線時所進行的作業。為了避免打擾某些消費者,開發者可停止強制的收據驗證作業 (消費者可能進入隧道而暫時離線),只要等消費者上線時再次檢查即可。</p> -<h2 id="如何驗證收據">如何驗證收據</h2> -<p>最簡單就是使用 Firefox Marketplace 的驗證服務即可。如果你的 App 屬於「HTML-only」,也就是伺服器只會提供靜態檔案,則可使用 Mozilla 的<a href="https://github.com/mozilla/receiptverifier">「receiptverifier」JavaScript 函式庫</a>。此函式庫基本上只會將 <code>receiptverifier.js</code> 指令碼加入 App 之中,並使用 <code>verifyReceipts()</code> 函式。可參閱上述連結以進一步了解。</p> -<h2 id="收據內容">收據內容</h2> -<p>Open Web App 所使用的收據,均為可攜式、可驗證的「Token」購買證明,即所謂 <a href="http://self-issued.info/docs/draft-jones-json-web-token.html">JSON Web Token</a> (JWT) 的數位簽署 JSON 資料架構,且此格式可讓所有用戶端與伺服器讀取。許多程式語言均提供 JWT 函式庫。</p> -<h2 id="應接受的收據">應接受的收據</h2> -<p>收據就是付款的證明,但 App 開發者可決定自己想要的收據類型。以下是你該檢查的要項:</p> -<ul> - <li>收據來自於售出 App 的商店。請檢查自己清單中的 <code>iss</code> 欄位。</li> - <li>自己 App 的專屬收據。如果是架設/托管式 (Hosted) App,可檢查 <code>product</code> <code>URL</code> 欄位是否正確。如果是封裝式 (Packaged) App,可檢查 <code>product storeData</code> 是否正確,直到 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867265" title="FIXED: Identifying your packaged app from a receipt">bug 867265</a> 解決為止。除非已發出收據,否則 <code>storeData</code> 均為未知值,且發出收據之後將不再變動。</li> - <li>驗證作業的網址是位於商店的網域或子網域之下。可檢查 <code>verify</code> 的網址是否為 <code>iss</code> 欄位的子網域。</li> - <li>收據真正用於購買活動,而非測試用收據。請檢查 <code>typ</code> 欄位。</li> -</ul> -<p><a class="link-https" href="https://github.com/mozilla/receiptverifier">receipt verifier</a> 函式庫可進行其中數項檢查。</p> -<h2 id="測試用收據">測試用收據</h2> -<p>在開發期間,Firefox Marketplace 即可協助發出測試用收據,以供完整測試 App 的相關付款程序。可透過 Firefox 開發者交流中心 (Firefox Developer Hub) 的<a href="https://marketplace.firefox.com/developers/test/receipts/">公用程式頁面</a>產生測試用收據。此種收據將具備「<code>test-receipt</code>」的 <code>typ</code>。且 App 只會在開發期間接收這類收據,一旦上架之後就<b>停止接收</b>;否則消費者可略過 App 銷售程序,直接使用測試用收據。</p> -<p><a class="link-https" href="https://github.com/mozilla/receiptverifier">receipt verifier</a> 函式庫預設不會接收 <code>test-receipts</code>。</p> -<h2 id="收據驗證">收據驗證</h2> -<p>在沒有 JWT 函式庫的情況下,開發者也能在收據的 <code>verify</code> 欄位中,找到驗證服務的對應網址,並將收據傳送給驗證服務。各個 App 均具備不同的 Firefox Marketplace 驗證服務網址。</p> -<p>下列範例程式碼可於收據中顯示 <code>verify</code> 網址。該程式碼將用於 Firefox 的「網頁主控台 (Web console)」開發者工具。</p> -<pre class="brush: js"><span class="kd">var</span> <span class="nx">request</span> <span class="o">=</span> <span class="nx">navigator</span><span class="p">.</span><span class="nx">mozApps</span><span class="p">.</span><span class="nx">getSelf</span><span class="p">();</span> -request.onsuccess = function() { - // Get the app's receipt and decode it - console.log(atob(request.result.receipts[0].split('~')[1].split('.')[1])); -};</pre> -<p>為了取得 <code>verify</code> 網址,此範例將近行下列作業:</p> -<ul> - <li>針對由 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.getSelf">mozApps.getSelf()</a> (對目前 App 的參照) 所回傳的物件,將之儲存於 <code>request</code> 變數中。</li> - <li>如果請求成功,則會檢索 App 的第一筆收據,且將切割由 JWT 送進的值,以取得包含收據的實際部位。</li> - <li>透過 JavaScript 的 <code>{{ domxref("Window.atob") }}</code> 函式,而解碼 Base64-encoded 的收據。</li> -</ul> -<p>接著是上述程式碼結果的完整範例。此即為扣除 JWT 部分的完整收據。</p> -<pre class="brush: js">{ - "product": { - "url": "http://example.com", - "storedata": "id=111111" - }, - "iss": "https://marketplace.mozilla.org", - "verify": "https://receiptcheck.marketplace.mozilla.org/verify/111111", // The verify URL - "detail": "https://marketplace.mozilla.org/en-US/purchases/111111", - "reissue": "https://marketplace.mozilla.org/en-US/app/example/purchase/reissue", - "user": { - "type": "directed-identifier", - "value": "1234-abcd99ef-a123-456b-bbbb-cccc11112222" - }, - "exp": 1353028900, - "iat": 1337304100, - "typ": "purchase-receipt", - "nbf": 1337304100 -}</pre> -<p>在開發者取得 <code>verify</code> 網址之後,就可透過 <code>POST</code> 函式,在訊息主體之內傳送完整的 JWT。驗證服務的回應即如上方所述。下列程式碼片段 (snippet),將從上列範例中取得 App 第一筆收據的完整 JWT。</p> -<pre>request.result.receipts[0]</pre> -<p>請注意,上述程式碼並不會處理 JWT 的加密部分。如果你要透過 Marketplace 驗證收據,則收據將檢查本身的加密簽章。</p> -<div class="note"> - <p><strong>注意:</strong>可在 Kumar McMillan 提供的 <a href="https://github.com/kumar303/yacht/blob/master/www/js/server-app.js">Private Yacht</a> 範例中,找到其他更高擴充性的收據驗證範例。</p> -</div> -<h2 id="App_盜版問題">App 盜版問題</h2> -<p>即使你驗證了自己付費 App 的收據,還是可能有人繞過收據機制而盜用 App。上列的收據驗證函式並無法避免此問題。</p> -<p>如果想要更好的防盜版機制,就必須設定代理伺服器,將之作為 App 與 Firefox Marketplace 之間的媒介。代理伺服器可檢查收據、IP 位址,還有更多物件。如果單一收據來自於不同的 IP 位址,且能一樣執行正確動作,則伺服器就可進行類似通知的作業。如果是大型、複雜、使用伺服器處理功能的 App,就能達到更適當、更正確的設定。</p> -<p><a class="link-https" href="https://github.com/andymckay/receipts">此 Python 程式碼</a>仍是開發中的專案,可提供某些代理伺服器的靈感。<a class="external" href="http://django-receipts.herokuapp.com/">Django Receipts</a> 則是測試用的代理伺服器,可驗證收據。開發者最好不要直接將之作為正式運行的代理伺服器,但可進行測試以了解相關機制。<a class="link-https" href="https://wiki.mozilla.org/Apps/WebApplicationReceipt">另可參閱更多資訊</a>,讓自己了解收據驗證作業。</p> -<h2 id="收據欄位">收據欄位</h2> -<p>收據應包含下列欄位:</p> -<dl> - <dt> - <code>typ</code></dt> - <dd> - 可供識別收據類型的字串,必為以下之一: - <ul> - <li><code>purchase-receipt</code> ─ 交易完成之後隨即發出的收據。這類收據應隨時能由 App 接收。</li> - <li><code>developer-receipt</code> ─ 由 App 開發者所發出的收據。一般是開發者交由自己使用的 App 商店所發出。這類收據有效期較短。</li> - <li><code>reveiwer-receipt</code> ─ 由 App 審查者所發出的收據。一般是 App 審查者透過其所位於的商店發出。這類收據只需要在審查期間接收即可,有效期較短。</li> - <li><code>test-receipt</code> ─ 在開發期間用以測試 App 所發出的收據。只要是開發期間以外,<strong>均不應該</strong>接收這類收據,有效期較短。</li> - </ul> - </dd> - <dt> - <code>product</code></dt> - <dd> - JSON 物件在識別產品時,包含收據所囊括的範圍,以及任何特定商店的資料。包含下列欄位: - <ul> - <li><code>url</code> ─ 代表該網址的根網域 (root of a domain),且沒有最後的斜線 (例如「<a class="link-https" href="https://someapp.com" rel="freelink">https://someapp.com</a>」)。一般這樣就代表了 Web App。如果是以根網域開頭的其他網址,則代表「App 內購買」。只要開發者或收據開立者覺得方便,則可使用各種路徑規則 (Path scheme)。</li> - <li><code>storedata</code> ─ 此字串為 App 所獨有,將提供給收據驗證器 (Verifier) 所用。</li> - </ul> - </dd> - <dt> - <code>user</code></dt> - <dd> - 針對完成購買作業的消費者,此 JSON 物件包含了使用者 ID,並包含下列欄位: - <ul> - <li><code>type</code> ─ 此字串內有「<code>directed-identifier</code>」值。</li> - <li><code>value</code> ─ 此字串即為消費者的專屬 ID。消費者每次購買 App,都會擁有不同的 ID。</li> - </ul> - </dd> - <dt> - <code>iss</code></dt> - <dd> - 發出收據的商店,其所屬之網域。</dd> - <dt> - <code>nbf</code></dt> - <dd> - 完成購買程序之後,顯示「Not-before」的時間戳記。時間戳記是從 1970-01-01T00:00:00Z (UTC, RFC 3339) 開始的秒數。</dd> - <dt> - <code>iat</code></dt> - <dd> - 發出收據之後,顯示「Issued-at」的時間戳記。此時間戳記的格式如同 <code>nbf</code>。可透過此數值決定收據的存在時間。</dd> - <dt> - <code>exp</code></dt> - <dd> - (選填) 代表收據過期的時間戳記。此時間戳記的格式如同 <code>nbf</code>。</dd> - <dt> - <code>detail</code></dt> - <dd> - (選填) 網址包含額外人、機均可讀取的購買細節。如果另提供購買行為的交易記錄或退款功能,則本頁亦應包含相關函式。</dd> - <dt> - <code>verify</code></dt> - <dd> - (選填) 由經過授權的 App 使用此網址,以驗證收據。另請注意,Firefox Marketplace 一定會為 App 提供此欄位。如果開發者想自己建立 App 的商城,就可能不需使用此欄位。</dd> - <dt> - <code>reissue</code></dt> - <dd> - (選填) 網址可重新發出新收據。</dd> -</dl> diff --git a/files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html b/files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html deleted file mode 100644 index 69614f7cf4..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/options/hosted_apps/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: 托管\架設式 (Hosted) App -slug: Archive/Mozilla/Marketplace/Options/Hosted_apps -translation_of: Archive/Mozilla/Marketplace/Options/Hosted_apps ---- -<div class="summary"> -<p><span class="seoSummary">托管\架設式 (Hosted) App 即為 Open Web App,將其所有資源 (HTML、CSS、JavaScript、manifest 檔案等) 儲存於 Web 伺服器上。本文將簡介托管\架設式 App,另有相關連結讓你從開發者的角度進一步了解相關資訊。</span></p> -</div> - -<p>與一般網站相同,托管的 Open Web App 亦透過 Web 伺服器提供其所有內容,另於 App 的根目錄中提供 <a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest">App 的 manifest 檔案</a>。manifest 檔案則具備 App 的詳細資料,如相關說明、代表 App 的圖示等等。且不論是 Firefox OS 裝置、<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_android">Android 裝置</a>,或<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_desktop">桌上型電腦</a>,這些詳細資料都會用於 App 的安裝作業。一旦安裝完畢,App 就會從原本的托管伺服器動態載入其內容,並可存取 Web 上的其他資源,如 Web 伺服器上的資料庫。</p> - -<p>在 <a href="/en-US/Firefox_OS/Security/Security_model#App_Security">Firefox OS 安全模型</a>中,托管式 App 均定義為 Web App,意即這類 App 無法利用 <a href="https://developer.mozilla.org/en-US/Apps/Build/App_permissions">Privileged 與內部 (即 Certified) API</a>。若要利用這些 API,則必須以<a href="/en-US/Marketplace/Options/Packaged_apps">封裝式 (Packaged) App</a> 的方式來提供 App。</p> - -<div class="note"> -<p><strong>注意:</strong>Firefox Marketplace 僅支援 Firefox OS 的付費托管式,以及 Firefox OS、Firefox for Android、Firefox 的免費托管式 App。目前正開發所有平台的付費 App 支援功能。</p> -</div> - -<h2 id="App_托管選擇">App 托管選擇</h2> - -<p>開發者可自行選擇 App 的托管之處。如果你還沒選擇托管方式,則可考慮本段說明的常見托管選擇。</p> - -<h3 id="GitHub">GitHub</h3> - -<p>如果你的 Open Web App 為靜態內容 (HTML/CSS/JavaScript,但無伺服器端的處理作業),那<a class="external external-icon" href="http://pages.github.com" rel="external">GitHub Pages</a> 應該是你的不二選擇。如果你的 manifest 檔案是 <code>.webapp</code> 為附檔名,則 GitHub 就能用 <a href="https://developer.mozilla.org/en-US/Apps/Developing/Manifest#Serving_from_GitHub">correct MIME type</a> 提供 manifest 檔案。</p> - -<h3 id="一般托管解決方案">一般托管解決方案</h3> - -<p>動態的 Open Web App 需要伺服器端的處理作業,所以你可用任何常見的托管選擇 (像是你自己架設或可存取的 Web 伺服器)。你必須先確認 Web 伺服器具備相關功能。另有許多托管服務供應商已針對托管式 App 的需求 (如 <a class="external external-icon" href="http://www.heroku.com" rel="external">Heroku</a>、<a class="external external-icon" href="http://code.google.com/appengine" rel="external">Google App Engine</a>、<a class="external external-icon" href="http://aws.amazon.com/application-hosting" rel="external">Amazon App Hosting</a>),量身打造出 Web 伺服器。</p> - -<div class="note"> -<p><strong>注意:</strong>之前在安裝 Open Web App 時,必須滿足「一組來源僅能提供一個 App」的安全規範。但這項條件到 Firefox 34/Firefox OS 2.1 (可參閱<a href="https://developer.mozilla.org/en-US/Apps/Build/installable_apps_for_Firefox_OS/App_manifest_FAQ#Can_I_have_more_than_one_app_at_my_origin.3F">此 FAQ</a> 以獲得更多資訊) 已經移除。如果你仍要支援較舊版本,則可試試看在不同來源托管不同的 App (如測試\正式版本)。其中一個方法就是為 App <a href="/en-US/Marketplace/Publishing/Adding_a_subdomain">建立不同的子網域</a>,或可透過 <a href="/en-US/docs/Tools/WebIDE">WebIDE</a> 測試 App。可參閱<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/FAQs/About_app_manifests">〈manifest 檔案常見問題〉</a>以進一步了解。</p> -</div> - -<h2 id="測試托管式_App">測試托管式 App</h2> - -<p>若要將托管式 App 安裝至 Firefox OS 模擬器或實體裝置上,以利進行測試,請參閱《<a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">應用程式管理員 (App Manager)</a>》。你也可觀看《<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing">自行發佈 App</a>》中所說明的步驟,透過 Web 伺服器將 App 安裝到裝置之上。</p> - -<h2 id="發佈托管式_App">發佈托管式 App</h2> - -<p>現有 2 種方式可發佈托管式 App:1). 透過 Firefox Marketplace 或 2). 自行發佈。</p> - -<h3 id="發佈於_Firefox_Marketplace">發佈於 Firefox Marketplace</h3> - -<p>你可參閱《<a href="https://developer.mozilla.org/en-US/Marketplace/Publishing">App 發佈流程</a>》,了解應如何將托管式 App 提交到 Firefox Marketplace 之上。</p> - -<p>在你提交自己的托管式 App 之後,Marketplace 隨即根據你放在 Web 伺服器上的 manifest 檔案,產生新的「<strong>mini-manifes</strong>」檔案。只要消費者決定要安裝 App,則 mini-manifest 就會傳送到 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.install"><code>Apps.install()</code></a> 函式以安裝該 App。mini-manifest 僅會用於 App 的安裝與更新作業,並不會用於 App 執行期間。</p> - -<h3 id="自行發佈">自行發佈</h3> - -<p>你當然也能在 Firefox Marketplace 以外發佈托管式 App,也就是透過自己架設的 Web 伺服器。可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Publishing/Publish_options">自行發佈 App</a>》。</p> - -<h2 id="更新托管式_App">更新托管式 App</h2> - -<p>共有 2 種方式可更新托管式 App:</p> - -<ul> - <li>在 App 所托管的 Web 伺服器上進行變更,消費者在下次執行 App 時就能獲得更新檔案。</li> - <li>將新版 App 提交到 Firefox Marketplace 之後,就會隨之更新 mini-manifest 所控制的裝置內容,如如 App 的圖示或名稱。</li> -</ul> - -<p>若要進一步了解在 Firefox Marketplace 上更新 App 的方法,可參閱《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Publishing/Updating_apps">更新 App</a>》;若是自行發佈的 App,則可參閱《<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing">自行發佈 App</a>》。</p> - -<h2 id="另請參閱">另請參閱</h2> - -<ul> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_model">Firefox OS 安全性概述</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Application_security">App 安全性</a></li> - <li><a class="external external-icon" href="https://github.com/robnyman/Firefox-OS-Boilerplate-App" title="https://github.com/robnyman/Firefox-OS-Boilerplate-App">Firefox OS 的「Boilerplate」App</a></li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html deleted file mode 100644 index 27d7c108df..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/adding_a_subdomain/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: 為 App 添增子網域 -slug: Archive/Mozilla/Marketplace/Publishing/Adding_a_subdomain -translation_of: Archive/Mozilla/Marketplace/Publishing/Adding_a_subdomain ---- -<div class="summary"> - <p>一組來源網域僅限容納一個 App。但若要打破此限制,則可為 App 新增子網域。每個子網域就代表不同的來源,例如 <code>app1.example.com 或 </code><code>app2.example.com</code>。建立子網域很簡單,而且大多數的網域托管服務供應商也都不額外收費。服務供應商一般會免費提供特定數量的子網域。以下即為子網域的新增範例。</p> -</div> -<h2 id="新增子網域的常見步驟">新增子網域的常見步驟</h2> -<ol> - <li>登入托管服務供應商的管理介面,找到自己所使用的網域。</li> - <li>找到設定網域的頁面。</li> - <li>找到可新增子網域的功能。</li> - <li>新增子網域、指定子網域檔案的儲存路徑、儲存你所完成的變更。</li> - <li>將自己的 App 檔案放進你在上個步驟所指定的伺服器路徑中。</li> - <li>實際以瀏覽器開啟該路徑,檢驗新的子網域已確實產生。</li> -</ol> -<p>接著將說明該如何透過特定托管工具新增子網域。</p> -<h2 id="以_cPanel_新增子網域">以 cPanel 新增子網域</h2> -<p>這裡提供 cPanel 建立子網域的範例。cPanel 是 Web 托管控制台,已有多家托管服務供應商採用。每個開發者的 cPanel 頁面可能因設定方式而略有不同。這裡僅提供整個介面的基本概念。</p> -<ol> - <li>登入 cPanel。</li> - <li>往下捲動找到「Domains」區塊。 - <p><img alt="" src="/files/4007/cpanel-domains1.png" style="width: 527px; height: 181px;"></p> - </li> - <li>點擊「<em>Subdomains</em>」即開啟「<em>Subdomains</em>」頁面。 - <p><img alt="" src="/files/4011/subdomain.png" style="width: 802px; height: 300px;"></p> - </li> - <li>在「<em>Subdomain</em>」文字框中輸入子網域名稱。我們這裡先以「newsubdomain」為例。</li> - <li>再點入「<em>Document Root</em>」文字框。隨著顯示的路徑,就是儲存新子網域檔案的路徑。我們這裡先以「<code>/public_html/newsubdomain</code><code>」為例。如果開發者想把 App 檔案儲存到其他位址,亦可依自己需要更改。假設你的 App 檔案位於「</code><code>public_html/gamedev_com/games/coolgame/</code><code>」,則可於「</code>Document Root<code>」文字框中鍵入該路徑。</code><img alt="Document root" src="/files/4035/subdomain2.png" style="width: 768px; height: 163px;"></li> - <li>點擊「<em>Create</em>」按鈕,即可收到確認訊息。</li> - <li>將 App 檔案放進你指定的子網域路徑中。我們這裡先使用名為「<code>index.html</code>」的簡單 HTML,將顯示「This is on a new subdomain!」。</li> - <li>確認新的子網域現已存在。開啟瀏覽器並輸入新的網域名稱。根據我們所使用的範例,即如下圖所示: - <p><img alt="New subdomain in browser" src="/files/4037/subdomain3.png" style="width: 696px; height: 204px;"></p> - </li> -</ol> -<h2 id="以_Go_Daddy_新增子網域">以 Go Daddy 新增子網域</h2> -<p>可觀看此<a href="http://www.youtube.com/watch?v=Nw5mi8ihA5A" title="http://www.youtube.com/watch?v=Nw5mi8ihA5A">影片</a>,為 Go Daddy 所托管的網域添增子網域。</p> -<div> - </div> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html deleted file mode 100644 index 968dce2720..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/creating_a_store/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: 設立自己的 App 商店 -slug: Archive/Mozilla/Marketplace/Publishing/Creating_a_store -translation_of: Archive/Marketplace/Options/Creating_a_store ---- -<div class="summary"> - <p>任何 Web 網站若具備豐富的圖片與互動經驗,則 Web 瀏覽器可透過Mozilla 的 App 專案平台,將這類網站識別為「Web App」,進而能跨裝置安裝並同步這些網站。開發者現可透過此項特性,將已發佈的 App 整理到目錄與商店中。接著說明相關步驟。</p> -</div> -<h2 id="與瀏覽器整合">與瀏覽器整合</h2> -<p>App 平台即提供「<a href="https://developer.mozilla.org/en-US/docs/Web/API/navigator.mozApps" title="Returns an Apps object you can use to install, manage, and control Open Web Apps in the browser."><code>navigator.mozApps</code></a>」這個 JavaScript 物件,可作為商店與瀏覽器之間的溝通橋樑。</p> -<p>Web App 是根據其網域所辨識而得。而一個來源網域就只會有一個 App。針對目錄或商店,開發者可透過 <a href="https://developer.mozilla.org/en-US/Apps/Developing/JavaScript_API">App Installation API 與 App Management API</a>,讓瀏覽器觸發 <a href="https://developer.mozilla.org/en-US/docs/Web/API/apps.install" title="Triggers the installation of an app. During the installation process, the app is validated and the user is prompted to approve the installation."><code>apps.install</code></a> 函式並提示 App 的安裝作業,另提供 App 的 manifest 檔案網址,以及任何想要補充的後設資料 (metadata)。開發者可存取此筆後設資料,以查閱消費者的購買資訊、確認單一登入狀態 (SSO),或其他服務。</p> -<h3 id="使用_getInstalled()">使用 getInstalled()</h3> -<p>只要 App 是根據你的網域而安裝於目前的瀏覽器上,均可透過 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.getInstalled"><code>navigator.mozApps.getInstalled()</code></a> 函式取得此類 App 的清單。另請注意,開發者不會看到其他網域所安裝的 App,只會看到放在自己網域中的 App。</p> -<p>開發者可透過此函式而了解消費者安裝的 App 是否符合你的預期。即使消費者是以新帳戶登入你的網站,亦可透過「resync」功能而再次安裝既有的 App。</p> -<h2 id="到底該不該托管?">到底該不該托管?</h2> -<p>針對托管式 App,商店只需該網站的 manifest 網址,即可觸發 App 的安裝作業 (<a href="https://developer.mozilla.org/en-US/docs/Web/API/apps.install" title="Triggers the installation of an app. During the installation process, the app is validated and the user is prompted to approve the installation."><code>apps.install</code></a>)。該 App 檔案不一定要儲存於商店或目錄之下。</p> -<p>如果 App 沒有伺服器的邏輯元件 (也就是完全以用戶端 JavaScript、HTML、CSS 所建構的 App),開發者就可能會想建構出托管功能。此時必須為各 App 指派不同的網域名稱,並針對各 App 的 manifest 檔案建構伺服邏輯,才能使用托管功能。</p> -<p>如果你現在正自行托管 App 邏輯,則可輕鬆維護和消費者之間的會話 (Session),進而追蹤消費者的喜好、購買證明,或其他服務。如果你要針對遠端網站提供服務,就必須完成額外作業,才能支援分散式的認證系統。</p> -<div class="note"> - <p><strong>注意:</strong><a href="http://firefox-marketplace-api.readthedocs.org/en/latest/">Firefox Marketplace API</a> 內含的功能,讓開發者只耗費最小程度的心血,即可迅速設立自己的 App 商店。</p> -</div> -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/index.html deleted file mode 100644 index 280345b59e..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Publishing -slug: Archive/Mozilla/Marketplace/Publishing -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Introduction ---- -<p>Marketplace publishing</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html deleted file mode 100644 index 0cdc397b2e..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/introduction/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: 介紹 — App 發佈流程 -slug: Archive/Mozilla/Marketplace/Publishing/Introduction -translation_of: Archive/Mozilla/Marketplace/Publishing/Introduction ---- -<div class="summary"> - 你到這裡應該已經知道該如何<a href="/en-US/Marketplace/Prepare/Introduction">打造成功的 App</a>、選擇 <a href="/en-US/Marketplace/Options/Introduction">App 發佈平台 (甚或發佈到 Firefox OS 以外的平台)</a>、撰寫並側試過自己的程式碼。現在應該著手將 App 發表給全球的使用者知道,並於 Firefox Marketplace 上發佈。本文將引導你<span class="seoSummary">完成相關程序,讓你順利於 Firefox Marketplace 上發佈自己的 Open Web App,並能隨時更新檔案及有用的附加資訊。 </span></div> -<div class="column-container"> - </div> -<div class="row topicpage-table"> - <div class="section"> - <h2 class="Community" id="Community" name="Community">發佈指南</h2> - <dl> - <dt> - <a href="/en-US/Marketplace/Publishing/Submission_checklist">提交作業檢查清單</a></dt> - <dd> - 提交 App 前的準備工作。</dd> - <dt> - <a href="/en-US/Marketplace/Publishing/Marketplace_review_criteria">Marketplace 審查</a></dt> - <dd> - 審查 App 時的程序與準則。</dd> - <dt> - <a href="/en-US/Marketplace/Publishing/Pricing/Introduction">設定付費 App 與應用程式內付款 (In-app payment)</a></dt> - <dd> - Marketplace 的相關功能,可設定付費式 App 與應用程式內的付款項目。另將說明 Firefox Marketplace 是如何使用第三方的付費服務,並建立廠商的帳戶。</dd> - </dl> - <h2 class="Community" id="Community" name="Community">策略與指南</h2> - <dl> - <dt> - <a href="/en-US/Apps/Build/Icon_implementation_for_apps#Firefox_OS">圖示 (應用程式中心)</a></dt> - <dd> - 根據 Firefox OS 的不同版本,取得詳細的圖示尺寸。</dd> - </dl> - <dl> - <dt> - <a class="external external-icon" href="https://www.mozilla.org/en-US/styleguide/products/firefox-os/icons/">圖示設計 (Mozilla 風格指南)</a></dt> - <dd> - 你的 App 或 In-app 產品圖示,必須符合圓形或方形設計。進一步參閱 Mozilla 風格指南。</dd> - </dl> - <dl> - <dt> - <a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Privacy_policies#Mozilla_Marketplace_privacy_requirements">隱私權政策</a></dt> - <dd> - 如果你的 App 會取得使用者的個人資料,就必須另外具備隱私權政策。指南內所提供的資訊,均必須納入你的 App 隱私權政策之中。</dd> - </dl> - <dl> - <dt> - <a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Marketplace_screenshot_criteria">擷圖指南</a></dt> - <dd> - 若要讓自己的 App 在 Marketplace 順利上架,所提供的擷圖必須符合相關規範。</dd> - <dt> - <a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Policies_and_Guidelines/Testing_and_troubleshooting">App 測試與疑難排解</a></dt> - <dd> - 帶領你設定測試環境、實際測試 App,並解決你所發現的問題或錯誤。</dd> - </dl> - </div> - <div class="section"> - <h2 class="Community" id="Community" name="Community">提交 App</h2> - <dl> - <dt> - <a href="/en-US/Marketplace/Publishing/Submit/Overview">App 提交程序指南</a></dt> - <dd> - 你已經準備好發佈第一個 App;也可能要以自己沒用過的方式封裝/發佈 App。到這裡了解該如何將 App 提交到 Firefox Marketplace 之上。</dd> - </dl> - <h2 class="Community" id="Community" name="Community">更新 App</h2> - <dl> - <dt> - <a href="/en-US/Marketplace/Publishing/Updating_apps">更新 App</a></dt> - <dd> - 不論是要添增新功能或是修正錯誤 (當然最好不要是錯誤),定期提供 App 更新檔,才能保持 App 的能見度。本文將說明應如何透過 Firefox Marketplace 遞交 App 的更新檔案。</dd> - </dl> - <h2 class="Community" id="Community" name="Community">管理已發佈的 App</h2> - <dl> - <dt> - <a href="/en-US/Marketplace/Publishing/Managing_your_apps/Introduction_Managing_your_apps">App 管理指南</a></dt> - <dd> - 在發佈 App 之後,你可能想更改某個地方,或了解消費者對該 App 的接受度為何。本文將帶領你變更 App 的狀態、檢視統計資料、檢查於 Firefox Marketplace 上所獲得的評價。</dd> - </dl> - <h2 id="更多工具">更多工具</h2> - <dl> - <dt> - <a href="/en-US/Marketplace/Publishing/Adding_a_subdomain">為自己的 App 添增子網域</a></dt> - <dd> - 如果要從自己的網站上提供超過 1 個的架設/托管式 (Hosted) App,就必須逐一建立子網域。本文將說明添增子網域的方式。</dd> - </dl> - </div> -</div> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html deleted file mode 100644 index 6454ca8f31..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/managing_your_apps/app_statistics/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: App 統計資料 -slug: Archive/Mozilla/Marketplace/Publishing/Managing_your_apps/App_Statistics -translation_of: Archive/Mozilla/Marketplace/Publishing/Managing_your_apps/App_Statistics ---- -<div class="summary"> -<p>Firefox Marketplace 可提供 App 的多樣統計資料。本文將說明應如何取得自己<span class="seoSummary"> App 在 Firefox Marketplace 上的統計資料、報表資料的呈現方式,另可審閱報表內的特定資訊、可用的報表,並使用已匯出的報表資料。</span></p> -</div> - -<h2 id="取得_App_的狀態">取得 App 的狀態</h2> - -<p>若要取得任何已發佈 App 的狀態,須先到 Firefox Marketplace 點擊「<strong>開發者交流中心 (Developer Hub)</strong>」,再進入「我的提交 (<strong>My Submissions)</strong>」。所有已發佈的 App 都能看到 (1)「統計資訊 (<strong>Statistics</strong>)」連結。</p> - -<p><img alt="In My Submissions, for each published app you will find a link to the app's stats page" src="https://mdn.mozillademos.org/files/8281/Stats%20link.png" style="width: 990px; height: 210px;"></p> - -<h2 id="報表介紹">報表介紹</h2> - -<p>在開啟了 App 的統計資訊之後,就會進入下方的統計資料表。此頁將摘要呈現目前可用的統計報表資料。</p> - -<p><img alt="The stats dashboard provides a visual summary of your app's stats and links to the 5 reports" src="https://mdn.mozillademos.org/files/8285/Stats%20Dashboard.png" style="width: 1041px; height: 723px;"></p> - -<p>開發者可在此頁看到下列報表:</p> - -<ul> - <li><strong>Installs</strong>:App 完整安裝的次數</li> - <li><strong>Visits</strong>:App 在 Marketplace 列表頁面受消費者瀏覽的次數</li> - <li><strong>Ratings</strong>:提交給 App 的評分</li> - <li><strong>Abuse Reports</strong>:提交給 App 的濫用回報次數</li> - <li><strong>Average Rating</strong>:App 目前所接收的平均評分</li> -</ul> - -<p>每組報表均為相同的基礎架構,如下所示:</p> - -<p><img alt="All reports follow the same basic structure with date selector, region selector (Installs report only) graph, JSON export option and daily summary." src="https://mdn.mozillademos.org/files/8287/Report%20layout%20overview.png" style="width: 1045px; height: 1026px;"></p> - -<ol> - <li>日期選擇 — 可設定報表應顯示的開始\結束日期。</li> - <li>地區選擇 (僅 Installs 報表) — 可設定報表應顯示全世界活動資料,或個別國家\地區的資料。 - <div class="warning">在本文撰寫期間,此功能因資料加總功能的問題,先予以關閉。可參閱 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1028448">Bug 1028448</a>。</div> - </li> - <li>「更新」按鈕 — 依照目前日期與地區設定,重新整理報表內容。</li> - <li>按每日顯示的活動圖表。</li> - <li>JSON 匯出選項。</li> - <li>其他按每日顯示的活動圖表。</li> -</ol> - -<h2 id="使用匯出的資料">使用匯出的資料</h2> - -<p>你可能想在其他試算表應用中使用匯出的資料。目前尚無主流的試算表應用程式 (Microsoft 的 Excel、Apple 的 iWorks Numbers、OpenOffice 的 Calc) 能支援 JSON 格式的資料匯入功能。解決方案就是將 JSON 轉檔為 CSV 格式。此檔案格式可用於大多數的試算表應用程式。目前有許多 JSON to CSV 的線上轉檔功能:</p> - -<ul> - <li><a href="http://www.convertcsv.com/json-to-csv.htm">Convert JSON to CSV</a> 有多樣的 CSV 輸出選項,可轉換檔案或黏貼文字 (例如冒號與分號可用其他分隔符號替代),並針對轉換完成的資料提供文字顯示與 CSV 檔案下載。</li> - <li><a href="https://json-csv.com/">JSON to CSV - Online converter</a> 有多樣的 CSV 輸出選項,可轉換檔案或黏貼文字 (冒號、標籤、分號),並可顯示格式化的表格,亦可下載轉換過的資料與 CSV 檔案。另可針對轉換過的 JSON 資料建立永久連結。但免費版本將限制來源檔案須 1Mb 以下。</li> - <li><a href="http://konklone.io/json/">JSON to CSV</a> - 可將 JSON 資料貼上頁面並顯示資料表格。而資料即可下載為 CSV 檔案。你也可依照自己需要,建立 JSON\頁面的永久連結。其原始碼<a href="https://github.com/konklone/json">架設於 GitHub</a> 上,且該作者另透過<a href="http://sunlightfoundation.com/blog/2014/03/11/making-json-as-simple-as-a-spreadsheet/">此部落格文章說明此專案的背景。</a></li> -</ul> - -<p>此外還有下列資源提供程式碼,讓你能針對不同的試算表應用程式,建立自動匯入功能:</p> - -<ul> - <li>Excel - <ul> - <li><a href="https://code.google.com/p/vba-json/">VBA-JSON</a></li> - <li><a href="http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html">VB-JSON</a></li> - </ul> - </li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html deleted file mode 100644 index 76f2576eff..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/marketplace_screenshot_criteria/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Marketplace 截圖準則 -slug: Archive/Mozilla/Marketplace/Publishing/Marketplace_screenshot_criteria -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Marketplace_screenshot_criteria ---- -<div class="summary"> - <p>在將 App 提交至 Firefox Marketplace 時,開發者必須提供 1 幅或更多截圖以供使用。Marketplace 另提供此類截圖的非硬性規範,可作為開發者截圖時的準則。如果 App 截圖均未能符合本篇文章所載明的規範,則可能會要求開發者提交新的截圖。</p> -</div> -<h2 id="截圖概述">截圖概述</h2> -<ul> - <li>開發者所上傳的截圖會出現在 - <ul> - <li>各個 App 的頁面</li> - <li>如果 App 榮獲編輯或館長推薦,也會出現在「精選 App」的類似區塊中</li> - <li>Marketplace 中的多樣選單或動態播放區</li> - </ul> - </li> - <li>Marketplace 接受 3 種不同規格,共 1 ~ 6 組截圖: - <ul> - <li>手機 (直幅或橫幅)</li> - <li>平板電腦</li> - <li>桌上型電腦 (一般應達 1024x768 或以上)</li> - </ul> - </li> - <li>根據 App 所支援裝置的規格,至少各需提供 1 組截圖。</li> -</ul> -<h2 id="截圖重點">截圖重點</h2> -<ul> - <li>應要儘量呈現自己的 App 特色與功能</li> - <li>可能的話,應移除狀態列 (一般均位於手機畫面最上方,顯示時間、電池電量、電信營運商名稱等硬體資訊)</li> - <li>儘量以實體裝置取得截圖,較模擬器取得的截圖為佳</li> - <li>避免將 App 放入裝置或桌機的圖片中 - <ul> - <li>若將 App 放入裝置或桌機的圖片中,就必須縮小 App 的介面而看不清楚</li> - <li>你所呈現的裝置或桌機介面,極可能與消費者本身所使用的介面有所不同</li> - </ul> - </li> - <li>避免「手拿」手機、螢幕、平板電腦的照片</li> - <li>Marketplace 中的 App 不會用於瀏覽器中,所以避免呈現出瀏覽器的介面 (工具列、網址列、上/下一頁等)</li> - <li>儘量以最少的文字解釋該介面,而不要淪為打廣告</li> - <li>避免使用與 App 本身無關的圖素</li> - <li>避免出現邊框</li> - <li>截圖將依照上傳的順序來呈現。開發者應先上傳最漂亮的截圖</li> -</ul> -<p>總而言之,截圖應該以 App 為重點,而不是 App 周圍的情境。</p> -<h2 id="尺寸與格式">尺寸與格式</h2> -<p>截圖可為 JPG 與 PNG 格式。若是較能保有原來解析度的 PNG-24 最好。如果是 JPG 格式,則應儘量使用最小幅度的壓縮並設定為最高圖像品質。</p> -<h3 id="建議尺寸">建議尺寸</h3> -<table class="standard-table"> - <thead> - <tr> - <th scope="col">裝置規格</th> - <th scope="col">建議的解析度</th> - </tr> - </thead> - <tbody> - <tr> - <td>手機</td> - <td> - <p>320x480 的倍數、720x1280 的倍數;或 480x320 的倍數、1280x720 的倍數</p> - </td> - </tr> - <tr> - <td>平板電腦</td> - <td>1024x768 的倍數、1280x800 的倍數</td> - </tr> - <tr> - <td>桌上型電腦</td> - <td>1280x800 的倍數、1440x900 的倍數</td> - </tr> - </tbody> -</table> -<h2 id="範例">範例</h2> -<p>不要出現與 App 無關的圖素,如廣告或商標。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/6313/no-ads.png" style="width: 640px; height: 360px;"></p> -<p>不要提供「手拿著裝置」的照片,或將截圖編輯到實體裝置之上。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/6315/no-hand.png" style="width: 640px; height: 360px;"></p> -<p>截圖不需使用/添加裝置的邊框、不必要的文字、其他不必要的特色。</p> -<p><img alt="" src="https://mdn.mozillademos.org/files/6317/no-simulated-device.png" style="width: 640px; height: 360px;"></p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html deleted file mode 100644 index cf9937c110..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/packaged_apps/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: 封裝式 (Packaged) App -slug: Archive/Mozilla/Marketplace/Publishing/Packaged_apps -translation_of: Archive/Mozilla/Marketplace/Options/Packaged_apps ---- -<p><span class="seoSummary"><strong>封裝式</strong><strong> (Packaged) App</strong> 屬於 Open Web App,即以 ZIP 壓縮檔納入其 HTML、CSS、JavaScript、manifest 檔案等所有資源,不像之前必須將資源置於網路伺服器之中。本篇文章將為開發者提供封裝式 App 的相關說明 。</span></p> -<p>封裝式 App 為 ZIP 壓縮檔,內含 Open Web App 能夠運作的所有資源,並將 <a href="https://developer.mozilla.org/docs/Apps/Manifest">manifest</a> 檔案置於其根目錄之下,且此 manifest 檔案將提供 App 本身的說明、圖示等資訊,以利辨識出已安裝的 App。此封包接著可將 App 安裝到 Firefox OS 裝置、<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_android">Android 裝置</a>、<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_desktop">桌機</a>之中。一旦在裝置上安裝 App 之後,仍可存取 Web 上的資源,如伺服器上的資料庫。</p> -<p><a href="https://developer.mozilla.org/zh-TW/Apps/Developing/Packaged_apps/Packaged_apps$edit#types_of_packaged_apps">封裝式 App 另可分為三類:</a>Web App、Privileged App、Certified App。封裝式 App 可作為任何形式的 Open Web App;Privileged 與 Certified App 則是透過數位簽章的方式,啟動 <a href="https://developer.mozilla.org/en-US/Apps/Build/App_permissions">Privileged 與 Certified API</a>。Privileged App 簽章之後即成為 Marketplace 審查流程的一部分;Certified App 則是由裝置製造商或電信營運商進行簽章。</p> -<p>封裝式 App 除了能使用 Privileged 與 Certified API 之外,也能在安裝之後更快取得裝置的資源,達到更快的首次啟動速度。基於這些特色,我們也針對 Firefox OS 裝置、<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_android">Android 裝置</a>、<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Open_web_apps_for_desktop">桌機</a>,均建議以封裝式 App 的形式提供 Open Web App。</p> -<div class="note"> - <p><strong>注意:</strong>目前 Firefox Marketplace 上所支援的付費封裝式 App,僅限為 Firefox OS App。而免費封裝式 App 已可支援 Firefox OS、行動版 Firefox (Firefox for Android)、桌面版 Firefox。現正開發可支援所有平台的付費 App。</p> -</div> -<div class="note"> - <p><strong>注意:</strong>你會在 Firefox 開發者工具的「應用程式管理員 (App Manager)」看到「manifest」中文翻譯為「安裝資訊檔」。</p> -</div> -<h2 id="封裝式_App_的類型"><strong>封</strong>裝<strong>式</strong><strong> App </strong><strong>的類型</strong></h2> -<p>封裝式 App 可分為 Web App、Privileged App、Certified App,且均可對應 Firefox OS 不同程度的 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_model#App_Security">App 安全性</a>模式。接著將提供進一步資訊。</p> -<h3 id="Web_app">Web app</h3> -<p>Web App 不會使用 Privileged 或 Certified API。在提交到 Marketplace 之後,App 的封包隨即簽章完成,但仍尚未執行 Privileged 或 Certified App 所使用的特殊授權程序。也因此 Web App 不能使用 Privileged 或 Certified API。這些 App 也不需要 Privileged 與 Certified App 所必備的<a href="https://developer.mozilla.org/en-US/Apps/CSP">內容安全政策</a> (CSP)。</p> -<p>這種封裝式 App 的 <code>manifest.webapp</code> 檔案中,不需要 <code>type</code> 欄位。其 <code>type</code> (<code>web</code>) 的預設值就是正確的值。</p> -<p>Web App 可<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing">自行發佈</a>,或可透過 Firefox Marketplace 發佈。Web App 亦可透過<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Hosted_apps">架設/托管式 App</a> 的機制對外提供。</p> -<h3 id="Privileged_app">Privileged app</h3> -<dl> - <dt> - </dt> - <dd> - Privileged app 是由 Firefox OS Marketplace 以特殊程序核准之後發出。如果任一 App 要存取裝置上的特定 Sensitive API,則可為使用者提供更高的安全性。此種 App 即等同 iOS 或 Android 平台上的原生 App。若要指定為 Privileged App,必須在其 <code>manifest.webapp 檔案中添增</code> <a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#type"><code>type</code></a> 欄位並設定為 <code>privileged</code>。App 所要存取的 privileged API,均必須加入 <a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest">manifest</a> 檔案的 <code>permissions</code> 欄位中。</dd> - <dd> - Firefox OS、Web runtimes for Android、桌機,將針對 Privileged App 強制使用下列 <a href="https://developer.mozilla.org/en-US/docs/Security/CSP/Introducing_Content_Security_Policy">CSP</a>:</dd> -</dl> -<dl> - <dd> - <pre>"default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'"</pre> - <p>Privileged App 僅能透過 Firefox Marketplace 發佈。</p> - </dd> - <dt> - </dt> -</dl> -<h3 id="Certified_app">Certified app</h3> -<dl> - <dt> - </dt> - <dd> - <div class="geckoVersionNote"> - <p>一般第三方開發者並不會接觸到 Certified App;且 Certified App 也不會透過 Firefox Marketplace 發佈。這類 API 的長遠目標,就是要讓本身的憑證更完善、更具公信力,進而也能作為 Privileged API。如果你不是很想架構特定的 API,也可直接在 <a href="https://lists.mozilla.org/listinfo/dev-webapps">dev-webapps</a> 郵件群組中反應。</p> - </div> - </dd> - <dd> - Certified App 將透過 Certified API 而存取重要的系統功能,如智慧型手機上預設的撥號鍵盤,或系統設定 App。與 Privileged App 相較,並不會用於第三方 App,所以大多數的 App 開發者可忽略此類 App。除了所有的裝置許可均為隱式許可 (Implicit permission,意即不需要外部的使用者許可) 之外,Certified 與 Privileged App 大部分均屬於相似的封裝式 App。而 Certified App 必須取得 OEM 裝置或電信營運商裝置的許可,才能讓此隱式 App 使用重要 API。若要將 App 指定為 Certified App,則需於其 <code>manifest.webapp</code> 檔案中添增 <a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#type"><code>type</code></a> 欄位並設定為 <code>certified</code>。</dd> - <dd> - Firefox OS 則針對 Certified App 建構了下列 CSP: - <pre>"default-src *; script-src 'self'; object-src 'none'; style-src 'self'"</pre> - 與 Certified App 相較,Privileged App 則是針對 inline CSP 的影響而稍微放寬了限制。進一步了解其原因,可參閱<a href="https://wiki.mozilla.org/Apps/CSP">預設 CSP</a> 與 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=768029">Bug 768029</a>。<br> - <br> - OEM 廠商與電信營運商均已將 Certified App 安裝到裝置之上。</dd> - <dt> - </dt> -</dl> -<h2 id="測試封裝式_App"><strong>測試封</strong>裝<strong>式</strong><strong> App</strong></h2> -<p>如果要透過 Firefox OS 模擬器 (Firefox OS Simulator),測試 Firefox OS 裝置在安裝封裝式 App 的情形,可參閱<a href="https://developer.mozilla.org/zh-TW/Firefox_OS/Using_the_App_Manager">《應用程式管理員 (App Manager)》</a>。開發者也能透過《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Publishing/Publish_options">App 發佈方式</a>》中的步驟,從一般網頁伺服器上安裝該 App 到裝置上。另請注意,如果你要自己發佈 App,就只能安裝封裝式 Web App。</p> -<h2 id="發佈封裝式_App">發佈封裝式 App</h2> -<p>有兩種方式可發佈封裝式 App:透過 Firefox Marketplace 或自行發佈。</p> -<h3 id="透過_Firefox_Marketplace_發佈">透過 Firefox Marketplace 發佈</h3> -<p>可參閱 <a href="https://developer.mozilla.org/en-US/Marketplace/Publishing">App Publishing</a>,將封裝式 App 提交到 Firefox Marketplace 之上。</p> -<p>在提交封裝式 App 時,其 zip 檔案即儲存於 Marketplace 伺服器之上,且 Marketplace 將根據封裝式 App 的 zip 檔案中的 manifest,產生新的「<strong>mini-manifest</strong>」檔案。在消費者安裝 App 時,隨即將 mini-manifest 傳送至 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.installPackage"><code>Apps.installPackage()</code></a> 函式以安裝該 App。僅安裝與更新程序才會使用 mini-manifest。App 執行期間並不會使用此檔案。</p> -<h3 id="自行發佈">自行發佈</h3> -<p>當然也能在 Firefox Marketplace 之外,也就是自己的網路伺服器上發佈封裝式 App。可參閱《<a href="https://developer.mozilla.org/en-US/Marketplace/Options/Self_publishing">自行發佈 App</a>》。</p> -<h2 id="更新封裝式_App"><strong>更新封</strong>裝<strong>式 A</strong>pp</h2> -<p>若要進一步了解更新作業,請參閱《<a href="https://developer.mozilla.org/docs/Apps/Updating_apps">更新 App</a>》。</p> -<h2 id="更多資訊">更多資訊</h2> -<ul> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_model">Firefox OS 安全性概述</a></li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Security/Application_security">應用程式安全性</a></li> - <li><a href="https://github.com/robnyman/Firefox-OS-Boilerplate-App" title="https://github.com/robnyman/Firefox-OS-Boilerplate-App">Firefox OS Boilerplate App</a></li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html deleted file mode 100644 index d914835648..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Policies and Guidelines -slug: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines -tags: - - NeedsTranslation - - Structure - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines ---- -<p>This section contains Firefox Marketplace policies and guidelines</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html deleted file mode 100644 index 230c5d714a..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/policies_and_guidelines/introduction/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: 簡介 ─ 政策與指南 -slug: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Introduction -translation_of: Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Introduction ---- -<div class="summary"><span class="seoSummary">本文將提供 Firefox Marketplace 所用的多項政策與指南。</span></div> - -<div class="column-container">下列政策與指南均為 Firefox Marketplace 所用:</div> - -<div class="column-container"> </div> - -<div class="row topicpage-table"> -<div class="section"> -<h2 class="Community" id="Community" name="Community">政策</h2> - -<dl> - <dt><a href="/en-US/Marketplace/Publishing/Policies_and_Guidelines/Privacy_policies#Mozilla_Marketplace_privacy_requirements">隱私權政策</a></dt> - <dd>如果 App 需用到消費者的個人資料,就必須提供隱私權政策。</dd> -</dl> -</div> - -<div class="section"> -<h2 class="Tools" id="Tools" name="Tools">指南</h2> - -<dl> - <dt><a href="/en-US/Marketplace/Publishing/Policies_and_Guidelines/Privacy_policies">隱私權政策</a></dt> - <dd>如果 App 需用到消費者的個人資料,則相關指南可提供 App 隱私權政策中所需的資訊。</dd> -</dl> - -<dl> - <dt><a href="/en-US/Marketplace/Publishing/Policies_and_Guidelines/Marketplace_screenshot_criteria">截圖指南</a></dt> - <dd>為 App 截圖的相關指南,且截圖亦可用於 Marketplace 上架展示。</dd> - <dt><a href="/en-US/Marketplace/Publishing/Policies_and_Guidelines/Testing_and_troubleshooting">App 測試與疑難排解</a></dt> - <dd>相關資訊將說明測試環境的設定方式,以利測試 App 並解決可能發現的問題。</dd> -</dl> -</div> -</div> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html deleted file mode 100644 index 6c505166dd..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/introduction/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: 簡介 — 制定 App 的價格 -slug: Archive/Mozilla/Marketplace/Publishing/Pricing/Introduction -translation_of: Archive/Marketplace/Publishing/Pricing/Introduction ---- -<div class="warning"> -<p>本文將陸續新增相關內容,請隨時注意更新資訊。</p> -</div> - -<div class="summary">要讓自己的 App 透過 Firefox Marketplace 獲得收益很簡單:為自己的帳戶設定 1 或更多的付款服務供應商,再設定 App 價格與發售國家 (免費 App 也能讓消費者升級為付費版本)。如果你要使用「應用程式內付款 (In-app payment)」功能,就必須取得 API 金鑰並定義 App 內販售的產品。本文將帶領你在 <span class="seoSummary">Firefox Marketplace</span> 中設定付費的<span class="seoSummary">Open Web App 及其內部販售產品,另提供有用的相關資訊。</span></div> - -<div class="column-container"> </div> - -<div class="row topicpage-table"> -<div class="section"> -<h2 class="Community" id="Community" name="Community">設定付費 App</h2> - -<dl> - <dt><a href="/en-US/Marketplace/Publishing/Pricing/Payment_Accounts">付費帳戶</a></dt> - <dd>設定帳戶的付款服務供應商,才能收取 App 售出及其內部付款的收益。</dd> - <dt>訂價 (敬請期待)</dt> - <dd>設定 App 價格與銷售國家等選項。</dd> - <dt><a href="/en-US/Marketplace/Publishing/Pricing/Promote_as_upgrade_to_free_version">以「升級」方式推廣</a></dt> - <dd>免費 App 亦可升級為付費 App。</dd> -</dl> - -<h2 class="Community" id="Community" name="Community">更多資訊</h2> - -<dl> - <dt> </dt> - <dt><a href="/en-US/Marketplace/Monetization/Validating_a_receipt">檢驗收據</a></dt> - <dd>該如何檢查消費者是否付款購買 App。</dd> - <dt><a href="/en-US/Marketplace/Monetization/App_pricing">價格點數</a></dt> - <dd>依國家訂價的相關資訊。</dd> -</dl> -</div> - -<div class="section"> -<h2 class="Community" id="Community" name="Community">設定應用程式內付款</h2> - -<dl> - <dt>取得自己的 API 金鑰 (敬請期待)</dt> - <dd>為自己的 App 取得 API 金鑰。</dd> - <dt><a href="/en-US/Marketplace/Publishing/Pricing/In-app_products">定義應用程式內販售的產品</a></dt> - <dd>於 Marketplace 上設定 fxPay 的應用程式內產品。</dd> -</dl> - -<h2 id="更多資訊">更多資訊</h2> - -<dl> - <dt><a href="/en-US/Marketplace/Monetization/Validating_a_receipt">檢驗收據</a></dt> - <dd>該如何檢查消費者是否付款購買 App 內販售的產品。</dd> -</dl> -</div> -</div> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html deleted file mode 100644 index e6938f4336..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/payment_accounts/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: 付款帳號 -slug: Archive/Mozilla/Marketplace/Publishing/Pricing/Payment_Accounts -translation_of: Archive/Marketplace/Publishing/Pricing/Payment_Accounts ---- -<div class="summary"> -<p>如果要在 Firefox Marketplace 設定付款 App 或應用程式內付款 (In-app payment) 產品,首先就是設定 1 家或更多的付款服務供應商。本文將說明 Firefox Marketplace 搭配多家供應商的理由、提交程序中所應完成的設定,另提供各家供應商的<strong>帳號</strong>資訊。</p> -</div> - -<h2 id="付款服務供應商">付款服務供應商</h2> - -<p>目前配合 Firefox Marketplace 活躍中的付款服務供應商就是「Bango」,當然 Firefox Marketplace 未來將支援其他供應商。付款服務供應商可新增其他付款選項,如付款類型、電信營運商、收款國家等。另間「Boku」供應商很快就會加入 Marletplace。供應商另可透過 Marketplace 讓消費者選用其服務;但目前尚未有供應商支援此一選項。</p> - -<div class="note"> -<p>在交易付費 App 時,均必須透過 Firefox Marketplace 中的付款服務供應商之一。如果 App 亦提供應用程式內付款的產品,也可配合其他供應商,但開發者必須自行滿足必要的推銷與技術需求。</p> -</div> - -<h2 id="供應商的功能">供應商的功能</h2> - -<p>所有的付款服務供應商必須達到下列:</p> - -<ul> - <li>只要消費者購買 App 或其內付款的產品,必須能透過消費者的信用卡或電信帳單收取款項。</li> - <li>將款項分配給開發者與 Mozilla (相關收入僅用以支付 Marketplace 發展與運作費用),並收取本次交易的費用。</li> - <li>提供開發者的收益報表。</li> -</ul> - -<h2 id="設定自己的付款帳號">設定自己的付款帳號</h2> - -<p>在<strong> </strong>Marketplace<strong> </strong>提交程序的「<strong>相容性與付款 (Compatibility & Payments)</strong>」頁面上,找到「<strong>付款帳號 (Payment Accounts)</strong>」區塊並設定付款服務供應商。</p> - -<p><img alt="The Payment Accounts section of the Compatibility and Pricing page" src="https://mdn.mozillademos.org/files/8031/Payment%20accounts.png" style="width: 1001px; height: 920px;"></p> - -<p>在設定付款帳號與供應商兩者時,所需的資訊有所不同。但同樣必備的資訊如下:</p> - -<ul> - <li>開發者的詳細資訊:姓名、地址、稅務編號、(如果你是以法人型態運作) 當地的公司登記資訊。</li> - <li>詳細的銀行帳號資訊:銀行名稱、分行地址、匯款代碼或類似編號、自己的銀行帳號。</li> -</ul> - -<div class="note"> -<p>在大多數的情況下,付款服務供應商也有在其他國家運作,因此會透過某些形式的國際銀行轉帳作業支付款項給開發者。這類交易都會需要收款銀行的識別代碼。常用的代碼有:</p> - -<ul> - <li>SWIFT/BIC — 此代碼可識別收款銀行。開發者可能必須另外提供分行撥款的帳號。</li> - <li>IBAN — 此代碼可一併識別收款銀行與你的帳號。</li> -</ul> - -<p>其實只要透過 Google 查詢自己開戶的銀行名稱與匯款代碼 (可能是 SWIFT 或 BIC 或 IBAN),往往都能找到銀行的相關資訊。可在你開戶銀行的網站上尋找「跨國轉帳」、「收取海外匯款」或類似字眼。此外還有某些工具可協助你找到相關代碼:</p> - -<ul> - <li><a href="https://ipsosepaservice.sentenial.com/ipso/">Irish Payment Services Organisation (IPSO) BIC and IBAN conversion tool</a> (僅限愛爾蘭銀行的帳號)。</li> -</ul> -</div> - -<p>以下連結可找到付款服務供應商的設定資訊:</p> - -<ul> - <li><a href="/en-US/Marketplace/Publishing/Pricing/Providers/Bango">Bango</a></li> - <li><a href="/en-US/Marketplace/Publishing/Pricing/Providers/Boku">Boku</a> (尚未啟用)</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html deleted file mode 100644 index d0eb6c32a4..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/pricing/promote_as_upgrade_to_free_version/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: 建議升級 App 的免費版本 -slug: >- - Archive/Mozilla/Marketplace/Publishing/Pricing/Promote_as_upgrade_to_free_version -translation_of: Archive/Marketplace/Publishing/Pricing/Promote_as_upgrade_to_free_version ---- -<div class="summary"> -<p><span class="seoSummary">談到 App 的相容性與付款選項時,可讓 App 的免費版本升級為付費版本,並透過 Firefox Marketplace 提出此一推銷建議。此一選項可供消費者先體驗功能有所限制的 App,在決定是否購買完整功能的版本。或是免費版本會顯示廣告,付費版本則無廣告;或可為其他類似的組合。本文章說明設定方式,並讓 Firefox Marketplace 顯示升級資訊。</span></p> -</div> - -<p>在「相容性與訂價 (<strong>Compatibility & Pricing</strong>)」頁面底部,可看到「以升級至免費版本促銷 (<strong>Promote as upgrade to free version)</strong>」區塊。而在「<strong>這個付費版本升級此附加元件 (This is a paid upgrade of)</strong>」方塊中,你可選擇要哪些免費 App 可升級為付費 App。一旦選擇對應的免費版本 App 之後,就點擊「儲存變更 (<strong>Save Changes)</strong>」。</p> - -<p><img alt="Promote as upgrade to free version section of the Compatibility & Pricing page" src="https://mdn.mozillademos.org/files/8025/Promote%20as%20Paid.png" style="width: 749px; height: 196px;"></p> - -<p>一旦 App 通過審查並發佈於 Firefox Marketplace 之上,則免費 App 列表中就會出現下列附加資訊:</p> - -<ul> - <li>在手機上為:<br> - <img alt="The Premium version available notice and link in the listing of a free app on a Firefox OS device." src="https://mdn.mozillademos.org/files/8029/Premium%20version%20available%20(phone).png" style="width: 480px; height: 853px;"></li> - <li>在桌機上為:<br> - <img alt="The Premium version available notice and link in the listing of a free app." src="https://mdn.mozillademos.org/files/8027/Premium%20version%20available.png" style="width: 740px; height: 220px;"></li> -</ul> - -<p>若要進一步了解 App 的銷售方式,可參閱〈<a href="/en-US/Marketplace/Prepare/Choosing_your_business_model">選擇自己的商業模式〉。</a></p> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html deleted file mode 100644 index 80c1bc6b62..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/privacy_policies/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: 隱私權政策制定指南 -slug: Archive/Mozilla/Marketplace/Publishing/Privacy_policies -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Privacy_policies ---- -<p>隱私權極難以界定,且牽涉到法律、社會規範、使用者期望等複雜的概念。不論是 App、網站、網頁、附加元件的開發者,都必須謹慎對待使用者的隱私權以獲得信賴。Mozilla 集結相關指南並制定極佳的隱私權政策,以協助開發者建構出注重隱私權的 App。但請注意,本文並無法取代真正律師所提供的實質法律服務。</p> -<h2 id="隱私權政策">隱私權政策</h2> -<p>隱私權政策用以闡述你對資料的處理方式。關鍵在於開發者<strong>蒐集</strong>、<strong>使用</strong>、<strong>儲存</strong>、<strong>共用</strong>、<strong>揭露</strong>個人資訊的方法。Mozilla 則集結成隱私權政策範本,讓開發者能簡單說明自己的隱私權政策。</p> -<pre><a href="https://github.com/flamsmark/privacy-policy-template" title="https://github.com/flamsmark/privacy-policy-template">https://github.com/flamsmark/privacy-policy-template</a> -</pre> -<p>首先請參閱 <a class="link-https" href="https://github.com/flamsmark/privacy-policy-template#readme" title="https://github.com/flamsmark/privacy-policy-template#readme">README</a>。此範本僅可協助你制定部分的隱私權政策。Mozilla 前提是協助開發者能更輕鬆制定隱私權政策,但無法保證此範本已經面面俱到。至少此範本能讓你注意到主要的隱私權問題並進一步思考。敬請使用該範本並自行強化不足的部份。</p> -<p>此範本也是很好的實作機會 (某些情況下必須兼顧適法性的問題)。開發者可透過隱私權政策讓消費者知道自己的資訊將何去何從。全世界有這麼多不同的國家,對使用者資料的蒐集、使用、儲存、揭露方式的要求也有所差異。開發者應透過律師了解不同的隱私權政策,並確實讓消費者得知自己應熟悉的要點。</p> -<h2 id="Mozilla_Marketplace_的隱私權要求">Mozilla Marketplace 的隱私權要求</h2> -<p>如果任一 App 或附加元件 (Add-on) 將蒐集消費者的資料,則開發者就必須提供隱私權政策並將之列於 Mozilla Marketplace 之中。</p> -<h2 id="設計_App_的隱私權要點">設計 App 的隱私權要點</h2> -<ul> - <li>設計自己的 App 或附加元件,而處理消費者資料的方式,務必與消費者心中所認知的方式一致。</li> - <li>儘量讓消費者能控制自己的資料,例如讓他們自行選擇是否允許資料蒐集作業。</li> - <li>限制自己的資料蒐集作業,只使用必要的資料。</li> - <li>設計自己的 App 與服務,以保護消費者資料在蒐集、儲存、使用過程中的安全性。</li> - <li>回答消費者對於隱私權的問題與懷疑之處。</li> - <li>避免不為消費者所知的更新作業。</li> - <li>將相關社交功能攤在陽光下,讓消費者確實知道自己正分享資料出去。</li> - <li>讓消費者能關閉自動分享的功能,或針對資料分享提供更多樣的選項。</li> - <li>必要時應取得消費者的許可,特別是當事人的地理位置或其他敏感資訊。</li> - <li>提供自己隱私權政策的連結。若有「使用條款」亦可於 App 內提供。</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html deleted file mode 100644 index c7b213c18c..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/publish_options/index.html +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: 自行發佈 App -slug: Archive/Mozilla/Marketplace/Publishing/Publish_options -translation_of: Archive/Mozilla/Marketplace/Options/Self_publishing ---- -<div class="summary"> - <p>開發者可能不想透過 Firefox Marketplace 發佈 App,例如你只想提供給組織內的成員、執行測試版 App,或只是自己試好玩的。本篇文章將說明開發者如何在 Firefox Marketplace 之外自行發佈 App。</p> -</div> -<h2 id="sect1"> </h2> -<p>Open Web App 可透過 {{ domxref("Apps.install") }} 或 {{ domxref("Apps.installPackage") }},安裝到 Firefox OS、執行 Firefox for Android 的裝置,或是執行桌面版 Firefox 的桌機之上。而這些 API 均會送出 manifest 檔案的網址,其內將敘述所將安裝的 App。因此要自行發佈 App 就必須滿足下列基本要求:</p> -<ol> - <li>伺服器必須裝載 App 的 manifest 檔案</li> - <li>伺服器必須裝載 (架設/托管式) App,或 (封裝式) App 的 ZIP 檔案</li> - <li>置於網站上的程式碼必須觸發合適的 {{ domxref("Apps.install") }} 或 {{ domxref("Apps.installPackage") }}</li> -</ol> -<h2 id="限制">限制</h2> -<p>在自己發佈 Open Web App 之前,必須注意下列限制:</p> -<ul> - <li>自行發佈的 App 不能使用 <a href="https://developer.mozilla.org/en-US/Apps/Build/App_permissions">Privileged API</a>。若要使用這類 API,則必須為封裝式 (Packaged) App 並具備自己的 ZIP 檔案,另需經由 Firefox Marketplace 提交程序而完成簽署。</li> - <li>你的 App 不能使用 Firefox Marketplace 的 App 內購買功能。</li> - <li>由於 App 無法在 Firefox Marketplace 上曝光,所以開發者必須自行研究 App 的發佈技術。</li> -</ul> -<h2 id="自行發佈封裝式_App"><strong>自行發佈封裝式</strong> App</h2> -<p>只要在伺服器上架設/托管 ZIP 檔案與其 mini-manifest,就能自行發佈封裝式 App。而 mini-manifest 必須置於 ZIP 相同的目錄之下,以利安裝程序能識別 App。接著可建立指令碼以觸發 {{ domxref("Apps.installPackage") }},送出 mini-manifest 的細節。可參閱下方以了解:</p> -<ol> - <li> - <p>將 App 的內容壓縮為 ZIP 並命名為 <code>package.zip</code>。 此檔案應容納 App 的所有資源檔案,並包含 (主要) <a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest" title="Manifest documentation">manifest</a> 檔案。</p> - <div class="warning"> - <p>重要:請注意封裝式 App 所要壓縮的內容,不要包含檔案本身的目錄。如果你連母目錄都壓縮進去,則 manifest 檔案就位於錯誤地方,整個封裝式 App 隨即無效。</p> - </div> - </li> - <li>建立名為 <code>manifest.webapp</code> 的檔案,並加入以下內容。此檔案即所謂的 mini-manifest,也是封裝式 App 壓縮檔內的精簡版 manifest 檔案。而 {{ domxref("Apps.installPackage") }} 將使用 mini-manifest,以進行 App 的安裝程序。若要進一步了解細節,可參閱下方的 <a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Publishing/Publish_options$edit#Mini-manifest_fields">Mini-manifest 欄位</a>。<br> - <pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"My sample app"</span><span class="token punctuation">,</span> - <span class="token string">"package_path"</span> <span class="token punctuation">:</span> <span class="token string">"http://my-server.com/my-app-directory/package.zip"</span><span class="token punctuation">,</span> - <span class="token string">"version"</span><span class="token punctuation">:</span> <span class="token string">"1"</span><span class="token punctuation">,</span> - <span class="token string">"developer"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"A. Developer"</span><span class="token punctuation">,</span> - <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">"http://my-server.com"</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> - </li> - <li>建立可安裝 App 的指令碼。這裡我們使用了名為「<code>index.html</code>」的簡易 HTML 檔案。但你也可將指令碼新增至按鈕,或使用任何適當的函式,以於自己的網站上觸發作業。此頁面上的 JavaScript 將呼叫 Packaged App installer API ({{ domxref("Apps.installPackage") }}),並針對安裝作業的成功與否進行回呼 (Callback)。 - <pre class="brush: html language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>html</span><span class="token punctuation">></span></span> - <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>body</span><span class="token punctuation">></span></span> - <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>p</span><span class="token punctuation">></span></span>Packaged app installation page<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>p</span><span class="token punctuation">></span></span> - <span class="token script"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span><span class="token punctuation">></span></span> - <span class="token comment"> // This URL must be a full url. -</span> <span class="token keyword">var</span> manifestUrl <span class="token operator">=</span> <span class="token string">'http://my-server.com/my-app-directory/manifest.webapp'</span><span class="token punctuation">;</span> - <span class="token keyword">var</span> req <span class="token operator">=</span> navigator<span class="token punctuation">.</span>mozApps<span class="token punctuation">.</span><span class="token function">installPackage<span class="token punctuation">(</span></span>manifestUrl<span class="token punctuation">)</span><span class="token punctuation">;</span> - req<span class="token punctuation">.</span>onsuccess <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token function">alert<span class="token punctuation">(</span></span>this<span class="token punctuation">.</span>result<span class="token punctuation">.</span>origin<span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span><span class="token punctuation">;</span> - req<span class="token punctuation">.</span>onerror <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> - <span class="token function">alert<span class="token punctuation">(</span></span>this<span class="token punctuation">.</span>error<span class="token punctuation">.</span>name<span class="token punctuation">)</span><span class="token punctuation">;</span> - <span class="token punctuation">}</span><span class="token punctuation">;</span> - <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span></span> - <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>body</span><span class="token punctuation">></span></span> -<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>html</span><span class="token punctuation">></span></span></code></pre> - </li> - <li>將「<code>package.zip</code>」、「<code>package.manifest</code>」、「<code>index.html」</code>複製到你指定的目錄中 (此範例則為 <code>my-app-directory</code>),即可在自己的伺服器或網站上設定檔案。</li> - <li>以相容設備 (如 Firefox OS 手機) 安裝 App。只要開啟 <code>index.html</code> 檔案 (此範例的路徑為 <code> <a class="LinkyMobile-ext" href="http://my-server.com/my-app-directory/package.manifest" title="Linkification: http://my-server.com/my-app-directory/package.manifest">http://my-server.com/my-app-directory/index.html</a></code>) 就會看到系統詢問是否要安裝該 App。繼續執行安裝步驟直到完畢,接著網頁指令就會顯示安裝作業是否成功。</li> -</ol> -<div class="note"> - <p>秘訣:你可於本端架設/托管 1 個封裝式 App,並於裝置中進行測試。伺服器與裝置必須位於同一個網路之上,而伺服器必須能接收本端網路的請求。你只要在 mini-manifest 檔案的 <code>package_path</code> 中加入絕對路徑即可。只要用相同的方式,正常情況就已經納入絕對路徑 (可參閱下方)。如果要使用非標準通訊埠,例如 <code><a class="LinkyMobile-ext" href="http://10.10.12.1:8080/package.zip" title="Linkification: http://10.10.12.1:8080/package.zip">http://10.10.12.1:8080/package.zip</a></code>,則記得應納入通訊埠的資訊。</p> -</div> -<h3 id="Mini-manifest_檔案的欄位">Mini-manifest 檔案的欄位</h3> -<p>如果要在 Firefox Marketplace 發佈 App,就不需擔心該如何建立 mini-manifest 檔案;Firefox Marketplace 可為開發者代勞。Marketplace 將使用 manifest 檔案中的相關資訊。可參閱《<a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest">App 的 manifest 檔案</a>》一文。</p> -<p>如果要自行發佈 App,也就必須自行建立 mini-manifest 檔案。最好就是複製「主要」的 manifest 檔案,並依需求將之更新。先複製完整內容就能輕鬆建立 mini-manifest 檔案,因其內的 <code>name</code>、<code>version</code>、<code>developer</code>、<code>locales</code> 欄位必須完全相同。開發者亦可添增其他內容。mini-manifest 檔案專屬的欄位則包含 <code>package_path</code>、<code>release_notes</code>、<code>size</code>。</p> -<dl> - <dt> - <code>package_path</code> (必填)</dt> - <dd> - 儲存 App 壓縮檔的絕對路徑 (需為完整的網址,如 <code> <a class="LinkyMobile-ext" href="http://my-server.com/my-app-directory/package.manifest" title="Linkification: http://my-server.com/my-app-directory/package.manifest">http://my-server.com/my-app-directory/manifest.webapp</a></code>)</dd> - <dt> - <code>release_notes</code> (選填)</dt> - <dd> - App 版本資訊。在 Firefox Marketplace 的提交過程中,就必須提供此項資訊。</dd> -</dl> -<dl> - <dt> - <code>size</code> (選填)</dt> - <dd> - 以 byte 計算的 App 壓縮檔容量。而 {{ domxref("Apps.installPackage") }} 將使用此項資訊,才能在安裝過程中顯示安裝進度。</dd> -</dl> -<p>以下提供範例:</p> -<pre class="brush: js language-js"><code class="language-js"><span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"My app"</span><span class="token punctuation">,</span> - <span class="token string">"package_path"</span><span class="token punctuation">:</span> <span class="token string">"http://thisdomaindoesnotexist.org/myapp.zip"</span><span class="token punctuation">,</span> - <span class="token string">"version"</span><span class="token punctuation">:</span> <span class="token string">"1.0"</span><span class="token punctuation">,</span> - <span class="token string">"size"</span><span class="token punctuation">:</span> <span class="token number">172496</span><span class="token punctuation">,</span> - <span class="token string">"release_notes"</span><span class="token punctuation">:</span> <span class="token string">"First release"</span><span class="token punctuation">,</span> - <span class="token string">"developer"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Developer Name"</span><span class="token punctuation">,</span> - <span class="token string">"url"</span><span class="token punctuation">:</span> <span class="token string">"http://thisdomaindoesnotexist.org/"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"locales"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"fr-FR"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Mon application"</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"se-SE"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"Min balla app"</span> - <span class="token punctuation">}</span> - <span class="token punctuation">}</span><span class="token punctuation">,</span> - <span class="token string">"icons"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span> - <span class="token string">"16"</span><span class="token punctuation">:</span> <span class="token string">"/icons/16.png"</span><span class="token punctuation">,</span> - <span class="token string">"32"</span><span class="token punctuation">:</span> <span class="token string">"/icons/32.png"</span><span class="token punctuation">,</span> - <span class="token string">"256"</span><span class="token punctuation">:</span> <span class="token string">"/icons/256.png"</span> - <span class="token punctuation">}</span> -<span class="token punctuation">}</span></code></pre> -<p>此範例中的其他欄位包含:</p> -<dl> - <dt> - <code>name</code> (必填)</dt> - <dd> - App 的名稱,最長 128 個字元。</dd> - <dt> - <code>version</code> (選填)</dt> - <dd> - App 的目前版本。</dd> - <dt> - <code>developer</code> (選填)</dt> - <dd> - 開發者的資訊,內含 <code>name</code> 與 <code>url</code> 欄位。而 mini-manifest 與 manifest 檔案中的開發者資訊必須相同。</dd> - <dt> - <code>locales</code> (選填)</dt> - <dd> - 語系資訊,必須為 <code>xx-YY</code> 格式。</dd> - <dt> - <code>icons</code> (選填)</dt> - <dd> - App 所使用的圖示。</dd> -</dl> -<p>若要進一步了解 manifest 檔案,可參閱《<a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest" title="Manifest documentation">App 的 manifest 檔案</a>》。</p> -<h2 id="自行發佈架設托管式_App">自行發佈架設/托管式 App</h2> -<p>與封裝式 App 相較,如果你建立內容的方式,就與 Firefox Marketplace 發佈的方式相同,則自行發佈架設/托管式 (Hosted) App 就更簡單了。基本上就是為自己的 App 建立 <a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest" title="Manifest documentation">manifest 檔案</a>。接著加入程式碼以觸發 {{ domxref("Apps.install") }}。此程式碼必須與上述封裝式 App 所用的相同。唯一不同點在於,你可對 manifest 檔案設立相對的參考位置。</p> -<h2 id="另請參閱">另請參閱</h2> -<ul> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/JavaScript_API">App 的 Installation 與 Management API</a></li> - <li>{{ domxref("Apps.install") }}</li> - <li>{{ domxref("Apps.installPackage") }}</li> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/Manifest" title="Manifest documentation">App 的 manifest 檔案</a></li> - <li><a href="https://developer.mozilla.org/en-US/Apps/Build/App_permissions">App 權限</a></li> -</ul> -<p> </p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html deleted file mode 100644 index 5f029ca0c3..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submission_checklist/index.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: 提交作業檢查清單 -slug: Archive/Mozilla/Marketplace/Publishing/Submission_checklist -translation_of: Archive/Mozilla/Marketplace/Publishing/Submission_checklist ---- -<div class="summary"> - <p><span class="seoSummary">在將自己的 App 提交到 Firefox Marketplace 之前,當然該確認是否已經掌握了所有必要資源。本文則提供檢查項目與相關資訊的連結。</span></p> -</div> -<h2 id="提交作業檢查清單">提交作業檢查清單</h2> -<p>要完成 Firefox Marketplace 的提交程序,你需要:</p> -<h3 id="針對封裝式_(Packaged)_App">針對<a href="/en-US/Marketplace/Options/Packaged_apps">封裝式 (Packaged) App</a></h3> -<ul> - <li>將 App 封裝為 zip 檔案,並將 <a href="/en-US/Apps/Build/Manifest">manifest</a> 檔案至於根目錄中。</li> - <li>於 <a href="/en-US/Apps/Build/Manifest">manifest</a> 檔案中指定 <code><a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#launch_path">launch_path</a></code>。</li> -</ul> -<h3 id="針對架設托管式_(Hosted)_App">針對<a href="/en-US/Marketplace/Options/Hosted_apps">架設/托管式 (Hosted) App</a></h3> -<ul> - <li><span style="line-height: 1.5em;">可架設/托管 App 的網站。進一步資訊可參閱</span><span style="line-height: 1.5em;">《<a href="/en-US/Marketplace/Options/Hosted_apps#Options_for_hosting_your_app">Options for hosting your app</a></span><span style="line-height: 1.5em;">》。</span></li> - <li>App 內 manifest 檔案的網址。進一步資訊可參閱《<a href="https://developer.mozilla.org/zh-TW/Apps/Developing/Manifest/Manifest-840092-dup#csp">App 的 Manifest 檔案</a>》。</li> -</ul> -<div class="note"> - <p>在將 App 提交到 Firefox Marketplace 之前,可使用「<a href="https://marketplace.mozilla.org/developers/validator">測試應用程式驗證</a>」工具來測試 manifest 檔案的正確性。</p> -</div> -<div class="note"> - <p><strong>注意:</strong>你會在「應用程式管理員 (App Manager)」看到「manifest」中文翻譯為「安裝資訊檔」。</p> -</div> -<h3 id="針對所有_App_(必備)">針對所有 App (必備)</h3> -<p>架設/托管式、封裝式 App 的共通必要條件:</p> -<ul> - <li>App 的<a href="/en-US/Apps/Developing/Manifest#name">名稱</a>必須加進 manifest 檔案中,最多可達 128 個字元。在 App 上傳程序的 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_3.3A_Details">Step 3</a> 中,亦必須預先填入 Marketplace 的「Name」欄位。</li> - <li>App 的 manifest 檔案必須有 App 的<a href="/en-US/Apps/Developing/Manifest#description">相關敘述</a>,最多可達 1024 個字元。在 App 上傳程序的 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_3.3A_Details">Step 3</a> 中,亦必須預先填入 Marketplace 的「Description」欄位,並可後續進行編輯 (但如果是 Marketplace 的說明欄位,則沒有字元數的限制)。</li> - <li>需提供 128 x 128px 的縮圖圖示,以於 Marketplace 上呈現。此為固定的圖示尺寸。若要進一步了解應如何將圖示加入 App 中,可參閱 <a href="/en-US/Apps/Developing/Manifest#icons">manifest 圖示</a>。</li> - <li>需提供 App 截圖,至少為 320 x 480px (可參閱 <a href="/en-US/Apps/Publishing/Marketplace_screenshot_criteria">Marketplace 截圖準則</a>以進一步了解。若要添增或變更截圖,可於 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_4.3A_Next_Steps">Step 4</a> 中更新之)。</li> - <li>App 的隱私權政策,或是隱私權政策網頁的網址。可參閱<a href="/en-US/Marketplace/Publishing/Privacy_policies">隱私權政策指南</a>以進一步了解 (可於 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_3.3A_Details">Step 3</a> 時輸入)。</li> - <li>提供 App 支援服務的電子郵件位址 (可於 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_3.3A_Details">Step 3</a> 時輸入)。</li> -</ul> -<h3 id="針對付費_App_或應用程式內付款_(In-app_payments)">針對付費 App 或應用程式內付款 (In-app payments)</h3> -<ul> - <li>你必須找好付款服務商、銀行帳戶明細 (如帳號、SWIFT 代號、地址明細)、公司明細 (如 VAT 編號、公司統編、開業日期)。</li> - <li>如果 App 使用 In-app payments,確認已於 manifest 檔案中提供了 origin。</li> -</ul> -<h3 id="針對所有_App_(非必備)">針對所有 App (非必備)</h3> -<p>架設/托管式、封裝式 App 的建議條件:</p> -<ul> - <li>最多可提交 6 張截圖來呈現 App 的主畫面。最好是涵蓋不同裝置規格的 App 截圖,且各有尺寸限制: - <ul> - <li>手機:建議 320 x 480px 或相對應的倍數。</li> - <li>平板電腦:建議 1024 x 768px 或 1280 x 800px。</li> - <li>桌上型電腦:建議 1280 x 800px 或 1440 x 900px。</li> - </ul> - </li> - <li>其他尺寸的圖示應透過 manifest 檔案指定,以於其他平台/網頁內容達到最佳顯示效果: - <ul> - <li>60 x 60px 圖示可於裝置螢幕上顯示。</li> - <li>32 x 32px、90 x 90px、120 x 120px、256 x 256px 圖示,可於不同平台達到最佳顯示效果,如 Windows 7 與 Android。</li> - </ul> - </li> - <li>App 及其支援服務首頁的網址。根據你自己的需要,可為相同或不同的網址 (於 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_3.3A_Details">Step 3</a> 時輸入)。</li> - <li>其他<a href="/en-US/Apps/Developing/Manifest"> manifest</a> 檔案的選填欄位。目前有 <a href="/en-US/Apps/Developing/Manifest#name">name</a>、<a href="/en-US/Apps/Developing/Manifest#description">description</a>、<a href="/en-US/Apps/Developing/Manifest#icons">icons</a> 為必要欄位,另有許多選填欄位,例如: - <ul> - <li>如果你要提供多語言版本的 App,就必須填入 <a href="/en-US/Apps/Developing/Manifest#locales">locales</a> 的資訊。</li> - <li>如果有 locales 欄位,就必須一併提供 <a href="/en-US/Apps/Developing/Manifest#default_locale">default_locale</a> 欄位。</li> - <li>如果要在 App 中使用特定裝置的 API 或 Web Activity,也必須在 manifest 檔案中提供相關 <a href="/en-US/Apps/Developing/App_permissions">App permissions</a> 或 <a href="/en-US/docs/WebAPI/Web_Activities">activities</a> 欄位。</li> - </ul> - </li> -</ul> -<h3 id="另外還有......">另外還有......</h3> -<p>......你應該:</p> -<ul> - <li>在 Marketplace 審核通過你的 App 之後,預設將立刻讓 App 上架。如果你不想讓 App 立刻上架,則在提交 App 時要取消勾選「<strong>Publish my app in the Firefox Marketplace as soon as it's reviewed</strong>」(於 <a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_2.3A_Submit">Step 2</a> 時勾選)。</li> - <li>可參閱 <a href="/en-US/docs/Web/Apps/Publishing/Marketplace_review_criteria">Marketplace 審查準則</a> (<a href="/en-US/Marketplace/Submission/Submitting_an_app#Step_1.3A_Agreement">Step 1</a>)。</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html deleted file mode 100644 index 88211b4b18..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/enter_your_apps_details/index.html +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: 輸入 App 上架時所顯示的詳細資訊 -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Enter_your_apps_details -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Enter_your_apps_details ---- -<div class="summary"> -<p>在將 App 上傳到 Firefox Marketplace 之後,應更新 App 的詳細資訊以利於 Marketplace 頁面上顯示。</p> -</div> - -<div class="note"> -<p>此步驟將針對 App 的預設語系版本 (英文),編輯相關細節 (如網址與說明等)。如果你有其他語系版本,或是要針對其他國家\語系而修改詳細資訊,仍必須透過標準的「編輯資訊 (Edit Listing)」選項 (可參閱 <a href="/en-US/Marketplace/Publishing/Submit/Edit_other_localizations">step 9</a>)。</p> -</div> - -<div class="note"> -<p>注意:你可能會看到「manifest 檔案」的正體中文翻譯為「安裝資訊檔」。</p> -</div> - -<p>現在進入「<strong>提交 App、編輯</strong><strong> App 詳細資訊</strong>」的頁面。</p> - -<p><img alt="Edit app details page header" src="https://mdn.mozillademos.org/files/8245/Page%20header.png" style="width: 979px; height: 345px;"></p> - -<p>如頁面中所示,你在 <a href="/en-US/Apps/Build/Manifest">manifest</a> 檔案中提供的 App 詳細資訊,會由系統預先填入大部分的頁面空格之中。</p> - -<h2 id="App_圖示與網址">App 圖示與網址</h2> - -<p>在 manifest 檔案中提供的 App 圖示與說明,再加上檔案儲存網頁的網址,都已經列於此頁面的第一區塊內。Marketplace 將根據 App 名稱而自動產生網址,並逕行修改以成為專屬網址。你可以點擊 (1)「<strong>開啟詳細資訊頁面 (Open details</strong> <strong>page)</strong>」以檢視 Marketplace 的細節頁面,也能點擊 (2)「<strong>編輯 (Edit)」</strong>以編輯圖示與Marketplace 的網址。</p> - -<p><img alt="When the page first loads your app name and icon are displayed (based on the manifest content) along with the URL generated by Marketplace" src="https://mdn.mozillademos.org/files/8247/App%20URL%20-%20Display.png" style="width: 978px; height: 136px;"></p> - -<p>若要更改 App 的圖示,就點擊 (1) 的圖示就能瀏覽電腦上的其他圖檔。若要更改 App 詳細資訊的頁面名稱,可於 (2) 的 <strong>App 網址</strong>方塊中輸入新的值。如果你輸入目前已存在的頁面名稱,就會出現警告訊息,直到你修改完畢並點擊「<strong>繼續 (Continue)</strong>」為止。而且必須修改成有效的 App 詳細資訊頁面網址,否則就無法離開此頁面。</p> - -<p><img alt="You can (1) change the app's icon and (2) enter your own page name for the app" src="https://mdn.mozillademos.org/files/8197/App%20URL%20-%20Edit.png" style="width: 978px; height: 130px;"></p> - -<h2 id="App_說明">App 說明</h2> - -<p>接著下個區塊則顯示 App 的相關說明,也是直接取自於 manifest 檔案而來。你也可以依照自己需要而在「<strong>說明 (Description)</strong>」方塊中編輯說明。只要拖曳方塊右下角,就能拉大整個編輯方塊的面積。此為必填欄位。</p> - -<p><img alt="You can create a description over 1024 characters and include some HTML tags to improve formatting. " src="https://mdn.mozillademos.org/files/8249/Edit%20description.png" style="width: 978px; height: 171px;"></p> - -<p>與 manifest 檔案所提供的說明不同,這裡讓你編輯的說明內容可以:</p> - -<ul> - <li>超過 1024 個字元,但請還是儘量提供簡潔的說明內容。可參閱〈<a href="/en-US/Marketplace/Prepare/Promoting_your_app">Promoting your app</a>〉一文中的「<a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Promoting_your_app#App_listing" rel="internal">App listing</a>」,帶你寫出精簡的說明。</li> - <li>納入基本的 HTML 標籤功能,呈現更漂亮的說明內容。只要點擊 (1)「<strong>支援部分 HTML supported</strong>」,就能看到相關的標籤清單。目前可支援的標籤有: - <ul> - <li><a href title></li> - <li><abbr title></li> - <li><acronym title></li> - <li><b></li> - <li><blockquote></li> - <li><code></li> - <li><em></li> - <li><i></li> - <li><strong></li> - <li><ul>, <li>, and <ol></li> - </ul> - </li> -</ul> - -<h2 id="App_分類">App 分類</h2> - -<p>Marketplace 是以「分類 (Category)」提供 App 完整列表。開發者必須為自己的 App 勾選至少一項分類,當然也可以視需要而勾選他項適合的分類。舉例來說,如果 App 可擷取、編輯、分享照片,你當然可以勾選「<strong>Photo & Video</strong>」與「<strong>Social</strong>」兩種分類。</p> - -<p><img alt="You must pick one, but can pick 2, categories that match your app'scontent" src="https://mdn.mozillademos.org/files/8251/Categories.png" style="width: 985px; height: 187px;"></p> - -<h2 id="隱私權政策">隱私權政策</h2> - -<p>開發者必須提供 App 的隱私權政策,即使 App 聲稱不會蒐集個人資料,也同樣必須提供。如果 App 會蒐集消費者的個人詳細資訊,就必須提供詳盡的政策 (網頁連結或純文字均可)。你可到《<a href="/en-US/Marketplace/Publishing/Privacy_policies">隱私權政策指南</a>》 找到的撰寫資訊。而上述「說明」欄位所支援的 HTML 標籤,也同樣可用在政策撰寫時的格式。這裡一樣拖曳 (1) 方塊的右下角,能拉大編輯方塊的面積空間。</p> - -<p><img alt="A privacy policy must be provided, even if its only to say that no personal data is collected by the app" src="https://mdn.mozillademos.org/files/8253/Privacy%20policy.png" style="width: 979px; height: 211px;"></p> - -<h2 id="App_資訊與支援服務連結">App 資訊與支援服務連結</h2> - -<p>如果有 App 首頁與支援服務頁面的網址,亦可一併提供。但你至少須提供電子郵件位址,以利消費者聯絡後續支援服務。</p> - -<p><img alt="Link can be provided to any information or support pages for the app, however a support email address must be provided" src="https://mdn.mozillademos.org/files/8255/app%20links.png" style="width: 977px; height: 237px;"></p> - -<div class="note"> -<p>支援服務的電子郵件位址,即納入 App 於<span class="hint"> Marketplace 上架時的公開清單中。建議你應提供專屬的電子郵件位址,而不要使用一般的免費郵件位址。</span></p> -</div> - -<h2 id="是否支援_Flash">是否支援 Flash</h2> - -<p>如果你針對 Adobe Flash 而開發 Web App 的內容,則請在這裡點選「Yes」代表使用了 Adobe Flash。反之則點選「No」。</p> - -<p><img alt="Indicate whether your app has need for Flash support" src="https://mdn.mozillademos.org/files/8257/Flash.png" style="width: 973px; height: 79px;"></p> - -<h2 id="截圖與影片">截圖與影片</h2> - -<p>現在可為自己的 App 加上截圖與影片了。點擊 (1)「<strong>新增螢幕截圖或影片 (Add a screenshot or video)</strong>」,就能瀏覽電腦的檔案,找到對應的檔案並點選即可。若添增超過 1 支以上的檔案,就能拖曳 (2) 檔案以變更 Marketplace 中呈現的順序。亦可點擊 (3) 的刪除圖示,移除你不想要的檔案。</p> - -<p>截圖可為 PNG 或 JPG 格式,影片則為 <a href="http://www.webmproject.org/">WebM</a> 格式。建議手機截圖為 320 x 480 px 尺寸。另可參閱《<a href="https://developer.mozilla.org/en-US/Marketplace/Publishing/Marketplace_screenshot_criteria" title="Some guidelines on how to create an effective screenshot for marketplace submission">Marketplace 截圖準則</a>》,以及《<a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Promoting_your_app#Videos" rel="internal">Promoting your app</a>》的〈<a href="https://developer.mozilla.org/en-US/Marketplace/Prepare/Promoting_your_app#Videos" rel="internal">Videos</a>〉進一步了解。</p> - -<p><img alt="Click Add a screenshot or video to add a new item. reorder added items and delete any unwanted items" src="https://mdn.mozillademos.org/files/8259/Add%20screenshots%20and%20videos.png" style="width: 982px; height: 462px;"></p> - -<h2 id="設定發佈方式">設定發佈方式</h2> - -<p>你可決定在 App 通過 Firefox Marketplace 的審查之後,是要立刻上架 (<strong>發佈 App 並讓任何人都能在 Marketplace 中看到,另將納入搜尋結果</strong>),或是暫時不要發佈 (<strong>不發佈App。提醒開發者可稍後調整 App 上架情形</strong>)。</p> - -<p><img alt="Selected whether your app will be added to Marketplace as soon as it's been approved or whether you will set its visibility after approval" src="https://mdn.mozillademos.org/files/8473/publication%20visibility%20new.png" style="width: 996px; height: 179px;"></p> - -<p>點選「<strong>不要自動發佈我的程式 (Do not publish my app)</strong>」將可:</p> - -<ul> - <li>選擇 App 發佈時機。你可能想排定自己的軟體釋出與發表時機。</li> - <li>保持他人還看不到此 App。你可能只是發表自己公司內部使用,或是尚在測試階段的 App。</li> -</ul> - -<p>「不要自動發佈我的程式」將有更多詳細資訊供你選擇,敬請期待。</p> - -<div class="note"> -<p>在你完成這一步驟之後,就無法編輯此選項。往後若要修改此選項,就必須提供 App 的更新檔才行。</p> -</div> - -<h2 id="給審查人員看的註記">給審查人員看的註記</h2> - -<p>最後,你可提供額外資訊給 App 審查人員觀看。特別一提,如果 App 所搭配的 Web 服務需要消費者登入才可使用,則你應提供暫時性的帳戶給審查人員試用此服務。只要拖曳方塊右下角,就能拉大整個編輯方塊的面積。</p> - -<p><img alt="Add comments to assist the reviewer review your app" src="https://mdn.mozillademos.org/files/8261/your%20comments%20for%20reviewer.png"></p> - -<div class="note"> -<p>在你完成這一步驟之後,就無法編輯此選項。往後若要修改此選項,就必須提供 App 的更新檔才行。</p> -</div> - -<h2 id="下一步">下一步</h2> - -<p>點擊「繼續 (Contiune)」即可進到下個程序:<a href="/en-US/Marketplace/Publishing/Submit/Next_steps">下一步</a></p> - -<p><img alt="Click Continue to proceed to the next step" src="https://mdn.mozillademos.org/files/8263/continue.png" style="width: 980px; height: 81px;"></p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html deleted file mode 100644 index a6e3468169..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Submit -slug: Archive/Mozilla/Marketplace/Publishing/Submit -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit ---- -<p>This section describes the process for submitting an app to Firefox Marketplace</p> -<p>Residual details: <a href="/en-US/Marketplace/Publishing/Submit/Submitting_an_app">https://developer.mozilla.org/en-US/Marketplace/Publishing/Submit/Submitting_an_app</a></p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html deleted file mode 100644 index 7c657ed720..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/load_your_app/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: 將 App 上傳到 Firefox Marketplace -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Load_your_app -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Load_your_app ---- -<div class="summary"> -<p>在登入自己的開發者帳戶並同意開發者協定之後,就能輸入 App 的細節,再讓 Firefox Marketplace 識別其 manifest 檔案。</p> -</div> - -<div class="note"> -<p>注意:你可能會看到「manifest 檔案」之正體中文翻譯為「安裝資訊檔」。</p> -</div> - -<h2 id="概述">概述</h2> - -<p>現在你進入「提交 App (<strong>Submit an App</strong> )」頁面,可進行:</p> - -<ul> - <li>確認 App 的獲利模式 — 是要免費提供給消費者,或是消費者須付費購買,也可以另外提供應用程式內付款 (In-app payments) 產品。</li> - <li>確認 App 是否可相容於該平台。</li> - <li>根據 App 的封裝方式: - <ul> - <li>確認托管\架設式 (Hosted) App 的 manifest 檔案之位址。</li> - <li>上傳封裝式 (Packaged) App 的 ZIP 檔案。</li> - </ul> - </li> - <li>提供 App 必要的特性\功能相關資訊。</li> -</ul> - -<h2 id="收益方式">收益方式</h2> - -<p>你首先應對 App 所提供的資訊,就是其收益方式。</p> - -<ol> - <li>針對自己的 App,點選 (1)「免費 (<strong>Free)</strong>」或「付費/應用程式內付款 (<strong>Paid / in-app)</strong>」分頁。</li> - <li><img alt="Select either Free if the app is free to download and use, or Paid / In-app of the app has to be purchased or contains any in-app payment options" src="https://mdn.mozillademos.org/files/8213/Select%20monetization%20model.png" style="width: 978px; height: 162px;"></li> -</ol> - -<div class="note"> -<p>如果你想先讓消費者免費下載 App,再透過 App 內部付費產品獲得收益,請點選「<strong>付費 / 應用程式內付款</strong>」。</p> -</div> - -<div class="note"> -<p>只要你點選「付費/應用程式內付款」並完成提交程序之後,就無法再將該 App 改回免費提供。但原本就點選「免費」的 App 可隨時更改為付費形式。</p> -</div> - -<h2 id="平台相容性">平台相容性</h2> - -<p>在選擇了免費\付費 App 之後,就該定義 App 所將賴以執行的作業系統與瀏覽器。</p> - -<ol> - <li>選擇 App 相容的平台<br> - <img alt="Select the OS and browser implementations the app is designed to work on." src="https://mdn.mozillademos.org/files/8217/Select%20compatible%20platforms.png" style="width: 980px; height: 337px;"></li> -</ol> - -<p>各個平台所支援的收益方式如下。</p> - -<table class="standard-table" style="width: 60% ;"> - <thead> - <tr> - <th scope="row" style="width: 60% ;"> </th> - <th scope="col" style="width: 20%;">Free</th> - <th scope="col" style="width: 20%;">Paid /In-app</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row">Firefox OS</th> - <td style="text-align: center;"><img alt="" src="https://mdn.mozillademos.org/files/8219/Tick_20x20.png" style="width: 20px; height: 20px;"></td> - <td style="text-align: center;"><img alt="" src="https://mdn.mozillademos.org/files/8219/Tick_20x20.png" style="width: 20px; height: 20px;"></td> - </tr> - <tr> - <th scope="row">Firefox for Desktop</th> - <td style="text-align: center;"><img alt="" src="https://mdn.mozillademos.org/files/8219/Tick_20x20.png" style="width: 20px; height: 20px;"></td> - <td style="text-align: center;"> </td> - </tr> - <tr> - <th scope="row">Firefox Mobile<br> - (Firefox for Android on screen 7" or less)</th> - <td style="text-align: center;"><img alt="" src="https://mdn.mozillademos.org/files/8219/Tick_20x20.png" style="width: 20px; height: 20px;"></td> - <td style="text-align: center;"> </td> - </tr> - <tr> - <th scope="row">Firefox Tablet<br> - (Firefox for Android on screen over 7")</th> - <td style="text-align: center;"><img alt="" src="https://mdn.mozillademos.org/files/8219/Tick_20x20.png" style="width: 20px; height: 20px;"></td> - <td style="text-align: center;"> </td> - </tr> - </tbody> -</table> - -<h2 id="上傳_App">上傳 App</h2> - -<p>現在為 Firefox Marketplace 說明 App 類型:</p> - -<ol> - <li>如果為托管\架設式 App,(1) 須先輸入 <a href="/en-US/docs/Web/Apps/Manifest">App 的 manifest 檔案</a>所在之伺服器位址 (須為完整的 URL),再點擊 (2)「<strong>驗證 (Validate)</strong>」。<br> - <img alt="Enter the URL for the manifest of a Hosted App" src="https://mdn.mozillademos.org/files/8223/Identify%20Hosted%20App.png" style="width: 982px; height: 198px;"><br> - <br> - Marketplace 就會驗證你的 manifest 檔案。 - <ul> - <li>驗證完畢,點擊「<strong>繼續 (Continue)</strong>」。</li> - <li>若 manifest 檔案的驗證結果出現錯誤或警告,也會提供完整報告的連結。請看過報告之後修正錯誤,再重新提交 manifest 檔案進行驗證。<br> - <img alt="If there are errors or warning as a result of validating the app's manifest a link is provided to a full report" src="https://mdn.mozillademos.org/files/8225/Validation%20results.png" style="width: 981px; height: 55px;"></li> - </ul> - </li> - <li>如果為封裝式 App,則點擊「<strong>封裝</strong> (<strong>Packaged</strong>)」分頁並點選「<strong>選擇檔案... (Select a file...)</strong>」。接著就會開啟電腦的檔案瀏覽功能,找到 App 的 zip 檔案並上傳。<br> - <img alt="Click Select a file to upload a packaged app's ZIP file" src="https://mdn.mozillademos.org/files/8211/Select%20Packaged%20App.png" style="width: 982px; height: 189px;"><br> - Marketplace 現已可驗證 App 的封包。 - <ul> - <li>驗證完畢,點擊「<strong>繼續 (Continue)</strong>」。</li> - <li>若封包 (ZIP) 的驗證結果出現錯誤或警告,也會提供完整報告的連結。請看過報告之後修正錯誤,再重新封包檔案之後提交以利驗證。<br> - <img alt="If there are errors or warning as a result of validating the app's manifest a link is provided to a full report" src="https://mdn.mozillademos.org/files/8225/Validation%20results.png" style="width: 981px; height: 55px;"></li> - </ul> - </li> -</ol> - -<h2 id="了解_App_最低限度的_API_需求">了解 App 最低限度的 API 需求</h2> - -<p>在 App 驗證完成之後,就會出現「<strong>應用程式最低需求 (App Minimum Requirements)</strong>」頁面。一開始將顯示最常用的 API 需求清單。如果有找不到的 App 需求,則點擊 (1)「<strong>檢視全部 (View all)」</strong>,再 (2) 勾選所要的需求方塊。</p> - -<div class="note"> -<p>消費者的裝置若不支援本頁中所選的需求,則 Marketplace 將隱藏你的 App。</p> -</div> - -<p><img alt="An automatically populated list of app requirements displays, click View all and add any that have been missed" src="https://mdn.mozillademos.org/files/8227/Select%20the%20apps%20minimum%20API%20requiements.png" style="width: 984px; height: 506px;"></p> - -<h2 id="下一步">下一步</h2> - -<p>接著可點擊「<strong>繼續 (Continue)</strong>」完成下個程序。</p> - -<p><img alt="When the details have been added to the page, clicking Continue moves onto the next step." src="https://mdn.mozillademos.org/files/8233/Continue%20option.png" style="width: 982px; height: 91px;"></p> - -<p>若要了解接下來的步驟,可繼續閱讀:<a href="/en-US/Marketplace/Publishing/Submit/Enter_your_apps_details">輸入 App 的細節</a>。</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html deleted file mode 100644 index 47ef08f0d5..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/next_steps/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: App 提交程序的下一步 -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Next_steps -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Next_steps ---- -<div class="summary"> -<p>現在你已經上傳了自己的 App,也更新了詳細資訊。接著讓你先了解接下來將完成的步驟。</p> -</div> - -<p><img alt="an interface screen on the Firefox Marketplace at the start of stage 4, where you are told you can enter some more information, starting with submitting a content rating for your app." src="https://mdn.mozillademos.org/files/6877/submit-app-stage4.png" style="width: 650px; height: 621px; display: block; margin: 0px auto;"></p> - -<p>如果你的 App 有其他語言版本,你可能想在繼續下一步之前,再補充 Marketplace 上的其他詳細資訊。這時可點擊「<strong>編輯資訊 (Edit Listing)</strong>」,或參閱《<a href="/en-US/Marketplace/Publishing/Submit/Edit_other_localizations">Edit other localizations</a>》進一步了解。不論如何,當然還是跟著流程一步步完成比較簡單。</p> - -<h2 id="下一步">下一步</h2> - -<p>這時可點擊「繼續 (<strong>Continue</strong>)」以進到下一步驟:《<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Marketplace/Submission/Rating_Your_Content">取得 App 內容分級</a>》。</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html deleted file mode 100644 index 8c00d35b23..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/overview/index.html +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: Firefox Marketplace 概述 -slug: Archive/Mozilla/Marketplace/Publishing/Submit/Overview -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Overview ---- -<div class="summary"> -<p>若要讓自己的 App 在 Firefox Marketplace 上架,就必須將 App 提交到 Marketplace 並通過審查。本頁將簡述 App 提交程序。另可參閱其他頁面以了解其他步驟。</p> -</div> - -<div class="note"> -<p>若要進一步了解各個步驟,請逐一參閱各個步驟之連結,並從 Step 1 開始整個程序。而此頁下方亦提供步驟關係圖。</p> -</div> - -<p>另可觀看提交程序影片:<a class="video-item" href="http://s.vid.ly/embeded.html?link=8k2n4w&autoplay=false">http://vid.ly/8k2n4w</a></p> - -<h2 id="提交程序">提交程序</h2> - -<p>接著就開始將 App 提交到 Firefox Marketplace 之上:</p> - -<dl> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Sign-in_to_your_developer_account">Step 1 - 登入自己的開發者帳戶</a></dt> - <dd> - <ul> - <li>前往 <a class="external external-icon" href="https://marketplace.firefox.com/developers/">Firefox Marketplace 開發者交流中心 (Developer Hub)</a>。</li> - <li>點擊「提交您的應用程式至 Marketplace」 。<a class="button" href="https://marketplace.firefox.com/developers/submit/">Submit your app to the Marketplace </a></li> - <li>登入自己的開發者帳戶: - <ul> - <li>如果你尚未註冊,須先註冊。</li> - <li>如果你是第一次註冊,必須先同意〈Firefox Marketplace Developer Agreement〉。</li> - </ul> - </li> - </ul> - </dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Load_your_app">Step 2 - 上傳 App</a></dt> - <dd>在<strong>「提交應用程式」</strong>頁面上: - <ul> - <li>設定免費\付費 App。</li> - <li>選擇 App 對應的平台。</li> - <li>選擇該 App 為托管\架設式 (Hosted) 或是封裝式 (Packaged): - <ul> - <li>若為托管\架設式 App,應在其 manifest 檔案中提供連結。</li> - <li>若為封裝式 App,請上傳 <code>package.zip</code> 檔案,且在驗證完畢之後,確認是否符合最低 API 需求。</li> - </ul> - </li> - <li>點擊<strong>「繼續」</strong>。</li> - </ul> - - <div class="note"> - <p>注意:你可能會看到「manifest 檔案」之正體中文翻譯為「安裝資訊檔」。</p> - </div> - </dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Enter_your_apps_details">Step 3 - 輸入 App 的詳細資訊</a></dt> - <dd> - <p>在<strong>「編輯 App 詳細資訊」</strong>頁面:</p> - - <ul> - <li>依自己需要而修改 App 網址。</li> - <li>依自己需要而修改 App 相關說明 (manifest 檔案中所載)。</li> - <li>選擇 1 到 2 種分類。</li> - <li>提供隱私權政策。</li> - <li>若有首頁與支援服務網站,亦請提供。</li> - <li>提供支援服務的電子郵件位址。</li> - <li>說明該 App 是否須 Flash 支援功能。</li> - <li>上傳至少 1 張畫面截圖或影片。</li> - <li>提供額外說明\註記給 App 審查人員看 (如果 App 需要登入細節,應另外說明其理由)。另請注意,只有在你提交新版本 App 時,才能修改這些註記。</li> - <li>設定 App 是否在通過審查之後立刻上架。另請注意,只有在你提交新版本 App 時,才能修改此項設定。</li> - <li>點擊<strong>「繼續」</strong>。</li> - </ul> - </dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Next_steps">Step 4 - 參閱「下一步」的細節</a></dt> - <dd>在<strong>「下一步 (Next Steps)」</strong>頁面上點擊<strong>「繼續」</strong>。</dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Rating_Your_Content">Step 5 - 取得內容分級</a></dt> - <dd>在<strong>「內容分級」</strong>頁面: - <ul> - <li>點擊<strong>「建立 IARC 分級憑證 (Create an IARC Ratings Certificate)」</strong>以取得新的分級,另於 IARC 網站上完成分級問卷。</li> - <li>若要進入已取得之分級,須提供 <strong>Submission ID</strong> 與 <strong>Security Code</strong>。</li> - </ul> - </dd> - <dt><a href="/en-US/Marketplace/Publishing/Pricing/Introduction">Step 6 - 更新 App 目前對應的販售國別與付款細節</a></dt> - <dt style="margin-left: 40px;">Step 6a - 若為免費 App (且無 In-app purchases):</dt> - <dd style="margin-left: 40px;">在左側選單中點擊<strong>「相容性 (Compatibility)」</strong>。依自己需要而更改 App 即將販售的國別。</dd> - <dt style="margin-left: 40px;">Step 6b - 若為付費 App (或免費 App 但有 In-app payments):</dt> - <dd style="margin-left: 40px;">在左側選單點擊<strong>「相容性與付款 (Compatibility & Payments)」</strong> - <ul> - <li>設定你的付款服務供應商帳戶,如 Bango 與 Boku。</li> - <li>設定 App 價格。確認 App 是否提供應用程式內付款的產品,並選擇即將販售 App 的國別。</li> - <li>如果本為免費 App,須付費之後才能升級為較完整功能的「專業版」App,請先設定為免費 App。</li> - </ul> - </dd> - <dt style="margin-left: 40px;">Step 6c - 若 App 包含應用程式內付款的產品:</dt> - <dd style="margin-left: 40px;"> - <ul> - <li>在左側選單點擊<strong>「應用程式內付款 (In-App Payments)」</strong>,取得 API 金鑰與安全金鑰。(請注意,只要為 App 添增 API 金鑰與安全金鑰之後,就必須為 App <a href="/en-US/Marketplace/Publishing/Updating_apps">提交更新檔</a>。可參閱 <a href="/en-US/Marketplace/Monetization/In-app_payments">In-app payments</a> 進一步了解)</li> - <li>如果你使用 <a href="/en-US/Marketplace/Monetization/In-app_payments_section/fxPay_iap">fxPay</a>,則在左側選單點擊<strong>「In-App Products」</strong>,並逐一定義你的應用程式內付款產品。</li> - </ul> - </dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Define_your_team">Step 7 - 設定開發團隊成員 (選填)</a></dt> - <dd>在左側選單點擊<strong>「團隊成員 (Team Members)」</strong>,並依自己的需要添增團隊成員資訊。</dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/View_your_listing">Step 8 - 檢視清單 (選填)</a></dt> - <dd>在左側選單點擊<strong>「檢視清單 (View Listing)」</strong>,檢視自己在 Marketplace 上的 App 清單。</dd> - <dt><a href="/en-US/Marketplace/Publishing/Submit/Edit_other_localizations">Step 9 - 編輯其他本地化清單 (選填)</a></dt> - <dd>在左側選單點擊<strong>「編輯清單 (Edit Listing)」</strong>,針對 App 的本地化內容而修改 App 的網址、說明、分類,或新增 Firefox Marketplace 所支援任何語系的細節。</dd> -</dl> - -<p>到此為止,你的 App 已進入審查程序。在左側選單點擊<strong>「狀態與版本 (Status and Version)」</strong>即可了解目前的審查進度。只要 App 提供應用程式內付款的產品,就必須加入 API 金鑰,且須在發佈 App 之前提交更新檔案。</p> - -<h2 id="流程圖">流程圖</h2> - -<h2 id="sect1"> </h2> - -<p><img alt=""></p> - -<h2 id="下一步?">下一步?</h2> - -<p>提交 App 完畢之後,你可能會需要:</p> - -<ul> - <li><a href="https://marketplace.firefox.com/developers/support">取得支援服務</a></li> - <li>取得下列資訊: - <ul> - <li><a href="https://hacks.mozilla.org/">「Hacks」部落格</a></li> - <li><a href="https://www.youtube.com/user/mozhacks">YouTube 上的「Hacks」影片頻道</a></li> - <li><a href="https://twitter.com/mozhacks">「Hacks」的 Twitter 意見</a></li> - <li><a class="external external-icon" href="https://marketplace.firefox.com/developers/#newsletter-signup">Apps 與 Hacks 電子報</a></li> - </ul> - </li> - <li><a href="https://wiki.mozilla.org/Marketplace/Contributing/Apps">獲得 Marketplace</a> 相關資訊</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html deleted file mode 100644 index e46dbad938..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/submit/sign-in_to_your_developer_account/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: 登入 Firefox Marketplace 上的開發者帳戶 -slug: >- - Archive/Mozilla/Marketplace/Publishing/Submit/Sign-in_to_your_developer_account -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Submit/Sign-in_to_your_developer_account ---- -<div class="summary"> -<p>在將 App 提交到 Firefox Marketplace 之前,必須先申請開發者帳戶,登入之後再接受開發者協定。</p> -</div> - -<h2 id="開啟開發者交流中心_(Developer_Hub)">開啟開發者交流中心 (Developer Hub)</h2> - -<ol> - <li>以瀏覽器開啟 <a href="https://marketplace.firefox.com">Firefox Marketplace</a>。</li> - <li>到 Firefox Marketplace 頁面底部點擊 (1) <strong>開發者交流中心</strong>。<img alt="Footer of the Firefox Marketplace home page showing the link to the Developer Hub" src="https://mdn.mozillademos.org/files/8125/Developer%20Hub%20from%20Marketplace.png" style="width: 983px; height: 272px;"></li> -</ol> - -<h2 id="開始_App_提交程序">開始 App 提交程序</h2> - -<ol> - <li>在交流中心的首頁上,找到 (1) <strong>提交您的應用程式至 Marketplace (Submit your app to the Marketplace</strong>)。<br> - <img alt="Developer Hub home page showing the Submit your app to the Marketplace button" src="https://mdn.mozillademos.org/files/8127/Developer%20Hub%20home%20page%20submit%20button.png" style="width: 1011px; height: 366px;"></li> - <li><a name="Step2">這時會出現「請登入」對話框,點擊 (1) <strong>登入 / 註冊 (Sign in / Sign up</strong>)。</a><br> - <img alt="The Developer Hub please sign in dialog displayed over the Marketplace Developer Agreement" src="https://mdn.mozillademos.org/files/8129/Please%20sign%20in%20dialog.png" style="width: 988px; height: 248px;"></li> - <li>接下來就看你是否註冊過 Mozilla Persona: - <ul> - <li>如果你沒用過 Persona,建議你註冊:<br> - <img alt="The first dialog of the Create Persona process" src="https://mdn.mozillademos.org/files/8131/Create%20Persona.png" style="width: 740px; height: 398px;">你可到<a href="https://login.persona.org/about">這裡</a>進一步了解 Persona - <ol> - <li>輸入電子郵件位址並點擊「<strong>Next</strong>」。</li> - <li>輸入新的密碼並再次確認,點擊「<strong>Done</strong>」。</li> - <li>到你剛剛提供的電子郵件信箱收取確認信。此郵件內含「<strong>Confirm your account now</strong>」的確認連結,點擊此連結。</li> - <li>在接下來的頁面 (跟上述 <a href="#Step2">step 2</a> 顯示的頁面相同) 上點擊「<strong>登入 / 註冊</strong>」。</li> - </ol> - </li> - <li>如果你已經註冊過 Persona,就請確認你想登入為開發者帳戶的電子郵件位址。<br> - <img alt="Sign in with an existing Persona identity" src="https://mdn.mozillademos.org/files/8133/signin%20with%20persona.png" style="width: 740px; height: 398px;"><br> - 點擊「<strong>Sign in</strong>」。</li> - </ul> - </li> - <li>就會看到開發者協定 (Developer Agreement)。<br> - <img alt="Read the developer agreement, select the option to receive information by email if you wish and agree to the agreement" src="https://mdn.mozillademos.org/files/8139/Agreement.png"> - <ol> - <li>請閱讀過開發者協定。</li> - <li>同意往後接收 App Developer 新聞與問卷 (當然還是看你本身意願)</li> - <li>點擊「同意並繼續 (<strong>Agree and Continue</strong>)」。</li> - </ol> - </li> -</ol> - -<p>接著就能進到下一步:<a href="/en-US/Marketplace/Publishing/Submit/Load_your_app">上傳你的 App</a></p> diff --git a/files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html b/files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html deleted file mode 100644 index 57fb423374..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/publishing/updating_apps/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: 更新 App -slug: Archive/Mozilla/Marketplace/Publishing/Updating_apps -translation_of: Archive/Mozilla/Marketplace/Publishing/Updating_apps ---- -<div class="summary"> - <p>本篇文章將針對已發佈的 App (自行發佈或於 <a href="https://marketplace.firefox.com/">Firefox Marketplace</a> 上發佈),說明相關更新步驟。</p> -</div> -<div class="note"> - <p><strong>注意:</strong>如果 App 已通過 Marketplace 審查,而開發者想更改 App 的名稱,就必須再次提交 App 並重新審查。</p> -</div> -<h2 id="更新托管式_(Hosted)_App">更新托管式 (Hosted) App</h2> -<p>托管式 App 本質就是網頁,因此同樣依 Web 快取的常規而運作。但開發者亦可選用如 <a href="https://developer.mozilla.org/en-US/docs/HTML/Using_the_application_cache">HTML5 AppCache</a> 的進階機制以加快啟動速度。先了解這二點之後,更新 App 所使用的一般資源大概就沒有需要特別注意的地方了。</p> -<p>但 Open Web App 在處理 manifest 檔案時就不太一樣了。某些 manifest 的變動必須經過使用者許可。但根據 Web runtime 實作的不同,較難以確定是否會啟動更新作業。</p> -<p>如果要能確實解決此問題,開發者可於 manifest 檔案中添加「<code>version</code>」欄位。只要檢查 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.getInstalled"><code>navigator.mozApps.getInstalled()</code></a> 函式所回傳的值,即可了解目前的版本。如果消費者並未安裝最新版本,則可透過 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Apps.install"><code>navigator.mozApps.install()</code></a> 觸發更新作業。</p> -<p>Web runtime 並不會使用 <code>version</code> 的值,所以開發者可使用任何喜歡的版號設定格式。</p> -<p>另請注意,如果因更改 manifest 檔案而發生錯誤或毀損,則一旦將 manifest 檔案提交到 Firefox Marketplace 就會發現。嚴重錯誤將導致 App 無法出現在 Marketplace 之中。若是較不嚴重的錯誤,就可能會自動標定該 App 需要重新審查。</p> -<h2 id="更新封裝式_(Packaged)_App">更新封裝式 (Packaged) App</h2> -<p><a href="https://developer.mozilla.org/zh-TW/docs/Web/Apps/Developing/Packaged_apps/Packaged_apps">封裝式 App</a> 與托管式 App 的更新程序有所不同。在更新封裝式 App 時,開發者必須將 App 的新版 zip 檔案上傳至 Firefox Marketplace。更新過的 App 同樣要先通過審查,才能再發佈至 Marketplace 之上。如此將於 Firefox OS 手機上觸發更新作業。消費者亦可透過「Settings」App 要求進行更新。</p> -<p>若想進一步了解封裝式 App 的更新程序,可參閱下一章節。</p> -<h3 id="更新封裝式_App_相關細節">更新封裝式 App 相關細節</h3> -<p>接著提供封裝式 App 更新時的相關細節。如果你打算建構 App 商城,就可能必須特別注意。</p> -<ul> - <li>將更新過的封裝式 App 發佈之後,亦應更新 <a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Packaged_apps#Packaged_apps_and_the_Firefox_OS_Marketplace">mini-manifest</a> 指向更新過的 ZIP 檔案 (請注意 mini-manifest 並非 App 的主要 manifest 檔案)。<code>ETag</code> 標頭亦將變更,且將觸發 Firefox OS 手機上的更新作業。</li> - <li>搭載於手機上的 Firefox OS 將每天一次,檢查 App 是否更新。Firefox OS 將檢查 mini-manifest 的網址,再檢查 mini-manifest 之內 <code>package_path</code> 的網址。只要使用 <a href="https://developer.mozilla.org/en-US/docs/Web/API/App">App 物件</a>上的 <code>checkForUpdate()</code> 函式即可進行此作業。一旦 <code>ETag</code> 標頭改變,該函式隨即得知 App 更新過,並將檢查 ZIP 檔案是否變更。</li> - <li>Firefox OS 將批次檢查 App 的更新檔案。</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/index.html deleted file mode 100644 index 2ac47dd745..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Submission -slug: Archive/Mozilla/Marketplace/Submission -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Submission ---- -<p>Marketplace submission</p> diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html deleted file mode 100644 index efabe33036..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/marketplace_review_criteria/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Marketplace 審查準則 -slug: Archive/Mozilla/Marketplace/Submission/Marketplace_review_criteria -translation_of: Archive/Mozilla/Marketplace/Publishing/Marketplace_review_criteria ---- -<div class="summary"> - <p>開發者若要透過 Firefox Marketplace 發佈 App,則必須先滿足本篇文章的所有條件。相關條件是為了均衡 Firefox Marketplace 開發者與消費者的需求所設計。開發者需要公平、一致、審查嚴格但不嚴苛的平台,以安心作為 App 的開發基礎;消費者希望 App 安全無虞、可在裝置上順利運作、確實進行 App 本身所載明的功能。下方所列的 App 條件,就是為了兼顧相關需求所設計。</p> -</div> -<p>先列出 Mozilla 的 App 審查原則:</p> -<ul> - <li>審查原則將謹遵公平、一致、寬容的態度與方法。App 審查程序不應只是為 Marketplace 把關,也應該要有受信賴的窗口可提供反饋意見,協助開發者更成功。</li> - <li>審查人員不是 QA 人員!審查期間會有人檢查 App 的 manifest 檔案,並以一般消費者的角度花個幾分鐘實際執行 App。</li> - <li>如果 App 未能通過審查,我們也會讓開發者清楚知道所發現的問題,並提供重新開發 App 的步驟。若時間許可且有相關資源,審查人員也會提供說明文件的連結給開發者,並建議可修正之處。</li> - <li>審查人員不會評斷 App 的外觀,而是單就 App 的運作情形進行審查。舉例來說,即使 App 是以橘色背景搭配紅色的文字,審查人員不會因為版面配色醜陋,而可能以「版面難以閱讀」的理由而退回該 App。</li> - <li>我們同時為開發者提供懷疑的空間。如果審查人員不確定是否該退回 App,就會先向開發者提出相關問題。我們不會因為開發者無法控制的平台問題,而 (故意) 退回 App。但如果我們無法讓 App 運作,可能會先暫緩 App 通過核准。</li> -</ul> -<h2 id="安全性">安全性</h2> -<p>可到這裡參閱 App 安全架構的相關細節:<a href="https://wiki.mozilla.org/Apps/Security">https://wiki.mozilla.org/Apps/Security</a></p> -<ul> - <li>App 的 manifest 檔案,必須與 App 本身的來源一致。</li> - <li>App 的 manifest 檔案,需經由伺服器附註<code> application/x-web-app-manifest+json 的</code> <code>Content-Type</code> 標頭。</li> - <li>只要是開發者尚未授權使用的內容,App 均不能以 iframe 或重新導向的方式將之載入。</li> - <li>必須在 App 的 manifest 檔案中指定必要權限,並說明索取該權限的理由。</li> -</ul> -<h2 id="隱私性">隱私性</h2> -<ul> - <li>開發者在提交 App 進行審查時,必須一併提供隱私政策的連結,但 Mozilla 並未特別要求隱私政策的內容與格式。開發者可使用我們的<a href="https://github.com/flamsmark/privacy-policy-template">隱私政策範本</a>,另可參閱我們的<a href="https://developer.mozilla.org/en-US/docs/Privacy_policies">隱私政策制定指南</a>。</li> -</ul> -<h2 id="內容">內容</h2> -<ul> - <li>若 App 違反 Mozilla 下方〈內容指南〉章節中所述條文,我們都將退回 App。如果你認為自己的 App 正遊走〈內容指南〉的規範邊緣,甚或該 App 尚未達到可提交的階段,都可要求審查團隊進一步查明。Mozilla 希望能協助所有開發者順利完成自己的 App,而不是耗時開發 App 之後卻遭退回。</li> - <li>從 2014 年 1 月開始,所有 App 均必須先取得國際年齡分級聯盟 (International Age Rating Coalition,IARC) 的內容分級。在提交 App 的過程中,Mozilla 將引導開發者完成簡短的問卷,接著就會立刻收到分級結果。可到<a href="https://developer.mozilla.org/en-US/Marketplace/Submission/Rating_Your_Content">這裡</a>了解分級程序的相關資訊。</li> - <li>提交到 Firefox Marketplace 的截圖與說明,必須能確實代表/呈現此 App。</li> - <li>在 App 的 manifest 檔案中,<a href="https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest#locales"><code>locale</code> 的鍵值</a>必須對應 App 所支援的本地化語系。若開發者提供波蘭文的 <code>locale</code> 鍵值,當然消費者會認為該 App 也具備波蘭文的版本。</li> -</ul> -<h3 id="內容指南"><strong>內容指南</strong></h3> -<p>Firefox Marketplace 將不會接受涉及下列內容的 App。且下方均為說明性的列表而非絕對的定義。Mozilla 亦將視情況而隨時更新。若 App 違反本內容指南所提及的任何內容,Mozilla 均有權立刻將該 App 自 Firefox Marketplace 中撤除。</p> -<ul> - <li>App 內容不得涉及任何色情圖素,亦不可帶有色情或暴力的暗示。</li> - <li>App 內容不得侵犯他人權利,包含智慧財產權或其他私有/公眾的財產權。</li> - <li>App 內容不得傷害 Mozilla 或使用者 (如電腦病毒、間諜軟體、惡意程式碼等)。</li> - <li>App 內容不得涉及非法或倡導非法活動。</li> - <li>App 內容不得欺騙、誤導、進行網路釣魚,或導致任何身分竊取之行為。</li> - <li>App 內容不得倡導賭博行為。</li> - <li>App 內容不得宣傳、廣告非法或受控制的產品與服務。</li> - <li>App 內容不得利用、剝削兒童。</li> - <li>App 內容不得貶損、威脅、恐嚇、鼓吹偏頗之行為,進而影響任何年齡、性別、種族、民族、國籍、性向、殘疾、宗教信仰、地理位置、受法律保障的個人或團體。亦不得鼓吹任何仇恨性的言論。</li> - <li>App 內容不得誤導使用者進行購買行為。</li> -</ul> -<h2 id="功能性">功能性</h2> -<ul> - <li>審查人員必須能執行該 App 所宣稱的主要功能。外觀瑕疵或不影響整體功能的不便之處,均將由審查人員回報給開發者,但不會影響該 App 最後的審查結果。</li> - <li>App 必不能影響系統的效能或穩定度。</li> -</ul> -<h2 id="使用性">使用性</h2> -<ul> - <li>開發者應根據目標平台,嘗試適當的最佳化 App 配置,進而避免某些錯誤,如: - <ul> - <li>提交為行動裝置用的 App,卻明顯是桌面裝置適用的網站。</li> - <li>App 明顯無法延伸到完整畫面。例如 320x480 的 App 只會佔用平板電腦的上半角落,剩下的畫面都空白一片。這種 App 當然不適用!</li> - </ul> - </li> - <li>App 必須有自己的瀏覽方式,而不需依賴瀏覽器工具列或實體的退回按鈕 (並非所有裝置都具備實體退回按鈕)。 - <ul> - <li>舉例來說,審查人員可能瀏覽到 App 中的某一處卻無法倒回之前的頁面。但也不必因為瀏覽的方便性,而硬要附上完整的瀏覽器工具列。</li> - <li>注意:現正針對舊版 Web 內容而開發 Gaia 的「wrapper」: <a href="https://github.com/mozilla-b2g/gaia/issues/2557">https://github.com/mozilla-b2g/gaia/issues/2557</a></li> - </ul> - </li> - <li>如按鈕與連結等的瀏覽元素,均應可輕鬆點擊使用。</li> -</ul> -<h2 id="黑名單政策">黑名單政策</h2> -<p>Mozilla 希望永遠都不會動用到黑名單機制,但仍保留將 App 撤除下架的權利。但只要發現已發佈的 App 違反安全性、隱私性、內容規範,或是嚴重影響系統/網路效能,我們將立刻撤除該 App。在將 App 列入黑名單之前,Mozilla 均將通知該 App 的開發者 (除非我們握有特定證據,否則會假設所有開發者都是善良好公民),並由 App 審查團隊提供完整協助,妥善溝通我們所發現的錯誤並儘力解決。以下特定情況絕對會將 App 列入黑名單並撤除下架:</p> -<ul> - <li>進行網路詐欺、網路釣魚</li> - <li>散佈垃圾郵件、垃圾訊息</li> - <li>在尚未更新內容分級 (即將建構此功能) 的情況下,私自將可愛小狗圖片 v1.0 換成暴力圖片 v1.0</li> - <li>App 對極高比例的使用者造成嚴重不當後果 ─ 拖慢手機效能、導致手機重新開機、遺失使用者資料等。而使用者無法辨別是否由 App 所引起,且重新開機亦無法解決相關問題。</li> - <li>App 用以進行網路攻擊,如分散式阻斷服務 (Distributed denial of service,DDOS)</li> - <li>(insert movie plot risk here)</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html deleted file mode 100644 index 3299054ee5..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/pre-submission_checklist/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: App 測試與疑難排解 -slug: Archive/Mozilla/Marketplace/Submission/Pre-submission_checklist -translation_of: >- - Archive/Mozilla/Marketplace/Publishing/Policies_and_Guidelines/Testing_and_troubleshooting ---- -<div class="summary"> - <p>本文將說明 App 測試與疑難排解時的注意事項。</p> -</div> -<h2 id="設定自己的測試環境">設定自己的測試環境</h2> -<p>開發者可安裝多種工具,針對 Firefox OS/Open Web App 執行真正有效的測試。我們建議至少安裝下列工具:</p> -<ul> - <li>Firefox 桌面版。建議使用如 <a href="http://aurora.mozilla.org/">Aurora</a> 或 <a href="http://nightly.mozilla.org/">Nightly</a> 的預先發行版進行相關測試。</li> - <li>Firefox 行動版,即 Firefox for Android。同樣建議使用如 <a href="http://aurora.mozilla.org/">Aurora</a> 或 <a href="http://nightly.mozilla.org/">Nightly</a> 的預先發行版進行相關測試。如果開發者手上沒有實體的 Android 裝置,亦可使用 <a href="http://developer.android.com/sdk/">Android emulator</a>。</li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager">Firefox OS 應用程式管理員 (App Manager)</a>。此工具已內建於桌面版 Firefox 26 或更高版本中,提供多項有用工具 (如 App 除錯),並可將 App 安裝至模擬器與實體裝置上。</li> - <li><a href="https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_Simulator">Firefox OS 模擬器 (Firefox OS Simulator)</a>。如果開發者特別想在舊版 Firefox OS 上測試 App,即可使用此模擬器。針對 1.2 或更高版本,請使用「應用程式管理員 (App Manager)」。另可透過模擬器的控制面板,將 App 安裝至模擬器之中。</li> -</ul> -<p>最理想的情況,當然是能用實際裝置測試自己的 App。可參閱<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Developer_phone_guide">開發者手機指南</a>。</p> -<h2 id="測試">測試</h2> -<p>雖然 Open Web App 與網頁,均使用相同的技術和發佈方式,但因為 App 環境並不具備如 Chrome 瀏覽器的網址列或返回按鈕;且 Firefox OS 裝置也不像 Android 有實體的退回按鈕,所以使用者經驗是截然不同。以下步驟可讓開發者確保 App 達到絕佳的使用者經驗。</p> -<ol> - <li>安裝 App。確認 App 的圖示有出現在主畫面上,且 App 的名稱完整未遭截斷。</li> - <li>啟動 App。確認能正確偵測、顯示螢幕尺寸與方向。</li> - <li>確認消費者可馬上看到你的 App,而不是看到你的首頁。請記住,若消費者是從 Firefox Marketplace 上安裝你的 App,也就是購買了 App 的功能。不需再次傳送 App 功能的登錄頁面給消費者才對。理想的 App 應該讓消費者能第一眼就看到「Getting Started」或「Login」頁面。</li> - <li>從頭到尾執行過 App 的主要功能。特別注意瀏覽作業的最末端,還有內容縮放時的問題。</li> - <li>確認內容連結將導向 App 之外 (如連至其他網頁或 Twitter)。若要開啟新的視窗或框架,也要讓消費者能順利返回你的 App。</li> - <li>在桌面版瀏覽器中,可使用<a href="https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_View">適應性設計 (Responsive Design) 檢視</a>模式檢查 App 在不同螢幕尺寸中的情況。建議檢查 320x480 ~ 1260x800 的解析度。</li> -</ol> -<h2 id="疑難排解">疑難排解</h2> -<ul> - <li>如果需要 App 開發方面的協助,則可參閱<a href="https://developer.mozilla.org/zh-TW/docs/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F-840092-dup">應用程式中心</a>上的豐富資訊,其中囊括了設計與開發技術、App 安裝作業、已支援的 API,還有更多。</li> - <li><a href="https://developer.mozilla.org/en-US/Firefox_OS">Firefox OS 專區</a>提供 Firefox OS 平台的豐富資訊,包含 Firefox OS 的建構、開發其內預設的 App 等。</li> - <li>若要了解提交作業,可參閱下個章節。</li> - <li><a href="/en-US/docs/Mozilla/Marketplace/FAQ">Marketplace 常見問題</a>,將針對 Firefox Marketplace 上的多樣 App 發佈問題,提供相關答案。</li> - <li>若有特殊問題需要解答,另可前往許多<a href="http://www.mozilla.org/about/forums/">相關討論區</a>,包含新聞群組、郵件群組、IRC 聊天室等等。另可參閱<a href="/en-US/Apps">應用程式中心</a>、<a href="/en-US/Firefox_OS">Firefox OS 專區</a>、<a href="/en-US/Marketplace">Marketplace 專區</a>等頁面,找到最高度相關的區塊!</li> -</ul> diff --git a/files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html b/files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html deleted file mode 100644 index 0446f0240f..0000000000 --- a/files/zh-tw/archive/mozilla/marketplace/submission/rating_your_content/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: 取得 App 內容分級 -slug: Archive/Mozilla/Marketplace/Submission/Rating_Your_Content -translation_of: Archive/Mozilla/Marketplace/Publishing/Submit/Rating_Your_Content ---- -<div class="summary"> -<p>Mozilla 與<a href="http://globalratings.com/">國際年齡分級聯盟 (International Age Rating Coalition,IARC)</a> 合作,將所有 App 均納入適用年齡分級規範。Mozilla 關心使用者,並認為使用者應能自行選擇適合自己的內容。凡 Firefox Marketplace 內的所有 App 均必須完成 IARC 分級。Mozilla 絕對在乎、愛護所有的 App,也必須要求所有 App 或遊戲完成內容分級。在 2014 年 5 月 15 日之後,只要是未完成內容分級的 App 均將強制從 Marketplace 下架。 而 IARC 另提供免費工具讓開發者進行內容分級。</p> -</div> - -<h2 id="有關_IARC_分級工具">有關 IARC 分級工具</h2> - -<p>IARC 是由多間國際級的分級委員會合力運作,針對以數位方式發佈於全球的 App 與遊戲,提供了相關工具作為內容分級的基準。只要填寫簡單表格,就會立刻收到所有分級委員會所制定的分級規範。此份規範不僅可協助消費者了解 App 的內容,亦可讓開發者不需個別取得各國的內容分級,進而大幅縮減成本與不便。</p> - -<h2 id="所支援的國際分級系統">所支援的國際分級系統</h2> - -<p>透過單一的分級精靈功能,即可產生不同系統、國家、所在地區的內容分級。</p> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">分級系統</th> - <th scope="col">支援國家</th> - </tr> - </thead> - <tbody> - <tr> - <td><a href="http://portal.mj.gov.br/classificacao/data/Pages/MJ6BC270E8PTBRNN.htm">Classificação Indicativa </a></td> - <td>Brazil</td> - </tr> - <tr> - <td><a href="http://www.esrb.org/">ESRB</a></td> - <td>Canada, Mexico, United States</td> - </tr> - <tr> - <td><a href="http://www.pegi.info">PEGI</a></td> - <td>Austria, Denmark, Hungary, Latvia, Norway, Slovenia, Belgium, Estonia, Iceland, Lithuania, Poland, Spain, Bulgaria, Finland, Ireland, Luxembourg, Portugal, Sweden, Cyprus, France, Israel, Malta, Romania, Switzerland, Czech Republic, Greece, Italy, Netherlands, Slovak Republic, United Kingdom</td> - </tr> - <tr> - <td><a href="http://usk.de/">USK</a></td> - <td>Germany</td> - </tr> - <tr> - <td>通用</td> - <td>其他所有國家適用</td> - </tr> - </tbody> -</table> - -<h2 id="內容分級包含哪些項目?">內容分級包含哪些項目?</h2> - -<p>分級系統將提供消費者三種資訊:</p> - -<ul> - <li>建議最低使用年齡 (The recommended minimum age) ─ 可能因各國民情風俗而有所差異。</li> - <li>內容說明 (Content descriptors) ─ 該項資訊將說明 App 的所有內容,讓消費者了解自己關心的要點。其內可能包含暴力、酒/藥品使用參考、驚悚指數、實際/模擬博奕行為等資訊。</li> - <li>互動要素 (Interactive Elements) ─ 該項資訊將提供 App 與消費者互動功能的相關細節,如分享個人資料、分享所在地理位置、應用程式內部付費機制、可下載的內容,或社交網路工具。</li> -</ul> - -<p>分級程序僅需幾分鐘且完全免費,並已整合至 Firefox Marketplace 提交程序與開發者主控頁 (Developer Dashboard) 中。任何 App 均必須先完成分級,Mozilla 才能進行後續審查作業。消費者可在 App 說明頁面上看到 App 對應所在地區的分級,並取得自己想進一步了解的相關資訊。</p> - -<h2 id="讓自己的_App_取得內容分級">讓自己的 App 取得內容分級</h2> - -<p>IARC 即提供免費的遊戲分級工具,且大多數的 App 都能輕鬆又快速的完成分級。接著來看看分級程序。</p> - -<div class="note"> -<p><strong>注意:</strong>Mozilla 並不接受其他系統的分級認證。即使 App 已經完成其他系統的內容分級,開發者仍需要完成 IARC 認證程序。</p> -</div> - -<ol> - <li>登入 Firefox Marketplace 開發者網站。你必須以開發者的身分登入,才會看到分級工具。</li> - <li> - <p>在 App 提交程序期間,就會進入 IARC 分級工具:</p> - - <p><img alt="Demonstrates where in the app submission flow where ratings can be entered." src="https://mdn.mozillademos.org/files/6579/submission_flow.png" style="width: 200px; height: 239px; border-width: 1px; border-style: solid;"></p> - - <p>或可從開發者主控頁中找到分級工具:</p> - - <p><img alt="" src="https://mdn.mozillademos.org/files/6623/from_nav_bar.png" style="border-width: 1px; border-style: solid; height: 199px; width: 200px;"></p> - </li> - <li> - <p>開始分級程序:</p> - - <p><img alt="" src="https://mdn.mozillademos.org/files/6583/start_the_rating_process.png" style="width: 600px; height: 242px; border-width: 1px; border-style: solid;"></p> - - <p>或可輸入現有分級的資訊:</p> - - <p><img alt="" src="https://mdn.mozillademos.org/files/6585/enter_existing_rating_info.png" style="width: 600px; height: 276px; border-width: 1px; border-style: solid;"></p> - </li> - <li> - <p>填寫簡單的問卷:</p> - - <p><img alt="" src="https://mdn.mozillademos.org/files/6587/questions.png" style="width: 600px; border-width: 1px; border-style: solid; height: 725px;"></p> - </li> - <li> - <p>添加 App 額外資訊:</p> - - <p><img alt="" src="https://mdn.mozillademos.org/files/6589/additional_info.png" style="width: 589px; height: 637px;"></p> - </li> - <li> - <p>預覽並確認分級資訊:</p> - - <p><img alt="" src="https://mdn.mozillademos.org/files/6591/confirm_info.png" style="width: 400px; height: 865px; border-width: 1px; border-style: solid;"></p> - </li> - <li> - <p>回到開發者主控頁就會看到分級資訊。接著就可準備上架!</p> - </li> -</ol> - -<div class="note"> -<p><strong>注意:</strong>開發者接著會收到電子郵件,內含分級認證與安全碼。請自行保留相關記錄備查。</p> -</div> - -<h2 id="更多資訊">更多資訊</h2> - -<p>如果開發者對分級程序、分級問卷填寫方式,或對分級結果有任何疑問,請寄發電子郵件至 <a href="mailto:dev-questions@globalratings.com">dev-questions@globalratings.com</a> 向 IARC 團隊詢問。另可前往<a href="http://www.globalratings.com/">全球分級網站</a>獲得更多資訊。</p> - -<p>其他任何問題,可聯繫 Mozilla 的 App 審查團隊 <a href="https://groups.google.com/forum/#%21forum/mozilla.appreview" title="appreview@lists.mozilla.org">mozilla.appreview</a>。</p> diff --git a/files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html b/files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html deleted file mode 100644 index 857b8f22eb..0000000000 --- a/files/zh-tw/archive/mozilla/migrate_apps_from_internet_explorer_to_mozilla/index.html +++ /dev/null @@ -1,1070 +0,0 @@ ---- -title: 轉換網頁程式:從 IE 到 Mozilla -slug: Archive/Mozilla/Migrate_apps_from_Internet_Explorer_to_Mozilla -tags: - - 待翻譯 -translation_of: Archive/Mozilla/Migrate_apps_from_Internet_Explorer_to_Mozilla ---- -<p>這篇文章描述 IE 與 Mozilla 瀏覽器之間在程式上的差異,協助您將 IE-only 網頁改寫為 Mozilla 通用網頁。</p> -<h3 id=".E7.B0.A1.E4.BB.8B" name=".E7.B0.A1.E4.BB.8B">簡介</h3> -<p>Netscape 當初決定要製作 Mozilla 瀏覽器時刻意決定要支援 W3C 標準,因此 Mozilla 並不能完全回溯相容 Netscape Navigator 4.x 及 Microsoft Internet Explorer 的自有程式。舉例來說,Mozilla 不支援稍候會討論的 <code><layer></code> 標籤。此外,有些在 W3C 標準觀念尚未普及前製作的瀏覽器(如 Internet Explorer 4)內含各式怪異的花招,我們稱為怪癖(Quirk),而為了相容這些舊瀏覽器的模式便稱為 Quirks 模式。本文稍後也會討論 Mozilla 的 Quirks 模式。</p> -<p>我也會闡述其他 Mozilla 支援、但還沒有 W3C 相關規格的非標準技術,如 XMLHttpRequest 及 Rich-text 編輯功能。此處指的 W3C 規格包括:</p> -<ul> - <li><a class="external" href="http://www.w3.org/TR/html401/">HTML 4.01</a> 和 <a class="external" href="http://www.w3.org/TR/xhtml1/">XHTML 1.0/1.1</a></li> - <li>Cascade Style Sheets (CSS): <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> 及部分 <a class="external" href="http://www.w3.org/Style/CSS/current-work.html">CSS Level 3</a></li> - <li>Document Object Model (DOM): <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> 及部分 <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 (XML): <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/2001AprJ%20un/att-0074/01-NOTE-FIXptr-20010425.htm">Fragment Identifier for XML</a></li> - <li>XSL Transformations: <a class="external" href="http://www.w3.org/TR/xslt">XSLT 1.0</a></li> - <li>XML Path Language: <a class="external" href="http://www.w3.org/TR/xpath">XPath 1.0</a></li> - <li>Resource Description Framework: <a class="external" href="http://www.w3.org/RDF/">RDF</a></li> - <li>Simple Object Access Protocol: <a class="external" href="http://www.w3.org/TR/SOAP/%20">SOAP 1.1</a></li> - <li>ECMA-262, revision 3 (JavaScript 1.5): <a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262</a></li> -</ul> -<h3 id=".E8.B7.A8.E7.80.8F.E8.A6.BD.E5.99.A8.E7.A8.8B.E5.BC.8F.E5.B0.8F.E6.8A.80.E5.B7.A7" name=".E8.B7.A8.E7.80.8F.E8.A6.BD.E5.99.A8.E7.A8.8B.E5.BC.8F.E5.B0.8F.E6.8A.80.E5.B7.A7">跨瀏覽器程式小技巧</h3> -<p>雖然這世上有所謂的 Web 標準,但不同的瀏覽器作法依然大不相同(即使是同一個瀏覽器,也可能因為作業系統差別而相異)。許多瀏覽器(如 Internet Explorer)在 W3C 規格形成前便提供某些功能,卻在標準制訂後忘了修改既有支援程式以符合標準。</p> -<p>在我闡述 Mozilla 與 Internet Explorer 相異之處前,我會先講點小技巧,讓你的 Web 應用程式容易擴充、在未來略事修改便能相容新瀏覽器。</p> -<p>不同瀏覽器下的某相同功能,往往也有不同的 API,所以在某些程式中你會發現不少 <code>if() else()</code> 程式區段,以便區分不同的瀏覽器。以下程式是寫給 Internet Explorer 用的:</p> -<pre>. . . - -var elm; - -if (ns4) - elm = document.layers["myID"]; -else if (ie4) - elm = document.all["myID"] -</pre> -<p>上面這段程式稱不上容易擴充,如果你要多相容一種瀏覽器就得改寫一次。</p> -<p>要排除遇到新的瀏覽器就要重寫網頁碼的情形,最容易的方法,就是把功能「抽」出來。與其使用一堆 <code>if() else()</code>,不如將常用的程式片段獨立為一個函式以提高效率。如此一來不但程式易讀,要支援更多瀏覽器也方便些:</p> -<pre>var elm = getElmById("myID"); - -function getElmById(aID){ - var element = null; - - if (isMozilla || isIE5) - element = document.getElementById(aID) - else if (isNetscape4) - element = document.layers[aID] - else if (isIE4) - element = document.all[aID]; - - return element; -} -</pre> -<p>以上的程式仍得處理<strong>瀏覽器偵測</strong>的問題,通常這要靠 useragent 字串來解決,例如:</p> -<pre>Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031016 -</pre> -<p>雖然 useragent 字串提供瀏覽器的詳細資訊,但處理這段字串的程式碰上新瀏覽器時還是有可能出錯,此時便需修改程式。</p> -<p>如果瀏覽器種類無關緊要(好比你已經把不支援的瀏覽器全都擋在門外了),那麼依據瀏覽器的能力來判別會比較好一點。通常可以用 JavaScript 來測試必備的功能,舉例來說,與其使用這樣的程式碼:</p> -<pre>if (isMozilla || isIE5) -</pre> -<p>還不如換條路走:</p> -<pre>if (document.getElementById) -</pre> -<p>這樣也可以讓其他支援此方法的瀏覽器(如 Opera 或 Safari)正常使用,無須更動程式。</p> -<p>而依據 useragent 字串辨識瀏覽器也並非一無是處,例如在檢查瀏覽器是否符合最低需求或除錯時都有其用途。</p> -<p>JavaScript也允許順序條件語言(inline conditional statements)以助於代碼的可讀性:</p> -<p>JavaScript 也支援判斷句簡寫法,協助你將程式寫得更易讀:</p> -<pre>var foo = (condition) ? conditionIsTrue : conditionIsFalse; -</pre> -<p>舉例而言,要取用某元素,可以寫為:</p> -<pre> -function getElement(aID){ - return (document.getElementById) ? document.getElementById(aID) - : document.all[aID]; -} -</pre> -<h3 id="Mozilla_.E8.88.87_Internet_Explorer_.E7.9A.84.E5.B7.AE.E5.88.A5" name="Mozilla_.E8.88.87_Internet_Explorer_.E7.9A.84.E5.B7.AE.E5.88.A5">Mozilla 與 Internet Explorer 的差別</h3> -<p>首先,我要討論Mozilla和IE在表現HTML行為上的差別。</p> -<h4 id=".E5.B7.A5.E5.85.B7.E6.8F.90.E7.A4.BA.EF.BC.88tooltips.EF.BC.89" name=".E5.B7.A5.E5.85.B7.E6.8F.90.E7.A4.BA.EF.BC.88tooltips.EF.BC.89">工具提示(tooltips)</h4> -<p>老牌的瀏覽器透過在超連結和利用 <code>alt</code> 屬性值的 HTML 中導入工具提示來作為工具提示的內容。 最新的 W3C HTML specification 建立了 <code>title</code> 這個屬性,它包含超連結的詳細說明。 現代的瀏覽器會使用 <code>title</code> 的屬性來顯示工具提示,而且 mozilla 只支援 <code>title</code> 屬性,並不支援 <code>alt</code> 屬性。</p> -<h4 id="HTML_.E7.89.B9.E6.AE.8A.E5.AD.97.E5.85.83.EF.BC.88entities.EF.BC.89" name="HTML_.E7.89.B9.E6.AE.8A.E5.AD.97.E5.85.83.EF.BC.88entities.EF.BC.89">HTML 特殊字元(entities)</h4> -<p>HTML 標籤可以是一些在 <a class="external" href="http://www.w3.org/TR/REC-html40/sgml/entities.html">W3 standards body</a> 中已定義的字元。 您可以利用它們的數值或字符來代替字元。 舉例來說,您可以利用 <code>&#160;</code> 或等同的字符參考資料 <code>&nbsp;</code> 來代替空白鍵。</p> -<p>有一些很老很老的瀏覽器,像是 Internet Explorer ,它們允許在特殊字元後面拿走<code>;</code>(分號(:</p> -<pre>&nbsp Foo -&nbsp&nbsp Foo -</pre> -<p>Mozilla 依然會把 <code>&nbsp</code> 當作空白鍵,既使這樣違反了 W3C 標準(W3C specification)。 但如果 <code>&nbsp</code> 後面直接跟上一些其他的字元,瀏覽器就不會轉換它。 範例:</p> -<pre>&nbsp12345 -</pre> -<p>這行程式碼在 Mozilla 中就不會被執行,因為它違反了 W3 標準(W3 standard)。請使用正確的格式(<code>&nbsp;</code>)來避免瀏覽器與瀏覽器之間的差異性。</p> -<h3 id="DOM_.E5.B7.AE.E7.95.B0" name="DOM_.E5.B7.AE.E7.95.B0">DOM 差異</h3> -<p>文件物件模型(The Document Object Model,簡稱DOM)是一個裝載著文件元素的樹狀結構。你可以熟練地透過已成為 W3C 標準的 JavaScript API 來操作 DOM。然而在 W3C 標準建立以前, Netscape 4 和 IE 4 實作了一些類似的 API。 Mozilla 僅在使用 W3C 標準無法達成這些 API 的效果時才予以實作。</p> -<h4 id=".E5.AD.98.E5.8F.96.E5.85.83.E7.B4.A0" name=".E5.AD.98.E5.8F.96.E5.85.83.E7.B4.A0">存取元素</h4> -<p>如果你想以跨瀏覽器的方式來取得某個元素的參考,請使用<code>document.getelementById(aID)</code> 方法,這個方法不僅可以在 IE 5.0+ 和 Mozilla 上正常運作,它還是 DOM Level 1 的規範。</p> -<p>Mozilla 不能夠以 <code>document.elementName</code> 或是元素名稱來存取元素,而 IE 可以(名為<em>全域名稱污染</em>)。 Mozilla 也不支援 Netscape 4 的 <code>document.layers</code> 和 IE 的 <code>document.all</code>。 而 <code>document.getElementById</code> 可以讓你取得某個元素,你還可以使用 <code>document.layers</code> 和 <code>document.all</code> 指定一個 tag 名稱來取得一串文件元素,像是全部的 <code><div></code> 元素。</p> -<p>在 W3C DOM Level 1 的規範中,JavaScript 應透過 <code>getElementsByTagName()</code> 取得相同標籤(tag)下的元素。這個方法會傳回一個陣列,同時這個方法也可以呼叫 <code>document</code> 或其他節點下的元素。如果你想取得,你可以透過 <code>getElementsByTagName("*")</code> 來取得整個 DOM 下的元素陣列。</p> -<p>就如下面表格一,DOM Level 1 經常被用來移動或者隱藏元素。當一個 HTML 元素可以隨意移動時,Netscape 4 所使用的 <code><layer></code> 標籤就不被 Mozilla 支援,你可以使用如同 Internet Explorer 的 <code><div></code>。根據 HTML 規範,這個標籤可以在 Mozilla 正常運行的。</p> -<p> </p> -<p>表格一 - 用於存取元素的方法</p> -<table class="standard-table"> - <tbody> - <tr> - <th>方法</th> - <th>描述</th> - </tr> - <tr> - <td>document.getElementById( aId )</td> - <td>回傳文件中 ID 值為 aId 元素的。</td> - </tr> - <tr> - <td>document.getElementsByTagName( aTagName )</td> - <td>回傳文件中標籤名稱為 aTagName 的元素</td> - </tr> - </tbody> -</table> -<h4 id=".E7.B8.B1.E6.A9.AB_DOM" name=".E7.B8.B1.E6.A9.AB_DOM">縱橫 DOM</h4> -<p>Mozilla 支援透過 JavaScript 存取 DOM 樹狀圖的 W3C DOM APIs (詳見表格二)。透過他可以讀取文件中的任何一個節點。Internet Explorer 也支援這個 APIs,同時也支援一些過時的方法,像是 <code>children</code>。</p> -<p> </p> -<p>表格二 - 縱橫 DOM 的方法</p> -<table class="standard-table"> - <tbody> - <tr> - <th>屬性/方法</th> - <th>描述</th> - </tr> - <tr> - <td>childNodes</td> - <td>回傳一個該元素下所有子節點的陣列。</td> - </tr> - <tr> - <td>firstChild</td> - <td>回傳該元素下的第一個子節點。</td> - </tr> - <tr> - <td>getAttribute( aAttributeName )</td> - <td>回傳 aAttributeName 的值。</td> - </tr> - <tr> - <td>hasAttribute( aAttributeName )</td> - <td>回傳一個關於節點 aAttributeName 是否有屬性的布林值。</td> - </tr> - <tr> - <td>hasChildNodes()</td> - <td>回傳一個關於該節點下是否仍含有子節點的布林值。</td> - </tr> - <tr> - <td>lastChild</td> - <td>回傳該元素下的最後一個子節點。</td> - </tr> - <tr> - <td>nextSibling</td> - <td>回傳當下節點後的下一個節點。</td> - </tr> - <tr> - <td>nodeName</td> - <td>回傳一個當下節點名稱的字串。</td> - </tr> - <tr> - <td>nodeType</td> - <td>回傳該節點的類型。 - <table> - <tbody> - <tr> - <th>數值</th> - <th>描述</th> - </tr> - <tr> - <td>1</td> - <td>元素節點(Element Node)</td> - </tr> - <tr> - <td>2</td> - <td>屬性節點(Attribute Node)</td> - </tr> - <tr> - <td>3</td> - <td>文字節點(Text Node)</td> - </tr> - <tr> - <td>4</td> - <td>CDATA 段落節點(CDATA Section Node)</td> - </tr> - <tr> - <td>5</td> - <td>實體參引節點(Entity Reference Node)</td> - </tr> - <tr> - <td>6</td> - <td>實體節點(Entity Node)</td> - </tr> - <tr> - <td>7</td> - <td>處理指令(Processing Instruction Node)</td> - </tr> - <tr> - <td>8</td> - <td>註解節點(Comment Node)</td> - </tr> - <tr> - <td>9</td> - <td>文件節點(Document Node)</td> - </tr> - <tr> - <td>10</td> - <td>文件型別(Document Type Node)</td> - </tr> - <tr> - <td>11</td> - <td>文件片段(Document Fragment Node)</td> - </tr> - <tr> - <td>12</td> - <td>記法節點(Notation Node)</td> - </tr> - </tbody> - </table> - <pre class="eval"> - <em>*譯注:目前參照 <a class="external" href="http://xml.ascc.net/zh/utf-8/gloss.html">中央研究院計算中心曾士熊先生提供 SGML 名詞部份的翻譯內容</a>,其中並不包含「文件片段(Document Fragment Node)」</em> -</pre> - </td> - </tr> - <tr> - <td>nodeValue</td> - <td>回傳當下節點的值。當節點中存在文字或文段,如文字和註解節點時,此方法會回傳他們的字串值。當節點為屬性節點(attribute node)時,此方法將會回傳屬性值。除此之外,其餘的節點類型都會回傳 <code>null</code>。 </td> - </tr> - <tr> - <td>ownerDocument</td> - <td>回傳存在於當下節點的 <code>document</code> 物件。</td> - </tr> - <tr> - <td>parentNode</td> - <td>回傳當前節點的父節點。</td> - </tr> - <tr> - <td>previousSibling</td> - <td>回傳在該節點之前的節點。</td> - </tr> - <tr> - <td>removeAttribute( aName )</td> - <td>從當前的節點中移除 aName 屬性。</td> - </tr> - <tr> - <td>setAttribute( aName, aValue )</td> - <td>將 aName 屬性的值更改為 aValue。</td> - </tr> - </tbody> -</table> -<p>在 Internet Explorer 中有個不正常的怪癖(quirk),上表中有許多方法會略過自動產生的空白文字節點。請注意,在 Mozilla 中這些並不會略過,所以有時候你必須區別開這些節點。每一個節點都有它的 <code>nodeType</code> 屬性。舉例來說,元素節點的類型是 1;而文字節點是 3、註解節點是 8(詳見表格二 - nodeType)。最好區別開這些空白文字節點的辦法就是指處裡節點類型為 1 的子節點:</p> -<pre>HTML部分: - <div id="foo"> - <span>Test</span> - </div> - -JavaScript部分: - var myDiv = document.getElementById("foo"); - var myChildren = myXMLDoc.childNodes; - for (var i = 0; i < myChildren.length; i++) { - if (myChildren[i].nodeType == 1){ - // 元素節點 - } - } -</pre> -<h4 id=".E5.85.A7.E5.AE.B9.E5.BB.BA.E7.AB.8B.E5.8F.8A.E8.99.95.E7.90.86" name=".E5.85.A7.E5.AE.B9.E5.BB.BA.E7.AB.8B.E5.8F.8A.E8.99.95.E7.90.86">內容建立及處理</h4> -<p>Mozilla 支援一些比較舊的動態增加 DOM 內容的方法,像是</p> -<pre class="eval"><code>document.write</code>, <code>document.open</code> 和 document.close。 -</pre> -<p>Mozilla 也支援 Internet Explorer 的 <code>innerHTML</code> 方法,這個方法可以用來處理所有的節點。即使這個方法無效,Mozilla 還支援 <code>outerHTML</code> (這個方法包含該元素,它與 <code>innerHTML</code> 有一定的差異) 和 <code>innerText</code> (用於存取或修改節點的文字,功能與 Mozilla 裡的 <code>textContent</code> 差不多)。</p> -<p>Internet Explorer 中存在著許多不規範也不被 Mozilla 的內容處理方法,包括回傳參數、插入數值和插入元素到節點中。像是 <code>getAdjacentElement</code>、 <code>insertAdjacentHTML</code> 等。表格三中敘述了 W3C 定義的內容處理方法,它們適用於所有的 DOM 節點。</p> -<p> </p> -<p>表格三 - Mozilla 使用的內容處理方法</p> -<table class="standard-table"> - <tbody> - <tr> - <th>方法</th> - <th>描述</th> - </tr> - <tr> - <td>appendChild( aNode )</td> - <td>建立一個新的子節點,並回傳新子節點的參照值。</td> - </tr> - <tr> - <td>cloneNode( aDeep )</td> - <td>複製該節點並且傳回複製後的節點。如果 aDeep 的值「成立」,那個這個方法會把該節點下所有的子節點複製到新的節點。</td> - </tr> - <tr> - <td>createElement( aTagName )</td> - <td>建立並回傳一個沒有母節點(即上層沒有節點)的節點。該節點的名稱為 aTagName 。</td> - </tr> - <tr> - <td>createTextNode( aTextValue )</td> - <td>建立並回傳一個沒有母節點的文字節點,該節點值為 aTextValue。</td> - </tr> - <tr> - <td>insertBefore( aNewNode, aChildNode )</td> - <td>把 aNewNode 插入到 aChildNode 之前。(兩者都必須在當前的節點下)</td> - </tr> - <tr> - <td>removeChild( aChildNode )</td> - <td>移除 aChildNode 並回傳一個參照值。</td> - </tr> - <tr> - <td>replaceChild( aNewNode, aChildNode )</td> - <td>用 aChildNode 替代 aNewNode,並且回傳一個移除節點的參照值。</td> - </tr> - </tbody> -</table> -<h4 id=".E6.96.87.E4.BB.B6.E7.89.87.E6.AE.B5" name=".E6.96.87.E4.BB.B6.E7.89.87.E6.AE.B5">文件片段</h4> -<p>因為效能的緣故,你可以在記憶體中創建 document 而非在現存的 DOM 上做動作。 DOM Level 1 Core 引入了 document fragments,這是一個輕量化的 document 且支援了部份既有可用的 document interface。舉例來說,他雖不支援 <code>getElementById</code> 但卻支援 <code>appendChild</code> 。你可以很容易的按照現存的的 document 來創建 document fragments 。</p> -<p>在 Mozilla 中,要創造新的 document fragments 只需要使用 <code>document.createDocumentFragment()</code>,之後你便可取得一個空的 document fragment。</p> -<p>Internet Explorer 在實做 document fragment 上並未按照標準的 W3C standard 。倘若你在 IE 中調用此功能,只能拿回一個 regular document 而非 document fragment。</p> -<h3 id="JavaScript_.E5.B7.AE.E7.95.B0" name="JavaScript_.E5.B7.AE.E7.95.B0">JavaScript 差異</h3> -<p>Mozilla 與 Internet Explorer 之間最大的差別就是 JavaScript。 這些問題通常存在於瀏覽器所公佈的 JavaScript APIs,像是 DOM hooks。 這兩種瀏覽器各自佔有一部份 JavaScript 核心的差異性;這些遇到的問題通常也和時間有關。</p> -<h4 id="JavaScript_.E6.97.A5.E6.9C.9F.E5.B7.AE.E7.95.B0" name="JavaScript_.E6.97.A5.E6.9C.9F.E5.B7.AE.E7.95.B0">JavaScript 日期差異</h4> -<p><code>getYear</code> 這個函數是唯一 <code>Date</code> 中的不同點。根據 ECMAScript specification(JavaScript 也遵循這個 specification),這個函式不是 Y2k-compliant 。假設在 2004 年時執行 <code>new Date().getYear()</code>,它會回傳 "104" 。根據 ECMAScript specification , <code>getYear</code> 會回傳年份減去 1900,原意是回傳 "98" 來表示 1998。<code>getYear</code> 在 ECMAScript Version 3 時被 <code>getFullYear()</code> 所代替。 當 mozilla 繼續遵循規範時,Internet Explorer 已經把 <code>getYear()</code> 修改成像 <code>getFullYear()</code> 的工作方式,使它成為Y2k-compliant。</p> -<h4 id="JavaScript_.E5.9F.B7.E8.A1.8C.E5.B7.AE.E7.95.B0" name="JavaScript_.E5.9F.B7.E8.A1.8C.E5.B7.AE.E7.95.B0">JavaScript 執行差異</h4> -<p>不同的瀏覽器使用不同的方法執行 JavaScript。舉例來說,下面的程式碼假設當 <code>script</code> 執行的時候 <code>div</code> 節點已經存在於 DOM:</p> -<pre>... -<div id="foo">Loading...</div> - -<script> - document.getElementById("foo").innerHTML = "Done."; -</script> -</pre> -<p>無論如何,這都不能夠確定元素(elements)是否存在。要確認所有的元素都存在,您應該將 <code>onload</code> 事件擺在 <code><body></code> 標籤:</p> -<pre><body onload="doFinish()"> - -<div id="foo">Loading...</div> - -<script> - function doFinish() { - var element = document.getElementById("foo"); - element.innerHTML = "Done."; - } -</script> -... -</pre> -<p>像這樣與時間相關的問題也和硬體有關-較慢的系統可以顯示出較快的系統中隱藏的臭蟲(bugs)。 <code>window.open</code> 是一個具體的例子: </p> -<pre><script> - function doOpenWindow(){ - var myWindow = window.open("about:blank"); - myWindow.location.href = "http://www.ibm.com"; - } -</script> -</pre> -<p>這段程式碼的問題是: <code>window.open</code> 的時程是非同步的-它不會阻擋 JavaScript 的執行,直到所有的新視窗載入完畢。 因此,您應該在在載入新視窗完畢後才執行 <code>window.open</code> 。 您可以透過 在新視窗中利用 <code>onload</code> 執行 <code>window.opener</code> 來回到原本開啟新視窗的視窗(母體)。</p> -<h4 id="JavaScript_.E7.94.A2.E7.94.9F.E4.B9.8B_HTML_.E5.B7.AE.E7.95.B0" name="JavaScript_.E7.94.A2.E7.94.9F.E4.B9.8B_HTML_.E5.B7.AE.E7.95.B0">JavaScript 產生之 HTML 差異</h4> -<p> 在 JavaScript 中,我們可以透過 <code>document.write 來從字串產生 HTML 程式碼。但這有個值得注意的地方在於,要是你的內嵌碼中中含有</code> <code><script></code> tag 會發生什麼事?當你的目標頁面處於 <a href="#html_modes">strict rendering mode</a> 下時,它將會解析位於 <code><script> 和 </code> <code></script></code> 中的內容。讓我們看個例子:</p> -<pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -... -<script> - document.write("<script>alert("Hello")</script>") -</script> -</pre> -<p> 因為目前處於 strict mode 下,Mozilla 的解析器 (parser) 將會查看介於 <code><script></code> 和 <code></script>中的內容。這是因為在 strict mode 下解析器並不認得任何語言。但假如處在</code> quirks mode 下,解析器卻識得 JavaScript 語法。而事實上,Internet Explorer 總是處於 quirks mode 下 - 它並不真正之支援 XHTML。一個比較兩全其美的作法是將該內容分割成兩個部份:</p> -<pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -... -<script> - document.write("<script>alert("Hello")</" + "script>") -</script> -</pre> -<h4 id="JavaScript_.E9.99.A4.E9.8C.AF" name="JavaScript_.E9.99.A4.E9.8C.AF">JavaScript 除錯</h4> -<p>Mozilla provides several ways to debug JavaScript-related issues found in applications created for Internet Explorer. The first tool is the built-in JavaScript console, shown in Figure 1, where errors and warnings are logged. You can access it in Mozilla by going to <strong>Tools -> Web Development -> JavaScript Console</strong>, or in Firefox (the standalone browser product from Mozilla) at <strong>Tools -> JavaScript Console</strong>.</p> -<p> </p> -<p>Figure 1. JavaScript console</p> -<div> - <img alt="Javascript Console"></div> -<p>The JavaScript console can show the full log list or just errors, warnings, and messages. The error message in Figure 1 says that at aol.com, line 95 tries to access an undefined variable called is_ns70. Clicking on the link will open Mozilla's internal view source window with the offending line highlighted.</p> -<p>The console also allows you to evaluate JavaScript. To evaluate the entered JavaScript syntax, type in <code>1+1</code> into the input field and press <strong>Evaluate</strong>, as Figure 2 shows.</p> -<p> </p> -<p>Figure 2. JavaScript console evaluating</p> -<div> - <img alt="JavaScript Console evaluating"></div> -<p>Mozilla's JavaScript engine has built-in support for debugging, and thus can provide powerful tools for JavaScript developers. Venkman, shown in Figure 3, is a powerful, cross-platform JavaScript debugger that integrates with Mozilla. It is usually bundled with Mozilla releases; you can find it at <strong>Tools -> Web Development -> JavaScript Debugger</strong>. For Firefox, the debugger isn't bundled; instead, you can download and install it from the <a class="external" href="http://www.mozilla.org/projects/venkman/">Venkman Project Page</a>. You can also find tutorials at the development page, located at the <a class="external" href="http://www.hacksrus.com/%7Eginda/venkman/">Venkman Development Page</a>.</p> -<p> </p> -<p>Figure 3. Mozilla's JavaScript debugger</p> -<div> - <img alt="Mozilla's JavaScript debugger"></div> -<p>The JavaScript debugger can debug JavaScript running in the Mozilla browser window. It supports such standard debugging features as breakpoint management, call stack inspection, and variable/object inspection. All features are accessible through the user interface or through the debugger's interactive console. With the console, you al can execute arbitrary JavaScript in the same scope as the JavaScript currently being debugged.</p> -<h3 id="CSS_.E5.B7.AE.E7.95.B0" name="CSS_.E5.B7.AE.E7.95.B0">CSS 差異</h3> -<p>與 Internet Explorer 和其他的瀏覽器比較之下, Mozilla 擁有最強大的 Cascading Style Sheets 4(即 CSS) 支援, 包含大部份的 CSS1、CSS2 和部份的 CSS3 。</p> -<p>對於下列敘述的問題, Mozilla 會在 JavaScript 控制台中發出警告。 如果您遇到了 CSS 的相關問題,請確認 JavaScript 控制台。</p> -<h4 id="CSS_.E6.AA.94.E7.84.A1.E6.B3.95.E5.A5.97.E7.94.A8.EF.BC.9AMIME_Type_.E5.95.8F.E9.A1.8C" name="CSS_.E6.AA.94.E7.84.A1.E6.B3.95.E5.A5.97.E7.94.A8.EF.BC.9AMIME_Type_.E5.95.8F.E9.A1.8C">CSS 檔無法套用:MIME Type 問題</h4> -<p>CSS 定義的相關檔沒有被讀取是 CSS 的相關問題中最常見的。 這通常是伺服器將 CSS 檔案送出了錯誤的 MIME Type 。 CSS 說明書 ( CSS specification ) 中提到:「 CSS 檔案應該被作為 text/css mimetype 。」 當網頁處於嚴格的規範模式 ( strict standards mode )時, Mozilla 將遵循並只載入以 text/css 作為 mimetype 的 CSS 檔案。 在 Internet Explorer 中,無論 mimetype 是甚麼, CSS 檔案都會被載入。 當網頁的 doctype ( document type,檔案類型 ) 在網頁的開頭被指定時,他們會進入嚴格的標準模式。 要解決這個問題,您可以修改正確的 mimetype 或移除 doctype。 我們會在下個章節中討論更多關於 doctype。</p> -<h4 id="CSS_.E5.96.AE.E4.BD.8D" name="CSS_.E5.96.AE.E4.BD.8D">CSS 單位</h4> -<p>有很多網路應用程式都不在他們的 CSS 中加上單位,尤其是利用 JavaScript 設定 CSS 的時候。 當網頁不執行在標準模式時,Mozilla 不會回報錯誤。 因為 Internet Explorer 並非真正的支援 XHTML ,它不在乎有沒有具體的單位描述。 如果網頁處於嚴格的標準描述下,並且沒有使用單位,那麼 Mozilla 將忽略以下的 style :</p> -<pre class="eval"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "<span class="nowiki">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</span>"> -<html> - <body> - // works in strict mode - <div style="width:40<span class="boldcode">px</span>; border:1px solid black;"> - Text - </div> - - // will fail in strict mode - <div style="width:40; border:1px solid black;"> - Text - </div> - </body> -</html> -</pre> -<p>因為上述的範例中有一個規範的 doctype (檔案類型),所以網頁將執行在嚴格的標準模式下。 第一個 div 標籤會套用 40 像素的寬度,因為它有單位,但是第二個 div 標籤將不會套用指定的寬度,因此會套用預設的 100% 寬度。 透過 JavaScript 設定寬度將會得到一樣的結果。</p> -<h4 id="JavaScript_.E5.8F.8A_CSS" name="JavaScript_.E5.8F.8A_CSS">JavaScript 及 CSS</h4> -<p>既然 Mozilla 支援 CSS 標準,它同時也支援透過 JavaScript 設定 CSS 的 CSS DOM。 您可以透過 <code>style</code> 標籤讀取、移除和修改 CSS 的屬性規則:</p> -<pre><div id="myDiv" border:1px solid black;"> - Text -</div> - -<script> - var myElm = document.getElementById("myDiv"); - myElm.style.width = "40px"; -</script> -</pre> -<p>您可以利用這種方式來延伸 css 的屬性。再次強調,如果網頁處於標準模式,您必須加上單位,否則 Mozilla 將忽略指令。 當您要查詢變數時,透過 <code>.style.width</code> 來達成,在 Mozilla 和 Internet Explorer 中,傳回的值中會包含單位,也就是傳回了一串字串。 您可以利用 <code>parseFloat("40px")</code> 將字串轉換成數值。</p> -<h4 id="CSS_.E6.BA.A2.E5.87.BA.E9.83.A8.E5.88.86.EF.BC.88overflow.EF.BC.89.E5.B7.AE.E7.95.B0" name="CSS_.E6.BA.A2.E5.87.BA.E9.83.A8.E5.88.86.EF.BC.88overflow.EF.BC.89.E5.B7.AE.E7.95.B0">CSS 溢出部分(overflow)差異</h4> -<p>CSS 增加了溢出(overflow)的概念,它允許您定義如何處理溢出部份;舉例來說,當 <code>div</code> 內容指定的高度高於 <code>div</code> 的高度時, CSS 規範(CSS standard)中定義了如果程式中沒有定義溢出的相關設定, <code>div</code> 的內容將會溢出。 但是 Internet Explorer 仍然不會遵循相關規範,並且會為了留住內容而擴張 <code>div</code> 的高度。 下面的例子表現了這個差異性:</p> -<pre><div style="height:100px; border: 1px solid black;"> - <div style="height:150px; border: 1px solid red; margin:10px;"> - a - </div> -</div> -</pre> -<p>就像你在圖片四看到的,Mozilla 依照了 CSS 規範做出了判斷。 規範中提到了在這個情況下,因為 <code>div</code> 的內部高過它的母體,所以它溢出到了按鈕的地方。 如果您這麼愛 Internet Explorer 的行為,就不要在母體(即 <code>div</code> )加上 height 這個屬性。</p> -<p> </p> -<p>圖片四:div溢出部份</p> -<div> - <img alt="DIVdiv溢出部份"></div> -<h4 id="hover.EF.BC.88.E6.BB.91.E9.BC.A0.E7.A7.BB.E4.B8.8A.E6.9F.90.E5.85.83.E7.B4.A0.EF.BC.89.E6.95.88.E6.9E.9C.E5.B7.AE.E7.95.B0" name="hover.EF.BC.88.E6.BB.91.E9.BC.A0.E7.A7.BB.E4.B8.8A.E6.9F.90.E5.85.83.E7.B4.A0.EF.BC.89.E6.95.88.E6.9E.9C.E5.B7.AE.E7.95.B0">hover(滑鼠移上某元素)效果差異</h4> -<p>在一些網站上存在著 Internet Explorer 的非標準 CSS hover。 在 Mozilla 中,通常當滑鼠滑入的時候,利用改變 Text Style 來顯示它自己。 這是因為 <code>a:hover</code> ,在 Internet Explorer 中的 CSS 解析器對應 HTML 中錨點(anchor)的是 <code><a href="" /></code>,而不是 <code><a name="" /></code> 由於作者將錨點設定標記(anchor-setting markup)套用進了區塊,所以造成了文字的顏色變化:</p> -<pre>CSS: - a:hover {color:green;} - -HTML: - <a href="foo.com">This text should turn green when you hover over it.</a> - - <a name="anchor-name"> - This text should change color when hovered over, but doesn't in Internet Explorer. - </a> -</pre> -<p>Mozilla 遵循 CSS 說明書 ( CSS specification )並且在這個例子中會把顏色變成綠色。 您可以使用這兩種方法來讓 Mozilla 擁有像 Internet Explorer 的效果,並且當滑鼠滑入時不會改變文字的顏色:</p> -<ul> - <li>其一,您可以把 CSS 的規則改成 <code>a:link:hover {color:green;}</code>,這樣只會當該元素是超連結(有 <code>href</code> 屬性),才會改變顏色。</li> - <li>其二,您可以修改標記,並在文字的開頭之前關閉已打開的 <code><a /></code> -採用這個方法的話,錨點(anchor)會是有效的。</li> -</ul> -<h3 id="Quirks_.E6.A8.A1.E5.BC.8F.E3.80.81.E6.A8.99.E6.BA.96.E6.A8.A1.E5.BC.8F" name="Quirks_.E6.A8.A1.E5.BC.8F.E3.80.81.E6.A8.99.E6.BA.96.E6.A8.A1.E5.BC.8F">Quirks 模式、標準模式</h3> -<p> 在舊的瀏覽器上 (如 Internet Explorer 4),網頁可能會被以一種被不完全正確的方式渲染網頁。當 Mozilla 企圖成為一個和標準相容的瀏覽器的情況下,它採取三種不同方式來處理在這些不太合標準的渲染方式下開發的既有網頁。你可以在 Mozilla 瀏覽器中的 <strong>View -> Page Info</strong> (或 Ctrl-i) 下查看目前處於哪種模式。而該採取怎樣的模式則取決於該頁面的 doctype。</p> -<p> Doctypes (document type declarations) 看起來是:</p> -<p><code><!DOCTYPE HTML PUBLIC <span style="color: blue;">"-//W3C//DTD HTML 4.01 Transitional//EN"</span> <span style="color: green;">"<span class="nowiki">http://www.w3.org/TR/html4/loose.dtd</span>"</span>></code></p> -<p> 藍色部份稱為 public identifier,而綠色部份是為 system identifier (以 URI 方式描述)。</p> -<h4 id=".E6.A8.99.E6.BA.96.E6.A8.A1.E5.BC.8F" name=".E6.A8.99.E6.BA.96.E6.A8.A1.E5.BC.8F">Standards Mode (標準模式)</h4> -<p> Standards mode 是最嚴謹的渲染模式。它將完全按照 W3C HTML 以及 CSS specification 來處理,並且不支援任何除此之外的寫法。 Mozilla 會在以下情形中使用此模式:</p> -<ul> - <li>當頁面是以 <code>text/xml</code> mimetype 或任何其他 XML 及 XHTML mimetype 發送時</li> - <li>採用除了 IBM doctype 之外的任何 "DOCTYPE HTML SYSTEM" doctype (例如 <code><!DOCTYPE HTML SYSTEM "<span class="nowiki">http://www.w3.org/TR/REC-html40/strict.dtd</span>"></code>)</li> - <li>不知名的 doctypes 或沒有提供 DTDs 的 doctypes </li> -</ul> -<h4 id=".E8.BF.91.E4.B9.8E.E6.A8.99.E6.BA.96.E6.A8.A1.E5.BC.8F" name=".E8.BF.91.E4.B9.8E.E6.A8.99.E6.BA.96.E6.A8.A1.E5.BC.8F">Almost Standards mode (近乎標準模式)</h4> -<p>Mozilla introduced almost standards mode for one reason: a section in the CSS 2 specification breaks designs based on a precise layout of small images in table cells. Instead of forming one image to the user, each small image ends up with a gap next to it. The old IBM homepage shown in Figure 5 offers an example.</p> -<p> </p> -<p>Figure 5. Image gap</p> -<div> - <img alt="Image Gap"></div> -<p>Almost standards mode behaves almost exactly as standards mode, except when it comes to an image gap issue. The issue occurs often on standards-compliant pages and causes them to display incorrectly.</p> -<p>Mozilla uses almost standards mode for the following conditions:</p> -<ul> - <li>For any "loose" doctype (for example, <code><!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"></code>, <code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<span class="nowiki">http://www.w3.org/TR/html4/loose.dtd</span>"></code>)</li> - <li>For the IBM doctype (<code><!DOCTYPE html SYSTEM "<span class="nowiki">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</span>"></code>)</li> -</ul> -<p>You can read more about the <a href="/zh_tw/Images,_Tables,_and_Mysterious_Gaps" title="zh_tw/Images,_Tables,_and_Mysterious_Gaps">image gap issue</a>.</p> -<h4 id="Quirks_.E6.A8.A1.E5.BC.8F" name="Quirks_.E6.A8.A1.E5.BC.8F">Quirks Mode (怪癖模式)</h4> -<p> 以目前情況來說,網路上充斥著許多不完全符合標準規範的網頁。這些不合標準的網頁,卻和有著 bug 的瀏覽器配合的很好。舉例來說,在以前Netscape 居市場領導地位時,便有著 bug。而 IE 誕生石,為了能和那些網頁相容,「繼承」了這些 bug 們。對於在之後才來到市場上的新一代瀏覽器們來說,這些 bug 們便被稱為 <strong>quirks</strong> (但他們大都能向下相容於這些網頁)。值得注意的是,因為這些既有網頁並非按照規格設計,所以新瀏覽器在渲染時得花上更多時間。不幸的是,絕大多數的網頁都有賴新瀏覽器們以此模式渲染。</p> -<p>Mozilla 會在以下情況使用此模式:</p> -<ul> - <li>當網頁不指明 doctype 時</li> - <li>當 doctypes 沒有 system identifier 時(例如 <code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"></code>)</li> -</ul> -<p>For further reading, check out: <a class="external" href="http://www.mozilla.org/docs/web-developer/quirks/quirklist.html">List of Quirks</a> and <a class="external" href="http://www.mozilla.org/docs/web-developer/quirks/doctypes.html">List of Doctypes and What Modes They Cause</a>.</p> -<p> </p> -<h3 id=".E4.BA.8B.E4.BB.B6.E5.B7.AE.E7.95.B0" name=".E4.BA.8B.E4.BB.B6.E5.B7.AE.E7.95.B0">事件差異</h3> -<p> Mozilla 和 Internet Explorer 在 events 的這個部分幾乎是完全不同的。 Mozilla event model 遵循 W3C 以及 Netscape model。但在 Internet Explorer 中,倘若一個 function 被 event 所觸發,那麼我們可以用 <code>window.event </code>來接觸到該 event 物件 - 這必須被特別指定為參數傳入。Mozilla 則會直接傳遞該 <code>event</code> 物件到 event handlers 中。一個跨瀏覽器 (cross-browser) 的 event handling 範例如下:</p> -<pre><div onclick="handleEvent(event)">Click me!</div> - -<script> - function handleEvent(aEvent) { - // if aEvent is null, means the Internet Explorer event model, - // so get window.event. - var myEvent = aEvent ? aEvent : window.event; - } -</script> -</pre> -<p> 此外,event 物件產生時所擁有的 properties 和 functions 在 Mozilla and Internet Explorer 也可能有不同的名字。請參見 Table 4。</p> -<p> </p> -<p>Table 4. Mozilla/Internet Explorer event property 比較表</p> -<table class="standard-table"> - <tbody> - <tr> - <th>Internet Explorer Name</th> - <th>Mozilla Name</th> - <th>Description</th> - </tr> - <tr> - <td>altKey</td> - <td>altKey</td> - <td>Boolean property that returns whether the alt key was pressed during the event.</td> - </tr> - <tr> - <td>cancelBubble</td> - <td>stopPropagation()</td> - <td>Used to stop the event from bubbling farther up the tree.</td> - </tr> - <tr> - <td>clientX</td> - <td>clientX</td> - <td>The X coordinate of the event, in relation to the client.</td> - </tr> - <tr> - <td>clientY</td> - <td>clientY</td> - <td>The Y coordinate of the event, in relation to the client.</td> - </tr> - <tr> - <td>ctrlKey</td> - <td>ctrlKey</td> - <td>Boolean property that returns whether the Ctrl key was pressed during the event.</td> - </tr> - <tr> - <td>fromElement</td> - <td>relatedTarget</td> - <td>For mouse events, this is the element from which the mouse moved away.</td> - </tr> - <tr> - <td>keyCode</td> - <td>keyCode</td> - <td>For keyboard events, this is a number representing the key that was pressed. It is 0 for mouse events.</td> - </tr> - <tr> - <td>returnValue</td> - <td>preventDefault()</td> - <td>Used to prevent the event's default action from occurring.</td> - </tr> - <tr> - <td>screenX</td> - <td>screenX</td> - <td>The X coordinate of the event, in relation to the screen.</td> - </tr> - <tr> - <td>screenX</td> - <td>screenY</td> - <td>The Y coordinate of the event, in relation to the screen.</td> - </tr> - <tr> - <td>shiftKey</td> - <td>shiftKey</td> - <td>Boolean property that returns whether the Shift key was pressed during the event.</td> - </tr> - <tr> - <td>srcElement</td> - <td>target</td> - <td>The element to which the event was originally dispatched.</td> - </tr> - <tr> - <td>toElement</td> - <td>currentTarget</td> - <td>For mouse events, this is the element to which the mouse moved.</td> - </tr> - <tr> - <td>type</td> - <td>type</td> - <td>Returns the name of the event.</td> - </tr> - </tbody> -</table> -<h4 id=".E5.8A.A0.E4.B8.8A.E4.BA.8B.E4.BB.B6.E6.8E.A7.E5.88.B6.E5.BC.8F" name=".E5.8A.A0.E4.B8.8A.E4.BA.8B.E4.BB.B6.E6.8E.A7.E5.88.B6.E5.BC.8F">加上事件控制式</h4> -<p> Mozilla 支援了兩種方式來附加 events 到 JavaScript 中。第一種是所有瀏覽器都支援的,直接將 event properties 連接到物件上。下例為設定一個 <code>click</code> event handler,一個 function reference 被設定到物件的 <code>onclick</code> property:</p> -<pre><div id="myDiv">Click me!</div> - -<script> - function handleEvent(aEvent) { - // if aEvent is null, means the Internet Explorer event model, - // so get window.event. - var myEvent = aEvent ? aEvent : window.event; - } - - function onPageLoad(){ - document.getElementById("myDiv").onclick = handleEvent; - } -</script> -</pre> -<p>Mozilla fully supports the W3C standard way of attaching listeners to DOM nodes. You use the <code>addEventListener()</code> and <code>removeEventListener()</code> methods, and have the benefit of being able to set multiple listeners for the same event type. Both methods require three parameters: the event type, a function reference, and a boolean denoting whether the listener should catch events in their capture phase. If the boolean is set to false, it will only catch bubbling events. W3C events have three phases: capturing, at target, and bubbling. Every event object has an <code>eventPhase</code> attribute indicating the phase numerically (0 indexed). Every time you trigger an event, the event starts at the DOM's outermost element, the element at the top of the DOM tree. It then walks the DOM using the most direct route toward the target, which is the capturing phase. When the event reaches the target, the event is in the target phase. After arriving at the target, it walks up the DOM tree back to the outermost node; this is <strong>bubbling</strong>. Internet Explorer's event model only has the bubbling phase; therefore, setting the third parameter to false results in Internet Explorer-like behavior:</p> -<pre><div id="myDiv">Click me!</div> - -<script> - - function handleEvent(aEvent) { - // if aEvent is null, it is the Internet Explorer event model, - // so get window.event. - var myEvent = aEvent ? aEvent : window.event; - } - - function onPageLoad() { - var element = document.getElementById("myDiv"); - element.addEventListener("click", handleEvent, false); - } -</script> -</pre> -<p>One advantage of <code>addEventListener()</code> and <code>removeEventListener()</code> over setting properties is that you can have multiple event listeners for the same event, each calling another function. Thus, to remove an event listener requires all three parameters be the same as the ones you use when adding the listener.</p> -<p>Mozilla does not support Internet Explorer's method of converting <script> tags into event handlers, which extends <script> with <code>for</code> and <code>event</code> attributes (see Table 5). It also does not support the <code>attachEvent</code> and <code>detachEvent</code> methods. Instead, you should use the <code>addEventListener</code> and <code>removeEventListener</code> methods. Internet Explorer does not support the W3C events specification.</p> -<p> </p> -<p>Table 5. Event method differences between Mozilla and Internet Explorer</p> -<table class="standard-table"> - <tbody> - <tr> - <th>Internet Explorer Method</th> - <th>Mozilla Method</th> - <th>Description</th> - </tr> - <tr> - <td>attachEvent(aEventType, aFunctionReference)</td> - <td>addEventListener(aEventType, aFunctionReference, aUseCapture)</td> - <td>Adds an event listener to a DOM element.</td> - </tr> - <tr> - <td>detachEvent(aEventType, aFunctionReference)</td> - <td>removeEventListener(aEventType, aFunctionReference, aUseCapture)</td> - <td>Removes an event listener to a DOM element.</td> - </tr> - </tbody> -</table> -<h3 id="Rich-text_.E7.B7.A8.E8.BC.AF" name="Rich-text_.E7.B7.A8.E8.BC.AF">Rich-text 編輯</h3> -<p>While Mozilla prides itself with being the most W3C standards-compliant browser, it does support nonstandard functionality, such as <code>innerHTML</code> and rich text editing, if no W3C equivalent exists.</p> -<p>Mozilla 1.3 introduced an implementation of Internet Explorer's designMode feature, which turns an HTML document into a rich text editor field. Once turned into the editor, commands can run on the document through the <code>execCommand</code> command. Mozilla does not support Internet Explorer's <code>contentEditable</code> attribute for making any widget editable. You can use an iframe to add a rich text editor.</p> -<h4 id="Rich-text_.E5.B7.AE.E7.95.B0" name="Rich-text_.E5.B7.AE.E7.95.B0">Rich-text 差異</h4> -<p>Mozilla supports the W3C standard of accessing iframe's document object through <code>IFrameElm.contentDocument</code>, while Internet Explorer requires you to access it through <code>document.frames{{ mediawiki.external('\"name\"') }}</code> and then access the resulting <code>document</code>:</p> -<pre>function getIFrameDocument(aID) { - var rv = null; - - // if contentDocument exists, W3C compliant (Mozilla) - if (document.getElementById(aID).contentDocument){ - rv = document.getElementById(aID).contentDocument; - } else { - // IE - rv = document.frames[aID].document; - } - return rv; -} -</pre> -<p>Another difference between Mozilla and Internet Explorer is the HTML that the rich text editor creates. Mozilla defaults to using CSS for the generated markup. However, Mozilla allows you to toggle between HTML and CSS mode using the <code>useCSS</code> execCommand and toggling it between true and false. Internet Explorer always uses HTML markup.</p> -<pre>Mozilla (CSS): - <span style="color: blue;">Big Blue</span> - -Mozilla (HTML): - <font color="blue">Big Blue</font> - -Internet Explorer: - <FONT color="blue">Big Blue</FONT> -</pre> -<p>Below is a list of commands that execCommand in Mozilla supports:</p> -<p> </p> -<p>Table 6. Rich text editing commands</p> -<table class="standard-table"> - <tbody> - <tr> - <th>Command Name</th> - <th>Description</th> - <th>Argument</th> - </tr> - <tr> - <td>bold</td> - <td>Toggles the selection's bold attribute.</td> - <td>---</td> - </tr> - <tr> - <td>createlink</td> - <td>Generates an HTML link from the selected text.</td> - <td>The URL to use for the link</td> - </tr> - <tr> - <td>delete</td> - <td>Deletes the selection.</td> - <td>---</td> - </tr> - <tr> - <td>fontname</td> - <td>Changes the font used in the selected text.</td> - <td>The font name to use (Arial, for example)</td> - </tr> - <tr> - <td>fontsize</td> - <td>Changes the font size used in the selected text.</td> - <td>The font size to use</td> - </tr> - <tr> - <td>fontcolor</td> - <td>Changes the font color used in the selected text.</td> - <td>The color to use</td> - </tr> - <tr> - <td>indent</td> - <td>Indents the block where the caret is.</td> - <td>---</td> - </tr> - <tr> - <td>inserthorizontalrule</td> - <td>Inserts an <hr> element at the cursor's position.</td> - <td>---</td> - </tr> - <tr> - <td>insertimage</td> - <td>Inserts an image at the cursor's position.</td> - <td>URL of the image to use</td> - </tr> - <tr> - <td>insertorderedlist</td> - <td>Inserts an ordered list (<ol>) element at the cursor's position.</td> - <td>---</td> - </tr> - <tr> - <td>insertunorderedlist</td> - <td>Inserts an unordered list (<ul>) element at the cursor's position.</td> - <td>---</td> - </tr> - <tr> - <td>italic</td> - <td>Toggles the selection's italicize attribute.</td> - <td>---</td> - </tr> - <tr> - <td>justifycenter</td> - <td>Centers the content at the current line.</td> - <td>---</td> - </tr> - <tr> - <td>justifyleft</td> - <td>Justifies the content at the current line to the left.</td> - <td>---</td> - </tr> - <tr> - <td>justifyright</td> - <td>Justifies the content at the current line to the right.</td> - <td>---</td> - </tr> - <tr> - <td>outdent</td> - <td>Outdents the block where the caret is.</td> - <td>---</td> - </tr> - <tr> - <td>redo</td> - <td>Redoes the previous undo command.</td> - <td>---</td> - </tr> - <tr> - <td>removeformat</td> - <td>Removes all formatting from the selection.</td> - <td>---</td> - </tr> - <tr> - <td>selectall</td> - <td>Selects everything in the rich text editor.</td> - <td>---</td> - </tr> - <tr> - <td>strikethrough</td> - <td>Toggles the strikethrough of the selected text.</td> - <td>---</td> - </tr> - <tr> - <td>subscript</td> - <td>Converts the current selection into subscript.</td> - <td>---</td> - </tr> - <tr> - <td>superscript</td> - <td>Converts the current selection into superscript.</td> - <td>---</td> - </tr> - <tr> - <td>underline</td> - <td>Toggles the underline of the selected text.</td> - <td>---</td> - </tr> - <tr> - <td>undo</td> - <td>Undoes the last executed command.</td> - <td>---</td> - </tr> - <tr> - <td>unlink</td> - <td>Removes all link information from the selection.</td> - <td>---</td> - </tr> - <tr> - <td>useCSS</td> - <td>Toggles the usage of CSS in the generated markup.</td> - <td>Boolean value</td> - </tr> - </tbody> -</table> -<p>For more information, visit <a href="/zh_tw/Rich-Text_Editing_in_Mozilla" title="zh_tw/Rich-Text_Editing_in_Mozilla">Rich-Text Editing in Mozilla</a>.</p> -<p> </p> -<h3 id="XML_.E5.B7.AE.E7.95.B0" name="XML_.E5.B7.AE.E7.95.B0">XML 差異</h3> -<p>Mozilla 對 XML 與相關的技術有很完整的支援,如對 XSLT 與 Web services 等。它也支援一些 Internet Explorer 非標準的延伸,例如 XMLHttpRequest。</p> -<p>Mozilla has strong support for XML and XML-related technologies, such as XSLT and Web services. It also supports some nonstandard Internet Explorer extensions, such as XMLHttpRequest.</p> -<h4 id=".E6.8E.8C.E6.8E.A7_XML" name=".E6.8E.8C.E6.8E.A7_XML">掌控 XML</h4> -<p>如同對於標準 HTML,對於可各方面控制 XML 檔的 DOM 的支援,Mozilla 也是依 W3C 所定的 XML DOM 規格。Mozilla 與 Internet Explorer 在 XML DOM 上的不同處大多在於 Internet Explorer 非標準的處理方式。一個常見的差異是對空白字元節點的處理。 通常在建立 XML 時,XML 節點間會有空白。 Internet Explorer 用 <code>XMLNode.childNodes[]</code> 時不會包括這些空白節點,但在 Mozilla 上這些節點會在 array 裡。</p> -<p> 在 HTML 標準上,Mozilla 支援了 W3C XML DOM 規範,但 Internet Explorer 則否。Mozilla 和 Internet Explorer 的一些差異很大部分是肇始於後者的非規範行為。在這其中,最廣為人知的應該就是如何去處理 white space text nodes 了。通常在 XML 文檔產生後,會在 XML node 間包含著一些 white space。當你使用 <code>XMLNode.childNodes[] 時,Internet Explorer 將不會包含這些</code> white space nodes。但在 Mozilla 中,這些 nodes 仍會出現在 array 中。</p> -<pre>XML: - <?xml version="1.0"?> - <myXMLdoc xmlns:myns="http://myfoo.com"> - <myns:foo>bar</myns:foo> - </myXMLdoc> - -JavaScript: - var myXMLDoc = getXMLDocument().documentElement; - alert(myXMLDoc.childNodes.length); -</pre> -<p>The first line of JavaScript 的第一行載入 XML 檔並用 <code>documentElement</code> 來存取它的 root 元素 (<code>myXMLDoc</code>)。第二行顯示子節點的數目。根據 W3C 規格,接在一起的空白與換行字符組成一個文字節點。在 Mozilla 上 <code>myXMLdoc</code> 節點有三個子:一個有換行字符與兩個空白的文字節點、<code>myns:foo</code> 節點、與另一個有換行字符的文字節點。Internet Explorer 並不遵循這個,因此上面的程式碼會顯示 "1",表示只有 <code>myns:foo</code> 節點。所以,如要迴走子節點並掠過文字節點,要分辨這些節點。</p> -<p>The first line of JavaScript loads the XML document and accesses the root element (<code>myXMLDoc</code>) by retrieving the <code>documentElement</code>. The second line simply alerts the number of child nodes. Per the W3C specification, the white spaces and new lines merge into one text node if they follow each other. For Mozilla, the <code>myXMLdoc</code> node has three children: a text node containing a new line and two spaces; the <code>myns:foo</code> node; and another text node with a new line. Internet Explorer, however, does not abide by this and will return "1" for the above code, namely only the <code>myns:foo</code> node. Therefore, to walk the child nodes and disregard text nodes, you must distinguish such nodes.</p> -<p>As mentioned earlier, every node has a <code>nodeType</code> attribute representing the node type. For example, an element node has type 1, while a document node has type 9. To disregard text nodes, you must check for types 3 (text node) and 8 (comment node).</p> -<pre>XML: - <?xml version="1.0"?> - <myXMLdoc xmlns:myns="http://myfoo.com"> - <myns:foo>bar</myns:foo> - </myXMLdoc> - -JavaScript: - var myXMLDoc = getXMLDocument().documentElement; - var myChildren = myXMLDoc.childNodes; - - for (var run = 0; run < myChildren.length; run++){ - if ( (myChildren[run].nodeType != 3) && - myChildren[run].nodeType != 8) ){ - // not a text or comment node - } - } -</pre> -<h4 id="XML_data_islands" name="XML_data_islands">XML data islands</h4> -<p>Internet Explorer has a nonstandard feature called <em>XML data islands</em>, which allow you to embed XML inside an HTML document using the nonstandard HTML tag <code><xml></code>. Mozilla does not support XML data islands and handles them as unknown HTML tags. You can achieve the same functionality using XHTML; however, because Internet Explorer's support for XHTML is weak, this is usually not an option.</p> -<p>One cross-browser solution is to use DOM parsers, which parse a string that contains a serialized XML document and generates the document for the parsed XML. Mozilla uses the <code>DOMParser</code> class, which takes the serialized string and creates an XML document out of it. In Internet Explorer, you can achieve the same functionality using ActiveX. A new <code>Microsoft.XMLDOM</code> generates and has a <code>loadXML</code> method that can take in a string and generate a document from it. The following code shows you how:</p> -<pre>IE XML data island: - .. - <xml id="xmldataisland"> - <foo>bar</foo> - </xml> - -Cross-browser solution: - var xmlString = "<xml id=\"xmldataisland\"><foo>bar</foo></xml>"; - - var myDocument; - - if (document.implementation.createDocument){ - // Mozilla, create a new DOMParser - var parser = new DOMParser(); - myDocument = parser.parseFromString(xmlString, "text/xml"); - } else if (window.ActiveXObject){ - // Internet Explorer, create a new XML document using ActiveX - // and use loadXML as a DOM parser. - myDocument = new ActiveXObject("Microsoft.XMLDOM") - myDocument.async="false"; - - myDocument.loadXML(xmlString); - } -</pre> -<h4 id="XML_HTTP_request" name="XML_HTTP_request">XML HTTP request</h4> -<p>Internet Explorer allows you to send and retrieve XML files using MSXML's <code>XMLHTTP</code> class, which is instantiated through ActiveX using <code>new ActiveXObject("Msxml2.XMLHTTP")</code> or <code>new ActiveXObject("Microsoft.XMLHTTP")</code>. Since there is no standard method of doing this, Mozilla provides the same functionality in the global JavaScript <code>XMLHttpRequest</code> object. The object generates asynchronous requests by default.</p> -<p>After instantiating the object using <code>new XMLHttpRequest()</code>, you can use the <code>open</code> method to specify what type of request (GET or POST) you use, which file you load, and if it is asynchronous or not. If the call is asynchronous, then give the <code>onload</code> member a function reference, which is called once the request has completed.</p> -<p>Synchronous request:</p> -<pre class="eval"> var myXMLHTTPRequest = new XMLHttpRequest(); - myXMLHTTPRequest.open("GET", "data.xml", false); - - myXMLHTTPRequest.send(null); - - var myXMLDocument = myXMLHTTPRequest.responseXML; -</pre> -<p>Asynchronous request:</p> -<pre class="eval"> var myXMLHTTPRequest; - - function <span class="boldcode">xmlLoaded</span>() { - var myXMLDocument = myXMLHTTPRequest.responseXML; - } - - function loadXML(){ - myXMLHTTPRequest = new XMLHttpRequest(); - - myXMLHTTPRequest.open("GET", "data.xml", true); - - myXMLHTTPRequest.onload = <span class="boldcode">xmlLoaded</span>; - - myXMLHTTPRequest.send(null); - } -</pre> -<p>Table 7 features a list of available methods and properties for Mozilla's <code>XMLHttpRequest</code>.</p> -<p> </p> -<p>Table 7. XMLHttpRequest methods and properties</p> -<table class="standard-table"> - <tbody> - <tr> - <th>Name</th> - <th>Description</th> - </tr> - <tr> - <td>void abort()</td> - <td>Stops the request if it is still running.</td> - </tr> - <tr> - <td>string getAllResponseHeaders()</td> - <td>Returns all response headers as one string.</td> - </tr> - <tr> - <td>string getResponseHeader(string headerName)</td> - <td>Returns the value of the specified header.</td> - </tr> - <tr> - <td>functionRef onerror</td> - <td>If set, the references function will be called whenever an error occurs during the request.</td> - </tr> - <tr> - <td>functionRef onload</td> - <td>If set, the references function will be called when the request completes successfully and the response has been received. Use when an asynchronous request is used.</td> - </tr> - <tr> - <td>void open (string HTTP_Method, string URL)<br> - <br> - void open (string HTTP_Method, string URL, boolean async, string userName, string password)</td> - <td>Initializes the request for the specified URL, using either GET or POST as the HTTP method. To send the request, call the <code>send()</code> method after initialization. If <code>async</code> is false, the request is synchronous, else it defaults to asynchronous. Optionally, you can specify a username and password for the given URL needed.</td> - </tr> - <tr> - <td>int readyState</td> - <td>State of the request. Possible values: - <table> - <tbody> - <tr> - <th>Value</th> - <th>Description</th> - </tr> - <tr> - <td>0</td> - <td>UNINITIALIZED - open() has not been called yet.</td> - </tr> - <tr> - <td>1</td> - <td>LOADING - send() has not been called yet.</td> - </tr> - <tr> - <td>2</td> - <td>LOADED - send() has been called, headers and status are available.</td> - </tr> - <tr> - <td>3</td> - <td>INTERACTIVE - Downloading, responseText holds the partial data.</td> - </tr> - <tr> - <td>4</td> - <td>COMPLETED - Finished with all operations.</td> - </tr> - </tbody> - </table> - </td> - </tr> - <tr> - <td>string responseText</td> - <td>String containing the response.</td> - </tr> - <tr> - <td>DOMDocument responseXML</td> - <td>DOM Document containing the response.</td> - </tr> - <tr> - <td>void send(variant body)</td> - <td>Initiates the request. If <code>body</code> is defined, it issent as the body of the POST request. <code>body</code> can be an XML document or a string serialized XML document.</td> - </tr> - <tr> - <td>void setRequestHeader (string headerName, string headerValue)</td> - <td>Sets an HTTP request header for use in the HTTP request. Has to be called after <code>open()</code> is called.</td> - </tr> - <tr> - <td>string status</td> - <td>The status code of the HTTP response.</td> - </tr> - </tbody> -</table> -<h4 id="XSLT_.E5.B7.AE.E7.95.B0" name="XSLT_.E5.B7.AE.E7.95.B0">XSLT 差異</h4> -<p>Mozilla supports XSL Transformations (XSLT) 1.0. It also allows JavaScript to perform XSLT transformations and allows running XPATH on a document.</p> -<p>Mozilla requires that you send the XML and XSLT file holding the stylesheet with an XML mimetype (<code>text/xml</code> or <code>application/xml</code>). This is the most common reason why XSLT won't run in Mozilla but will in Internet Explorer. Mozilla is strict in that way.</p> -<p>Internet Explorer 5.0 and 5.5 supported XSLT's working draft, which is substantially different than the final 1.0 recommendation. The easiest way to distinguish what version an XSLT file was written against is to look at the namespace. The namespace for the 1.0 recommendation is <code><span class="nowiki">http://www.w3.org/1999/XSL/Transform</span></code>, while the working draft's namespace is <code><span class="nowiki">http://www.w3.org/TR/WD-xsl</span></code>. Internet Explorer 6 supports the working draft for backwards compatibility, but Mozilla does not support the working draft, only the final recommendation.</p> -<p>If XSLT requires you to distinguish the browser, you can query the "xsl:vendor" system property. Mozilla's XSLT engine will report itself as "Transformiix" and Internet Explorer will return "Microsoft."</p> -<pre><xsl:if test="system-property('xsl:vendor') = 'Transformiix'"> - <!-- Mozilla specific markup --> -</xsl:if> -<xsl:if test="system-property('xsl:vendor') = 'Microsoft'"> - <!-- Internet Explorer specific markup --> -</xsl:if> -</pre> -<p>Mozilla also provides JavaScript interfaces for XSLT, allowing a Web site to complete XSLT transformations in memory. You can do this using the global <code>XSLTProcessor</code> JavaScript object. <code>XSLTProcessor</code> requires you to load the XML and XSLT files, because it needs their DOM documents. The XSLT document, imported by the <code>XSLTProcessor</code>, allows you to manipulate XSLT parameters. <code>XSLTProcessor</code> can generate a standalone document using <code>transformToDocument()</code>, or it can create a document fragment using <code>transformToFragment()</code>, which you can easily append into another DOM document. Below is an example:</p> -<p> </p> -<pre>var xslStylesheet; -var xsltProcessor = new XSLTProcessor(); - -// load the xslt file, example1.xsl -var myXMLHTTPRequest = new XMLHttpRequest(); -myXMLHTTPRequest.open("GET", "example1.xsl", false); -myXMLHTTPRequest.send(null); - -// get the XML document and import it -xslStylesheet = myXMLHTTPRequest.responseXML; - -xsltProcessor.importStylesheet(xslStylesheet); - -// load the xml file, example1.xml -myXMLHTTPRequest = new XMLHttpRequest(); -myXMLHTTPRequest.open("GET", "example1.xml", false); -myXMLHTTPRequest.send(null); - -var xmlSource = myXMLHTTPRequest.responseXML; - -var resultDocument = xsltProcessor.transformToDocument(xmlSource); -</pre> -<p>After creating an <code>XSLTProcessor</code>, you load the XSLT file using <code>XMLHttpRequest</code>. The XMLHttpRequest's <code>responseXML</code> member contains the XML document of the XSLT file, which is passed to <code>importStylesheet</code>. You then use the <code>XMLHttpRequest</code> again to load the source XML document that must be transformed; that document is then passed to the <code>transformToDocument</code> method of <code>XSLTProcessor</code>. Table 8 features a list of <code>XSLTProcessor</code> methods.</p> -<p> </p> -<p>Table 8. XSLTProcessor methods</p> -<table class="standard-table"> - <tbody> - <tr> - <th>Method</th> - <th>Description</th> - </tr> - <tr> - <td>void importStylesheet(Node styleSheet)</td> - <td>Imports the XSLT stylesheet. The <code>styleSheet</code> argument is the root node of an XSLT stylesheet's DOM document.</td> - </tr> - <tr> - <td>DocumentFragment transformToFragment(Node source, Document owner)</td> - <td>Transforms the Node <code>source</code> by applying the stylesheet imported using the <code>importStylesheet</code> method and generates a DocumentFragment. <code>owner</code> specifies what DOM document the DocumentFragment should belong to, making it appendable to that DOM document.</td> - </tr> - <tr> - <td>Document transformToDocument(Node source)</td> - <td>Transforms the Node <code>source</code> by applying the stylesheet imported using the <code>importStylesheet</code> method and returns a standalone DOM document.</td> - </tr> - <tr> - <td>void setParameter(String namespaceURI, String localName, Variant value)</td> - <td>Sets a parameter in the imported XSLT stylesheet.</td> - </tr> - <tr> - <td>Variant getParameter(String namespaceURI, String localName)</td> - <td>Gets the value of a parameter in the imported XSLT stylesheet.</td> - </tr> - <tr> - <td>void removeParameter(String namespaceURI, String localName)</td> - <td>Removes all set parameters from the imported XSLT stylesheet and makes them default to the XSLT-defined defaults.</td> - </tr> - <tr> - <td>void clearParameters()</td> - <td>Removes all set parameters and sets them to defaults specified in the XSLT stylesheet.</td> - </tr> - <tr> - <td>void reset()</td> - <td>Removes all parameters and stylesheets.</td> - </tr> - </tbody> -</table> -<div class="originaldocinfo"> - <h3 id=".E5.8E.9F.E6.96.87.E8.B3.87.E8.A8.8A" name=".E5.8E.9F.E6.96.87.E8.B3.87.E8.A8.8A">原文資訊</h3> - <ul> - <li>原文作者:Doron Rosenberg, IBM Corporation</li> - <li>公開日期: 26 Jul 2005</li> - <li>原文連結: <a class="external" href="http://www-128.ibm.com/developerworks/web/library/wa-ie2mozgd/" rel="freelink">http://www-128.ibm.com/developerwork...y/wa-ie2mozgd/</a></li> - </ul> -</div> diff --git a/files/zh-tw/archive/mozilla/persona/branding/index.html b/files/zh-tw/archive/mozilla/persona/branding/index.html deleted file mode 100644 index 2793b91f88..0000000000 --- a/files/zh-tw/archive/mozilla/persona/branding/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: 品牌資源 -slug: Archive/Mozilla/Persona/branding -translation_of: Archive/Mozilla/Persona/User_interface_guidelines ---- -<h2 id="「使用_Persona_登入」按鈕">「使用 Persona 登入」按鈕</h2> -<h3 id="圖片">圖片</h3> -<p>登入按鈕有三種版本、三種配色:</p> -<table> - <thead> - <tr> - <th scope="row"> </th> - <th scope="col">Sign in with your Email</th> - <th scope="col">Sign in with Persona</th> - <th scope="col">Sign in</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row">黑</th> - <td><img alt="" src="/files/3955/email_sign_in_black.png" style="width: 202px; height: 25px;"></td> - <td><img alt="" src="/files/3961/persona_sign_in_black.png" style="width: 185px; height: 25px;"></td> - <td><img alt="" src="/files/3967/plain_sign_in_black.png" style="width: 95px; height: 25px;"></td> - </tr> - <tr> - <th scope="row">藍</th> - <td><img alt="" src="/files/3957/email_sign_in_blue.png" style="width: 202px; height: 25px;"></td> - <td><img alt="" src="/files/3963/persona_sign_in_blue.png" style="width: 185px; height: 25px;"></td> - <td><img alt="" src="/files/3969/plain_sign_in_blue.png" style="width: 95px; height: 25px;"></td> - </tr> - <tr> - <th scope="row">紅</th> - <td><img alt="" src="/files/3959/email_sign_in_red.png" style="width: 202px; height: 25px;"></td> - <td><img alt="" src="/files/3965/persona_sign_in_red.png" style="width: 185px; height: 25px;"></td> - <td><img alt="" src="/files/3971/plain_sign_in_red.png" style="width: 95px; height: 25px;"></td> - </tr> - </tbody> -</table> -<h3 id="CSS-Based">CSS-Based</h3> -<p><a href="http://sawyerhollenshead.com/" title="http://sawyerhollenshead.com/">Sawyer Hollenshead</a> 製作了一套精美的 CSS-based 按鈕。<a href="/files/3973/persona-css-buttons.zip" title="/files/3973/persona-css-buttons.zip">下載 (.zip)</a></p> -<h2 id="更多資訊">更多資訊</h2> -<p>您可在 <a href="http://people.mozilla.org/~smartell/persona/" title="http://people.mozilla.org/~smartell/persona/">Sean Martell's style primer</a> 找到更多有關 Persona 視覺設計的資訊。</p> diff --git a/files/zh-tw/archive/mozilla/persona/index.html b/files/zh-tw/archive/mozilla/persona/index.html deleted file mode 100644 index 5345e5f569..0000000000 --- a/files/zh-tw/archive/mozilla/persona/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Persona -slug: Archive/Mozilla/Persona -translation_of: Archive/Mozilla/Persona ---- -<div class="callout-box"> -<p><strong> 保持聯繫或取得協助!</strong></p> - -<p>追蹤 <a class="external" dir="ltr" href="mailto:jcchimjj@yahoo.com?subject=%E9%80%A3%E7%B5%90" id="jcchimjj@yahoo.com" lang="Zh-TW" name="huawei 大叔" title="http://identity.mozilla.com/">我們的 </a><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://login.persona.org/" title="https://www.mozilla.org/zh-TW/persona/">Mozilla Persona</a> 是一個跨瀏覽器的 Web 登入驗證系統,其基本設計精神為易於使用以及易於實作。它可以使用於當今<a href="/zh-TW/docs/persona/Browser_compatibility" title="/zh-TW/docs/persona/Browser_compatibility">主要的各種瀏覽器</a>環境中,你可以<a href="/zh-TW/docs/Persona/Quick_Setup">現在就開始使用</a>它。</p> - -<p>為什麼你應該套用 Persona 在你的網站上呢?</p> - -<ol> - <li><strong>Persona 完全消除了特定網站的密碼,</strong>讓使用者們與網站們從創立、管理以及安全地保存密碼的責任中解放出來。</li> - <li><strong>Persona </strong><strong>易於使用。</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> -</ol> - -<p>而且,Persona 未來將會變得越來越棒:它是基於<strong>開放</strong>、<strong>去中心化</strong>的通訊協定,被設計規劃成<strong>可直接整合到各個瀏覽器中</strong>,以及<strong>可由電子郵件服務提供者直接提供支援</strong>。今天採用並導入 Persona 的網站將直接體驗到這些未來的改進項目,不需要再更動其程式碼。</p> - -<div class="note"><strong>備註:</strong>Persona 正在很活躍地開發中。歡迎造訪<a class="external" href="http://identity.mozilla.com/" title="http://identity.mozilla.com/">我們的</a><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-TW/docs/Persona/Why_Persona" title="zh-TW/BrowserID/Why_BrowserID">為什麼是 Persona?</a></dt> - <dd>認識更多關於在你的網站上採用 Persona 的原因,以及它與其他身分驗證系統的差異比較。</dd> - <dt><a href="/zh-TW/docs/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-TW/DOM/navigator.id" title="navigator.id">navigator.id API </a></dt> - <dd>這是一份關於 <code>navigator.id</code> 物件的參考資料,Web 開發人員可以用來將 Persona 整合到網站中。</dd> - <dt><a href="/zh-TW/Persona/Remote_Verification_API" title="zh-TW/BrowserID/Remote_Verification_API">Verification (驗證) API </a></dt> - <dd>這份參考資料是關於建構在<code>https</code><code>://verifier.login.persona.org/verify</code> 的遠端驗證 API。</dd> - </dl> - </td> - </tr> - <tr> - <td> - <h3 id="導引指南">導引指南</h3> - - <dl> - <dt><a href="/zh-TW/Persona/Security_Considerations" title="BrowserID/Security considerations">安全考量</a></dt> - <dd>實作與技巧用以確保你的 Persona 佈署是安全的。</dd> - <dt><a href="/zh-TW/Persona/Browser_compatibility" title="/Browser_compatibility">瀏覽器相容性</a></dt> - <dd>確切得知有哪些瀏覽器有支援 Persona。</dd> - <dt><a href="/zh-TW/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 framework、blog 或是內容管理系統 (CMS) 的函式庫或套件 (plugin)。</dd> - <dt><a class="link-https" href="https://github.com/mozilla/browserid-cookbook" title="https://github.com/mozilla/browserid-cookbook">The Persona cookbook</a></dt> - <dd>給 Persona 網站參考的範例程式碼。包含有 C# (MVC3)、PHP、Node.JS 等等各種語言。</dd> - <dt><a href="/zh-TW/docs/persona/branding" title="/zh-TW/docs/persona/branding">品牌資源</a></dt> - <dd>Persona 登入按鈕,以及方便你的使用者識別的 Persona 圖形資源。</dd> - </dl> - </td> - </tr> - </tbody> -</table> - -<p> </p> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 id="給身分識別提供者_(Identity_Provider)_的資訊">給身分識別提供者 (Identity Provider) 的資訊</h2> - - <p>如果你是電子郵件服務提供者,或是身分識別服務提供者,請參考以下資訊獲知如何整合並成為一個 Persona 身分識別提供者 (IdP)。</p> - - <dl> - <dt><a href="/zh-TW/docs/Persona/Identity_Provider_Overview" title="IdP">IdP 概述</a></dt> - <dd>Persona 身份識別提供者概述。</dd> - <dt><a href="/zh-TW/Persona/Implementing_a_Persona_IdP" title="Guide to Implementing a Persona IdP">實作 IdP</a></dt> - <dd>這是一份詳細的技術指南,關於如何成為身分識別提供者 (IdP)。</dd> - <dt><a href="/zh-TW/docs/Persona/.well-known-browserid" title="https://developer.mozilla.org/zh-TW/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-TW/Persona/Glossary" title="navigator.id">專有名詞對照表</a></dt> - <dd>BrowserID 和 Persona 定義的專有名詞。</dd> - <dt><a href="/zh-TW/Persona/FAQ" title="zh-TW/BrowserID/FAQ">FAQ</a></dt> - <dd>常見問題集。</dd> - <dt><a href="/zh-TW/Persona/Protocol_Overview" title="BrowserID/Protocol overview">通訊協定概述</a></dt> - <dd>BrowserID 通訊協定的底層技術性概述。</dd> - <dt><a href="/zh-TW/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-TW/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 實作,以及一個身分判定 (identity assertion) 驗證服務。</dd> - <dt><a href="https://github.com/mozilla/browserid">Persona 原始程式碼</a></dt> - <dd>我們將 Persona 網站背後的程式碼放在 GitHub 上。非常歡迎送 Pull requests 給我們!</dd> - </dl> - </td> - </tr> - </tbody> -</table> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/persona/internationalization/index.html b/files/zh-tw/archive/mozilla/persona/internationalization/index.html deleted file mode 100644 index b4ec357352..0000000000 --- a/files/zh-tw/archive/mozilla/persona/internationalization/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Internationalization -slug: Archive/Mozilla/Persona/Internationalization -tags: - - Persona -translation_of: Archive/Mozilla/Persona/Internationalization ---- -<h2 id="Persona_的本土化如何呢?">Persona 的本土化如何呢?</h2> -<p>將來,使用 Persona 登入網站的使用者界面(UI)將被直接集成至瀏覽器中,並且隨著瀏覽器自己的本土化來本土化。。而不支援集成的瀏覽器,Persona 的使用者界面即由一系列來自 <a href="https://login.persona.org" title="https://login.persona.org">login.persona.org</a> 的對話框所組成。這些對話框的翻譯由來自社群的自願者進行,並且有超過 45 種語言<a href="https://github.com/mozilla/browserid/blob/dev/config/l10n-prod.json" title="https://github.com/mozilla/browserid/blob/dev/config/l10n-prod.json">可用於這些產品中</a>。</p> -<h2 id="Persona_如何選擇語言?">Persona 如何選擇語言?</h2> -<p>Persona 服務通過來自瀏覽器請求頭部訊息中的 <code>Accept-Language</code> 來選擇語言。<code>Accept-Language</code> 頭部訊息所使用的語言與 <code>mozilla.org</code> 所使用的為一致:</p> -<ol> - <li>對於每個 <code>Accept-Language</code> 中的語言標籤: - <ul> - <li>確保我們有完整的該語言標籤的語言,則為精準配對該語言標籤</li> - <li>確保我們有該語言標籤中的第一個部分,則精準配對第一部分</li> - </ul> - </li> - <li>若沒辦法通過規則 1 來配對,則退而使用 en-US 。但是,通常 en 或 en-US 幾乎會被大多數瀏覽器作為最後一個傳送的 accept-lang 頭部資訊。</li> -</ol> -<p>舉例來說,下列下列表格列出了不同的 <code>Accept-Language</code> 會選擇的語言,假設支援下列語言: <code>en-US, es, es-MX</code>:</p> -<table> - <thead> - <tr> - <th scope="col"><strong>Accept-Language Header</strong></th> - <th scope="col"><strong>Persona 選擇的語言</strong></th> - </tr> - </thead> - <tbody> - <tr> - <td><code>es-AR,es;q=0.8,en-us;q=0.5</code></td> - <td><code>es</code></td> - </tr> - <tr> - <td><code>es-MX,es;q=0.8,en-us;q=0.5</code></td> - <td><code>es-MX</code></td> - </tr> - <tr> - <td><code>e</code><code>s-es,en-us;q=0.5</code></td> - <td><code>en-US</code></td> - </tr> - <tr> - <td><code>e</code><code>s-es</code></td> - <td><code>en-US</code></td> - </tr> - </tbody> -</table> -<p>目前還沒辦法讓網站強制將對話框設為某一種語言。這是因為 Persona UI 的邏輯是(以及未來在本機上實現的,也會是)設計為作為瀏覽器的使用者界面的一部分,所以其語言應該要同瀏覽器的語言一致。</p> -<h2 id="我可以如何協助?">我可以如何協助?</h2> -<p>Persona 使用了 Mozilla Verbatim 來協助志願者建立新的翻譯。若您想幫助,請參閱<a href="https://developer.mozilla.org/en-US/docs/Localizing_with_Verbatim" title="https://developer.mozilla.org/en-US/docs/Localizing_with_Verbatim">開始使用 Verbatim</a> 並看看 Verbatim 上的<a href="https://localize.mozilla.org/projects/browserid/" title="https://localize.mozilla.org/projects/browserid/">「BrowserID」計劃</a> 。</p> -<p> </p> diff --git a/files/zh-tw/archive/mozilla/persona/quick_setup/index.html b/files/zh-tw/archive/mozilla/persona/quick_setup/index.html deleted file mode 100644 index d21858329f..0000000000 --- a/files/zh-tw/archive/mozilla/persona/quick_setup/index.html +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: 快速指南 -slug: Archive/Mozilla/Persona/Quick_Setup -translation_of: Archive/Mozilla/Persona/Quick_Setup ---- -<p>要把 Persona 登入系統加到你的網站,只需要五個步驟:</p> -<ol> - <li>在你的網頁中引入 Persona 的 JavaScript 函式庫。</li> - <li>加上「登入」和「登出」按鈕。</li> - <li>監聽登入和登出行為。</li> - <li>驗證使用者的身分 (credential)。</li> - <li>檢視最佳導入實例。</li> -</ol> -<p>你應該能在一個下午就建置完成並開始執行,另外重要的事情是:如果你要在你的網站上開始使用 Persona,請花點時間訂閱 <a href="https://mail.mozilla.org/listinfo/persona-notices">Persona 通知</a> 郵件清單。它的流量非常低,只會用於通知你關於變更公告或是安全問題等可能對你的網站造成影響的議題。</p> -<h2 id="步驟1:引入_Persona_函式庫">步驟1:引入 Persona 函式庫</h2> -<p>Persona 被設計為跨瀏覽器且可在<a href="https://developer.mozilla.org/docs/persona/Browser_compatibility">全部主要桌面和移動瀏覽器</a>中工作。</p> -<p>在未來我們期望瀏覽器提供 Persona 的原生支援,但我們同時提供了一個 JavaScript 函式庫完整實作了使用者介面和客戶端部分的協議。透過包含這個函式庫,你的使用者將可以用 Persona 登入,無論他們的瀏覽器是否有原生支援。</p> -<p>一旦頁面中的這個函式庫載入完成,你需要的 Persona 函式({{ domxref("navigator.id.watch()", "watch()") }}、{{ domxref("navigator.id.request()", "request()") }} 和 {{ domxref("navigator.id.logout()", "logout()") }})會在全域物件 <code>navigator.id</code> 中可用。</p> -<p>要包含 Persona JavaScript 函式庫,你可以把這個 <code>script</code> 標籤放進你頁面的首部:</p> -<pre class="brush: html;"><script src="https://login.persona.org/include.js"></script> -</pre> -<p>你<strong>必須</strong>在每個使用 {{ domxref("navigator.id") }} 中函式的頁面裡包含這個標籤。因為 Persona 始終在開發中,你不應該自行管理 <code>include.js</code> 檔。</p> -<h2 id="步驟2:加入登入登出按鈕">步驟2:加入登入/登出按鈕</h2> -<p>因為 Persona 被設計為一個 DOM API,你必須在使用者按下你網站上的登入或登出按鈕時呼叫函式。要開啟 Persona 對話視窗並提示使用者登入,你應該呼叫 {{ domxref("navigator.id.request()") }} 。而登出要呼叫 {{ domxref("navigator.id.logout()") }} 。</p> -<p>例如:</p> -<pre class="brush: js;">var signinLink = document.getElementById('signin'); -if (signinLink) { -signinLink.onclick = function() { navigator.id.request(); }; -}; - -var signoutLink = document.getElementById('signout'); -if (signoutLink) { -signoutLink.onclick = function() { navigator.id.logout(); }; -}; -</pre> -<p>那些按鈕的是什麼樣子的?查看我們的<a href="https://developer.mozilla.org/docs/persona/branding">品牌資源</a>頁面中的預製圖片和基於 CSS 的按鈕!</p> -<h2 id="步驟3:監視登入登出行為">步驟3:監視登入/登出行為</h2> -<p>要把 Persona 封裝成函式,你需要告訴它當使用者登入/登出時做甚麼。呼叫 {{ domxref("navigator.id.watch()") }} 函式就可以實作,它支援三處:</p> -<ol> - <li> - <p>你網站目前使用者的 <code>loggedInEmail</code> ,如果沒有則為 <code>null</code> 。你應該在渲染頁面的時候動態產生它。</p> - </li> - <li> - <p>當觸發 <code>onlogin</code> 行為的時候呼叫的函式。這個函式會被傳遞一個必須認證的「身分斷言」參數。</p> - </li> - <li> - <p>當觸發 <code>onlogout</code> 行為的時候呼叫的函式。這個函式不會被傳遞任何參數。</p> - </li> -</ol> -<div class="note style-wrap"> - <p><strong>注意:</strong>你必須總是在呼叫 {{ domxref("navigator.id.watch()") }} 時同時包含 <code>onlogin</code> 和 <code>onlogout</code> 。</p> -</div> -<p>例如,如果你現在認為 Bob 已經登入到你的網站,你會這樣做:</p> -<pre class="brush: js;">var currentUser = 'bob@example.com'; - -navigator.id.watch({ -loggedInUser: currentUser, -onlogin: function(assertion) { -// 一個使用者已經登入!這是你需要做的: -// 1. 把斷言發送到後端驗證並建立一個工作階段。 -// 2. 更新你的 UI。 -$.ajax({ /* <-- 本例使用了 jQuery,但你也可以用你想用的 */ -type: 'POST', -url: '/auth/login', // 這是你網站上的一個 URL -data: {assertion: assertion}, -success: function(res, status, xhr) { window.location.reload(); }, -error: function(res, status, xhr) { alert("登入失敗" + res); } -}); -}, -onlogout: function() { -// 一個使用者已經登出!這是你需要做的: -// 銷毀使用者的工作階段並重新導向使用者或做後端的呼叫。 -// 同樣,讓 loggedInUser 在下個頁面載入時變為 null。 -// (這是一個字面的 JavaScript null。不是 false、 0 或 undefined。null。) -$.ajax({ -type: 'POST', -url: '/auth/logout', // 這是你網站上的一個 URL -success: function(res, status, xhr) { window.location.reload(); }, -error: function(res, status, xhr) { alert("登出失敗" + res); } -}); -} -}); -</pre> -<p>在本例中,<code>onlogin</code> 和 <code>onlogout</code> 都通過向你網站的後端發送非同步 <code>POST</code> 請求來實作。後端隨後通常用設定或刪除工作階段 cookie 中的資訊來登入或登出使用者。之後,如果一切都核對無誤,頁面重新載入來考慮帳號的新登入狀態。</p> -<p>你當然可以用 AJAX 來不用重新載入或重新導向來實作,但這超出了本教學的範疇。</p> -<p>你<strong>必須</strong>在每個有登入/登出按鈕的頁面上呼叫這個函式。要為使用者支持 Persona 加強功能,諸如自動登入和全域登出,你<strong>應該</strong>在網站上的每個頁面都呼叫這個函式。</p> -<h2 id="步驟4:驗證使用者證書">步驟4:驗證使用者證書</h2> -<p>Persona 用「身分斷言」來代替密碼,那是一種類似一次性、單一網站的、使用者郵件地址捆綁的密碼。當使用者想要登入時,你的 <code>onlogin</code> 回調會傳入一個該使用者的斷言來呼叫。在你登入他們前,你必須驗證斷言的有效性。</p> -<p>在你的伺服器上而不是使用者瀏覽器上執行的 JavaScript 中驗證斷言是<em>極度</em>重要的,因為那很容易偽造。上面的例子用 jQuery 的 <code>$.ajax()</code> 輔助函式來把斷言通過 <code>POST</code> 到 <code>/auth/login</code> 來呈遞給後端。</p> -<p>一旦你的伺服器取得了斷言,你如何驗證它?最簡單的方法是用 Mozilla 提供的輔助服務。簡單地把斷言以兩個參數 <code>POST</code> 給 <code>https://verifier.login.persona.org/verify</code>:</p> -<ol> - <li><code>assertion</code>: 使用者提供的身分斷言。</li> - <li><code>audience</code>: 你網站的主機名稱和連接埠。你必須在後端硬編碼這個值;不要從使用者提供的任何資料中派生這個值。</li> -</ol> -<p>例如,如果你是 <code>example.com</code>,你可以用下面的命令行來測試斷言:</p> -<pre class="brush: bash;">$ curl -d "assertion=<ASSERTION>&audience=https://example.com:443" "https://verifier.login.persona.org/verify" -</pre> -<p>如果它是有效的,你會得到像這樣的一個 JSON 回應:</p> -<pre class="brush: js;">{ -"status": "okay", -"email": "bob@eyedee.me", -"audience": "https://example.com:443", -"expires": 1308859352261, -"issuer": "eyedee.me" -} -</pre> -<p>你可以閱讀<a href="https://developer.mozilla.org/en-US/docs/BrowserID/Remote_Verification_API">驗證服務 API</a>來獲知更多關於驗證服務的內容。一個 <code>/api/login</code> 實作的使用了 <a href="http://python.org/">Python</a>、<a href="http://flask.pocoo.org/">Flask</a> web 框架和 <a href="http://python-requests.org">Requests</a> HTTP 函式庫的例子看起來是這樣:</p> -<pre class="brush: python;">@app.route('/auth/login', methods=['POST']) -def login(): -# 請求必須包含我們要驗證的斷言 -if 'assertion' not in request.form: -abort(400) - -# 把斷言發送給 Mozilla 的驗證服務 -data = {'assertion': request.form['assertion'], 'audience': 'https://example.com:443'} -resp = requests.post('https://verifier.login.persona.org/verify', data=data, verify=True) - -# 驗證器回應了嗎? -if resp.ok: -# 處理回應 -verification_data = json.loads(resp.content) - -# 檢查斷言是否有效 -if verification_data['status'] == 'okay': -# 設置一個安全工作階段 cookie 來登入使用者 -session.update({'email': verification_data['email']}) -return resp.content - -# 哎喲,有什麼東西不對,放棄 -abort(500) -</pre> -<p>工作階段管理可能很像你現有的登入系統。首先的大區別是在驗證使用者身分採用了檢查斷言而不是檢查密碼。另一個不同是確保使用者的郵件地址有效來用於 {{ domxref("navigator.id.watch()") }} 的 <code>loggedInEmail</code> 參數</p> -<p>登出很簡單:你只需要移除使用者的工作階段 cookie。</p> -<h2 id="步驟5:回顧最佳實踐">步驟5:回顧最佳實踐</h2> -<p>一旦所有的東西都工作正常並且你已經成功登入和登出你的網站,你應該花一會時間來回顧安全可靠地使用 Persona 的<a href="https://developer.mozilla.org/docs/BrowserID/Security_Considerations">最佳實踐</a>。</p> -<p>如果你在做一個要作為生產環境的網站,你會想要編寫整合測試來模擬用 Persona 登入或登出使用者。要改善 Selenium 中的這個行為,請考慮使用 <a href="https://github.com/mozilla/bidpom" title="https://github.com/mozilla/bidpom">bidpom</a> 函式庫。<a href="https://mockmyid.com/" title="https://mockmyid.com/">mockmyid.com</a> 和 <a href="http://personatestuser.org" title="http://personatestuser.org">personatestuser.org</a> 這兩個網站也可能會有用。</p> -<p>最後,不要忘記登記加入 <a href="https://mail.mozilla.org/listinfo/persona-notices">Persona 通知</a> 郵件清單,這樣會通知你任何安全問題或 Persona API 的向後相容變更。這個清單的流量非常低:它只用於通知會對你的網站造成負面影響的變更。</p> diff --git a/files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html b/files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html deleted file mode 100644 index 7d84cc21b6..0000000000 --- a/files/zh-tw/archive/mozilla/persona/remote_verification_api/index.html +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: 遠端驗證 API -slug: Archive/Mozilla/Persona/Remote_Verification_API -translation_of: Archive/Mozilla/Persona/Remote_Verification_API ---- -<h2 id="Summary" name="Summary">概覽</h2> -<p>當使用者嘗試登入至網站時,瀏覽器會產生一名為「斷言」的資料結構,其實質上就是一個加密過的電子郵件位置。瀏覽器傳送這個斷言至網站上,使用者登入前,網站必須驗證斷言的有效性。</p> -<p>斷言可以在本地端或是通過在下列位置的 API 來進行驗證:<span class="link-https"><code>https://verifier.login.persona.org/verify</code></span>。這個頁面介紹了如何使用 API 。</p> -<h2 id="Methods" name="Methods">方法</h2> -<p>HTTP POST 請求至 <code>https://verifier.login.persona.org/verify</code>。</p> -<h3 id="Parameters" name="Parameters">參數</h3> -<dl> - <dt> - <code>assertion</code></dt> - <dd> - 使用者所提供之斷言。作為傳入 {{ domxref("navigator.id.watch()") }} 中 <code>onlogin</code> 函數的第一個參數。</dd> - <dt> - <code>audience</code></dt> - <dd> - 您網站的通訊協定、網域名稱、與通訊埠。例如:<code>「https://example.com:443</code>」</dd> -</dl> -<h3 id="Return_values" name="Return_values">回傳值</h3> -<p>呼叫後會傳統一個包含 <code>status</code> 元素的 JSON 結構,其值可能為「okay」或是「failure」。 依據 <code>status 的值的不同,可能會包含下列表中的額外元素。</code></p> -<h4 id="okay" name="okay">"okay"</h4> -<p>該斷言有效。</p> -<p>在這種情況下,JSON 結構會包含下列附加元素:</p> -<table class="standard-table" style="width: 80%;"> - <tbody> - <tr> - <td>"<code>email</code>"</td> - <td>斷言中包含的登入者的郵件位置。</td> - </tr> - <tr> - <td>"<code>audience</code>"</td> - <td>Audience 的值包含了斷言。Expected to be your own website URL.</td> - </tr> - <tr> - <td>"<code>expires</code>"</td> - <td>斷言有效期的資料,expressed as the <a href="/en/JavaScript/Reference/Global_Objects/Date/valueOf" title="en/JavaScript/Reference/Global_Objects/Date/valueOf">primitive value of a Date object</a>: that is, the number of milliseconds since midnight 01 January, 1970 UTC.</td> - </tr> - <tr> - <td>"<code>issuer</code>"</td> - <td>The hostname of the identity provider that issued the assertion.</td> - </tr> - </tbody> -</table> -<h4 id="failure" name="failure">"failure"</h4> -<p>該斷言無效。這種情況下 JSON 結構將會包含一個附加的元素:</p> -<table class="compact-table"> - <tbody> - <tr> - <td><code>"reason"</code></td> - <td>一字串解釋驗證為何失敗。</td> - </tr> - </tbody> -</table> -<h2 id="Examples" name="Examples">範例</h2> -<h3 id="node.js" name="node.js">node.js</h3> -<p>該範例為使用 express.js 的 Node.js 伺服器。</p> -<pre class="brush: js">var express = require("express"), - app = express.createServer(), - https = require("https"), - querystring = require("querystring"); -/* ... */ - -// Audience 必須符合您瀏覽器的位置列上顯示的, -// 包含通訊協定、主機名稱、以及通訊埠。 -var audience = "http://localhost:8888"; - -app.post("/authenticate", function(req, res) { - var vreq = https.request({ - host: "verifier.login.persona.org", - path: "/verify", - method: "POST" - }, function(vres) { - var body = ""; - vres.on('data', function(chunk) { body+=chunk; } ) - .on('end', function() { - try { - var verifierResp = JSON.parse(body); - var valid = verifierResp && verifierResp.status === "okay"; - var email = valid ? verifierResp.email : null; - req.session.email = email; - if (valid) { - console.log("assertion verified successfully for email:", email); - res.json(email); - } else { - console.log("failed to verify assertion:", verifierResp.reason); - res.send(verifierResp.reason, 403); - } - } catch(e) { - console.log("non-JSON response from verifier"); - // bogus response from verifier! - res.send("bogus response from verifier!", 403); - - } - }); - }); - - vreq.setHeader('Content-Type', 'application/x-www-form-urlencoded'); - - var data = querystring.stringify({ - assertion: req.body.assertion, - audience: audience - }); - - vreq.setHeader('Content-Length', data.length); - vreq.write(data); - vreq.end(); - - console.log("verifying assertion!"); -}); - -</pre> -<p>via <a class="link-https" href="https://github.com/lloyd/myfavoritebeer.org/blob/06255b960e1f9078bc935c1c7af0662f33c88818/server/main.js#L112">Lloyd Hilaiel</a></p> -<h3 id="PHP" name="PHP">PHP</h3> -<pre class="brush: php">$url = 'https://verifier.login.persona.org/verify'; -$assert = filter_input( - INPUT_POST, - 'assertion', - FILTER_UNSAFE_RAW, - FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH -); -//使用 $_POST 超全域陣列供 PHP < 5.2 並撰寫您自己的篩選其 -$params = 'assertion=' . urlencode($assert) . '&audience=' . - urlencode('http://example.com:80'); -$ch = curl_init(); -$options = array( - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => TRUE, - CURLOPT_POST => 2, - //CURLOPT_SSL_VERIFYPEER => true, //This currently blocks connection to 'https://verifier.login.persona.org/verify' - CURLOPT_SSL_VERIFYPEER => 0, - - CURLOPT_SSL_VERIFYHOST => 2, - CURLOPT_POSTFIELDS => $params -); -curl_setopt_array($ch, $options); -$result = curl_exec($ch); -curl_close($ch); -echo $result;</pre> -<p>Via <a class="link-https" href="https://github.com/codepo8/BrowserID-login-with-PHP/blob/184fdb74c8a554461c262875859968154d09288e/verify.php">Christian Heilmann</a></p> -<h3 id="Java" name="Java" style="line-height: 20px;">Java</h3> -<pre class="brush: java">@Override -protected void doPost(final HttpServletRequest req, - final HttpServletResponse resp) throws ServletException, - IOException { - - final String audience = req.getServerName(); - final String assertion = req.getParameter("assertion"); - final Verifier verifier = new Verifier(); - final BrowserIDResponse personaResponse = verifier.verify(assertion,audience); - final Status status = personaResponse.getStatus(); - - if (status == Status.OK) { - /* Authentication with Persona was successful */ - String email = personaResponse.getEmail(); - log.info("{} has sucessfully signed in", email); - HttpSession session = req.getSession(true); - session.setAttribute("email", email); - - } else { - /* Authentication with Persona failed */ - log.info("Sign in failed..."); - - } -} -</pre> -<p>Via <a class="link-https" href="https://github.com/user454322/browserid-verifier">Javier</a></p> -<p> </p> -<p>注意:If you send the assertion and audience parameters as a JSON-object, they <strong>must not</strong> be URL-encoded. If they are sent as regular HTTP POST parameters, as in the example above, they <strong>must</strong> be URL-encoded.</p> diff --git a/files/zh-tw/archive/mozilla/persona/why_persona/index.html b/files/zh-tw/archive/mozilla/persona/why_persona/index.html deleted file mode 100644 index e6b3b97ded..0000000000 --- a/files/zh-tw/archive/mozilla/persona/why_persona/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 為什麼是 Persona? -slug: Archive/Mozilla/Persona/Why_Persona -translation_of: Archive/Mozilla/Persona/Why_Persona ---- -<p style="">現行的使用者帳號和密碼系統不是個長久之計:使用者每造訪一個新網站新服務就得建立並記住一組新的、複雜的密碼,然後每一個網站系統都必須要夠安全地存放這些密碼。儘管如此,最近的事故中也顯示了即使是有規模、有聲望的大型網路公司也還是會在密碼安全上失誤出錯,讓他們的使用者資訊暴露在風險中。</p> -<p style="">Persona 是一個開放的、分散式的、web 規模的身分識別系統,用以取代一個網站一組密碼的局面。它解決了如 OpenID 這類系統的易用性與隱私相關等缺點,而且不訴諸於如 Facebook Connect 這類型中心化系統架構。</p> -<h2 id="Persona_擺脫了每站一密碼">Persona 擺脫了每站一密碼</h2> -<p>Persona 讓使用者在完成一個簡單的、一次性的身分識別處理流程後,只需要兩次點擊即可登入網站,而不再需要每站一密碼了。這是安全、可靠的,並且植基於公開金鑰密碼學的基礎上。使用者的瀏覽器產生一組加密過的「身分判定」來取代密碼,它的有效期只存在幾分鐘而且只能用於單一網站上。因為沒有網站特定的密碼,網站使用 Persona 也就不需要擔心如何安全地儲存密碼或是擔心失去或洩漏密碼資料庫了。</p> -<p>如此快速簡便的步驟,將讓使用者更快樂地造訪新網站。</p> -<h2 id="Persona_使用電子郵件信箱地址作為身分識別">Persona 使用電子郵件信箱地址作為身分識別</h2> -<p>Persona 使用電子郵件信箱地址作為身分的識別方式,而不使用任意形式或自訂形式的用戶名稱作為身分識別。這帶給了使用者與開發人員諸多的好處:</p> -<h3 id="使用者使用電子郵件信箱地址的好處">使用者使用電子郵件信箱地址的好處</h3> -<ul> - <li>使用者已經知道自己的郵件信箱地址,相反地,使用 OpenID 得要多學習心得而且可能讓人感到困惑的 URL 網址。</li> - <li>電子郵件信箱地址很靈巧地可以取得 <code>someone@some-context</code> 的概念,容易用來讓使用者區分 <code>@work(工作用)</code>、 <code>@home(家用)</code> 或 <code>@school(學校)</code> 的身份。這與 Facebook 或 Google+ 等社群網站使用實名或單一帳號政策的合併身份的趨勢不相同。</li> - <li>電子郵件信箱地址可以自行設立或是委由其他供應者提供,讓使用者可以自己控制自己的身份。</li> -</ul> -<h3 id="開發者使用電子郵件信箱地址的好處">開發者使用電子郵件信箱地址的好處</h3> -<ul> - <li>郵件信箱地址,讓開發者可以直接聯繫他們的使用者。</li> - <li>大多數網站都需要使用者提供郵件信箱地址,Persona 會在使用者登入時自動提供,免除了額外需要填寫的註冊表單。</li> - <li>許多登入系統已經將電子郵件信箱地址視為唯一鍵。這代表著不會被 Persona 給綁住,而且可以與現有的登入系統一起並列部署。</li> -</ul> -<p>更不用說電子郵件已經是個完整地,橫跨無數服務提供者的,數以億計帳戶的分散式系統。</p> -<h2 id="Persona_與其他單一登入_(Single_Sign-On)_服務有何不同?" style="">Persona 與其他單一登入 (Single Sign-On) 服務有何不同?</h2> -<p>Persona 安全、可靠、而且簡單。它保護了使用者的隱私、使用者的控制權、使用者的選擇,而這些是其它登入服務無法或不願意做到的。</p> -<p>許多社群網站,例如 Facebook 或 Google+,需要使用者使用真實姓名,並且限制使用者僅能使用單一帳號。藉由建構於電子郵件信箱地址的架構,Persona 允許使用者用以區分它們工作用、家用、學校用等不同的身份識別。</p> -<p>Persona 是開放的,也是分散式的:任何一位擁有電子郵件信箱地址的人都可以登入使用 Persona。除此之外,任何人也可以建立他們自己的身份識別服務或委由其他專業機構建立服務,就像使用電子郵件一般。這與需要單一且中心化帳號的社群網站登錄服務的做法剛好相反。</p> -<p>Persona 也採用較為新穎的做法來保護使用者的隱私,藉由將瀏覽器置入成為驗證過程當中的一環:瀏覽器從使用者的電子郵件提供者獲取認證身份,然後瀏覽器轉頭將此認證轉呈給網站。電子郵件提供者無法追蹤使用者,但是網站仍可藉由密碼學等驗證技術取得使用者的身份認證,並信任此使用者身份。其它大部份系統,即使是像 OpenID 如此的分散式系統,仍需要網站在背景連接通訊 (phone home) 才允許使用者登入。</p> diff --git a/files/zh-tw/archive/mozilla/xpinstall/index.html b/files/zh-tw/archive/mozilla/xpinstall/index.html deleted file mode 100644 index 907f839dc4..0000000000 --- a/files/zh-tw/archive/mozilla/xpinstall/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: XPInstall -slug: Archive/Mozilla/XPInstall -tags: - - NeedsTranslation - - TopicStub - - XPInstall - - XPInstall_API_reference -translation_of: Archive/Mozilla/XPInstall ---- -<div><div class="warning"><p>Parts of this page show the use of the <a href="https://developer.mozilla.org/en-US/docs/XPInstall_API_Reference">XPInstall API</a>. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. <a href="https://developer.mozilla.org/en-US/docs/Extensions">Extension</a>, <a href="https://developer.mozilla.org/en-US/docs/Themes">Theme</a>, and <a href="https://developer.mozilla.org/en-US/docs/Plugins">plug-in</a> developers must switch away from <code>install.js</code> based packages to the new <a href="https://developer.mozilla.org/en-US/docs/Bundles">packaging scheme</a> with an <code><a href="https://developer.mozilla.org/en-US/docs/Install_Manifests">install.rdf</a></code> manifest. In particular plugin developers should see <a href="https://developer.mozilla.org/en-US/docs/Shipping_a_plugin_as_a_Toolkit_bundle">how to package a plugin as an extension</a>.</p></div> -<pre><code><?xml version="1.0" encoding="UTF-8"?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - <Description about="urn:mozilla:install-manifest"> - <!-- properties --> - </Description> -</RDF></code></pre> -</div> - -<div><strong>Cross-Platform Install (XPInstall)</strong> is a technology used by Mozilla Application Suite, Mozilla Firefox, Mozilla Thunderbird and other <a href="/en-US/docs/XUL" title="XUL">XUL</a>-based applications for installing <a href="/en-US/docs/Extensions" title="Extensions">extensions</a>. An <a href="/en-US/docs/XPI" title="XPI">XPI</a> (pronounced "zippy" and derived from XPInstall) installer module is a ZIP file that contains an install script or manifest (entitled install.js or <a href="/en-US/docs/Install_Manifests" title="Install_Manifests">install.rdf</a>) at the root of the file.</div> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 class="Documentation" id="Documentation" name="Documentation">Documentation</h2> - - <dl> - <dt><a href="/en-US/docs/XPInstall_API_Reference" title="XPInstall_API_Reference">XPInstall API Reference</a></dt> - <dd>XPInstall API Reference.</dd> - <dt><a href="/en-US/docs/Learn_XPI_Installer_Scripting_by_Example" title="Learn_XPI_Installer_Scripting_by_Example">Learn XPI Installer Scripting by Example</a></dt> - <dd>This article uses the installer script from <code>browser.xpi</code> install package as the basis for discussing XPI installations in general.</dd> - <dt><a href="/en-US/docs/Creating_XPI_Installer_Modules" title="Creating_XPI_Installer_Modules">Creating XPI Installer Modules</a></dt> - <dd>This article describes the packaging scheme of the Mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users.</dd> - <dt><a href="/en-US/docs/Install_Wizards_(aka:_Stub_Installers)" title="Install_Wizards_(aka:_Stub_Installers)">Install Wizards (aka: Stub Installers)</a></dt> - </dl> - - <p><span class="alllinks"><a href="/en-US/docs/tag/XPInstall" title="tag/XPInstall">View All...</a></span></p> - </td> - <td> - <h2 class="Community" id="Community" name="Community">Community</h2> - - <ul> - <li>View Mozilla forums... {{ DiscussionList("dev-platform", "mozilla.dev.platform") }}</li> - </ul> - - <h2 class="Tools" id="Tools" name="Tools">Tools</h2> - - <ul> - <li><a class="external" href="http://www.mozilla.org/quality/smartupdate/xpinstall-trigger.html">XPInstall trigger page</a></li> - </ul> - - <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related Topics</h2> - - <ul> - <li><a href="/en-US/docs/Extensions" title="Extensions">Extensions</a>, <a href="/en-US/docs/XUL" title="XUL">XUL</a>, <a href="/en-US/docs/XPI" title="XPI">XPI</a></li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html b/files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html deleted file mode 100644 index 7d95c88d75..0000000000 --- a/files/zh-tw/archive/mozilla/xpinstall/scripting_by_example/index.html +++ /dev/null @@ -1,244 +0,0 @@ ---- -title: XPI 安裝腳本範例教學 -slug: Archive/Mozilla/XPInstall/Scripting_by_example -tags: - - XPInstall - - 待翻譯 -translation_of: Archive/Mozilla/XPInstall/Scripting_by_example ---- -<p>本文以 browser.xpi 安裝套件為基礎,討論一般的 XPI 安裝程序。安裝腳本 <code><a href="zh_tw/Learn_XPI_Installer_Scripting_by_Example/Installer_Script">installer script</a></code> 雖短,但含括了 XPInstall API 大部分的重要功能,且可做為其他一般用途套件的安裝腳本樣本。本文在 unix 下安裝,不過各平台的安裝方式大同小異,你可以此變化安裝在各種 Mozilla 支援的平台。</p> - -<h2 id=".E9.97.9C.E6.96.BC_browser.xpi" name=".E9.97.9C.E6.96.BC_browser.xpi">關於 <code>browser.xpi</code></h2> - -<p><code>browser.xpi</code> 是 Mozilla 瀏覽器安裝主要元件的 XPI 封存檔。Mozilla 跨平台安裝以 XPI 格式作為組織、壓縮、以及軟體自動化安裝及更新的用途。XPI 的格式同 ZIP 及 JAR,為 PKZIP 壓縮後的檔案,只是內含可供管理安裝方式的腳本。本文目標即為此安裝腳本<code><a href="zh_tw/Learn_XPI_Installer_Scripting_by_Example/Installer_Script">installer script</a></code>(通常稱為 <code>install.js</code>)的教學。</p> - -<p>任何能解 ZIP 壓縮檔的工具都能開啟 XPI 檔,先來看看裡面有什麼東西:</p> - -<pre>install.js -bin\ - chrome\ - components - defaults\ - icons\ - plugins\ - res\ -</pre> - -<p>Note that this high-level structure parallels the directory structure of the installed browser very closely:</p> - -<p><img alt="mozilla directory on linux"></p> - -<p>As you will see in the installation script, the contents of the archive are installed onto the file system in much the same way that they are stored in the archive itself, though it's possible to rearrange things arbitrarily upon installation--to create new directories, to install files in system folders and other areas.</p> - -<h2 id=".E7.B6.9C.E8.A6.BD.E5.AE.89.E8.A3.9D.E8.85.B3.E6.9C.AC" name=".E7.B6.9C.E8.A6.BD.E5.AE.89.E8.A3.9D.E8.85.B3.E6.9C.AC">綜覽安裝腳本</h2> - -<p>XPI install scripts are written in JavaScript using XPInstall Engine syntax defined in the <a href="zh_tw/XPInstall_API_Reference">XPInstall API Reference</a>.</p> - -<p>Most installation scripts, including the one discussed here, take the following basic form (in pseudo-code and with links to the sections in which these installation steps are documented):</p> - -<p>節譯:大部分的安裝腳本都採以下的概念依流程安裝:</p> - -<pre>initInstall(); -if (verify_space()) { - err = add_dirs_and_files; - register_files; - - if (err==SUCCESS) { performInstall() }; - else { cancelInstall() }; -} -</pre> - -<p>As you can see in the <a href="zh_tw/Learn_XPI_Installer_Scripting_by_Example/Installer_Script">code listing</a>, the verification process at the top is on lines 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines 59 to 71. If you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts must<em>initialize, add the files to be installed, and execute.</em></p> - -<p>Note also that when you call methods on the <code>Install</code>--as you do so often in installation scripts (<code>getFolder</code>, <code>initInstall</code>, <code>addFile</code>, and <code>performInstall</code> are all examples of common <code>Install</code> object methods)--the <code>Install</code> object is implicit; like the <code>window</code> object in regular web page scripts, the Install object does not need to be prefixed to the method.</p> - -<h3 id=".E5.88.9D.E5.A7.8B.E5.8C.96" name=".E5.88.9D.E5.A7.8B.E5.8C.96">初始化</h3> - -<p>All installations must begin with <code>initInstall()</code>. The <code>initInstall()</code> method on the Install object creates a new installation for the specified software and version. In the browser.xpi installation, this function appears at line 20: <code> var err = initInstall("Netscape Seamonkey", "Browser", "6.0.0.2000110807"); </code></p> - -<p>如果你在 <code>initInstall()</code> 之前呼叫 <code>Install</code> 物件中的方法,會導致錯誤。</p> - -<p>The <code>initInstall</code> method takes the following parameters: the display name of the package, the name of the package as it appears in the client registry, and the version, which can be expressed as a number or as an InstallVersion object. In the example above, "Netscape Seamonkey" is the display name, "Browser" is the registry name, and the version is "6.0.0.2000110807." See <code><a href="zh_tw/XPInstall_API_Reference/Install_Object/Methods/initInstall">initInstall</a></code> in the <a href="zh_tw/XPInstall_API_Reference">XPInstall API Reference</a> for more information on the initialization process.</p> - -<h3 id=".E6.AA.A2.E9.A9.97.E5.AE.89.E8.A3.9D.E7.9B.AE.E6.A8.99" name=".E6.AA.A2.E9.A9.97.E5.AE.89.E8.A3.9D.E7.9B.AE.E6.A8.99">檢驗安裝目標</h3> - -<p>The first thing the installation script does when it's executed is to check that there is adequate disk space for the software to be installed, where the <code>verifyDiskSpace</code> function is called as a condition of the main installation block that starts at line 24).</p> - -<pre> // 先檢查磁碟剩餘空間 - function verifyDiskSpace(dirPath, spaceRequired) - { - var spaceAvailable; - // 取得安裝磁碟之剩餘空間 - spaceAvailable = fileGetDiskSpaceAvailable(dirPath); - - // 將剩餘空間單位化為 KB - spaceAvailable = parseInt(spaceAvailable / 1024); - // 開始檢查 - if(spaceAvailable < spaceRequired) - { - logComment("Insufficient disk space: " + dirPath); - logComment(" required : " + spaceRequired + " K"); - logComment(" available: " + spaceAvailable + " K"); - return(false); - } - return(true); - } -</pre> - -<p>In the <code>verifyDiskSpace</code> block, <code>fileGetDiskSpaceAvailable</code> is called with <code>dirPath</code> as its expected input. This input is defined in line 22, where <code>getFolder()</code> is used to assign a value to the communicatorFolder variable representing the "Program" folder on the local system:</p> - -<pre>var communicatorFolder = getFolder("Program"); -spaceAvailable = fileGetDiskSpaceAvailable(dirPath); -</pre> - -<p><code>spaceRequired</code>, the other expected input to the <code>verifyDiskSpace</code> function, is given as 17311 kilobytes on line 19. Inside the function, the two sizes are compared and if the available space is larger than the required space, the installation proceeds.</p> - -<h3 id=".E7.82.BA_Install_.E7.89.A9.E4.BB.B6.E5.8A.A0.E5.85.A5.E6.AA.94.E6.A1.88.E5.8F.8A.E5.85.A7.E5.90.AB.E6.AA.94.E6.A1.88.E7.9A.84.E7.9B.AE.E9.8C.84" name=".E7.82.BA_Install_.E7.89.A9.E4.BB.B6.E5.8A.A0.E5.85.A5.E6.AA.94.E6.A1.88.E5.8F.8A.E5.85.A7.E5.90.AB.E6.AA.94.E6.A1.88.E7.9A.84.E7.9B.AE.E9.8C.84">為 Install 物件加入檔案及內含檔案的目錄</h3> - -<p>一旦確保程式可以開始安裝,就該把想放的檔案加入安裝程序。在 <code>browser.xpi</code> 中,此程式段位於 26 到 41 行:</p> - -<pre> err = addDirectory("Program", - "6.0.0.2000110807", - "bin", // jar source folder - communicatorFolder, // target folder - "", // target subdir - true ); // force flag - - logComment("addDirectory() returned: " + err); - - // 建立 plugins 目錄 - var pluginsFolder = getFolder("Plugins"); - if (!fileExists(pluginsFolder)) - { - var ignoreErr = dirCreate(pluginsFolder); - logComment("dirCreate() returned: " + ignoreErr); - } - else - logComment("Plugins folder already exists"); -</pre> - -<p>本例檔案都放在單一目錄中, 所以採用 <code>Install</code> 物件的 <code>addDirectory</code> 方法將壓縮檔目錄中的檔案一併加入。<code>addDirectory</code> 跟 <code>addFile</code> 兩種方法都要指定來源與目的路徑,在此例中是把「bin」目錄中的檔案列為來源,並要求於程式正式呼叫 <code>performInstall</code> 時將檔案安裝到 <code>communicatorFolder</code> 目錄(此變數於第 22 行指定為「Program」)。</p> - -<p>"Program" is one of a short list of keywords that can be used in place of full path names in methods such as <code>addFile</code>. "Program" represents the directory where software itself is installed (e.g., <code>C:\Program Files\</code> on win32 systems), as opposed to supporting directories like "Components", "Chrome", or "Temporary" (see <code><a href="zh_tw/XPInstall_API_Reference/Install_Object/Methods/getFolder">getFolder</a></code> in the <a href="zh_tw/XPInstall_API_Reference">XPInstall API Reference</a> for a list of keywords).</p> - -<h3 id=".E7.99.BB.E8.A8.98.E8.BB.9F.E9.AB.94" name=".E7.99.BB.E8.A8.98.E8.BB.9F.E9.AB.94">登記軟體</h3> - -<p>對於一個軟體來說,有時候需要同時在作業系統和 Netscape 6 平台上進行登記「登錄碼」。當你安裝了一個新的 chrome 像是 <code>browser.xpi</code> 時,你需要讓 chrome 登錄碼把這些更新登記在起來;如此一來,面板(skin)、使用者介面(user preference)、檔案清單(packaging list)、本地化文件(localization bundle)就會自動與新的軟體對應。</p> - -<p>對於在 win32 作業系統上登記軟體,XPInstall API 提供兩個特別的物件-<code>WinProfile</code> 和 <code>WinReg</code>。它們能夠對 Windows 使用者資料和 Windows 登錄碼進行對應的操作。<code>browser.xpi</code> 安裝腳本並不強制你使用這些物件。關於在 win32 平台上和其他作業系統登記軟體,詳情可以參考 XPInstall API Reference。</p> - -<p>而要利用 chrome 登錄碼登記基於 Netscape 6 的新軟體,像是一些外掛(plug-in)、元件(component)、佈景主題(theme)和套件(package),你需要使用 Install 物件中的 registerChrome 函數。如果執行成功,這個函數會回傳一個「0」並且將這筆紀錄寫進 <code>chrome</code> 的子目錄「installed-chrome.txt」這個檔案當中以便以後其他的 <code>chrome</code> 能夠同步更新千變萬化的 RDF 檔案。</p> - -<pre> var cf = getFolder("Chrome"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"toolkit.xpi"),"content/global/"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/communicator/"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/editor/"); - registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"browser.xpi"),"content/navigator/"); - registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/communicator/"); - registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/editor/"); - ... -</pre> - -<p>在第 42 行至 58 行,只要有不同的資料夾中存在需要紀錄在 chrome 紀錄碼中的內容, <code>registerChrome</code> 就會被呼叫。 In lines 42-58, <code>registerChrome</code> is called as many times as there are different directories that contain content that needs to be registered with the chrome registry. Note that in the first few lines of this process, new content from the XPI is being registered, and in the remainder, it is new skin information. In this most common form of the <code>registerChrome</code> function (it can also be used to support the now-deprecated<em>manifest.rdf</em> style of installation archive), the three parameters represent, in order, the chrome <code>SWITCH</code> used to indicate what kind of software is being registered, the target destination of the software (e.g., the "Chrome" folder in the example above), and the path within the XPI (or JAR theme archive) where the contents.rdf file is located.</p> - -<p>See <code><a href="zh_tw/XPInstall_API_Reference/Install_Object/Methods/registerChrome">registerChrome</a></code> in the XPInstall API Reference for more information about registering new packages with the chrome registry.</p> - -<h3 id=".E9.96.8B.E5.A7.8B.E5.AE.89.E8.A3.9D" name=".E9.96.8B.E5.A7.8B.E5.AE.89.E8.A3.9D">開始安裝</h3> - -<p>Once you have added all the files to the installation, the final step is to actually execute the installation. Note that until this point, the install calls you have been making on the Install object are preliminary only. Recall that an install process takes the following general form:</p> - -<pre>initInstall(); -if (verify_space()) { - err = add_dirs_and_files; - register_files; - - if (err==SUCCESS) { performInstall() }; - else { cancelInstall() }; -} -</pre> - -<p>In this arrangement, the actual execution of the installation is checked against the errors returned from the addition of files to the installation, which may itself have been conditioned on some verification of version and necessary disk space.</p> - -<p>The actual install code used to execute the installation appears in the<em>install.js</em> file as follows:</p> - -<pre>if (err==SUCCESS) - { - err = performInstall(); - logComment("performInstall() returned: " + err); - } - - else - { - cancelInstall(err); - logComment("cancelInstall() due to error: " + err); - } -} -else - cancelInstall(INSUFFICIENT_DISK_SPACE); -</pre> - -<p><code>performInstall</code> is the function used to execute the install once it has been initialized and loaded, and it is the last step to installing the software. Note that in the example above, the installation is cancelled if the error code from the file addition process returns success (0), and also cancelled outside the main block if the earlier verification process is not successful.</p> - -<p>Note also the comments that indicate the success of various steps in the process--including the performInstall and cancelInstall steps--are written to the install log using the <code>logComment</code>, described in the following section.</p> - -<h2 id=".E5.AE.89.E8.A3.9D.E7.B4.80.E9.8C.84" name=".E5.AE.89.E8.A3.9D.E7.B4.80.E9.8C.84">安裝紀錄</h2> - -<p>Logging is an important feature of the XPInstall API that can help you streamline and debug your installations. In the example in the <a href="#Executing_the_Installation">Executing the Installation</a> section and in many places in the installation script, the <code>logComment</code> API is used to write data to a log file that can then be reviewed when things don't go as planned.</p> - -<p>The install log is created in the product directory by default (where the browser executable is). If the installation doesn't have proper permission, the install log is written to the user's profile directory. Respectively, these directories correspond to the "Program" and "Current User" keywords for the getFolder method.</p> - -<h2 id=".E6.9B.B4.E9.80.B2.E4.B8.80.E6.AD.A5" name=".E6.9B.B4.E9.80.B2.E4.B8.80.E6.AD.A5">更進一步</h2> - -<p>What does all this mean to you? How can this information be adapted for your own installations? In this final section, we describe the application of the XPInstall technology described here in the creation and deployment of a very simple installation script and installation archive (XPI).</p> - -<p>Say you have a simple executable and a README file that goes with it, and you want to make it available for installation from a XPI. After putting these two files in a XPI (which, as described above, is simply a ZIP file with an install.js script at the top and a suffix of '.xpi'), the next step is to add an installation script to the XPI.</p> - -<p>Minimally, the installation script must:</p> - -<ul> - <li>Call <code>initInstall</code> with the name and version of the executable (the version is not optional, though you may or may not use the version in subsequent installations or updates)</li> - <li>Find somewhere to put the installed files. In the example below, <code>getFolder</code> is used with the "Program" keyword to specify the browser's program directory as the target for installation. Since I am using NS6 right now on a Windows machine, that target directory is "C:\Program Files\Netscape\Netscape 6\".</li> - <li>Add files to the initialized installation using <code>addFile</code>.</li> - <li>Call performInstall to execute the installation.</li> -</ul> - -<p>Here is an example of small but complete installation script.</p> - -<pre>var xpiSrc = "cd_ripper.exe"; -var xpiDoc = "README_cdrip"; - -initInstall("My CD Ripper", "cdrip", "1.0.1.7"); -f = getFolder("Program"); -setPackageFolder(f); -addFile(xpiSrc); -addFile(xpiDoc); - -if (0 == getLastError()) - performInstall(); -else - cancelInstall(); -</pre> - -<p>The example above shows this minimal installation. This install script does not include any version or disk space checking, very little error checking, only a single executable, no registration, and no commenting. It does, however, take the executable and the README file and install them on the user's system. Note also that for the installation script in a XPI to be automatically triggered from a web page, you must use a "trigger script." The following InstallTrigger function, called from an event handler on a regular web page, will point to the remotely-hosted XPI (called here 'cdrip.xpi') and trigger its installation:</p> - -<pre>function putIt() -{ - xpi={'CD_Ripper':'cdrip.xpi'}; - InstallTrigger.install(xpi); -} -... - -<a href="#" onclick="putIt();">install the CD Ripper Now!</a> -</pre> - -<p>See the <a href="zh_tw/XPInstall_API_Reference/InstallTrigger_Object">InstallTrigger</a> object in the XPInstall API Reference for more information on triggering installations.</p> - -<div class="originaldocinfo"> -<h2 id=".E5.8E.9F.E6.96.87.E8.B3.87.E8.A8.8A" name=".E5.8E.9F.E6.96.87.E8.B3.87.E8.A8.8A">原文資訊</h2> - -<ul> - <li>作者:<a class="link-mailto" href="mailto:mailto:oeschger@netscape.com">Ian Oeschger</a></li> - <li>更新日期:01/26/2006</li> - <li>版權資訊:Copyright (C) <a class="link-mailto" href="mailto:mailto:oeschger@netscape.com">Ian Oeschger</a></li> -</ul> -</div> diff --git a/files/zh-tw/archive/mozilla/xul/index.html b/files/zh-tw/archive/mozilla/xul/index.html deleted file mode 100644 index ac13916ad4..0000000000 --- a/files/zh-tw/archive/mozilla/xul/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: XUL -slug: Archive/Mozilla/XUL -tags: - - XUL -translation_of: Archive/Mozilla/XUL ---- -<p> </p> - -<div class="callout-box"><strong><a href="/zh_tw/XUL_%E6%8C%87%E5%8D%97" title="zh_tw/XUL_指南">XUL 指南</a></strong><br> -這份指南將協助你開始學習 XUL,原始創作來自於 XULPlanet。</div> - -<div><strong>XUL</strong> (XML User Interface Language,XML 使用者介面語言) 是 Mozilla 以 <a href="/zh_tw/XML" title="zh_tw/XML">XML</a> 為基礎的語言,可以讓你打造豐富功能且跨平台的應用程式,不論是否有連線到網際網路。這些應用程式可以輕鬆地自訂文字、圖案以及排版,因此可以很方便地為不同市場區塊發表不同品牌形象或本地化。已經熟悉 Dynamic HTML (<a href="/zh_tw/DHTML" title="zh_tw/DHTML">DHTML</a>) 的 Web 開發人員將可以很快地學會 XUL,並且馬上開始開發應用程式。 用 Firefox 或其他以 <a href="/zh_tw/Gecko" title="zh_tw/Gecko">Gecko</a> 為基礎的瀏覽器開啟 <a class="external" href="http://www.hevanet.com/acorbin/xul/top.xul">XUL 週期表</a> ,你將會看到一些 XUL 範例。</div> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h4 id=".E6.96.87.E4.BB.B6" name=".E6.96.87.E4.BB.B6"><a href="/Special:Tags?tag=XUL&language=zh-tw" title="Special:Tags?tag=XUL&language=zh-tw">文件</a></h4> - - <dl> - <dt><a class="external" href="/index.php?title=zh_tw/XUL_%E5%8F%83%E8%80%83%E6%89%8B%E5%86%8A" title="https://developer.mozilla.org/index.php?title=zh_tw/XUL_參考手冊">XUL 參考文獻</a></dt> - <dd><small>請參照這份 <a href="/zh_tw/Preferences_System" title="zh_tw/Preferences_System">prefwindow</a> MDC 文件。</small></dd> - </dl> - - <dl> - <dt><a href="/en/XUL_controls" title="en/XUL_controls">XUL 控制項</a></dt> - <dd><small>快速瀏覽 XUL 控制項。</small></dd> - </dl> - - <dl> - <dt><a href="/zh_tw/The_Joy_of_XUL" title="zh_tw/The_Joy_of_XUL">第一次玩 XUL 就上手</a></dt> - <dd><small>介紹 XUL 幾項重要功能與元件。</small></dd> - </dl> - - <dl> - <dt><a href="/en/XUL/PopupGuide" title="en/XUL/PopupGuide">選單和彈出選單指南</a></dt> - <dd><small>選單和彈出式面板的指南。</small></dd> - </dl> - - <dl> - <dt><a href="/zh_tw/XUL/Template_Guide" title="zh_tw/XUL/Template_Guide">XUL 模板指南</a></dt> - <dd><small>一份詳細討論 XUL 模板的指南,是個從資料源產生內容的方法指引。</small></dd> - </dl> - - <dl> - <dt><a href="/En/DragDrop/Drag_and_Drop" title="Drag and Drop">XUL 的拖曳處理</a></dt> - <dd><small>如何使用拖曳操作。</small></dd> - </dl> - - <dl> - <dt><a href="/zh_tw/%E7%82%BA_Firefox_1.5_%E6%94%B9%E5%AF%AB_XUL_%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F" title="zh_tw/為_Firefox_1.5_改寫_XUL_應用程式">為 Firefox 1.5 改寫 XUL 應用程式</a></dt> - <dd><small>一份關於 <a href="/zh_tw/Firefox_1.5" title="zh_tw/Firefox_1.5">Firefox 1.5</a> 所做變更的清單,會影響到使用 XUL 開發人員。</small></dd> - </dl> - - <p><span class="alllinks"><a href="/Special:Tags?tag=XUL&language=zh-tw" title="Special:Tags?tag=XUL&language=zh-tw">所有文件...</a></span></p> - </td> - <td> - <h4 id=".E7.A4.BE.E7.BE.A4" name=".E7.A4.BE.E7.BE.A4">社群</h4> - - <ul> - <li>查閱 Mozilla 討論區...</li> - </ul> - - <ul> - <li><a href="https://lists.mozilla.org/listinfo/dev-tech-xul">郵件討論</a></li> - <li><a href="news://news.mozilla.org/mozilla.dev.tech.xul">新聞群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.tech.xul">Google 群組</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.tech.xul">feeds 消息來源</a></li> - </ul> - - <ul> - <li><a class="link-irc" href="irc://irc.mozilla.org/xul">irc.mozilla.org 上的 #xul</a></li> - </ul> - - <h4 id=".E5.B7.A5.E5.85.B7" name=".E5.B7.A5.E5.85.B7">工具</h4> - - <ul> - <li><a class="external" href="/en/docs/XUL_Explorer" title="en/docs/XUL_Explorer">XUL Explorer</a> (輕量級 XUL IDE)</li> - <li><a class="external" href="http://ted.mielczarek.org/code/mozilla/extensiondev/">給擴充套件開發人員的擴充套件</a> (即時 XUL 編輯器)</li> - <li><a class="external" href="http://www.extensionsmirror.nl/index.php?showtopic=751">XULRef sidebar</a></li> - <li><a href="/zh_tw/DOM_Inspector" title="zh_tw/DOM_Inspector">DOM Inspector</a></li> - </ul> - - <p><span class="alllinks"><a href="/Special:Tags?tag=XUL:Tools&language=zh-tw" title="Special:Tags?tag=XUL:Tools&language=zh-tw">所有工具...</a></span></p> - - <h4 id=".E7.9B.B8.E9.97.9C.E4.B8.BB.E9.A1.8C" name=".E7.9B.B8.E9.97.9C.E4.B8.BB.E9.A1.8C">相關主題</h4> - - <dl> - <dd><a href="/zh_tw/JavaScript" title="zh_tw/JavaScript">JavaScript</a>, <a href="/zh_tw/XBL" title="zh_tw/XBL">XBL</a>, <a href="/zh_tw/CSS" title="zh_tw/CSS">CSS</a>, <a href="/Zh_tw/RDF" title="Zh_tw/RDF">RDF</a>, <a href="/zh_tw/Extensions" title="zh_tw/Extensions">Extensions</a>, <a href="/zh_tw/XULRunner" title="zh_tw/XULRunner">XULRunner</a></dd> - </dl> - </td> - </tr> - </tbody> -</table> - -<p><span class="comment">Categories</span></p> - -<p><span class="comment">Interwiki Language Links</span></p> diff --git a/files/zh-tw/archive/mozilla/xul/template_guide/index.html b/files/zh-tw/archive/mozilla/xul/template_guide/index.html deleted file mode 100644 index 643bdaea0e..0000000000 --- a/files/zh-tw/archive/mozilla/xul/template_guide/index.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Template Guide -slug: Archive/Mozilla/XUL/Template_Guide ---- -<p>這個頁面無內容。您可以通過貢獻來豐富 MDN 的內容</p> diff --git a/files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html b/files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html deleted file mode 100644 index ab1da2e93c..0000000000 --- a/files/zh-tw/archive/mozilla/xul/the_joy_of_xul/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: The Joy of XUL -slug: Archive/Mozilla/XUL/The_Joy_of_XUL -tags: - - XUL -translation_of: Archive/Mozilla/XUL/The_Joy_of_XUL ---- -<p> </p> -<p>建議的讀者群:想要更加認識 XUL 且想瞭解為什麼 Mozilla 會採用 XUL 的應用開發人員與管理者。</p> -<p>翻譯原則:由於考量到預設讀者群應該有某種程度的原文專有名詞的認識基礎,故盡可能保留原文專有名詞,或採用加註的方式呈現。如果文中有對稱關係,則採用對稱保留或加註。</p> -<p> </p> -<h3 id=".E5.BA.8F.E8.AB.96" name=".E5.BA.8F.E8.AB.96">序論</h3> -<p><a href="/zh_tw/XUL" title="zh_tw/XUL">XUL</a> (發音〝/zu:l/〞) 是 Mozilla 以 XML 為基礎的使用者介面語言,讓你盡情地開發各式各樣的跨平台應用程式,不論是否在連線到網際網路的狀態皆可。這些應用程式可以藉由簡單地變更文字,圖案與版面佈局,來達到客製化的目的,因此可以輕易地本土化以推廣到各種市場去。如果您已經是熟習 Dynamic HTML (<a href="/zh_tw/DHTML" title="zh_tw/DHTML">DHTML</a>) 的網頁設計師,那您將可以很快地學會 XUL 並且可以馬上開始動手建構應用程式了。</p> -<p>這份文件將介紹一些比較吸引人的理由給網頁設計師,來應用 XUL 以及 Mozilla 相關技術來撰寫跨平台的應用程式。這也將充分說明 Mozilla 要設計 XUL 的動機,以及為什麼 Mozilla 平台是使用 XUL 建構起來的。XUL 的重要特色與優勢將會接著以支援 Mozilla 技術的方式來呈現。最後,有個關於 "使用 XUL 所撰寫之 Calendar" 的小小個案研討,作為補充。</p> -<h3 id=".E9.87.8D.E8.A6.81.E7.89.B9.E8.89.B2.E8.88.87.E5.84.AA.E5.8B.A2" name=".E9.87.8D.E8.A6.81.E7.89.B9.E8.89.B2.E8.88.87.E5.84.AA.E5.8B.A2">重要特色與優勢</h3> -<table class="standard-table"> <tbody> <tr> <td>強大、以元件為基礎的標示語言</td> <td>XUL 的目標是建造跨平台的應用程式,以別於原本拿來設計網頁的 DHTML。因此,XUL 設計為應用程式的加工組件(application artifacts),如︰視窗(windows)、標籤(labels)、按鈕(buttons)等,用來取代頁面(pages)、大標題(heading levels)、連結(hypertext links)等。 <p>事實上,許多開發人員已經嘗試在他們的 DHTML 網頁應用程式中達到圖形界面的效果,但這其中的代價就是複雜以及效能,而且沒有任何標準可以支援。</p> </td> </tr> <tr> <td>以現有標準為基礎</td> <td>XUL 是立基於 W3C 標準 XML 1.0 的一個 XML 語言。使用 XUL 的應用程式是建構於這些 W3C 標準技術之上︰HTML 4.0、CSS 1 & 2、DOM Levels 1 & 2、JavaScript 1.5,包括 ECMA-262 Edition 3 (ECMAscript)、XML 1.0。 <p>mozilla.org 正進一步地尋求 W3C 為 eXtensible Binding Language (XBL) 標準化。(參考下面的〝支援技術〞)。</p> </td> </tr> <tr> <td>平台可攜性</td> <td>如同 HTML,XUL 被設計成與平台無關的,可以很容易地讓應用程式在任何存在 Mozilla 的作業系統上面使用。想想看現在有多麼廣泛的平台支援 Mozilla,這是以 XUL 技術來開發應用程式當中,最令人讚嘆的特色。 <p>因為 XUL 提供了使用者介面組成元件的抽象層,因此實現了這個保證︰一經寫就,處處執行 (write-once, run-anywhere)。所有 Mozilla 核心應用程式的使用者介面都是用 XUL 所撰寫的,並且該單一程式碼,在所有 Mozilla 平台上都支援。</p> </td> </tr> <tr> <td>分離介面呈現與程式流程</td> <td>大部分網頁應用程式沒落的主因就是,把使用者介面跟程式流程緊緊的結合在一起了。這在一個團隊的環境中是個頗為難的問題,因為這兩部分所需的技能通常是分散在不同的人身上。 <p>XUL 很清楚地分離出應用程式的各個組成︰程式流程 ("content" 以 XUL、XBL 與 JavaScript 組成)、外觀 ("skin" 以 CSS 和圖像組成)、與特定語言的文字標籤 ("locale" 以 DTD 以及在 .properties 檔案中的對應字串)。XUL 應用程式的佈局與外觀可以自由地改變,獨立程式與流程之外。甚至,應用程式可以本地化為任何語言或地區,完全獨立於程式流程或外觀。</p> <p>對應用程式作各種分離所得的結果是︰程式設計師可以很容易地維護程式,設計師可以輕鬆地變更設計樣式,而各個語言的翻譯人員也可以自行完成翻譯工作。這樣子獨立的工作流程,相較於以 HTML 為基礎的應用程式更容易協同工作,也減少了整個系統在穩定性與品質上的衝擊。</p> </td> </tr> <tr> <td>輕鬆自訂、本地化、打品牌</td> <td>另一個由分離程式流程,介面呈現和語言文字所直接造成的特點,即是不同的使用者或使用群可以很容易的修改成所需要的樣子。 <p>程式開發人員可以只維護應用程式的主要程式碼,然後藉由使用不同的外觀介面 (skin) 來自訂圖示與品牌觀感給他們不同的顧客群。一個以英文介面撰寫與開發的應用程式,可以被翻譯成法文給相同需求的顧客使用。當這些改變被廣泛地使用在這個應用程式的時候,他們也可以從程式流程與介面呈現之中獨立出來,來分享給所有的自訂版本。</p> </td> </tr> </tbody> -</table> -<h3 id=".E6.94.AF.E6.8F.B4.E6.8A.80.E8.A1.93" name=".E6.94.AF.E6.8F.B4.E6.8A.80.E8.A1.93">支援技術</h3> -<p>這裡有一些 Mozilla 所用來支援 XUL 撰寫跨平台網頁應用程式的技術。</p> -<table class="standard-table"> <tbody> <tr> <td><a href="/zh_tw/XBL" title="zh_tw/XBL">XBL</a></td> <td>eXtensible Bindings Language (XBL) 是一種標記語言 (markup language),定義了新的物件元素以及給 XUL 構件 (widget) 的 "bindings"。藉由 XBL,開發人員可以為 XUL 構件定義新的內容,為 XUL 構件添加事件處理,加入新的介面屬性與方法。事實上,XBL 將使得開發人員得以利用自訂現有的標籤 (tag) 或是新增他們所需要的標籤來擴充 XUL。 <p>藉由使用 XBL,開發人員可以輕易地建構出所想要的使用者介面物件,如︰進度表、別緻的彈出式選單、甚至是工具列或搜尋表單。這些自訂物件可以在指定標籤與其屬性之後,使用在各個 XUL 應用程式當中。</p> </td> </tr> <tr> <td><a href="/zh_tw/Overlay" title="zh_tw/Overlay">Overlays</a></td> <td>Overlay 是用來描述使用介面之額外內容的 XUL 檔案。他們是一種增添使用介面的通用機制,用以增加額外的元件,覆蓋掉 XUL 檔案中不再支援的使用者介面,並且可以重新利用使用者介面當中的一些片段。 <p>Overlay 對於自訂與擴充現有應用程式而言是個很強大的機制,因為他們是以兩種相關但卻又幾乎完全不同的方式在運作著。某種程度上看來,Overlay 其他語言所謂的〝引入(include)〞檔案,因為一個應用程式可能指定在其定義中引入一個 Overlay。但是 Overlay 也可以只用於外觀上,使得設計人員可以在某個應用程式上頭使用 Overlay,而不需要改變其原始程式。</p> <p>在實作上,這使得開發人員只需對其應用程式維護一組程式碼,然後再為客戶應用各自自訂的外型,或是引入特別的功能,而這些都完全獨立於主程式碼。這導致整個解決方案的簡化,與降低維護成本。</p> <p>Overlay 對於那些想要為 Mozilla 增添新功能但又希望保有著作權的軟體開發人員而言還有個特點。這兩種執照聲明︰Netscape Public License (NPL) 和 Mozilla Public License (MPL) 都要求那些有對原始程式 (Mozilla 所提供的那些原始程式碼) 做過修改的開發人員,要釋放出他們變更之後的程式碼給他們的顧客。Overlay 可以在變更著作權的情況下用來為 Mozilla 增添新的功能,而不會污染了最原始的開放原始程式碼。</p> </td> </tr> <tr> <td><a href="/zh_tw/XPCOM" title="zh_tw/XPCOM">XPCOM</a>/<a href="/zh_tw/XPConnect" title="zh_tw/XPConnect">XPConnect</a></td> <td>XPCOM 與 XPConnect 都是加強技術,將外部函數庫與 XUL 應用程式整合在一起。 <p>XPCOM,代表的是跨平台組成物件模型 (Cross Platform Component Object Model),是個用來撰寫跨平台與軟體模組化的一個架構。XPCOM 的組成元件可以用 C、C++ 和 JavaScript 來撰寫,並且可以在這些環境下來開發︰C、C++、JavaScript、<a href="/zh_tw/Python" title="zh_tw/Python">Python</a>、與 Perl 擴充集。</p> <p>XPConnect 這個技術是用來製造出簡單的 XPCOM 與 JavaScript 之間的溝通。XPConnect 允許 JavaScript 物件正大光明地存取與運用 XPCOM 物件。他也讓 JavaScript 物件可以表示成 XPCOM 相容介面以供 XPCOM 物件呼叫使用。</p> <p>將兩者合在一起,XPCOM 和 XPConnect 使得開發人員可以設計那些需要使用編譯式語言的效能或是存取作業系統等級的 XUL 應用程式。</p> </td> </tr> <tr> <td><a href="/zh_tw/XPInstall" title="zh_tw/XPInstall">XPInstall</a></td> <td>XPInstall,Mozilla 的跨平台安裝技術,提供了一個標準的方式將 XUL 應用程式的各個元件包裝成一個安裝檔案,來讓 Mozilla 可以下載並且執行之。 <p>XPInstall 讓使用者可以毫不費力地從網際網路或是公司主機來安裝新的 XUL 應用程式。要安裝一個新的應用程式,使用者只要在網頁上或是電子郵件訊息中的超連結點一下滑鼠,然後在安裝對話方塊中允許安裝新的應用程式即可。</p> </td> </tr> </tbody> -</table> -<h3 id=".E5.80.8B.E6.A1.88.E7.A0.94.E8.A8.8E_A_Mozilla_Calendar_Application" name=".E5.80.8B.E6.A1.88.E7.A0.94.E8.A8.8E:_A_Mozilla_Calendar_Application">個案研討: A Mozilla Calendar Application</h3> -<p>這個小型的個案研討將敘述 OEone 公司 (<a class=" external" href="http://www.oeone.com" rel="freelink">http://www.oeone.com</a>) 如何將他的 Calendar 應用程式整合成為 Mozilla 的核心產品. Calendar 包含了 XUL 前端使用介面與以 C 寫成的 XPCOM 元件函式庫 libical , 該函式庫主要是供日期運算以及行事曆資料的儲存. 原本 Calendar 只有在 Linux 上開發, 但是都會成功地在一週之內移植到 Macintosh 和 Windows 平台上.</p> -<p><em>XUL 提供了許多的使用者介面元件.</em> Calendar 的使用者介面完完全全都是用 XUL 所完成的, JavaScript? 還有 CSS, 都可以證明這樣的開發平台所帶來的強大與彈性. 他使用了簡單的 XUL 元件, 例如 boxes, grids, 和 stacks 來構成週, 日, 和月的瀏覽介面. 一開始 Calendar 還沒有利用到 XBL, 因為開發人員還沒完全清楚地掌握這整個開發技術. 但是 Calendar 的未來計畫已經包含了要將這些使用者介面的元件轉換成 XBL widgets 來簡化開發工作.</p> -<p><em>XPCOM/XPConnect 讓整合現有程式碼成為可能.</em> 一個擁有完整行事曆功能的開放原始碼函式庫, libical (<a class=" external" href="http://www.softwarestudio.org/libical/" rel="freelink">http://www.softwarestudio.org/libical/</a>), 被 Calendar 專案所採用. Libical 以開放原始碼的方式實做了 IETF 的 iCalendar 行事曆與排程協定. (<a class="external" href="http://tools.ietf.org/html/rfc2445" title="http://tools.ietf.org/html/rfc2445">RFC 2445</a>, 2446, 及 2447). 他有 iCal 元件並提供了 C API 來操作這些元件的屬性, 參數以及其子元件. 這個函式庫藉由撰寫一個 XPCOM wrapper 來整合操作其使用介面. 為了增進應用程式的效能, 也將程式從 JavaScript 轉移成 XPCOM 元件.</p> -<p><em>外觀呈現與程式寫作的分離, 修改起來超有彈性.</em> 原本的使用者介面使用了大量的圖形檔案來呈現月和週的顯示. 而在開發人員學習了更多關於 XUL 的細節之後, 改用一些較為精巧的元件來呈現這個使用介面. 這不僅加快了顯示的速度, 也節省了許多記憶體與磁碟存取的資源. 他們幾乎重寫整個顯示月和週的使用者介面, 但對於主程式方面則絲毫不受影響, 不需要做任何的改變.</p> -<p><em>轉移 XUL 的應用程式到其他作業平台, 壓根兒不重要.</em> Calendar 原本是個 Linux 上的應用程式, 也沒想過要轉移到其他平台上面去. 但是當原來的開發者 (OEone Corporation) 將原始程式碼貢獻給 Mozilla 專案的時候, Calendar 就必須要想辦法轉移到 Windows 和 Macintosh 的平台上面去. XUL 應用程式的使用者介面不用做任何平台轉移的修改, 因為他可以幾乎不做任何變更就可以在這兩個新的平台上運作. 相類似地, 因為使用者介面是用 JavaScript 寫成的, 互動操作方面的程式也不需要做修改, 不過, 因為 libical 函式庫是由 C 所寫成的, 所以比較需要做修改, 才能轉移到其他平台上面去使用.</p> -<p>很幸運地, 現有的 libical 函式庫已經有 Macintosh 平台上的版本可以用了, 藉由 XPCOM 這個跨平台的基石, 在 Macintosh 上的行事曆在幾天之內就完成移植了. 可是那時候還沒有 Win32 上面的版本可以直接拿來用, 所以開發人員需要把 libical 移植到 Windows 平台上面來. 不到一個星期, 這項工作也完成了, 因此 Mozilla 可以在這三個平台上使用行事曆了: Linux, Macintosh, 和 Windows.</p> -<p><em>XPInstall 對於開發者和使用者都很方便.</em> Calendar 沒有被包含在 Mozilla 1.0 裡面一起發行, 因此沒有被當成標準配備而包含在固定的 nightly release builds 裡面. 對於有能力自行編譯 Mozilla 的開發人員而言, 他們可以自己設定相關的環境變數, 並且自己編譯 Calendar 來使用. 但是對於許多想要試看看 Calendar 的 Mozilla 使用者來說, 編譯這件事實在是遙不可及. 但是藉由 XPInstall, 開發者就可以很輕易地包裝各個版本的 Calendar, 然後只要在網路上點擊一個連結就可以直接進行安裝.</p> -<h3 id=".E7.B5.90.E8.AB.96" name=".E7.B5.90.E8.AB.96">結論</h3> -<p>Mozilla, 那出色的 XUL, 使用與 desktop 應用程式相同且豐富的使用者介面與使用體驗, 為開發跨平台的應用程式帶來令人讚嘆的全心體驗. 對於使用 W3C 標準來設計 web 應用程式的設計師們, 可以輕鬆地利用以往的經驗直接轉換到 desktop 應用程式.</p> -<p>在 web 成為散佈應用程式供使用者在不同電腦上使用的標準之前, 這個跨平台的問題需要藉由 客戶端-伺服端 (client-server) 的工具來解決. 但這總是會有版權的問題, 開發人員需要支付一筆可觀的金額來購買執行程式時所需要之函式庫的版權, 也同時被廠商給綁住了. Mozilla 為這些跨平台的工具, 提供了相同價值觀但卻是使用開放原始碼版權的選擇.</p> -<p>身為快速成長的跨平台技術, XUL 可以填滿一些有趣的技術空缺, 例如那些透過網路存取分散式物件的 Java J2EE 和 Microsoft .Net. 動態的應用程式搭配可以自由變換的使用者介面表達, 這都是依循標準, 具有擴充性, 而且可以很方便的透過網際網路來散播.</p> -<p>XUL 模糊了 desktop 和 web 應用程式的分界, 因為他在這兩個世界裡面都有良好的根基. 將 web 應用程式轉換成 XUL 將獲得許多好處, 可以有高度的介面彈性, 在各種支援的平台上擁有一致的操作環境, 而且仍然可以存取你原有的資源, 例如共享的函式庫, 以及本地端的檔案系統.</p> -<p>不論你是需要將現有的網頁應用程式轉移到 desktop 而尋求可以讓你輕鬆移轉到多重平台的技術, 或是將你的勁酷功能整合進瀏覽器, XUL 都會是個很值得的選擇.</p> -<h3 id="Reference_Material" name="Reference_Material">Reference Material</h3> -<ol> <li>XUL Planet - Samples, Tutorials and Language-References to XUL and XBL <a class=" external" href="http://www.xulplanet.com/" rel="freelink">http://www.xulplanet.com/</a></li> <li>Introduction to a XUL Document, Dan Matejka <<a class=" link-mailto" href="mailto:danm@netscape.com" rel="freelink">danm@netscape.com</a>> <a class=" external" href="http://www.mozilla.org/xpfe/xptoolkit/xulintro.html" rel="freelink">http://www.mozilla.org/xpfe/xptoolkit/xulintro.html</a></li> <li>XBL - Extensible Binding Language 1.0, David Hyatt <<a class=" link-mailto" href="mailto:hyatt@netscape.com" rel="freelink">hyatt@netscape.com</a>> <a class=" external" href="http://www.mozilla.org/projects/xbl/xbl.html" rel="freelink">http://www.mozilla.org/projects/xbl/xbl.html</a></li> <li>XBL - XML Binding Language (W3C Note), David Hyatt < <a class=" link-mailto" href="mailto:hyatt@netscape.com" rel="freelink">hyatt@netscape.com</a>> <a class=" external" href="http://www.w3.org/TR/xbl/" rel="freelink">http://www.w3.org/TR/xbl/</a></li> <li>XUL Overlays, Ian Oeschger <<a class=" link-mailto" href="mailto:oeschger@netscape.com" rel="freelink">oeschger@netscape.com</a>> and David Hyatt <<a class=" link-mailto" href="mailto:hyatt@netscape.com" rel="freelink">hyatt@netscape.com</a>> <a class=" external" href="http://www.mozilla.org/xpfe/xptoolkit/overlays.html" rel="freelink">http://www.mozilla.org/xpfe/xptoolkit/overlays.html</a></li> <li>XPCOM Part 1: An introduction to XPCOM, Rick Parrish <<a class=" link-mailto" href="mailto:rfmobile@swbell.net" rel="freelink">rfmobile@swbell.net</a>> <a class=" external" href="http://www-106.ibm.com/developerworks/webservices/library/co-xpcom.html" rel="freelink">http://www-106.ibm.com/developerwork.../co-xpcom.html</a></li> <li>XPConnect (Scriptable Components), John Bandhauer <<a class=" link-mailto" href="mailto:jband@netscape.com" rel="freelink">jband@netscape.com</a>> <a class=" external" href="http://www.mozilla.org/scriptable/" rel="freelink">http://www.mozilla.org/scriptable/</a></li> <li>為 Mozilla 建立新的套件(Package), Ian Oeschger <<a class=" link-mailto" href="mailto:oeschger@netscape.com" rel="freelink">oeschger@netscape.com</a>> <a class=" external" href="http://www.mozilla.org/docs/xul/xulnotes/xulnote_packages.html" rel="freelink">http://www.mozilla.org/docs/xul/xuln..._packages.html</a></li> <li>Mozilla Calendar 專案網站, 由 Mike Potter 所維護 <<a class=" link-mailto" href="mailto:mikep@oeone.com" rel="freelink">mikep@oeone.com</a>> <a class=" external" href="http://www.mozilla.org/projects/calendar/" rel="freelink">http://www.mozilla.org/projects/calendar/</a></li> -</ol> -<div class="originaldocinfo"> -<h3 id=".E5.8E.9F.E5.A7.8B.E6.96.87.E4.BB.B6.E8.B3.87.E8.A8.8A" name=".E5.8E.9F.E5.A7.8B.E6.96.87.E4.BB.B6.E8.B3.87.E8.A8.8A">原始文件資訊</h3> -<ul> <li>作者: Peter Bojanic</li> -</ul> -<h3 id=".E7.BF.BB.E8.AD.AF.E6.96.87.E4.BB.B6.E8.B3.87.E8.A8.8A" name=".E7.BF.BB.E8.AD.AF.E6.96.87.E4.BB.B6.E8.B3.87.E8.A8.8A">翻譯文件資訊</h3> -<ul> <li>翻譯 <a href="/User:Dwchiang" title="User:Dwchiang">Ernest Chiang</a></li> <li>修飾 <a href="/User:BobChao" title="User:BobChao">Bob Chao</a></li> -</ul> -</div> -<p><a href="/zh_tw/The_Joy_of_XUL">zh_tw:The Joy of XUL</a></p> - -<p>{{ languages( { "en": "en/The_Joy_of_XUL", "fr": "fr/Les_joies_de_XUL", "ja": "ja/The_Joy_of_XUL", "pl": "pl/Zabawa_j\u0119zykiem_XUL" } ) }}</p> diff --git a/files/zh-tw/archive/mozilla/xul/xul_reference/index.html b/files/zh-tw/archive/mozilla/xul/xul_reference/index.html deleted file mode 100644 index 337bb2938a..0000000000 --- a/files/zh-tw/archive/mozilla/xul/xul_reference/index.html +++ /dev/null @@ -1,344 +0,0 @@ ---- -title: XUL 參考文件 -slug: Archive/Mozilla/XUL/XUL_Reference -tags: - - XUL -translation_of: Archive/Mozilla/XUL/XUL_Reference ---- -<p>« <a href="/en-US/docs/XUL" title="en-US/XUL">XUL Reference</a> «</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <th colspan="3">全部 XUL 元件 (按字母排序)</th> - </tr> - <tr> - <td> - <p><a href="/en/XUL/action" title="en/XUL/action">action</a><br> - <a href="/en/XUL/arrowscrollbox" title="en/XUL/arrowscrollbox">arrowscrollbox</a><br> - <a href="/en/XUL/assign" title="en/XUL/assign">assign</a><br> - <a href="/en/XUL/bbox" title="en/XUL/bbox">bbox</a><br> - <a href="/en/XUL/binding" title="en/XUL/binding">binding</a><br> - <a href="/en/XUL/bindings" title="en/XUL/bindings">bindings</a><br> - <a href="/en/XUL/box" title="en/XUL/box">box</a><br> - <a href="/en/XUL/broadcaster" title="en/XUL/broadcaster">broadcaster</a><br> - <a href="/en/XUL/broadcasterset" title="en/XUL/broadcasterset">broadcasterset</a><br> - <a href="/en/XUL/button" title="en/XUL/button">button</a><br> - <a href="/en/XUL/browser" title="en/XUL/browser">browser</a><br> - <a href="/en/XUL/checkbox" title="en/XUL/checkbox">checkbox</a><br> - <a href="/en/XUL/caption" title="en/XUL/caption">caption</a><br> - <a href="/en/XUL/colorpicker" title="en/XUL/colorpicker">colorpicker</a><br> - <a href="/en/XUL/column" title="en/XUL/column">column</a><br> - <a href="/en/XUL/columns" title="en/XUL/columns">columns</a><br> - <a href="/en/XUL/commandset" title="en/XUL/commandset">commandset</a><br> - <a href="/en/XUL/command" title="en/XUL/command">command</a><br> - <a href="/en/XUL/conditions" title="en/XUL/conditions">conditions</a><br> - <a href="/en/XUL/content" title="en/XUL/content">content</a><br> - <a href="/en/XUL/datepicker" title="en/XUL/datepicker">datepicker</a><br> - <a href="/en/XUL/deck" title="en/XUL/deck">deck</a><br> - <a href="/en/XUL/description" title="en/XUL/description">description</a><br> - <a href="/en/XUL/dialog" title="en/XUL/dialog">dialog</a><br> - <a href="/en/XUL/dialogheader" title="en/XUL/dialogheader">dialogheader</a><br> - <a href="/en/XUL/dropmarker" title="en/XUL/dropmarker">dropmarker</a><br> - <a href="/en/XUL/editor" title="en/XUL/editor">editor</a><br> - <a href="/en/XUL/grid" title="en/XUL/grid">grid</a><br> - <a href="/en/XUL/grippy" title="en/XUL/grippy">grippy</a><br> - <a href="/en/XUL/groupbox" title="en/XUL/groupbox">groupbox</a><br> - <a href="/en/XUL/hbox" title="en/XUL/hbox">hbox</a><br> - <a href="/en/XUL/iframe" title="en/XUL/iframe">iframe</a><br> - <a href="/en/XUL/image" title="en/XUL/image">image</a><br> - <a href="/en/XUL/key" title="en/XUL/key">key</a><br> - <a href="/en/XUL/keyset" title="en/XUL/keyset">keyset</a><br> - <a href="/en/XUL/label" title="en/XUL/label">label</a><br> - <a href="/en/XUL/listbox" title="en/XUL/listbox">listbox</a><br> - <a href="/en/XUL/listcell" title="en/XUL/listcell">listcell</a><br> - <a href="/en/XUL/listcol" title="en/XUL/listcol">listcol</a><br> - <a href="/en/XUL/listcols" title="en/XUL/listcols">listcols</a><br> - <a href="/en/XUL/listhead" title="en/XUL/listhead">listhead</a><br> - <a href="/en/XUL/listheader" title="en/XUL/listheader">listheader</a><br> - <a href="/en/XUL/listitem" title="en/XUL/listitem">listitem</a></p> - </td> - <td> - <p><a href="/en/XUL/member" title="en/XUL/member">member</a><br> - <a href="/en/XUL/menu" title="en/XUL/menu">menu</a><br> - <a href="/en/XUL/menubar" title="en/XUL/menubar">menubar</a><br> - <a href="/en/XUL/menuitem" title="en/XUL/menuitem">menuitem</a><br> - <a href="/en/XUL/menulist" title="en/XUL/menulist">menulist</a><br> - <a href="/en/XUL/menupopup" title="en/XUL/menupopup">menupopup</a><br> - <a href="/en/XUL/menuseparator" title="en/XUL/menuseparator">menuseparator</a><br> - <a href="/en/XUL/notification" title="en/XUL/notification">notification</a><br> - <a href="/en/XUL/notificationbox" title="en/XUL/notificationbox">notificationbox</a><br> - <a href="/en/XUL/observes" title="en/XUL/observes">observes</a><br> - <a href="/en/XUL/overlay" title="en/XUL/overlay">overlay</a><br> - <a href="/en/XUL/page" title="en/XUL/page">page</a><br> - <a href="/en/XUL/panel" title="en/XUL/panel">panel</a><br> - <a href="/en/XUL/param" title="en/XUL/param">param</a><br> - <a href="/en/XUL/popupset" title="en/XUL/popupset">popupset</a><br> - <a href="/en/XUL/preference" title="en/XUL/preference">preference</a><br> - <a href="/en/XUL/preferences" title="en/XUL/preferences">preferences</a><br> - <a href="/en/XUL/prefpane" title="en/XUL/prefpane">prefpane</a><br> - <a href="/en/XUL/prefwindow" title="en/XUL/prefwindow">prefwindow</a><br> - <a href="/en/XUL/progressmeter" title="en/XUL/progressmeter">progressmeter</a><br> - <a href="/en/XUL/query" title="en/XUL/query">query</a><br> - <a href="/en/XUL/queryset" title="en/XUL/queryset">queryset</a><br> - <a href="/en/XUL/radio" title="en/XUL/radio">radio</a><br> - <a href="/en/XUL/radiogroup" title="en/XUL/radiogroup">radiogroup</a><br> - <a href="/en/XUL/resizer" title="en/XUL/resizer">resizer</a><br> - <a href="/en/XUL/richlistbox" title="en/XUL/richlistbox">richlistbox</a><br> - <a href="/en/XUL/richlistitem" title="en/XUL/richlistitem">richlistitem</a><br> - <a href="/en/XUL/row" title="en/XUL/row">row</a><br> - <a href="/en/XUL/rows" title="en/XUL/rows">rows</a><br> - <a href="/en/XUL/rule" title="en/XUL/rule">rule</a><br> - <a href="/en/XUL/scale" title="en/XUL/scale">scale</a><br> - <a href="/en/XUL/script" title="en/XUL/script">script</a><br> - <a href="/en/XUL/scrollbar" title="en/XUL/scrollbar">scrollbar</a><br> - <a href="/en/XUL/scrollbox" title="en/XUL/scrollbox">scrollbox</a><br> - <a href="/en/XUL/scrollcorner" title="en/XUL/scrollcorner">scrollcorner</a><br> - <a href="/en/XUL/separator" title="en/XUL/separator">separator</a><br> - <a href="/en/XUL/spacer" title="en/XUL/spacer">spacer</a><br> - <a href="/en/XUL/spinbuttons" title="en/XUL/spinbuttons">spinbuttons</a><br> - <a href="/en/XUL/splitter" title="en/XUL/splitter">splitter</a><br> - <a href="/en/XUL/stack" title="en/XUL/stack">stack</a><br> - <a href="/en/XUL/statusbar" title="en/XUL/statusbar">statusbar</a></p> - </td> - <td> - <p><a href="/en/XUL/statusbarpanel" title="en/XUL/statusbarpanel">statusbarpanel</a><br> - <a href="/en/XUL/stringbundle" title="en/XUL/stringbundle">stringbundle</a><br> - <a href="/en/XUL/stringbundleset" title="en/XUL/stringbundleset">stringbundleset</a><br> - <a href="/en/XUL/tab" title="en/XUL/tab">tab</a><br> - <a href="/en/XUL/tabbrowser" title="en/XUL/tabbrowser">tabbrowser</a> (從 Firefox 3/Gecko 1.9 開始支援)<br> - <a href="/en/XUL/tabbox" title="en/XUL/tabbox">tabbox</a><br> - <a href="/en/XUL/tabpanel" title="en/XUL/tabpanel">tabpanel</a><br> - <a href="/en/XUL/tabpanels" title="en/XUL/tabpanels">tabpanels</a><br> - <a href="/en/XUL/tabs" title="en/XUL/tabs">tabs</a><br> - <a href="/en/XUL/template" title="en/XUL/template">template</a><br> - <a href="/en/XUL/textnode" title="en/XUL/textnode">textnode</a><br> - <a href="/en/XUL/textbox" title="en/XUL/textbox">textbox</a><br> - <a href="/En/XUL/Textbox_(Toolkit_autocomplete)" title="en/XUL/textbox_(Firefox_autocomplete)">textbox (Firefox autocomplete)</a><br> - <a href="/En/XUL/Textbox_(XPFE_autocomplete)" title="en/XUL/textbox_(Mozilla_autocomplete)">textbox (Mozilla autocomplete)</a><br> - <a href="/en/XUL/timepicker" title="en/XUL/timepicker">timepicker</a><br> - <a href="/en/XUL/titlebar" title="en/XUL/titlebar">titlebar</a><br> - <a href="/en/XUL/toolbar" title="en/XUL/toolbar">toolbar</a><br> - <a href="/en/XUL/toolbarbutton" title="en/XUL/toolbarbutton">toolbarbutton</a><br> - <a href="/en/XUL/toolbargrippy" title="en/XUL/toolbargrippy">toolbargrippy</a><br> - <a href="/en/XUL/toolbaritem" title="en/XUL/toolbaritem">toolbaritem</a><br> - <a href="/en/XUL/toolbarpalette" title="en/XUL/toolbarpalette">toolbarpalette</a><br> - <a href="/en/XUL/toolbarseparator" title="en/XUL/toolbarseparator">toolbarseparator</a><br> - <a href="/en/XUL/toolbarset" title="en/XUL/toolbarset">toolbarset</a><br> - <a href="/en/XUL/toolbarspacer" title="en/XUL/toolbarspacer">toolbarspacer</a><br> - <a href="/en/XUL/toolbarspring" title="en/XUL/toolbarspring">toolbarspring</a><br> - <a href="/en/XUL/toolbox" title="en/XUL/toolbox">toolbox</a><br> - <a href="/en/XUL/tooltip" title="en/XUL/tooltip">tooltip</a><br> - <a href="/en/XUL/tree" title="en/XUL/tree">tree</a><br> - <a href="/en/XUL/treecell" title="en/XUL/treecell">treecell</a><br> - <a href="/en/XUL/treechildren" title="en/XUL/treechildren">treechildren</a><br> - <a href="/en/XUL/treecol" title="en/XUL/treecol">treecol</a><br> - <a href="/en/XUL/treecols" title="en/XUL/treecols">treecols</a><br> - <a href="/en/XUL/treeitem" title="en/XUL/treeitem">treeitem</a><br> - <a href="/en/XUL/treerow" title="en/XUL/treerow">treerow</a><br> - <a href="/en/XUL/treeseparator" title="en/XUL/treeseparator">treeseparator</a><br> - <a href="/en/XUL/triple" title="en/XUL/triple">triple</a><br> - <a href="/en/XUL/vbox" title="en/XUL/vbox">vbox</a><br> - <a href="/en/XUL/where" title="en/XUL/where">where</a><br> - <a href="/en/XUL/window" title="en/XUL/window">window</a><br> - <a href="/en/XUL/wizard" title="en/XUL/wizard">wizard</a><br> - <a href="/en/XUL/wizardpage" title="en/XUL/wizardpage">wizardpage</a></p> - </td> - </tr> - </tbody> -</table> - -<h1 id="XUL_參考文件">XUL 參考文件</h1> - -<p>« <a href="/en-US/docs/XUL" title="en-US/XUL">XUL Reference</a> «</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <th colspan="3">XUL 元件 (按分類)</th> - </tr> - <tr> - <td> - <p><u><strong>WINDOWS</strong></u></p> - - <p><a href="/en/XUL/dialog" title="en/XUL/dialog">dialog</a><br> - <a href="/en/XUL/overlay" title="en/XUL/overlay">overlay</a><br> - <a href="/en/XUL/page" title="en/XUL/page">page</a><br> - <a href="/en/XUL/window" title="en/XUL/window">window</a><br> - <a href="/en/XUL/wizard" title="en/XUL/wizard">wizard</a><br> - <a href="/en/XUL/wizardpage" title="en/XUL/wizardpage">wizardpage</a><br> - <a href="/en/XUL/preference" title="en/XUL/preference">preference</a><br> - <a href="/en/XUL/preferences" title="en/XUL/preferences">preferences</a><br> - <a href="/en/XUL/prefpane" title="en/XUL/prefpane">prefpane</a><br> - <a href="/en/XUL/prefwindow" title="en/XUL/prefwindow">prefwindow</a></p> - - <p><u><strong>WINDOW STRUCTURE</strong></u></p> - - <p><a href="/en/XUL/browser" title="en/XUL/browser">browser</a><br> - <a href="/en/XUL/tabbrowser" title="en/XUL/tabbrowser">tabbrowser</a><br> - <a href="/en/XUL/editor" title="en/XUL/editor">editor</a><br> - <a href="/en/XUL/iframe" title="en/XUL/iframe">iframe</a><br> - <a href="/en/XUL/titlebar" title="en/XUL/titlebar">titlebar</a><br> - <a href="/en/XUL/resizer" title="en/XUL/resizer">resizer</a><br> - <a href="/en/XUL/statusbar" title="en/XUL/statusbar">statusbar</a><br> - <a href="/en/XUL/statusbarpanel" title="en/XUL/statusbarpanel">statusbarpanel</a><br> - <a href="/en/XUL/dialogheader" title="en/XUL/dialogheader">dialogheader</a><br> - <a href="/en/XUL/notification" title="en/XUL/notification">notification</a><br> - <a href="/en/XUL/notificationbox" title="en/XUL/notificationbox">notificationbox</a></p> - - <p><u><strong>MENUS AND POPUPS</strong></u></p> - - <p><a href="/en/XUL/menubar" title="en/XUL/menubar">menubar</a><br> - <a href="/en/XUL/menu" title="en/XUL/menu">menu</a><br> - <a href="/en/XUL/menuitem" title="en/XUL/menuitem">menuitem</a><br> - <a href="/en/XUL/menuseparator" title="en/XUL/menuseparator">menuseparator</a><br> - <a href="/en/XUL/menupopup" title="en/XUL/menupopup">menupopup</a><br> - <a href="/en/XUL/panel" title="en/XUL/panel">panel</a><br> - <a href="/en/XUL/tooltip" title="en/XUL/tooltip">tooltip</a><br> - <a href="/en/XUL/popupset" title="en/XUL/popupset">popupset</a></p> - - <p><u><strong>TOOLBARS</strong></u></p> - - <p><a href="/en/XUL/toolbar" title="en/XUL/toolbar">toolbar</a><br> - <a href="/en/XUL/toolbarbutton" title="en/XUL/toolbarbutton">toolbarbutton</a><br> - <a href="/en/XUL/toolbargrippy" title="en/XUL/toolbargrippy">toolbargrippy</a><br> - <a href="/en/XUL/toolbaritem" title="en/XUL/toolbaritem">toolbaritem</a><br> - <a href="/en/XUL/toolbarpalette" title="en/XUL/toolbarpalette">toolbarpalette</a><br> - <a href="/en/XUL/toolbarseparator" title="en/XUL/toolbarseparator">toolbarseparator</a><br> - <a href="/en/XUL/toolbarset" title="en/XUL/toolbarset">toolbarset</a><br> - <a href="/en/XUL/toolbarspacer" title="en/XUL/toolbarspacer">toolbarspacer</a><br> - <a href="/en/XUL/toolbarspring" title="en/XUL/toolbarspring">toolbarspring</a><br> - <a href="/en/XUL/toolbox" title="en/XUL/toolbox">toolbox</a></p> - - <p><u><strong>TABS AND GROUPING</strong></u></p> - - <p><a href="/en/XUL/tabbox" title="en/XUL/tabbox">tabbox</a><br> - <a href="/en/XUL/tabs" title="en/XUL/tabs">tabs</a><br> - <a href="/en/XUL/tab" title="en/XUL/tab">tab</a><br> - <a href="/en/XUL/tabpanels" title="en/XUL/tabpanels">tabpanels</a><br> - <a href="/en/XUL/tabpanel" title="en/XUL/tabpanel">tabpanel</a><br> - <a href="/en/XUL/groupbox" title="en/XUL/groupbox">groupbox</a><br> - <a href="/en/XUL/caption" title="en/XUL/caption">caption</a><br> - <a href="/en/XUL/separator" title="en/XUL/separator">separator</a><br> - <a href="/en/XUL/spacer" title="en/XUL/spacer">spacer</a></p> - </td> - <td> - <p><u><strong>CONTROLS</strong></u></p> - - <p><a href="/en/XUL/button" title="en/XUL/button">button</a><br> - <a href="/en/XUL/checkbox" title="en/XUL/checkbox">checkbox</a><br> - <a href="/en/XUL/colorpicker" title="en/XUL/colorpicker">colorpicker</a><br> - <a href="/en/XUL/datepicker" title="en/XUL/datepicker">datepicker</a><br> - <a href="/en/XUL/menulist" title="en/XUL/menulist">menulist</a><br> - <a href="/en/XUL/progressmeter" title="en/XUL/progressmeter">progressmeter</a><br> - <a href="/en/XUL/radio" title="en/XUL/radio">radio</a><br> - <a href="/en/XUL/radiogroup" title="en/XUL/radiogroup">radiogroup</a><br> - <a href="/en/XUL/scale" title="en/XUL/scale">scale</a><br> - <a href="/en/XUL/splitter" title="en/XUL/splitter">splitter</a><br> - <a href="/en/XUL/textbox" title="en/XUL/textbox">textbox</a><br> - <a href="/En/XUL/Textbox_(Toolkit_autocomplete)" title="en/XUL/textbox_(Firefox_autocomplete)">textbox (Firefox autocomplete)</a><br> - <a href="/En/XUL/Textbox_(XPFE_autocomplete)" title="en/XUL/textbox_(Mozilla_autocomplete)">textbox (Mozilla autocomplete)</a><br> - <a href="/en/XUL/timepicker" title="en/XUL/timepicker">timepicker</a></p> - - <p><u><strong>TEXT AND IMAGES</strong></u></p> - - <p><a href="/en/XUL/description" title="en/XUL/description">description</a><br> - <a href="/en/XUL/label" title="en/XUL/label">label</a><br> - <a href="/en/XUL/image" title="en/XUL/image">image</a></p> - - <p><u><strong>LISTS</strong></u></p> - - <p><a href="/en/XUL/listbox" title="en/XUL/listbox">listbox</a><br> - <a href="/en/XUL/listitem" title="en/XUL/listitem">listitem</a><br> - <a href="/en/XUL/listcell" title="en/XUL/listcell">listcell</a><br> - <a href="/en/XUL/listcol" title="en/XUL/listcol">listcol</a><br> - <a href="/en/XUL/listcols" title="en/XUL/listcols">listcols</a><br> - <a href="/en/XUL/listhead" title="en/XUL/listhead">listhead</a><br> - <a href="/en/XUL/listheader" title="en/XUL/listheader">listheader</a><br> - <a href="/en/XUL/richlistbox" title="en/XUL/richlistbox">richlistbox</a><br> - <a href="/en/XUL/richlistitem" title="en/XUL/richlistitem">richlistitem</a></p> - - <p><u><strong>TREES</strong></u></p> - - <p><a href="/en/XUL/tree" title="en/XUL/tree">tree</a><br> - <a href="/en/XUL/treecell" title="en/XUL/treecell">treecell</a><br> - <a href="/en/XUL/treechildren" title="en/XUL/treechildren">treechildren</a><br> - <a href="/en/XUL/treecol" title="en/XUL/treecol">treecol</a><br> - <a href="/en/XUL/treecols" title="en/XUL/treecols">treecols</a><br> - <a href="/en/XUL/treeitem" title="en/XUL/treeitem">treeitem</a><br> - <a href="/en/XUL/treerow" title="en/XUL/treerow">treerow</a><br> - <a href="/en/XUL/treeseparator" title="en/XUL/treeseparator">treeseparator</a></p> - - <p> </p> - </td> - <td> - <p><u><strong>LAYOUT</strong></u></p> - - <p><a href="/en/XUL/box" title="en/XUL/box">box</a><br> - <a href="/en/XUL/hbox" title="en/XUL/hbox">hbox</a><br> - <a href="/en/XUL/vbox" title="en/XUL/vbox">vbox</a><br> - <a href="/en/XUL/bbox" title="en/XUL/bbox">bbox</a><br> - <a href="/en/XUL/deck" title="en/XUL/deck">deck</a><br> - <a href="/en/XUL/stack" title="en/XUL/stack">stack</a><br> - <a href="/en/XUL/grid" title="en/XUL/grid">grid</a><br> - <a href="/en/XUL/columns" title="en/XUL/columns">columns</a><br> - <a href="/en/XUL/column" title="en/XUL/column">column</a><br> - <a href="/en/XUL/rows" title="en/XUL/rows">rows</a><br> - <a href="/en/XUL/row" title="en/XUL/row">row</a><br> - <a href="/en/XUL/scrollbox" title="en/XUL/scrollbox">scrollbox</a></p> - - <p><u><strong>TEMPLATES</strong></u></p> - - <p><a href="/en/XUL/action" title="en/XUL/action">action</a><br> - <a href="/en/XUL/assign" title="en/XUL/assign">assign</a><br> - <a href="/en/XUL/binding" title="en/XUL/binding">binding</a><br> - <a href="/en/XUL/bindings" title="en/XUL/bindings">bindings</a><br> - <a href="/en/XUL/conditions" title="en/XUL/conditions">conditions</a><br> - <a href="/en/XUL/content" title="en/XUL/content">content</a><br> - <a href="/en/XUL/member" title="en/XUL/member">member</a><br> - <a href="/en/XUL/param" title="en/XUL/param">param</a><br> - <a href="/en/XUL/query" title="en/XUL/query">query</a><br> - <a href="/en/XUL/queryset" title="en/XUL/queryset">queryset</a><br> - <a href="/en/XUL/rule" title="en/XUL/rule">rule</a><br> - <a href="/en/XUL/template" title="en/XUL/template">template</a><br> - <a href="/en/XUL/textnode" title="en/XUL/textnode">textnode</a><br> - <a href="/en/XUL/triple" title="en/XUL/triple">triple</a><br> - <a href="/en/XUL/where" title="en/XUL/where">where</a></p> - - <p><u><strong>SCRIPTING</strong></u></p> - - <p><a href="/en/XUL/script" title="en/XUL/script">script</a><br> - <a href="/en/XUL/commandset" title="en/XUL/commandset">commandset</a><br> - <a href="/en/XUL/command" title="en/XUL/command">command</a><br> - <a href="/en/XUL/broadcaster" title="en/XUL/broadcaster">broadcaster</a><br> - <a href="/en/XUL/broadcasterset" title="en/XUL/broadcasterset">broadcasterset</a><br> - <a href="/en/XUL/observes" title="en/XUL/observes">observes</a><br> - <a href="/en/XUL/key" title="en/XUL/key">key</a><br> - <a href="/en/XUL/keyset" title="en/XUL/keyset">keyset</a><br> - <a href="/en/XUL/stringbundle" title="en/XUL/stringbundle">stringbundle</a><br> - <a href="/en/XUL/stringbundleset" title="en/XUL/stringbundleset">stringbundleset</a></p> - - <p><u><strong>HELPER ELEMENTS</strong></u></p> - - <p><a href="/en/XUL/scrollbar" title="en/XUL/scrollbar">arrowscrollbox</a><br> - <a href="/en/XUL/dropmarker" title="en/XUL/dropmarker">dropmarker</a><br> - <a href="/en/XUL/grippy" title="en/XUL/grippy">grippy</a><br> - <a href="/en/XUL/scrollbar" title="en/XUL/scrollbar">scrollbar</a><br> - <a href="/en/XUL/scrollcorner" title="en/XUL/scrollcorner">scrollcorner</a><br> - <a href="/en/XUL/spinbuttons" title="en/XUL/spinbuttons">spinbuttons</a></p> - </td> - </tr> - </tbody> -</table> - -<h3 id="Other_XUL_lists" name="Other_XUL_lists">其他 XUL 列表</h3> - -<ul> - <li><a href="/en/XUL/Attribute" title="en/XUL/Attribute">全部屬性 (attribute)</a></li> - <li><a href="/en/XUL/Property" title="en/XUL/Property">全部屬性 (propertie)</a></li> - <li><a href="/en/XUL/Method" title="en/XUL/Method">全部方法</a></li> - <li><a href="/en/XUL_element_attributes" title="en/XUL_element_attributes">全部 XUL 元件定義的屬性 (attribute)</a></li> - <li><a href="/en/XUL/Style" title="en/XUL/Style">樣式類別</a></li> - <li><a href="/en/XUL/Events" title="en/XUL/Events">事件處理</a></li> - <li><a href="/en/XUL/Deprecated//Defunct_Markup" title="en/XUL/Deprecated//Defunct_Markup">不推薦或廢棄的標記</a></li> -</ul> diff --git a/files/zh-tw/archive/mozilla/xulrunner/index.html b/files/zh-tw/archive/mozilla/xulrunner/index.html deleted file mode 100644 index f2e5e0b75c..0000000000 --- a/files/zh-tw/archive/mozilla/xulrunner/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: XULRunner -slug: Archive/Mozilla/XULRunner -tags: - - NeedsTranslation - - NeedsUpdate - - TopicStub - - XUL - - XULRunner -translation_of: Archive/Mozilla/XULRunner ---- -<div class="callout-box"><strong><a href="/en-US/docs/Getting_started_with_XULRunner" title="Getting_started_with_XULRunner">Getting Started with XULRunner</a></strong><br> -A short introduction to XULRunner.</div> - -<div><span class="seoSummary"><strong>XULRunner</strong> is a Mozilla runtime package that can be used to bootstrap <a href="/en-US/docs/XUL" title="XUL">XUL</a>+<a href="/en-US/docs/XPCOM" title="XPCOM">XPCOM</a> applications that are as rich as Firefox and Thunderbird. It provides mechanisms for installing, upgrading, and uninstalling these applications.</span> XULRunner also provides <code>libxul</code>, a solution which allows the embedding of Mozilla technologies in other projects and products.</div> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 id="Releases" name="Releases">Releases</h2> - - <div class="note"> - <p>Until version 41, XULRunner could be <a class="external" href="http://ftp.mozilla.org/pub/xulrunner/releases/latest/" title="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/">downloaded from ftp.mozilla.org</a>.</p> - - <p>Firefox (from version 3) ships with a private XULRunner package, which can run any compatible XULRunner application using the <code>-app</code> switch: <em><code>firefox -app application.ini</code> is equivalent to <code>xulrunner -app application.ini</code></em></p> - - <p><a href="/en-US/docs/XULRunner/Old_Releases" title="XULRunner/Old_Releases">Older builds</a> are also available.</p> - </div> - - <h2 id="Overview" name="Overview">Overview</h2> - - <ul> - <li>{{ interwiki('wikimo', 'XULRunner', 'Development Plan') }}</li> - <li><a href="/en-US/docs/XULRunner/What_XULRunner_Provides" title="XULRunner/What_XULRunner_Provides">What XULRunner Provides</a></li> - <li><a href="/en-US/docs/XULRunner_FAQ" title="XULRunner_FAQ">XULRunner FAQ</a></li> - <li>Nightly builds: <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/">unstable-trunk</a></li> - </ul> - - <h2 class="Documentation" id="Documentation" name="Documentation">Documentation</h2> - - <dl> - <dt><a href="/en-US/docs/Getting_started_with_XULRunner" title="Getting_started_with_XULRunner">Getting Started with XULRunner</a></dt> - <dd>Short tutorial on building desktop applications with XULRunner.</dd> - <dt><a href="/en-US/docs/XUL_Tutorial" title="XUL Tutorial">XUL Tutorial</a></dt> - <dd>Once you have a working XULRunner application, use the XUL tutorial to expand it into a fantastic XUL application.</dd> - <dt><a href="/en-US/docs/XULRunner_tips" title="XULRunner_tips">XULRunner tips</a></dt> - <dd>A collection of tips for working with XULRunner.</dd> - <dt><a href="/en-US/docs/XULRunner/Deploying_XULRunner_1.8" title="XULRunner/Deploying_XULRunner_1.8">Deploying XULRunner</a></dt> - <dd>An introduction on how to package your application with XULRunner.</dd> - <dt><a href="/en-US/docs/XULRunner_Hall_of_Fame" title="XULRunner_Hall_of_Fame">XULRunner Hall of Fame</a></dt> - <dd>Tracks all available applications based on XULRunner.</dd> - <dt><a href="/en-US/docs/Developer_Guide/Build_Instructions" title="Build_Documentation">Build Documentation</a></dt> - <dd>Learn how to get the source and build it.</dd> - <dt><a href="/en-US/docs/Debugging_a_XULRunner_Application" title="Debugging_a_XULRunner_Application">Debug Documentation</a></dt> - <dd>Steps to configure Venkman to debug your App</dd> - <dt><a class="external" href="http://zenit.senecac.on.ca/wiki/index.php/XULRunner_Guide">XULRunner Guide</a></dt> - <dd>A fairly complete, but outdated, introduction and tutorial for XULRunner which collates much of the documentation found here.</dd> - </dl> - - <p><span class="alllinks"><a href="/en-US/docs/tag/XULRunner" title="tag/XULRunner">View all...</a></span></p> - </td> - <td> - <h2 class="Community" id="Community" name="Community">Community</h2> - - <ul> - <li>View Mozilla forums... {{ DiscussionList("dev-platform", "mozilla.dev.platform") }}</li> - <li><a class="link-irc" href="irc://irc.mozilla.org/#xulrunner">#xulrunner on irc.mozilla.org</a></li> - <li><a href="/en-US/docs/XULRunner/Community" title="XULRunner/Community">Other community links...</a></li> - </ul> - - <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related topics</h2> - - <ul> - <li><a href="/en-US/docs/XUL" title="XUL">XUL</a></li> - </ul> - - <h2 id="See_also" name="See_also">See also</h2> - - <ul> - <li><a class="external" href="http://www.kodewerx.org/wiki/A_Brief_Introduction_To_XULRunner:_Part_1" title="http://www.kodewerx.org/wiki/A_Brief_Introduction_To_XULRunner:_Part_1">A brief introduction to XULRunner</a></li> - </ul> - </td> - </tr> - </tbody> -</table> - -<p> </p> diff --git a/files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html b/files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html deleted file mode 100644 index c51ae6a0ee..0000000000 --- a/files/zh-tw/archive/mozilla/xulrunner/xulrunner_tips/index.html +++ /dev/null @@ -1,213 +0,0 @@ ---- -title: XULRunner秘技 -slug: Archive/Mozilla/XULRunner/XULRunner_tips -translation_of: Archive/Mozilla/XULRunner/Tips ---- -<p>XULRunner Frequently Asked Questions. Work in progress.</p> -<h2 id="Extension_Manager" name="Extension_Manager">Extension Manager</h2> -<p>To be able to install any extensions, you first need to enable the Extension Manager in <a href="/en/XUL_Application_Packaging#em" title="en/XUL_Application_Packaging#em">application.ini</a>. XULRunner 1.8.0 does not load extensions from the application directory; only the XULRunner directory and the user profile directory are checked. However, it seems that with XULRunner 1.9 the XULRunner directory is ignored, while the profile and application directories are checked. The following prefs must also be set to make the XPInstall dialog, extension manager, and theme manager work:</p> -<pre class="eval">pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul"); -pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes"); -pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions"); -pref("xpinstall.dialog.progress.type.skin", "Extension:Manager-themes"); -pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager-extensions"); -pref("extensions.update.enabled", true); -pref("extensions.update.interval", 86400); -pref("extensions.dss.enabled", false); -pref("extensions.dss.switchPending", false); -pref("extensions.ignoreMTimeChanges", false); -pref("extensions.logging.enabled", false); -pref("general.skins.selectedSkin", "classic/1.0"); -// NB these point at AMO -pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties"); -pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties"); -pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties"); -</pre> -<p>If your application is based on Gecko 2.0, you need to register a component through the new component registration because the extension manager uses FUEL, namely <code>Application.restart()</code>, to restart your xulrunner-based application after any change (installation, removal, enabling, disabling) in the extensions' list:</p> -<ol> - <li>copy files <code>fuelApplication.js</code> and <code>fuelApplication.manifest</code> from <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/browser/fuel/src/" title="http://mxr.mozilla.org/mozilla-central/source/browser/fuel/src/"><code>browser/fuel/src</code></a> for instance into your <code>components/</code> directory</li> - <li>tweak the line <code>#include ../../../toolkit/components/exthelper/extApplication.js</code> in your copy of <code>fuelApplication.js</code> as needed</li> - <li>make sure to declare the FUEL module and the two files in your <code>components/Makefile.in</code> as in <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/browser/fuel/src/Makefile.in" title="http://mxr.mozilla.org/mozilla-central/source/browser/fuel/src/Makefile.in"><code>browser/fuel/src/Makefile.in</code></a></li> - <li>rebuild...</li> -</ol> -<h2 id="Useful_Chrome_URLs">Useful Chrome URLs</h2> -<p>Most of these require <a href="#Branding"> branding</a>.</p> -<table class="standard-table"> - <tbody> - <tr> - <th>Window</th> - <th>URL</th> - <th>Window Type</th> - </tr> - <tr> - <td>Extension Manager</td> - <td>chrome://mozapps/content/extensions/extensions.xul?type=extensions</td> - <td>Extension:Manager-extensions</td> - </tr> - <tr> - <td>Theme Manager</td> - <td>chrome://mozapps/content/extensions/extensions.xul?type=themes</td> - <td>Extension:Manager-themes</td> - </tr> - <tr> - <td>JavaScript Console</td> - <td>chrome://global/content/console.xul</td> - <td>global:console</td> - </tr> - <tr> - <td>about:config</td> - <td>chrome://global/content/config.xul</td> - <td> </td> - </tr> - </tbody> -</table> -<h2 id="Developer_Extensions" name="Developer_Extensions">Developer Extensions</h2> -<h3 id="Venkman"><a href="/en/Venkman" title="en/Venkman">Venkman</a></h3> -<ul> - <li>Need a custom build or a compatible extension</li> - <li>Need to edit compatibility in</li> - <li>Needs a method to start venkman (usually by overlaying the main XUL file, similar to existing code for Firefox, Suite, etc.)</li> - <li>The function toOpenWindowByType() needs to be defined. There is a <a class="external" href="http://www.rcode.net/blog/tlaurenzo/2006/03/17/getting-dev-tools-working-with-xulrunner/" title="http://www.rcode.net/blog/tlaurenzo/2006/03/17/getting-dev-tools-working-with-xulrunner/">working stub</a>. Any better suggestion?</li> - <li>Venkman uses "chrome://communicator/skin/" as an alias for "chrome://global/skin/" and this alias was maintained in the XULRunner toolkit until XULRunner 1.9 was released. When using XULRunner 1.9 or greater, you can create your own alias - <ul> - <li>in your chrome manifest add a "skin" line: - <pre>skin communicator classic/1.0 skin/communicator/</pre> - </li> - <li>add a skin folder named "communicator" and add a single CSS file named "communicator.css" with this content: - <pre>@import url("chrome://global/skin");</pre> - </li> - </ul> - </li> -</ul> -<h3 id="DOM_Inspector" name="DOM_Inspector"><a href="/en/DOM_Inspector" title="en/DOM_Inspector">DOM Inspector</a></h3> -<p>To add DOM Inspector 2.0.* to your XULRunner 1.9.0.* application follow these steps:</p> -<ul> - <li>Download the <a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/6622" title="https://addons.mozilla.org/en-US/firefox/addon/6622">Dom Inspector</a> (instead of clicking the "Add to..." button, right-click and select "Save Link As...").</li> - <li>Save the <em>dom_inspector-*.xpi</em> package to a temporary directory</li> - <li>Unzip the package</li> - <li>Copy the following files:<br> - <em>chrome/inspector.jar</em> to the chrome directory of your XULRunner application<br> - <em>components/inspector-cmdline.js</em> to your components directory<br> - <em>defaults/preferences/inspector.js</em> to your preferences directory</li> - <li>Open your chrome.manifest file and add these lines:</li> -</ul> -<pre>content inspector jar:inspector.jar!/content/inspector/ xpcnativewrappers=no -locale inspector en-US jar:inspector.jar!/locale/en-US/inspector/ -skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ -skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ - -overlay chrome://inspector/content/popupOverlay.xul chrome://inspector/content/viewers/dom/popupOverlay.xul -overlay chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/styleRules/commandOverlay.xul -overlay chrome://inspector/content/keysetOverlay.xul chrome://inspector/content/viewers/dom/keysetOverlay.xul -overlay chrome://inspector/content/popupOverlay.xul chrome://inspector/content/viewers/styleRules/popupOverlay.xul -overlay chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/dom/commandOverlay.xul -</pre> -<p>To launch DOM Inspector in your application, you need to open its main window, with a command like this:</p> -<pre>window.open("chrome://inspector/content/inspector.xul", "", "chrome"); -</pre> -<p><strong>Alternatively, the DOM Inspector may also be added as an extension:</strong></p> -<ol> - <li>(if you already have inspector installed for another application you can skip to the next step)<br> - Follow the instructions above through "Unzip the package."</li> - <li>Create a file in the extensions directory of your application with the same name as the DOM Inspector ID (<a class="link-mailto" href="mailto:inspector@mozilla.org" rel="freelink">inspector@mozilla.org</a>) containing one line of text -- the exact path to the root directory of DOM inspector (where the install.rdf is) like this one: - <pre>/home/username/.mozilla/firefox/numbersandletters/extensions/inspector@mozilla.org/</pre> - </li> - <li>Now create a javascript file with the following code and include it in the main window of your application: - <pre>function startDOMi() -{ - // Load the Window DataSource so that browser windows opened subsequent to DOM - // Inspector show up in the DOM Inspector's window list. - var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"] - .getService(Components.interfaces.nsIWindowDataSource); - var tmpNameSpace = {}; - var sl = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] - .createInstance(Components.interfaces.mozIJSSubScriptLoader); - sl.loadSubScript("chrome://inspector/content/hooks.js", tmpNameSpace); - tmpNameSpace.inspectDOMDocument(document); -} -</pre> - </li> - <li>Now create a hook in your application window to start DOM Inspector, like this one: - <pre><button label="Start Inpector" oncommand="startDOMi()"/></pre> - </li> - <li>Start your application and DOM Inspector will be installed.</li> -</ol> -<p>Note: I use this method of installing extensions into all of my Mozilla applications. This way I have one directory where I keep all my Mozilla extensions, and each application (Firefox, Thunderbird) simply contains a few small, one line files pointing to the location of the extensions. (I keep them in source control to be sure I can maintain compatibility)</p> -<h3 id="Component_Viewer" name="Component_Viewer">Component Viewer</h3> -<p>Need custom build, first of all. What else?</p> -<h3 id="Extension_Developer.27s_Extension" name="Extension_Developer.27s_Extension">Extension Developer's Extension</h3> -<p><a class="external" href="http://ted.mielczarek.org/code/mozilla/extensiondev/">Extension Developer's Extension</a> is a useful tool, featuring Live XUL Editor and JavaScript Shell. To install the extension into your application you'll need to hack its install.rdf (see above). You'll probably also want to create menuitems that let you open the JS Shell and other tools provided by the extension.</p> -<h2 id="Branding" name="Branding">Branding</h2> -<p>Branding is a <a href="/en/Chrome_Registration" title="en/Chrome_Registration">chrome package</a> containing product-specific information (e.g. the product name, vendor, and logo). Some XULRunner components (in particular, the <a href="#Extension_Manager"> Extension Manager</a>) depend on branding, in the sense that they expect to find certain strings in <code><a class="external" rel="freelink">chrome://branding/locale/brand.dtd</a></code> and <code><a class="external" rel="freelink">chrome://branding/locale/brand.properties</a></code>. In order to satisfy these dependencies, you can save Firefox's <code>brand.dtd</code>/<code>brand.properties</code> to <code>chrome/locale/branding</code> folder, modify them appropriately, and <a href="/en/Chrome_Registration#locale" title="en/Chrome_Registration#locale">register a locale provider</a> for <code>branding</code> by adding the following line to your chrome manifest:</p> -<pre class="eval">locale branding en-US chrome/locale/branding/ -</pre> -<p>The location you put the branding files in doesn't matter, as long as you register it appropriately in the manifest. In addition, a branding content package <a href="/en/Chrome_Registration#content" title="en/Chrome_Registration#content">must be registered</a> to include the application logos:</p> -<pre class="eval">content branding chrome/branding/ -</pre> -<p>3 files should be provided in this folder: <em>about.png</em>, <em>icon48.png</em> and <em>icon64.png</em>. See <a class="external" href="http://mxr.mozilla.org/mozilla/source/other-licenses/branding/firefox/content/">Firefox</a> for example.</p> -<h3 id="Making_Windows_display_correct_application_name_and_icon_when_buttons_are_grouped" name="Making_Windows_display_correct_application_name_and_icon_when_buttons_are_grouped">Making Windows display correct application name and icon when buttons are grouped</h3> -<p>By default, the task bar on Windows might group windows belonging to the same process into one button to save space. This button is usually called "xulrunner.exe" and has XULRunner's icon. There are two approaches to display the branding of your application instead:</p> -<ul> - <li>When compiling XULRunner yourself: create a file module.ver in the directory mozilla/xulrunner/app with the contents: - <pre>WIN32_MODULE_DESCRIPTION=MyApplication</pre> - <p>MyApplication should be replaced by whatever you want to see as title of the button. You can also replace xulrunner.ico in the same directory to change XULRunner's icon to the icon of your application.</p> - </li> - <li>With a precompiled XULRunner: use xulrunner-stub.exe to start your application but rename it into MyApplication.exe. With XULRunner 1.9 this will make the desired name appear in the task bar (not with XULRunner 1.8 however). Your application's icon can also be added to this executable with a tool like</li> - <li><a class="external" href="http://www.angusj.com/resourcehacker/">Resource Hacker</a>. To change icon of specific window, see <a class="internal" href="/en/Window_icons" title="En/Window icons">Window icons</a>.</li> -</ul> -<h2 id="Reading_command_line_arguments" name="Reading_command_line_arguments">Reading command line arguments</h2> -<p>See <a href="/en/Chrome/Command_Line" title="en/Chrome/Command_Line">Chrome: Command Line</a>. Command line arguments are handled via nsICommandLineHandler, as usual.</p> -<h2 id="Preferences_needed_for_file_download_dialogs" name="Preferences_needed_for_file_download_dialogs">Preferences needed for file download dialogs</h2> -<p>To use the unknown-content-type and file-downloads dialogs from a <browser> element, you need to add the following prefs:</p> -<pre class="eval">pref("browser.download.useDownloadDir", true); -pref("browser.download.folderList", 0); -pref("browser.download.manager.showAlertOnComplete", true); -pref("browser.download.manager.showAlertInterval", 2000); -pref("browser.download.manager.retention", 2); -pref("browser.download.manager.showWhenStarting", true); -pref("browser.download.manager.useWindow", true); -pref("browser.download.manager.closeWhenDone", true); -pref("browser.download.manager.openDelay", 0); -pref("browser.download.manager.focusWhenStarting", false); -pref("browser.download.manager.flashCount", 2); -// -pref("alerts.slideIncrement", 1); -pref("alerts.slideIncrementTime", 10); -pref("alerts.totalOpenTime", 4000); -pref("alerts.height", 50); -</pre> -<p>If you are missing preferences that a dialog requires, you will get the following errors:</p> -<pre class="eval">Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref] - -Error: dialog has no properties -Source File: <a class="external" rel="freelink">chrome://mozapps/content/downloads/u...ontentType.xul</a> -Line: 1 -</pre> -<h2 id="Enabling_Password_Manager" name="Enabling_Password_Manager">Enabling Password Manager</h2> -<p>These preferences seem to be the default in Firefox, however, they are missing in XULRunner. Without these settings Password Manager will not store login details.</p> -<pre class="eval">pref("signon.rememberSignons", true); -pref("signon.expireMasterPassword", false); -pref("signon.SignonFileName", "signons.txt"); -</pre> -<p>You also need to get an instance of the login manager service, which internally initializes the system:</p> -<pre class="eval">Components.classes["@mozilla.org/login-manager;1"].getService(Components.interfaces.nsILoginManager); -</pre> -<h2 id="Using_Firefox_3_to_run_XULRunner_applications" name="Using_Firefox_3_to_run_XULRunner_applications">Using Firefox 3 to run XULRunner applications</h2> -<p>Firefox 3 contains the XULRunner runtime. It has an <code>-app</code> command-line switch to run a specified XUL application instead of starting the browser.</p> -<p>On Windows:</p> -<pre class="eval"> firefox.exe -app <em>path\to\</em>application.ini -</pre> -<p>On Linux:</p> -<pre class="eval"> firefox -app <em>path/to/</em>application.ini</pre> -<p>On the Mac:</p> -<pre class="eval"> /Applications/Firefox.app/Contents/MacOS/firefox-bin -app <em>/path/to/</em>application.ini -</pre> -<p>Note that at least on the Mac, you need to use a full path. Partial paths don't seem to work.</p> -<h2 id="Troubleshooting" name="Troubleshooting">Troubleshooting</h2> -<h3 id="Window_title_missing" name="Window_title_missing">Window title missing</h3> -<p>If the title of your XUL <code><<a href="/en/XUL/window" title="en/XUL/window">window</a>></code> is blank, even though you specified a title attribute, make sure the extension on your XUL file is <code>.xul</code> rather than <code>.xml</code></p> -<h2 id="Default_Theme">Default Theme</h2> -<p>To create a default theme you need to create a folder in the extensions folder with an <a class="external" href="/en/Install_Manifests" title="http://developer.mozilla.org/editor/fckeditor/core/editor/en/Install_Manifests">install.rdf</a> in it. As of Oct. 2008, the folder needs to have the same name as the one in Firefox 3.0. </p> -<p><code>\MyApp\Extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}\</code>install.rdf</p> -<p>It should also have an <em:internalName>classic/1.0</em:internalName> as that is the default theme in Firefox.</p> -<p>{{ languages( { "ja": "ja/XULRunner_tips", "fr": "fr/Astuces_XULRunner" } ) }}</p> diff --git a/files/zh-tw/archive/themes/index.html b/files/zh-tw/archive/themes/index.html deleted file mode 100644 index a440be2e7a..0000000000 --- a/files/zh-tw/archive/themes/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Themes -slug: Archive/Themes -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Themes ---- -<p>Archived theme documentation.</p> - -<p>{{Listsubpages("/en-US/docs/Archive/Themes", 10)}}</p> diff --git a/files/zh-tw/archive/web/e4x/index.html b/files/zh-tw/archive/web/e4x/index.html deleted file mode 100644 index 7ba42421ff..0000000000 --- a/files/zh-tw/archive/web/e4x/index.html +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: E4X -slug: Archive/Web/E4X -translation_of: Archive/Web/E4X ---- -<p>This page was auto-generated because a user created a sub-page to this page.</p> diff --git a/files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html b/files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html deleted file mode 100644 index 3c8b4cb442..0000000000 --- a/files/zh-tw/archive/web/e4x/processing_xml_with_e4x/index.html +++ /dev/null @@ -1,229 +0,0 @@ ---- -title: 使用 E4X 處理 XML -slug: Archive/Web/E4X/Processing_XML_with_E4X -translation_of: Archive/Web/E4X/Processing_XML_with_E4X ---- -<p>{{Warning("E4X 已廢棄不用。 It's been disabled by default for chrome in Firefox 17, and completly removed in Firefox 21. 請使用 DOMParser/DOMSerializer 或 a non-native JXON algorithm 替代。")}}</p> -<h2 id="使用_E4X_處理_XML" name="使用_E4X_處理_XML">使用 E4X 處理 XML</h2> -<p>JavaScript 在 1.6 版本中首次引入,<strong><a class="internal" href="/zh_tw/E4X" title="zh tw/E4X">E4X</a></strong> 引入原生的 XML 物件以供 JavaScript 語言使用,並新增用來在 JavaScript 的代碼中嵌入照字面表達的 XML 文件的語法。</p> -<p>E4X 的完整定義可以在 <a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-357.htm">Ecma-357 規範</a> 中找到。本章提供實踐中的語言概要;但這並不是全面的參考資料。</p> -<h3 id="相容性的問題" name="相容性的問題">相容性的問題</h3> -<p>在主要的瀏覽器支援 <code><script></code> 元素以前,對於嵌入到頁面裡的 JavaScript 存有一種常見的做法,就是使用 HTML 的註解標籤將其包夾,避免瀏覽器直接把 <code><script></code> 裡的 JavaScript 代碼顯示在使用者眼前。如今已無須這麼做,不過仍殘存在部分遺留下來的代碼中。為了向後相容的需要,E4X 預設會忽略註解和 CDATA 區段。你可以給你的 <code><script></code> 標籤加上 <code>e4x=1</code> 參數以解除這項限制︰</p> -<pre><script type="text/javascript;e4x=1"> -... -</script> -</pre> -<h3 id="XML_物件的建立" name="XML_物件的建立">XML 物件的建立</h3> -<p>E4X 提供兩種建立 XML 物件的方式。第一種是傳入字串給 <code>XML</code> 建構子︰</p> -<pre class="eval"> var languages = new XML('<languages type="dynamic"><lang>JavaScript</lang><lang>Python</lang></languages>'); -</pre> -<p>第二種是直接在你的 Script 中嵌入 XML︰</p> -<pre class="eval"> var languages = <languages type="dynamic"> - <lang>JavaScript</lang> - <lang>Python</lang> - </languages>; -</pre> -<p>在這兩種情況裡,產生都會是 E4X <code>XML</code> 物件,他提供了方便的語法用以存取並更新其內夾藏著的資料。</p> -<p>XML 物件在外觀上和行為上都和普通的 JavaScript 物件很類似,但有兩件事並不相同。E4X 引入的新語法只能用在 E4X XML 物件上。雖然新語法被設計成對 JavaScript 設計者而言較熟悉的形式,但 E4X 並不提供從 XML 到原生 JavaScript 物件的完整對應;只是看起來很像而已。</p> -<p>可以把變數加入到 XML 的字面中用來建立元素的名稱(或是內容)。</p> -<pre>var h = 'html'; -var text = "Here's some text"; -var doc = <{h}><body>{text}</body></{h}>; -alert(doc.toXMLString()); -// 產生的是 -<html> - <body>Here's some text</body> -</html> -</pre> -<h3 id="屬性的運用" name="屬性的運用">屬性的運用</h3> -<p>當你需要動態的建立標記的時候,XML 字面語法明顯更勝 <code>XML</code> 建構子。使用 E4X 可輕易的在標記中嵌入動態值。只需使用花括弧 ({}) 包夾要建立的屬性值,並省略一般會加上的引號標記,變數和表達式即可用於建立屬性值,如同下例所示︰</p> -<pre class="eval"> var a = 2; - var b = <foo bar={a}>"hi"</foo>; -</pre> -<p>開始執行時,變數的值會被求出,並自動在適當的位置加上引號。前面的例子產生的 XML 物件看起來就像這樣︰<code><foo bar="2">"hi"</foo></code>。</p> -<p>在屬性的替換方面,雙引號會被跳脫成 &quot;,單引號則按平常方式處理。</p> -<pre class="eval">var b = 'He said "Don\'t go there."'; -var el = <foo a={b}/>; -alert(el.toXMLString()); -// 產生︰<foo a="He said &quot;Don't go there.&quot;"/> -</pre> -<p>小於和 & 符號也會被跳脫成各自的等價實體。由於大於符號不會被跳脫,因此如果包含了 <a class="internal" href="/zh_tw/DOM/CDATASection" title="zh tw/DOM/CDATASection">CDATA</a> 結束序列 (]]>),就有可能產生 XML 錯誤。</p> -<p>通常不會直接在字面(或變數)的屬性內容之中作修改(例如,<code>bar="a{var1}{var2}"</code>)。如果有必須使用 JavaScript 表達式計算變數來替代的內容的話(例如,<code>bar={'a'+var1+var2}</code>),在元素字面之前先定義新的變數,在變數中包含完整的修改內容,然後在字面中含入這個變數,或在字面之後取回屬性並將其修改(見下)。</p> -<p>可如同屬性值一般的修改屬性的名稱︰</p> -<pre>var a = 'att'; -var b = <b {a}='value'/>; -alert(b); -// Gives: -<b att="value"/> - -</pre> -<p>…但之後就不能修改表達式(例如,<b {a}>)。</p> -<p>執行上面的例子之後,參考 XML 物件的語言變數與 XML 文件中的 <code><languages></code> 結點一致。這個結點只有一個屬性︰type,這個屬性可用各種方式來存取並更新︰</p> -<pre class="eval"> alert(languages.@type); // 警報 "dynamic" - languages.@type = "agile"; - alert(languages.@type); // 警報 "agile" -</pre> -<pre class="eval"> alert(languages.toString()); - /* 警報: - <languages type="agile"><lang>JavaScript</lang><lang>Python</lang></languages> - */ -</pre> -<p>注意,如果想要把取回的屬性與其他的字串作比較,就有必要先把屬性作轉換,即使屬性有可能會在其他地方被轉換成字串(例如插入到文字框中)。</p> -<pre class="eval">if (<a class="link-mailto" href="mailto:languages.@type.toString()" rel="freelink">languages.@type.toString()</a> === 'agile') { - ... -} -</pre> -<h3 id="XML_物件的運用" name="XML_物件的運用">XML 物件的運用</h3> -<p>XML 物件提供一系列的方法用來查閱並更新其中的內容。這類物件亦支援 JavaScript 的點 (.) 和 <code>[]</code> 符號,但不是用來存取物件的屬性,E4X 覆蓋了這些運算子,改用來存取元素的子結點︰</p> -<pre>var person = <person> - <name>Bob Smith</name> - <likes> - <os>Linux</os> - <browser>Firefox</browser> - <language>JavaScript</language> - <language>Python</language> - </likes> -</person>; - -alert(person.name); // Bob Smith -alert(person['name']); // Bob Smith -alert(person.likes.browser); // Firefox -alert(person['likes'].browser); // Firefox -</pre> -<p>如果你使用多於一個以上的元素來存取的話,你會得到 <code>XMLList</code>︰</p> -<pre>alert(person.likes.language.length()); // 2 -</pre> -<p>和 DOM 一樣,<code>*</code> 可以用來存取所有的子結點︰</p> -<pre>alert(person.likes.*.length()); // 4 -</pre> -<p><code>.</code> 運算子會直接存取指定結點的子結點,<code>..</code> 運算子則會存取所有的子結點,不論嵌入的有多深︰</p> -<pre>alert(person..*.length()); // 11 -</pre> -<p><code>length()</code> 方法在此返回 11,因為元素結點和文字結點兩者都被包含在 <code>XMLList</code> 的結果中。</p> -<p>用來表示 XML 元素的物件提供一系列實用的方法,部分方法的解說見下︰<span class="comment">TODO: Add all of the methods to the JavaScript reference, link from here</span></p> -<pre>alert(person.name.text()) // Bob Smith - -var xml = person.name.toXMLString(); // 內含 XML 的字串 - -var personCopy = person.copy(); // XML 物件的深層複製 - -var child = person.child(1); // 第二個子結點;目前是 <likes> 元素 -</pre> -<h3 id="XMLLists_的運用" name="XMLLists_的運用">XMLLists 的運用</h3> -<p>除了 XML 物件以外,E4X 也引入了 <code>XMLList</code> 物件。<code>XMLList</code> 是用來表示附有編號的 XML 物件的集合;例如,元素的列表。接續上面的例子,我們可以在頁面上存取 <code>XMLList</code> 的 <code><lang></code> 元素如下︰</p> -<pre class="eval"> var langs = languages.lang; -</pre> -<p><code>XMLList</code> 提供 <code>length()</code> 方法,可用來查出內含元素的數目︰</p> -<pre class="eval"> alert(languages.lang.length()); -</pre> -<p>注意,有別於 JavaScript 陣列的 length 屬性,這個 length 是方法,不是屬性,而且必須使用 <code>length()</code> 來呼叫。</p> -<p>我們可以迭代所有相配的元素,就像這樣︰</p> -<pre class="eval"> for (var i = 0; i < languages.lang.length(); i++) { - alert(languages.lang[i].toString()); - } -</pre> -<p>在此我們使用同一個語法存取陣列中的已編號項。雖然這部分很類似普通的陣列,但 <code>XMLList</code> 並不支援 <code>Array</code> 的方法,如 <code>forEach</code>,且陣列的通用功能,如 <code>Array.forEach()</code> 也不相容於 <code>XMLList</code> 物件。</p> -<p>我們也可以使用在 JavaScript 1.6 中所引入的 <a class="internal" href="/zh_tw/Core_JavaScript_1.5_參考/語法/for_each...in" title="zh tw/Core JavaScript 1.5 參考/語法/for each...in">for each...in 語法</a>,他已支援 E4X 的部分︰</p> -<pre class="eval"> for each (var lang in languages.lang) { - alert(lang); - } -</pre> -<p><code>for each...in</code> 也可以用在普通的 JavaScript 物件,迭代出內含在物件中的值(不是鍵)。如同 <a class="internal" href="/zh_tw/Core_JavaScript_1.5_參考/語法/for...in" title="zh tw/Core JavaScript 1.5 參考/語法/for...in">for...in</a>,<a href="/en/Core_JavaScript_1.5_Reference/Statements/for...in#Description" title="en/Core_JavaScript_1.5_Reference/Statements/for...in#Description">非常不建議</a> 和陣列一起使用。</p> -<p>可以使用下面的 XML 字面語法來建立 <code>XMLList</code>,而無須建立格式正確的 XML 文件︰</p> -<pre class="eval"> var xmllist = <> - <lang>JavaScript</lang> - <lang>Python</lang> - </>; -</pre> -<p><code>+=</code> 運算子可用來把新的元素附加到文件中的 <code>XMLList</code>︰</p> -<pre class="eval"> languages.lang += <lang>Ruby</lang>; -</pre> -<p>注意,有別於由普通的 DOM 方法所返回的結點列表,<code>XMLList</code> 只是靜態的,而且不會自動更新以反映在 DOM 中的改變。如果你在既有的 <code>XML</code> 物件底下建立 <code>XMLList</code> 作為子集,<code>XMLList</code> 並不會反映 XML 物件的改變;你需要重新建立 XMLList 以取得最近的更新︰</p> -<pre class="eval"> var languages = <languages> - <lang>JavaScript</lang> - <lang>Python</lang> - </languages>; - - var lang = languages.lang; - alert(lang.length()); // 警報 2 - - languages.lang += <lang>Ruby</lang>; - alert(lang.length()); // 仍舊警報 2 - - lang = languages.lang; // 重新建立 XMLList - alert(lang.length()); // 警報 3 -</pre> -<h3 id="搜尋和過濾" name="搜尋和過濾">搜尋和過濾</h3> -<p>E4X 提供特殊的運算子用來在通過指定條件的文件內部選取結點。這種過濾動作是由括弧裡面的表達式所指定的︰</p> -<pre>var html = <html> - <p id="p1">First paragraph</p> - <p id="p2">Second paragraph</p> -</html>; - -alert(html.p.(@id == "p1")); // 警報 "First paragraph" -</pre> -<p>在表達式前面比對路徑的結點(在本例中即 p 元素)會在表達式求值之前先加上作用域的限縮。就如同已經用 <a class="internal" href="/zh_tw/Core_JavaScript_1.5_參考/語法/with" title="zh tw/Core JavaScript 1.5 參考/語法/with">with 語法</a> 指定了一樣。</p> -<p>因此,過濾器也可以依據在目前元素中內含的單一結點的值來執行︰</p> -<pre>var people = <people> - <person> - <name>Bob</name> - <age>32</age> - </person> - <person> - <name>Joe</name> - <age>46</age> - </person> -</people>; - -alert(people.person.(name == "Joe").age); // 警報 46 -</pre> -<p>也可以使用 JavaScript 函數當作過濾器的表達式︰</p> -<pre>function over40(i) { - return i > 40; -} - -alert(people.person.(over40(parseInt(age))).name); // 警報 Joe -</pre> -<h3 id="命名空間的處理" name="命名空間的處理">命名空間的處理</h3> -<p>E4X 也全面考慮到命名空間。任何代表結點或屬性的 XML 物件都提供了可返回 <code>QName</code> 物件的 <code>name()</code> 方法,使加上命名空間的元素的查詢更為容易。</p> -<h4 id="預設" name="預設">預設</h4> -<pre>default xml namespace = "http://www.w3.org/1999/xhtml"; -// 目前還沒有必要在 HTML 標記裡指定命名空間 -var xhtml = <html><head><title></title></head><body> - <p>text</p></body></html>; -alert(xhtml.head); // 目前還沒有必要在此處的子元素中指定命名空間</pre> -<h4 id="非預設" name="非預設">非預設</h4> -<pre>var xhtml = <html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Embedded SVG demo</title> - </head> - <body> - <h1>Embedded SVG demo</h1> - <svg xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 100 100"> - <circle cx="50" - cy="50" - r="20" - stroke="orange" - stroke-width="2px" - fill="yellow" /> - </svg> - </body> -</html>; - -alert(xhtml.name().localName); // 警報 "html" -alert(xhtml.name().uri); // 警報 "http://www.w3.org/1999/xhtml" -</pre> -<p>若要存取非預設命名空間內部的元素,首先建立 <code>Namespace</code> 物件把特定的命名空間的 URI 加以封裝︰</p> -<pre>var svgns = new Namespace('http://www.w3.org/2000/svg'); -</pre> -<p>目前可以在 E4X 中使用 <code>namespace::localName</code> 代替一般的元素指定子來作查詢︰</p> -<pre>var svg = xhtml..svgns::svg; -alert(svg); // 顯示文件中的 <svg> 部分 -</pre> -<h2 id="參閱" name="參閱">參閱</h2> -<ul> - <li><a class="internal" href="/zh_tw/E4X" title="zh tw/E4X">E4X</a></li> - <li><a class="internal" href="/zh_tw/E4X_教學" title="zh tw/E4X 教學">E4X 教學</a></li> -</ul> -<p>{{ languages( { "en": "en/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X", "zh-cn": "cn/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X", "fr": "fr/Guide_JavaScript_1.5/Traitement_de_XML_avec_E4X", "ja": "ja/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X" } ) }}</p> diff --git a/files/zh-tw/archive/web/index.html b/files/zh-tw/archive/web/index.html deleted file mode 100644 index 6f60d315ff..0000000000 --- a/files/zh-tw/archive/web/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Archived open Web documentation -slug: Archive/Web -tags: - - Archived - - NeedsTranslation - - TopicStub - - Web -translation_of: Archive/Web ---- -<p>The documentation listed below is archived, obsolete material about open Web topics.</p> -<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/web_standards/index.html b/files/zh-tw/archive/web_standards/index.html deleted file mode 100644 index 1fed929d5f..0000000000 --- a/files/zh-tw/archive/web_standards/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Web Standards -slug: Archive/Web_Standards -translation_of: Archive/Web_Standards ---- -<div><strong>In progress. Web standards</strong> are carefully designed to deliver the greatest benefits to the greatest number of web users while ensuring the long-term viability of any document published on the Web. Designing and building with these standards simplifies and lowers the cost of production, while delivering sites that are accessible to more people and more types of Internet devices. Sites developed along these lines will continue to function correctly as traditional desktop browsers evolve, and as new Internet devices come to market. {{ Ref(1) }}</div> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h4 id="Documentation" name="Documentation"><a href="https://developer.mozilla.org/en-US/docs/tag/Web%20Standards" title="https://developer.mozilla.org/en-US/docs/tag/Web%20Standards">Documentation</a></h4> - - <dl> - <dt><a href="/en/Migrate_apps_from_Internet_Explorer_to_Mozilla" title="en/Migrate_apps_from_Internet_Explorer_to_Mozilla">Migrate apps from Internet Explorer to Mozilla</a></dt> - <dd><small>Ever have trouble getting your Internet Explorer-specific Web applications to work with Mozilla? This article covers common issues associated with migrating applications to the open source Mozilla-based browser.</small></dd> - <dt><a href="/en/Using_Web_Standards_in_your_Web_Pages" title="en/Using_Web_Standards_in_your_Web_Pages">Using Web Standards in your Web Pages</a></dt> - <dd><small>This article provides an overview of the process for upgrading the content of your web pages to conform to the W3C web standards.</small></dd> - <dt><a href="/en/Choosing_Standards_Compliance_Over_Proprietary_Practices" title="en/Choosing_Standards_Compliance_Over_Proprietary_Practices">Choosing Standards Compliance Over Proprietary Practices</a></dt> - <dd><small>In the development world, there is a need for standards because applications are designed across multiple development groups.</small></dd> - <dt><a href="/en/The_Business_Benefits_of_Web_Standards" title="en/The_Business_Benefits_of_Web_Standards">The Business Benefits of Web Standards</a></dt> - <dd><small>This article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals.</small></dd> - </dl> - - <p><span class="alllinks"><a href="/Special:Tags?tag=Web_Standards&language=en" title="Special:Tags?tag=Web_Standards&language=en">View All...</a></span></p> - </td> - <td> - <h4 id="Community" name="Community">Community</h4> - - <ul> - <li>View Mozilla forums...</li> - </ul> - - <p>{{ DiscussionList("dev-web-development", "mozilla.dev.web-development") }}</p> - - <ul> - <li><a class="external" href="http://webstandards.org/">The Web Standards Project</a></li> - <li><a class="external" href="http://webdevfeedhouse.com/">WebDev FeedHouse</a></li> - <li><a href="/en/Web_Standards/Community" title="en/Web_Standards/Community">Other community links...</a></li> - </ul> - - <h4 id="Tools" name="Tools">Tools</h4> - - <ul> - <li><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug extension</a></li> - <li><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer extension</a></li> - <li><a class="external" href="http://validator.w3.org/">Markup validation service (W3C)</a></li> - <li><a class="external" href="http://jigsaw.w3.org/css-validator/">CSS validation service (W3C)</a></li> - </ul> - - <p><span class="alllinks"><a href="/Special:Tags?tag=Web_Standards:Tools&language=en" title="Special:Tags?tag=Web_Standards:Tools&language=en">View All...</a></span></p> - - <h4 id="Examples" name="Examples">Examples</h4> - - <ul> - <li><a class="external" href="http://www.mozilla.org/start/1.0/demos.html">Mozilla 1.0 Demos</a> - showing off what can be done with Web standards.</li> - <li><a class="external" href="http://www.mozilla.org/newlayout/demo/">Gecko Demos</a></li> - <li><a class="external" href="http://www.csszengarden.com/">css Zen Garden</a></li> - <li><a class="external" href="http://www.meyerweb.com/eric/css/edge/">Eric Meyers's css/edge</a></li> - <li><a class="external" href="http://dmoz.org/Computers/Programming/Languages/JavaScript/W3C_DOM/Demos/">W3C DOM Demos</a></li> - </ul> - - <h4 id="Related_Topics" name="Related_Topics">Related Topics</h4> - - <dl> - <dd><a href="/en/CSS" title="en/CSS">CSS</a>, <a href="/en/DHTML" title="en/DHTML">DHTML</a>, <a href="/en/HTML" title="en/HTML">HTML</a>, <a href="/en/Web_Development" title="en/Web_Development">Web Development</a>, <a href="/en/XHTML" title="en/XHTML">XHTML</a>, <a href="/en/XML" title="en/XML">XML</a></dd> - </dl> - </td> - </tr> - </tbody> -</table> - -<hr> -<p><small>{{ endnote(1) }} - <a class="external" href="http://webstandards.org/">The Web Standards Project</a></small></p> - -<p>{{ languages( { "ca": "ca/Est\u00e0ndards_web", "de": "de/Web-Standards", "es": "es/Est\u00e1ndares_Web", "fr": "fr/Standards_du_Web", "ja": "ja/Web_Standards", "ko": "ko/Web_Standards", "pl": "pl/Standardy_WWW", "pt": "pt/Normas_Web" } ) }}</p> diff --git a/files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html b/files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html deleted file mode 100644 index c9d003f911..0000000000 --- a/files/zh-tw/archive/web_standards/rdf_in_fifty_words_or_less/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: 50 字解說 RDF -slug: Archive/Web_Standards/RDF_in_Fifty_Words_or_Less -translation_of: Archive/Web_Standards/RDF_in_Fifty_Words_or_Less ---- -<p> </p> - -<p>好吧,可能比 50 字還要多一點,但重點十分簡單(並且已經幫諸位只想看重點的成功人士標為<strong>粗體</strong>)。<a href="/en/RDF" title="en/RDF">資源描述架構</a>,或稱為「RDF」(Resource Description Framework),其實是指兩件事。</p> - -<blockquote><strong>首先,RDF 是種圖像式模型,用以描述網路上的<em>資源</em>(如網頁內容、電子郵件訊息等),以及這些資源之間的關係。</strong></blockquote> - -<p>不過這到底是什麼意思?對 Mozilla 開發者來說,這代表 RDF 資料模型(就是那個「圖像」)可以用來組織、整合網路上的資源。</p> - -<p>舉「書籤」為例。目前大部分的網頁瀏覽器讓你將書籤歸入資料夾的樹狀結構,每個書籤則指向一個網頁的 <strong>URI</strong>(通用資源定義符,<strong>U</strong>niform <strong>R</strong>esource <strong>I</strong>dentifier)。</p> - -<p>但網頁只是眾多網路資源的其中一項,其他還有如電子郵件內容、新聞群組的訊息(或整個新聞群組)、搜尋引擎的探索結果... 等等。基本上,若說這些其他資源不能存入書籤、與其他書籤擺在一起以資料夾整理,也沒什麼道理。甚至還應該可以建立一個「智慧型」資料夾,點選後就動態找出符合某些條件的內容。</p> - -<p>一個「書籤」尚且應有眾多相關的屬性:您可能想自己定義一些書籤的「分類規則」、依據麥金塔的「hot」、「warm」、「cool」色彩標準上色;又或許,您想標示某個書籤與另一個書籤有關,還可能想將其同時放入多個不同的資料夾。</p> - -<p>RDF 圖像提供絕佳資料模型,可以建立上述的「通用」書籤服務:這種圖像可以指向任意資源、亦能以幾乎任何想得到的方式組織。</p> - -<p>別那麼快下結論,還有...</p> - -<blockquote><strong>第二,RDF 是種串接式的語法。這種語法讓圖像式的資料模型可以透過「代理人」溝通。</strong></blockquote> - -<p>這又是什麼意思?基本上,這代表 RDF 資料模型可以跨越網路來交流,其圖像內容還可以在收到遠端服務的資訊時動態變更。</p> - -<p>我們再回到書籤的例子。就說我有個書籤的「資料夾」,其實指向我的電子郵件收件匣:一旦點選這個資料夾,哇喔,所有昨晚收下來的郵件都列出來了!</p> - -<p>不過這是怎麼辦到的?其實這個「收件資料夾」指向一個網路資源,此資源內含更多的 RDF 來拓展資源版圖。此「網路資源」為一個指向 CGI 的 URI(像是 <code><span class="nowiki">http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox</span></code>),此 CGI 會建立串接 RDF、就像是把一張圖片以 <a href="/en/XML" title="en/XML">XML</a> 方式表達一樣:</p> - -<pre> <rdf:RDF - xmlns:rdf="http://www.w3.org/TR/WD-rdf-syntax#" - xmlns:sm="http://www.mozilla.org/smart-mail/schema#"> - <rdf:Description - about="http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox"> - <sm:message id="4025293"> - <sm:recipient> - Chris Waterson "waterson@netscape.com" - </sm:recipient> - <sm:sender> - Aunt Helga "helga@netcenter.net" - </sm:sender> - <sm:received-by>x-wing.mcom.com</sm:received-by> - <sm:subject>Great recipe for Yam Soup!</sm:subject> - <sm:body> - http://www.mozilla.org/smart-mail/get-body.cgi?id=4025293 - </sm:body> - </sm:message> - <sm:message id="4025294"> - <sm:recipient> - Chris Waterson "waterson@netscape.com" - </sm:recipient> - <sm:sender> - Sarah Waterson "waterson.2@postbox.acs.ohio-state.edu" - </sm:sender> - <sm:received-by>x-wing.mcom.com</sm:received-by> - <sm:subject>We won our ultimate game</sm:subject> - <sm:body> - http://www.mozilla.org/smart-mail/get-body.cgi?id=4025294 - </sm:body> - </sm:message> - </rdf:Description> - </rdf:RDF> -</pre> - -<p>收到上面這堆怪物之後,RDF 引擎會將 RDF 資料放在圖像中的適當位置。負責實際繪出書籤介面的 Tree 控制項此時將收到通知,知道應該繪出 Aunt Helga 關於 Yam Soup 之信件的一些圖示。</p> - -<p>其實,這正是 <a class="external" href="http://www.mozilla.org/mailnews/">SmartMail</a> 運作的原理。</p> - -<p>聯絡: <a class="link-mailto" href="mailto:waterson@netscape.com">Chris Waterson</a> (<a class="link-mailto" href="mailto:waterson@netscape.com" rel="freelink">waterson@netscape.com</a>)</p> - -<div class="originaldocinfo"> -<h2 id="Original_Document_Information" name="Original_Document_Information">原始文件資訊</h2> - -<ul> - <li>作者: <a class="link-mailto" href="mailto:waterson@netscape.com">Chris Waterson</a></li> - <li>最後更新: November 19, 1998</li> - <li>著作權資訊: Copyright (C) <a class="link-mailto" href="mailto:waterson@netscape.com">Chris Waterson</a></li> -</ul> -</div> - -<p><span class="comment">Interwiki Language Links</span></p> - -<p>{{ languages( { "fr": "fr/RDF_en_cinquante_mots", "it": "it/RDF_in_cinquanta_parole_o_meno", "ja": "ja/RDF_in_Fifty_Words_or_Less", "ko": "ko/RDF_in_Fifty_Words_or_Less", "zh-TW": "zh_tw/50_字解說_RDF" } ) }}</p> |