From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../mozilla/add-ons/add-on_debugger/index.html | 78 --- .../mozilla/add-ons/add-on_guidelines/index.html | 117 ---- files/zh-tw/mozilla/add-ons/amo/index.html | 9 - files/zh-tw/mozilla/add-ons/amo/policy/index.html | 21 - .../index.html" | 24 - .../add-ons/firefox_for_android/api/index.html | 30 -- .../mozilla/add-ons/firefox_for_android/index.html | 70 --- files/zh-tw/mozilla/add-ons/sdk/builder/index.html | 13 - files/zh-tw/mozilla/add-ons/sdk/guides/index.html | 115 ---- .../sdk/high-level_apis/context-menu/index.html | 588 --------------------- .../mozilla/add-ons/sdk/high-level_apis/index.html | 10 - files/zh-tw/mozilla/add-ons/sdk/index.html | 82 --- .../mozilla/add-ons/sdk/low-level_apis/index.html | 20 - .../mozilla/add-ons/themes/obsolete/index.html | 10 - .../index.html | 66 --- files/zh-tw/mozilla/chrome_registration/index.html | 348 ------------ files/zh-tw/mozilla/connect/index.html | 126 ----- .../mozilla/creating_mozsearch_plugins/index.html | 56 -- .../mozilla/firefox/developer_edition/index.html | 56 -- .../firefox/developer_edition/reverting/index.html | 25 - .../firefox/multiprocess_firefox/index.html | 80 --- files/zh-tw/mozilla/firefox/privacy/index.html | 9 - .../firefox/privacy/tracking_protection/index.html | 74 --- .../3/firefox_3_css_improvement/index.html | 30 -- .../gecko/chrome/api/browser_api/index.html | 158 ------ files/zh-tw/mozilla/gecko/chrome/api/index.html | 14 - files/zh-tw/mozilla/gecko/chrome/index.html | 15 - files/zh-tw/mozilla/gecko/index.html | 65 --- .../infallible_memory_allocation/index.html | 84 --- .../introduction_to_layout_in_mozilla/index.html | 358 ------------- .../mozilla/javascript_code_modules/index.html | 102 ---- .../javascript_code_modules/promise.jsm/index.html | 144 ----- .../promise.jsm/promise/index.html | 215 -------- files/zh-tw/mozilla/js-ctypes/index.html | 97 ---- files/zh-tw/mozilla/localization/index.html | 25 - .../localizing_with_pontoon/index.html | 135 ----- files/zh-tw/mozilla/mathml_project/index.html | 60 --- .../mozilla/mathml_project/screenshots/index.html | 14 - .../\351\226\213\351\240\255/index.html" | 91 ---- .../performance/about_colon_memory/index.html | 188 ------- files/zh-tw/mozilla/performance/index.html | 130 ----- files/zh-tw/mozilla/preferences/index.html | 48 -- .../preferences/preferences_system/index.html | 40 -- .../preferences_system/new_attributes/index.html | 55 -- files/zh-tw/mozilla/projects/index.html | 14 - .../nss/getting_started_with_nss/index.html | 58 -- files/zh-tw/mozilla/projects/nss/index.html | 180 ------- files/zh-tw/mozilla/projects/rhino/index.html | 27 - .../mozilla/projects/rhino/license/index.html | 47 -- .../mozilla/qa/bug_writing_guidelines/index.html | 246 --------- files/zh-tw/mozilla/qa/index.html | 251 --------- files/zh-tw/mozilla/rust/index.html | 40 -- files/zh-tw/mozilla/tech/index.html | 14 - .../zh-tw/mozilla/tech/xpcom/reference/index.html | 27 - .../tech/xpcom/reference/interface/index.html | 19 - .../interface/nsicontentpolicy/index.html | 491 ----------------- .../autoconfiguration/fileformat/howto/index.html | 199 ------- .../autoconfiguration/fileformat/index.html | 10 - .../thunderbird/autoconfiguration/index.html | 113 ---- .../index.html | 26 - .../index.html | 260 --------- files/zh-tw/mozilla/thunderbird/index.html | 79 --- .../thunderbird/thunderbird_extensions/index.html | 135 ----- .../theme_packaging/index.html | 105 ---- 64 files changed, 6436 deletions(-) delete mode 100644 files/zh-tw/mozilla/add-ons/add-on_debugger/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/amo/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/amo/policy/index.html delete mode 100644 "files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" delete mode 100644 files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/firefox_for_android/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/builder/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/guides/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html delete mode 100644 files/zh-tw/mozilla/add-ons/themes/obsolete/index.html delete mode 100644 files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html delete mode 100644 files/zh-tw/mozilla/chrome_registration/index.html delete mode 100644 files/zh-tw/mozilla/connect/index.html delete mode 100644 files/zh-tw/mozilla/creating_mozsearch_plugins/index.html delete mode 100644 files/zh-tw/mozilla/firefox/developer_edition/index.html delete mode 100644 files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html delete mode 100644 files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html delete mode 100644 files/zh-tw/mozilla/firefox/privacy/index.html delete mode 100644 files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html delete mode 100644 files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html delete mode 100644 files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html delete mode 100644 files/zh-tw/mozilla/gecko/chrome/api/index.html delete mode 100644 files/zh-tw/mozilla/gecko/chrome/index.html delete mode 100644 files/zh-tw/mozilla/gecko/index.html delete mode 100644 files/zh-tw/mozilla/infallible_memory_allocation/index.html delete mode 100644 files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html delete mode 100644 files/zh-tw/mozilla/javascript_code_modules/index.html delete mode 100644 files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html delete mode 100644 files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html delete mode 100644 files/zh-tw/mozilla/js-ctypes/index.html delete mode 100644 files/zh-tw/mozilla/localization/index.html delete mode 100644 files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html delete mode 100644 files/zh-tw/mozilla/mathml_project/index.html delete mode 100644 files/zh-tw/mozilla/mathml_project/screenshots/index.html delete mode 100644 "files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" delete mode 100644 files/zh-tw/mozilla/performance/about_colon_memory/index.html delete mode 100644 files/zh-tw/mozilla/performance/index.html delete mode 100644 files/zh-tw/mozilla/preferences/index.html delete mode 100644 files/zh-tw/mozilla/preferences/preferences_system/index.html delete mode 100644 files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html delete mode 100644 files/zh-tw/mozilla/projects/index.html delete mode 100644 files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html delete mode 100644 files/zh-tw/mozilla/projects/nss/index.html delete mode 100644 files/zh-tw/mozilla/projects/rhino/index.html delete mode 100644 files/zh-tw/mozilla/projects/rhino/license/index.html delete mode 100644 files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html delete mode 100644 files/zh-tw/mozilla/qa/index.html delete mode 100644 files/zh-tw/mozilla/rust/index.html delete mode 100644 files/zh-tw/mozilla/tech/index.html delete mode 100644 files/zh-tw/mozilla/tech/xpcom/reference/index.html delete mode 100644 files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html delete mode 100644 files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html delete mode 100644 files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html (limited to 'files/zh-tw/mozilla') diff --git a/files/zh-tw/mozilla/add-ons/add-on_debugger/index.html b/files/zh-tw/mozilla/add-ons/add-on_debugger/index.html deleted file mode 100644 index 2b3106d6af..0000000000 --- a/files/zh-tw/mozilla/add-ons/add-on_debugger/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: 附加元件除錯工具箱 -slug: Mozilla/Add-ons/Add-on_Debugger -translation_of: 'https://extensionworkshop.com/documentation/develop/debugging/' ---- -

{{AddonSidebar}}

- -

附加元件除錯工具箱提供 Firefox 工具箱中的部分工具,能在附加元件的作用範圍中除錯:

- - - -

需要重新啟動瀏覽器的 XUL overlay 附加元件無法使用附加元件除錯工具箱,這類的元件請使用瀏覽器工具箱

- -

請看這段影片,快速認識附加元件除錯工具箱:

- -

{{EmbedYouTube("KU3Xsck7qy0")}}

- -

啟用附加元件除錯工具箱

- -
-

如欲啟用附加元件除錯工具箱,您必須啟用 Firefox 裡的「啟用瀏覽器 chrome 與附加元件除錯工具箱」及「啟用遠端除錯」兩項設定。您可開啟網頁工具箱裡的設定,而後在「進階設定」一區中啟用上述選項。

-
- -

開啟附加元件除錯工具箱

- -

註:如前所述,附加元件除錯工具是專供不需重新啟動、以 SDK 製作的附加元件使用。若想為其他類型的附加元件除錯,請使用瀏覽器工具箱裡的工具。

- -

Now open the Add-on Manager. Next to the entry for your add-on you will see a button labeled "Debug". Click this button to launch the debugger.

- -

Next you'll see a dialog asking you to accept an incoming connection. Click "OK", and the debugger will start in a separate window. Note that sometimes the debugger window is hidden by the main Firefox window.

- -

{{EmbedYouTube("DvNpUVJcG_E")}}

- -

使用附加元件除錯工具

- -

The Add-on Debugger looks and behaves very much like the Browser Toolbox, except that while the scope of the Browser Toolbox is the whole browser, the Add-on Debugger is focused on the specific add-on for which you launched it. Like the Browser Toolbox, a toolbar along the top lets you switch between a number of different tools. In Firefox 31 there's only one such tool, the JavaScript Debugger, but with Firefox 32 you also get the Console and Scratchpad.

- -

JavaScript 除錯器

- -

This behaves just like the normal JavaScript Debugger, except its scope is the add-on rather than a web page. On the left-hand side it lists JavaScript sources:

- - - -

Content scripts

- -

Content scripts are only listed if and when they are loaded. So, if your Add-on loads a content script with contentScriptFile, the file will not appear in the debugger sources until you go to a page that loads the content script.

- -

If you set a breakpoint in a content script, it will not be active for instances of the content script which are loaded after the breakpoint is set.

- -

For example, suppose you have an add-on that attaches a content script to every tab the user loads. The content script adds a click handler to the page. As soon as you open a tab, this content script will be listed in the debugger. If you then set a breakpoint in the content script's click handler, then execution will pause whenever you click the page. But if you open a new tab, there are now two instances of the content script, and the breakpoint will not be enabled for the second instance You'll need to set a new breakpoint now if you want to it work for the second instance.

- -

We're investigating improvements to this in bug 1016046.

- -

主控台

- -

The Console behaves just like the Web Console, but its scope is the add-on rather than the web page.

- -

However, note that it actually runs in the context of the add-on's bootstrap.js, which may not be what you expect if your add-on uses the SDK: you won't see any objects defined in your add-on's main.js, and you won't see require() either. This issue is being tracked as bug 1005193.

- -

You can execute Console statements in the context of main.js while execution is paused inside main.js.

- -

程式碼速記本

- -

The Scratchpad behaves just like the normal Scratchpad, but its scope is the add-on rather than the web page.

- -

Like the Console, the add-on Scratchpad runs in the context of the add-on's bootstrap.js even if the add-on uses the SDK, and as with the Console you can execute Scratchpad code in the context of main.js while execution is paused inside main.js.

- -

為 chrome: 或 about: 頁面除錯

- -

從 Firefox 37 起,一般的除錯工具已經可以用來為 chrome: 及 about: 兩類頁面除錯,使用方法同一般網頁除錯。

diff --git a/files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html b/files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html deleted file mode 100644 index fe05866a87..0000000000 --- a/files/zh-tw/mozilla/add-ons/add-on_guidelines/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Add-on guidelines -slug: Mozilla/Add-ons/Add-on_guidelines -translation_of: 'https://extensionworkshop.com/documentation/publish/add-on-policies/' ---- -

These add-on guidelines were created to foster an open and diverse add-on developer community while ensuring an excellent user experience. They apply to all add-ons and add-on updates regardless of where they are hosted, and also apply to customizations performed by installers that configure Firefox without using an add-on. Add-ons hosted on AMO are subject to additional policies.

-

Be Transparent

- -

Be Respectful to Users

- -

Be Safe

- -

Be Stable

- -

Exceptions

- -

Other exceptions may apply.

-

Enforcement

-

Add-ons that do not follow these guidelines may qualify for blocklisting, depending on the extent of the violations. Guidelines qualified with the word - - must - are especially important, and violations thereof will most likely result in a blocklisting nomination.

-

The Add-ons Team will do their best to contact the add-on's developers and provide a reasonable time frame for the problems to be corrected before a block is put in place. If an add-on is considered malicious or its developers have proven unreachable or unresponsive, or in case of repeat violations, blocklisting may be immediate.

-

Guideline violations should be reported via Bugzilla, under Tech Evangelism > Add-ons. Questions can be posted in the #addons IRC channel.

-

These guidelines may change in the future. All updates will be announced in the Add-ons Blog.

diff --git a/files/zh-tw/mozilla/add-ons/amo/index.html b/files/zh-tw/mozilla/add-ons/amo/index.html deleted file mode 100644 index 3857ed65ca..0000000000 --- a/files/zh-tw/mozilla/add-ons/amo/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: AMO -slug: Mozilla/Add-ons/AMO -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO ---- -

Content to be added.

diff --git a/files/zh-tw/mozilla/add-ons/amo/policy/index.html b/files/zh-tw/mozilla/add-ons/amo/policy/index.html deleted file mode 100644 index 8ac1738387..0000000000 --- a/files/zh-tw/mozilla/add-ons/amo/policy/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: AMO 政策 -slug: Mozilla/Add-ons/AMO/Policy -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO/Policy ---- -

{{AddonSidebar}}

- -

Mozilla 致力於確保套件的用戶與開發者,都有著良好的體驗。提交套件以前,請閱讀以下政策。

- -
-
Developer Agreement
-
Effective January 5, 2016
Review Process
-
Add-ons extend the core capabilities of Firefox, allowing users to modify and personalize their Web experience. A healthy add-on ecosystem, built on trust, is vital for developers to be successful and users to feel safe making Firefox their own. For these reasons, Mozilla requires all add-ons to comply with the following set of policies on acceptable practices. The below is not intended to serve as legal advice, nor is it intended to serve as a comprehensive list of terms to include in your add-on’s privacy policy.
Featured Add-ons
-
How up-and-coming add-ons become featured and what's involved in the process.
聯絡我們 - -

如何就這些套件的政策,與我們取得聯繫

- -
diff --git "a/files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" "b/files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" deleted file mode 100644 index 7358e5f642..0000000000 --- "a/files/zh-tw/mozilla/add-ons/amo/policy/\350\201\257\347\265\241\350\263\207\350\250\212/index.html" +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: 附加元件聯絡資訊 -slug: Mozilla/Add-ons/AMO/Policy/聯絡資訊 -translation_of: Mozilla/Add-ons#Contact_us ---- -

誠摯的感謝您連絡 Mozilla 附加元件團隊,淺請先閱讀本頁說明以確保您的訊息被正確的遞送。

- -

附加元件支援服務

- -

若你需要特定附加元件的支援訊息,比如說 "我該如何使用這個附加元件?" 或 "它怎麼不能...?",請透過列於附加元建列表中的聯絡方式,聯絡該附加元件的開發者。

- -

附加元件編輯者審閱

- -

若你有任何關於某個附加元件的編輯者審閱(Editor's review)的疑問,或想回報政策違反,請 E-mail 至 amo-editors@mozilla.orgAlmost all add-on reports fall under this category. Please be sure to include a link to the add-on in question and a detailed description of your question or comment.

- -

Add-on Security Vulnerabilities

- -

If you have discovered a security vulnerability in an add-on, even if it is not hosted here, Mozilla is very interested in your discovery and will work with the add-on developer to correct the issue as soon as possible. Add-on security issues can be reported confidentially in Bugzilla or by emailing amo-admins@mozilla.org.

- -

Website Functionality & Development

- -

If you've found a problem with the site, we'd love to fix it. Please file a bug report in Bugzilla, including the location of the problem and how you encountered it.

- -

How to get in touch with us regarding these policies or your add-on.

diff --git a/files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html b/files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html deleted file mode 100644 index a8e6ebf9e0..0000000000 --- a/files/zh-tw/mozilla/add-ons/firefox_for_android/api/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: API -slug: Mozilla/Add-ons/Firefox_for_Android/API -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Legacy_Firefox_for_Android/API ---- -

There are a couple of differences between desktop Firefox and Firefox for Android that are particularly relevant to add-on developers:

- - - -

Instead, Firefox for Android provides its own APIs:

- - - -

In these pages we've documented the main functions and properties exposed by these objects. To see all the details, refer to the code at browser.js.

diff --git a/files/zh-tw/mozilla/add-ons/firefox_for_android/index.html b/files/zh-tw/mozilla/add-ons/firefox_for_android/index.html deleted file mode 100644 index 8ade48ff37..0000000000 --- a/files/zh-tw/mozilla/add-ons/firefox_for_android/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Extensions for Firefox for Android -slug: Mozilla/Add-ons/Firefox_for_Android -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Legacy_Firefox_for_Android ---- -

Firefox for Android supports add-ons using the same extension system used by all other Gecko-based applications. You can use the Add-on SDK or build manually bootstrapped restartless add-ons. You can even develop traditional restart-required add-ons, although the other two approaches are preferable.

- -

Add-ons that work with desktop Firefox do not automatically work in Firefox for Android:

- - - -

The following articles provide help with developing extensions for Firefox on Android. In addition, please refer to the general extension documentation that applies to all Mozilla applications.

- -
-
-

Tutorials

- -
-
Walkthrough
-
Developing, packaging and installing a simple add-on for Firefox for Android.
-
Firefox Hub Walkthrough
-
How to develop a Firefox Hub add-on to add content to the Firefox for Android home page.
-
Add-on SDK
-
How to develop Firefox for Android add-ons using the Add-on SDK.
-
- -

Sample code

- -
-
Code Snippets
-
Code samples for common tasks.
-
Initialization and Cleanup
-
How to initialize your add-on when it is started and clean up when it is shut down.
-
Firefox for Android Add-ons Github Repo
-
A collection of JS modules, sample code, and boilerplate repos to help you build add-ons for Firefox for Android.
-
-
- -
-

API reference

- -
-
NativeWindow
-
Create native Android UI widgets.
-
BrowserApp
-
Access browser tabs and the web content they host.
-
Prompt.jsm
-
Show native Android dialogs.
-
HelperApps.jsm
-
Query and launch native apps installed on the system.
-
Notifications.jsm
-
Use extended properties for Android system notifications.
-
Home.jsm
-
Customize the home page.
-
HomeProvider.jsm
-
Store data to display on the home page.
-
 
-
-
-
- -

 

diff --git a/files/zh-tw/mozilla/add-ons/sdk/builder/index.html b/files/zh-tw/mozilla/add-ons/sdk/builder/index.html deleted file mode 100644 index f7dc93a009..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/builder/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Builder -slug: Mozilla/Add-ons/SDK/Builder -translation_of: Archive/Add-ons/Add-on_SDK/Builder ---- -

Add-on Builder 是 Web-based 的開發環境,讓開發者能以 SDK API 來開發附加元件,而不必使用 cfx 命令列工具。Add-on Builder 已經於 2014 年 4 月 1 日下架,而原本的網址「builder.addons.mozilla.org」則轉至此頁。
-
- 若您過去使用 Builder 來開發採用 SDK 的附加元件,便已獲得絕大部分以 SDK 直接開發的必備知識。Builder 中的 high-levellow-level API,就跟 SDK 裡的一模一樣。改用 SDK 很簡單:

- diff --git a/files/zh-tw/mozilla/add-ons/sdk/guides/index.html b/files/zh-tw/mozilla/add-ons/sdk/guides/index.html deleted file mode 100644 index f4e37d9e10..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/guides/index.html +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: Guides -slug: Mozilla/Add-ons/SDK/Guides -translation_of: Archive/Add-ons/Add-on_SDK/Guides ---- -

This page lists more theoretical in-depth articles about the SDK.

-
-

Contributor's guide

-
-
-
-
- Getting Started
-
- Learn how to contribute to the SDK: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help.
-
- Modules
-
- Learn about the module system used by the SDK (which is based on the CommonJS specification), how sandboxes and compartments can be used to improve security, and about the built-in SDK module loader, known as Cuddlefish.
-
- Classes and Inheritance
-
- Learn how classes and inheritance can be implemented in JavaScript, using constructors and prototypes, and about the helper functions provided by the SDK to simplify this.
-
-
-
-
-
- Private Properties
-
- Learn how private properties can be implemented in JavaScript using prefixes, closures, and WeakMaps, and how the SDK supports private properties by using namespaces (which are a generalization of WeakMaps).
-
- Content Processes
-
- The SDK was designed to work in an environment where the code to manipulate web content runs in a different process from the main add-on code. This article highlights the main features of that design.
-
-
-
-
-

SDK infrastructure

-
-
-
-
- Module structure of the SDK
-
- The SDK, and add-ons built using it, are of composed from reusable JavaScript modules. This explains what these modules are, how to load modules, and how the SDK's module tree is structured.
-
- SDK API lifecycle
-
- Definition of the lifecycle for the SDK's APIs, including the stability ratings for APIs.
-
-
-
-
-
- Program ID
-
- The Program ID is a unique identifier for your add-on. This guide explains how it's created, what it's used for and how to define your own.
-
- Firefox compatibility
-
- Working out which Firefox releases a given SDK release is compatible with, and dealing with compatibility problems.
-
-
-
-
-

SDK idioms

-
-
-
-
- Working With Events
-
- Write event-driven code using the the SDK's event emitting framework.
-
- Content scripts guide
-
- An overview of content scripts, including: what they are, what they can do, how to load them, how to communicate with them.
-
-
-
-
-
- Two Types of Scripts
-
- This article explains the differences between the APIs available to your main add-on code and those available to content scripts.
-
-
-
-
-

XUL migration

-
-
-
-
- XUL Migration Guide
-
- Techniques to help port a XUL add-on to the SDK.
-
- XUL versus the SDK
-
- A comparison of the strengths and weaknesses of the SDK, compared to traditional XUL-based add-ons.
-
-
-
-
-
- Porting Example
-
- A walkthrough of porting a relatively simple XUL-based add-on to the SDK.
-
-
-
-

 

diff --git a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html b/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html deleted file mode 100644 index 42c5e0ca85..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/context-menu/index.html +++ /dev/null @@ -1,588 +0,0 @@ ---- -title: context-menu -slug: Mozilla/Add-ons/SDK/High-Level_APIs/context-menu -translation_of: Archive/Add-ons/Add-on_SDK/High-Level_APIs/context-menu ---- -
-

Stable

-
-

加入選單項目、子選單、選單分隔線到頁面右鍵選單。

-

用法

-

Instead of manually adding items when particular contexts occur and then removing them when those contexts go away, you bind items to contexts, and the adding and removing is automatically handled for you. Items are bound to contexts in much the same way that event listeners are bound to events. When the user invokes the context menu, all of the items bound to the current context are automatically added to the menu. If no items are bound, none are added. Likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu. You never need to manually remove your items from the menu unless you want them to never appear again.

-

For example, if your add-on needs to add a context menu item whenever the user visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads. Rather, create your item only once and supply a context that matches the target URL.

-

Context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. Menu items for each add-on will be grouped together automatically. If the total number of menu items in the main context menu from all add-ons exceeds a certain number (normally 10 but configurable with the extensions.addon-sdk.context-menu.overflowThreshold preference) all of the menu items will instead appear in an overflow menu to avoid making the context menu too large.

-

Specifying Contexts

-

As its name implies, the context menu should be reserved for the occurrence of specific contexts. Contexts can be related to page content or the page itself, but they should never be external to the page.

-

For example, a good use of the menu would be to show an "Edit Image" item when the user right-clicks an image in the page. A bad use would be to show a submenu that listed all the user's tabs, since tabs aren't related to the page or the node the user clicked to open the menu.

-

The Page Context

-

First of all, you may not need to specify a context at all. When a top-level item does not specify a context, the page context applies. An item that is in a submenu is visible unless you specify a context.

-

The page context occurs when the user invokes the context menu on a non-interactive portion of the page. Try right-clicking a blank spot in this page, or on text. Make sure that no text is selected. The menu that appears should contain the items "Back", "Forward", "Reload", "Stop", and so on. This is the page context.

-

The page context is appropriate when your item acts on the page as a whole. It does not occur when the user invokes the context menu on a link, image, or other non-text node, or while a selection exists.

-

宣告式場景條件(Declarative Contexts)

-

當你藉由設定 context 屬性(該屬性為: 傳給 constructor 的選項物件之屬性)來新增選單項目時,你可以指定一些簡單的宣告式場景條件, 如下:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "My Menu Item",
-  context: cm.URLContext("*.mozilla.org")
-});
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Constructor選單項目出現的條件
PageContext() 當場景為網頁時.
SelectionContext() 當使用者在網頁上選取項目時.
SelectorContext(selector) 當選單在符合下述條件之一的節點上顯示: selector匹配, CSS 選擇器, 或 其祖先節點匹配選擇器. selector可以有多個(以逗點分隔), 例如, "a[href], img".
URLContext(matchPattern) 特定網址的網頁. matchPattern is a match pattern string or an array of match pattern strings. 當 matchPattern 是陣列, 網址符合任何陣列元素之一時. These are the same match pattern strings that you use with the page-mod include property. Read more about patterns.
PredicateContext(predicateFunction)當選單被觸發時,predicateFunction 函數被呼叫,若函數傳回值為真值,則選單項目顯示。這函數傳入一物件,物件有著描述選單觸發場景條件的屬性.
arrayAn array of any of the other types. This context occurs when all contexts in the array occur.
-

選單項目也有 context 屬性,可以用在新增或移除宣告式場景條件,當建構後. 例如:

-
var context = require("sdk/context-menu").SelectorContext("img");
-myMenuItem.context.add(context);
-myMenuItem.context.remove(context);
-

當選單項目被指定了多個場景條件, 選單項目顯示於所有場景條件皆成立時.

-

In Content Scripts

-

宣告式場景條件很容易使用,但功能不強. 舉例來說, 你希望選單項目出現的條件為:「有著至少一張圖片的頁面」, 但宣告式場景條件並不能達成這一點.

-

當你需要對選單項目的出現時機有著更多的控制, 你可以使用 content scripts. 如同 SDK 的其他 APIs 一樣, context-menu API 使用 content scripts 以讓你的附加元件與瀏覽器中的頁面互動. 在最上層選單的每一個選單項目可以使用 content script.

-

每當選單即將顯示時,一個特殊事件,其名為 "context" ,觸發於你的 content scripts. 如果你為這個事件註冊了偵聽(listener)函數,當函數傳回真值時, 與偵聽函數關聯的選單項目會被顯示於選單中.

-

下例中, 當選單觸發於「有著至少一張圖片的頁面」時,顯示選單項目.

-
require("sdk/context-menu").Item({
-  label: "This Page Has Images",
-  contentScript: 'self.on("context", function (node) {' +
-                 '  return !!document.querySelector("img");' +
-                 '});'
-});
-

需要注意的是偵聽函數有一個參數叫 node. 這個 node 指的是使用者在頁面上按右鍵來觸發選單的頁面觸發節點. 你可以使用它來決定是否要顯示選單項目.

-

你可以在 content script 中,同時指定宣告式場景條件和 context 偵聽函數. 在這種情況下, 先評估宣告式場景條件, 然後你的選單項目顯示條件為:所有宣告式場景條件成立,並且你的 context 偵聽函數傳回真值.

-

如果任一宣告式場景條件未成立, 那麼你的 context 偵聽函數不會被呼叫. 下面的例子利用了這點. 確保了偵聽函數只在 image node 上觸發選單時,才會被呼叫:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "A Mozilla Image",
-  context: cm.SelectorContext("img"),
-  contentScript: 'self.on("context", function (node) {' +
-                 '  return /mozilla/.test(node.src);' +
-                 '});'
-});
-

However, if you do combine SelectorContext and the "context" event, be aware that the node argument passed to the "context" event will not always match the type specified in SelectorContext.

-

SelectorContext will match if the menu is invoked on the node specified or any descendant of that node, but the "context" event handler is passed the actual node on which the menu was invoked. 上個例子有作用,是因為 <IMG> 元素內不能包含其他元素, 但底下的例子裡, node.nodeName 不能保證是 "P" - 例如說, 當使用者在一個段落(<P>)的連結(<A>)上點右鍵時,它不會是 "P" :

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "A Paragraph",
-  context: cm.SelectorContext("p"),
-  contentScript: 'self.on("context", function (node) {' +
-                 '  console.log(node.nodeName);' +
-                 '  return true;' +
-                 '});'
-});
-

The content script is executed for every page that a context menu is shown for. It will be executed the first time it is needed (i.e. 當右鍵選單第一次顯示,並且選單項目的所有宣告式場景條件皆成立時) ,接著處於作用中,直到你銷毀你的選單項目或者關閉頁面.

-

處理選單項目上的點擊

-

content script 除了上述所說的功能(用來偵聽 "context" 事件)以外,你可以使用 content script 來處理選單項目上的點擊. 當使用者點擊選單項目時,一個名為 "click" 的事件在選單項目的 content script 內被觸發.

-

因此, 欲處理選單項目上的點擊, 可以藉由偵聽選單項目 content script 內的 "click" 事件, 如下:

-
require("sdk/context-menu").Item({
-  label: "My Item",
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  console.log("Item clicked!");' +
-                 '});'
-});
-

注意:偵聽函數有兩參數 nodedata.

-

"node" 參數

-

node 是使用者右鍵點擊所觸發選單的節點.

- -

例如, 假設你的附加元件看起來像這樣:

-
var script = "self.on('click', function (node, data) {" +
-             "  console.log('clicked: ' + node.nodeName);" +
-             "});";
-
-var cm = require("sdk/context-menu");
-
-cm.Item({
-  label: "body context",
-  context: cm.SelectorContext("body"),
-  contentScript: script
-});
-

這個附加元件建立了一個右鍵選單項目,該項目使用 SelectorContext 來顯示項目,顯示時機為:右鍵選單觸發於 <BODY> 元素的任何後代元素之上時. 點擊時, 項目記錄了 nodeName 屬性(觸發選單的節點名稱)傳給點擊事件處理器.

-

如果你執行這個附加元件,你將看到它總是記錄 "BODY", 即使你點擊的是頁面上的段落元素<P>:

-
info: contextmenu-example: clicked: BODY
-

與上面對比, 底下的附加元件使用了 PageContext:

-
var script = "self.on('click', function (node, data) {" +
-             "  console.log('clicked: ' + node.nodeName);" +
-             "});";
-
-var cm = require("sdk/context-menu");
-
-cm.Item({
-  label: "body context",
-  context: cm.PageContext(),
-  contentScript: script
-});
-

它將記錄實際點擊的節點名稱:

-
info: contextmenu-example: clicked: P
-

"data" 參數

-

data 是使用者所點擊選單項目的 data屬性. 注意: 當你有一個多層的選單(項目)時,點擊事件會被傳給被點擊的項目的所有祖先(項目),所以一定要驗證 data 值傳給你所期待的項目. 你可以使用 "data" 參數來簡化點擊事件處理 by providing just a single click listener on a Menu that reacts to clicks for any child items.:

-
var cm = require("sdk/context-menu");
-cm.Menu({
-  label: "My Menu",
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  console.log("You clicked " + data);' +
-                 '});',
-  items: [
-    cm.Item({ label: "Item 1", data: "item1" }),
-    cm.Item({ label: "Item 2", data: "item2" }),
-    cm.Item({ label: "Item 3", data: "item3" })
-  ]
-});
-
-

和附加元件通訊

-

時常,你需要收集一些訊息,在點擊偵聽函數內和執行一個無關於頁面動作. 為了與關聯於 content script 的選單項目通訊, content script 可以呼叫附屬於全域 self 物件的 postMessage 函數, 傳給它一些 JSON-able 資料. 選單項目的 "message" 事件偵聽函數將被呼叫(前述的 JSON-able 資料作為參數傳入).

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Image",
-  context: cm.SelectorContext("img"),
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(node.src);' +
-                 '});',
-  onMessage: function (imgSrc) {
-    openImageEditor(imgSrc);
-  }
-});
-

更新選單項目的文字標籤

-

Each menu item must be created with a label, but you can change its label later using a couple of methods.

-

最簡單的方法是設定選單項目的 label 屬性. 下面的例子更新選單項目的文字標籤為它被點擊的次數:

-
var numClicks = 0;
-var myItem = require("sdk/context-menu").Item({
-  label: "Click Me: " + numClicks,
-  contentScript: 'self.on("click", self.postMessage);',
-  onMessage: function () {
-    numClicks++;
-    this.label = "Click Me: " + numClicks;
-    // Setting myItem.label is equivalent.
-  }
-});
-

Sometimes you might want to update the label based on the context. For instance, if your item performs a search with the user's selected text, it would be nice to display the text in the item to provide feedback to the user. 在這些情況下,你可以使用第二種方法 . 回想一下,你的 content scripts 可以偵聽 "context" 事件,如果你的偵聽函數傳回真值, 與 content scripts 關聯的選單項目會顯示在選單中. 除了傳回真值, 你的 "context" 偵聽函數也可以傳回字串. 當 "context" 偵聽函數傳回字串, 字串成為選單項目的新文字標籤.

-

This item implements the aforementioned search example:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Search Google",
-  context: cm.SelectionContext(),
-  contentScript: 'self.on("context", function () {' +
-                 '  var text = window.getSelection().toString();' +
-                 '  if (text.length > 20)' +             // 若太長
-                 '    text = text.substr(0, 20) + "...";' + // 則截短
-                 '  return "Search Google for " + text;' +  // 後綴到固定字串上傳回
-                 '});'
-});
-

"context" 偵聽函數取得使用者所選取的文字, 如果字串太長則截短它, 並後綴到固定字串上傳回. 當選單項目顯示, 它的文字標籤將是 "Search Google for text", 此處的 text 是被截短的 使用者所選取的文字.

-

隱私視窗

-

If your add-on has not opted into private browsing, then any menus or menu items that you add will not appear in context menus belonging to private browser windows.

-

To learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module.

-

更多例子

-

For conciseness, these examples create their content scripts as strings and use the contentScript property. In your own add-on, you will probably want to create your content scripts in separate files and pass their URLs using the contentScriptFile property. See Working with Content Scripts for more information.

-
-

Unless your content script is extremely simple and consists only of a static string, don't use contentScript: if you do, you may have problems getting your add-on approved on AMO.

-

Instead, keep the script in a separate file and load it using contentScriptFile. This makes your code easier to maintain, secure, debug and review.

-
-

Show an "Edit Page Source" item when the user right-clicks a non-interactive part of the page:

-
require("sdk/context-menu").Item({
-  label: "Edit Page Source",
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(document.URL);' +
-                 '});',
-  onMessage: function (pageURL) {
-    editSource(pageURL);
-  }
-});
-

Show an "Edit Image" item when the menu is invoked on an image:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Image",
-  context: cm.SelectorContext("img"),
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(node.src);' +
-                 '});',
-  onMessage: function (imgSrc) {
-    openImageEditor(imgSrc);
-  }
-});
-

Show an "Edit Mozilla Image" item when the menu is invoked on an image in a mozilla.org or mozilla.com page:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Mozilla Image",
-  context: [
-    cm.URLContext(["*.mozilla.org", "*.mozilla.com"]),
-    cm.SelectorContext("img")
-  ],
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  self.postMessage(node.src);' +
-                 '});',
-  onMessage: function (imgSrc) {
-    openImageEditor(imgSrc);
-  }
-});
-

Show an "Edit Page Images" item when the page contains at least one image:

-
var cm = require("sdk/context-menu");
-cm.Item({
-  label: "Edit Page Images",
-  // This ensures the item only appears during the page context.
-  context: cm.PageContext(),
-  contentScript: 'self.on("context", function (node) {' +
-                 '  var pageHasImgs = !!document.querySelector("img");' +
-                 '  return pageHasImgs;' +
-                 '});' +
-                 'self.on("click", function (node, data) {' +
-                 '  var imgs = document.querySelectorAll("img");' +
-                 '  var imgSrcs = [];' +
-                 '  for (var i = 0 ; i < imgs.length; i++)' +
-                 '    imgSrcs.push(imgs[i].src);' +
-                 '  self.postMessage(imgSrcs);' +
-                 '});',
-  onMessage: function (imgSrcs) {
-    openImageEditor(imgSrcs);
-  }
-});
-

Show a "Search With" menu when the user right-clicks an anchor that searches Google or Wikipedia with the text contained in the anchor:

-
var cm = require("sdk/context-menu");
-var googleItem = cm.Item({
-  label: "Google",
-  data: "http://www.google.com/search?q="
-});
-var wikipediaItem = cm.Item({
-  label: "Wikipedia",
-  data: "http://en.wikipedia.org/wiki/Special:Search?search="
-});
-var searchMenu = cm.Menu({
-  label: "Search With",
-  context: cm.SelectorContext("a[href]"),
-  contentScript: 'self.on("click", function (node, data) {' +
-                 '  var searchURL = data + node.textContent;' +
-                 '  window.location.href = searchURL;' +
-                 '});',
-  items: [googleItem, wikipediaItem]
-});
-

Globals

-

Constructors

-

Item(options)

-

建立一個有文字標籤的選單項目,當點擊它時,可以執行一些動作.

-
參數
-

options : 物件
- options 物件的必要屬性:

- - - - - - - - - - - - - - - -
名稱型別 
label字串 -

選單項目的文字標籤. It must either be a string or an object that implements toString().

-
-

options 物件的可選屬性:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名稱型別 
image字串 -

選單項目的圖示, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI.

-
data字串 -

An optional arbitrary value to associate with the item. It must be either a string or an object that implements toString(). It will be passed to click listeners.

-
accessKey只有單一字元的字串 -
-

New in Firefox 35.

-
-

選單項目的快捷鍵. Pressing this key selects the item when the context menu is open.

-
contextvalue -

If the item is contained in the top-level context menu, this declaratively specifies the context under which the item will appear; see Specifying Contexts above.

-
contentScript字串, 陣列 -

If the item is contained in the top-level context menu, this is the content script or an array of content scripts that the item can use to interact with the page.

-
contentScriptFile字串, 陣列 -

If the item is contained in the top-level context menu, this is the local file URL of the content script or an array of such URLs that the item can use to interact with the page.

-
onMessage函數 -

If the item is contained in the top-level context menu, this function will be called when the content script calls self.postMessage. It will be passed the data that was passed to postMessage.

-
- -

建立一個有文字標籤的選單項目,用以展開子選單.

-
參數
-

options : 物件
- options 物件的必要屬性:

- - - - - - - - - - - - - - - - - - - - -
名稱型別 
label字串 -

選單項目的文字標籤. It must either be a string or an object that implements toString().

-
items陣列 -

選單項目構成的陣列,這些選單項目會被子選單所包含. 陣列中的元素須為 Item, Menu, 或 Separator.

-
-

options 物件的可選屬性:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
名稱型別 
image字串 -

The menu's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI.

-
contextvalue -

If the menu is contained in the top-level context menu, this declaratively specifies the context under which the menu will appear; see Specifying Contexts above.

-
contentScript字串, 陣列 -

If the menu is contained in the top-level context menu, this is the content script or an array of content scripts that the menu can use to interact with the page.

-
contentScriptFile字串, 陣列 -

If the menu is contained in the top-level context menu, this is the local file URL of the content script or an array of such URLs that the menu can use to interact with the page.

-
onMessage函數 -

If the menu is contained in the top-level context menu, this function will be called when the content script calls self.postMessage. It will be passed the data that was passed to postMessage.

-
-

Separator()

-

Creates a menu separator.

-

PageContext()

-

Creates a page context. See Specifying Contexts above.

-

SelectionContext()

-

Creates a context that occurs when a page contains a selection. See Specifying Contexts above.

-

SelectorContext(selector)

-

Creates a context that matches a given CSS selector. See Specifying Contexts above.

-
Parameters
-

selector : string
- A CSS selector.

-

URLContext(matchPattern)

-

Creates a context that matches pages with particular URLs. See Specifying Contexts above.

-
Parameters
-

matchPattern : string,array
- A match pattern string, regexp or an array of match pattern strings or regexps.

-

PredicateContext(predicateFunction)

-
-

New in Firefox 29

-
-

Creates a context that occurs when predicateFunction returns a true value. See Specifying Contexts above.

-
Parameters
-

predicateFunction : function(context)
- A function which will be called with an object argument that provide information about the invocation context. context object properties:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyDescription
documentTypeThe MIME type of the document the menu was invoked in. E.g. text/html for HTML pages, application/xhtml+xml for XHTML, or image/jpeg if viewing an image directly.
documentURLThe URL of the document the menu was invoked in.
targetNameThe name of the DOM element that the menu was invoked on, in lower-case.
targetIDThe id attribute of the element that the menu was invoked on, or null if not set.
isEditabletrue if the menu was invoked in an editable element, and that element isn't disabled or read-only.  This includes non-input elements with the contenteditable attribute set to true.
selectionTextThe current selection as a text string, or null. If the menu was invoked in an input text box or area, this is the selection of that element, otherwise the selection in the contents of the window.
srcURLThe src URL of the element that the menu was invoked on, or null if it doesn't have one.
linkURLThe href URL of the element that the menu was invoked on, or null if it doesn't have one.
valueThe current contents of a input text box or area if the menu was invoked in one, null otherwise.
-

Item

-

A labeled menu item that can perform an action when clicked.

-

Methods

-

destroy()

-

Permanently removes the item from its parent menu and frees its resources. The item must not be used afterward. If you need to remove the item from its parent menu but use it afterward, call removeItem() on the parent menu instead.

-

Properties

-

label

-

The menu item's label. You can set this after creating the item to update its label later.

-

image

-

The item's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI. You can set this after creating the item to update its image later. To remove the item's image, set it to null.

-

data

-

An optional arbitrary value to associate with the item. It must be either a string or an object that implements toString(). It will be passed to click listeners. You can set this after creating the item to update its data later.

-

context

-

A list of declarative contexts for which the menu item will appear in the context menu. Contexts can be added by calling context.add() and removed by called context.remove().

-

parentMenu

-

The item's parent Menu, or null if the item is contained in the top-level context menu. This property is read-only. To add the item to a new menu, call that menu's addItem() method.

-

contentScript

-

The content script or the array of content scripts associated with the menu item during creation.

-

contentScriptFile

-

The URL of a content script or the array of such URLs associated with the menu item during creation.

-

Events

-

message

-

If you listen to this event you can receive message events from content scripts associated with this menu item. When a content script posts a message using self.postMessage(), the message is delivered to the add-on code in the menu item's message event.

-
Arguments
-

value : Listeners are passed a single argument which is the message posted from the content script. The message can be any JSON-serializable value.

- -

A labeled menu item that expands into a submenu.

-

Methods

-

addItem(item)

-

Appends a menu item to the end of the menu. If the item is already contained in another menu or in the top-level context menu, it's automatically removed first. If the item is already contained in this menu it will just be moved to the end of the menu.

-
Parameters
-

item : Item,Menu,Separator
- The Item, Menu, or Separator to add to the menu.

-

removeItem(item)

-

Removes the given menu item from the menu. If the menu does not contain the item, this method does nothing.

-
Parameters
-

item : Item,Menu,Separator
- The menu item to remove from the menu.

-

destroy()

-

Permanently removes the menu from its parent menu and frees its resources. The menu must not be used afterward. If you need to remove the menu from its parent menu but use it afterward, call removeItem() on the parent menu instead.

-

Properties

-

label

-

The menu's label. You can set this after creating the menu to update its label later.

-

items

-

An array containing the items in the menu. The array is read-only, meaning that modifications to it will not affect the menu. However, setting this property to a new array will replace all the items currently in the menu with the items in the new array.

-

image

-

The menu's icon, a string URL. The URL can be remote, a reference to an image in the add-on's data directory, or a data URI. You can set this after creating the menu to update its image later. To remove the menu's image, set it to null.

-

context

-

A list of declarative contexts for which the menu will appear in the context menu. Contexts can be added by calling context.add() and removed by called context.remove().

-

parentMenu

-

The menu's parent Menu, or null if the menu is contained in the top-level context menu. This property is read-only. To add the menu to a new menu, call that menu's addItem() method.

-

contentScript

-

The content script or the array of content scripts associated with the menu during creation.

-

contentScriptFile

-

The URL of a content script or the array of such URLs associated with the menu during creation.

-

Events

-

message

-

If you listen to this event you can receive message events from content scripts associated with this menu item. When a content script posts a message using self.postMessage(), the message is delivered to the add-on code in the menu item's message event.

-
Arguments
-

value : Listeners are passed a single argument which is the message posted from the content script. The message can be any JSON-serializable value.

-

Separator

-

A menu separator. Separators can be contained only in Menus, not in the top-level context menu.

-

Methods

-

destroy()

-

Permanently removes the separator from its parent menu and frees its resources. The separator must not be used afterward. If you need to remove the separator from its parent menu but use it afterward, call removeItem() on the parent menu instead.

-

Properties

-

parentMenu

-

The separator's parent Menu. This property is read-only. To add the separator to a new menu, call that menu's addItem() method.

diff --git a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html b/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html deleted file mode 100644 index 32b39d045b..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/high-level_apis/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: High-Level APIs -slug: Mozilla/Add-ons/SDK/High-Level_APIs -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Add-on_SDK/High-Level_APIs ---- -

Modules listed on this page implement high-level APIs for building add-ons: creating user interfaces, interacting with the web, and interacting with the browser.

-

Unless the documentation explicitly says otherwise, all these modules are "Stable": we'll avoid making incompatible changes to them. {{ LandingPageListSubpages ("/en-US/Add-ons/SDK/High-Level_APIs", 5) }}

diff --git a/files/zh-tw/mozilla/add-ons/sdk/index.html b/files/zh-tw/mozilla/add-ons/sdk/index.html deleted file mode 100644 index 2937b883d7..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/index.html +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: Add-on SDK -slug: Mozilla/Add-ons/SDK -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Add-ons/Add-on_SDK ---- -

有了附加元件開發套件(Add-on SDK),您可以使用標準的JavaScript、HTML、CSS等語法來建立Firefox的附加元件。SDK包含用來製作附加元件的JavaScript API,及建立、測試、運行或包裝附加元件的相關工具。

- -
-

入門

- -
-
-
-
從此開始
-
如何安裝 SDK 使用 cfx tool 來建立、測試或包裝附加元件。
-
和瀏覽器互動
-
開啟網頁監測頁面載入以及列出已開啟頁面
-
開發技巧
-
學習常用開發技術,如單元測試紀錄建立可重用模組在地化流動裝置
-
-
- -
-
-
建立使用者介面的元件
-
工具列按鈕內文選單選單項目對話框等等。
-
修改網頁
-
修改符合網址模式的頁面或動態修改特定分頁
-
整合各項
-
以 Annotator(一個顯示註解的附加元件)為例顯示製作流程。
-
-
-
- -
-

指引

- -
- - - -
- -
-

參考資料

- -
-
-
-
高階 API
-
高階 SDK API 的參考文件。
-
工具參考
-
Reference documentation for the cfx tool used to develop, test, and package add-ons, the console global used for logging, and the package.json file.
-
-
- -
-
-
低階 API
-
低階 SDK API 的參考文件。
-
-
-
diff --git a/files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html b/files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html deleted file mode 100644 index 2108d30783..0000000000 --- a/files/zh-tw/mozilla/add-ons/sdk/low-level_apis/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Low-Level APIs -slug: Mozilla/Add-ons/SDK/Low-Level_APIs -translation_of: Archive/Add-ons/Add-on_SDK/Low-Level_APIs ---- -

Modules in this section implement low-level APIs. These modules fall roughly into three categories:

- -

These modules are still in active development, and we expect to make incompatible changes to them in future releases.

-

{{ LandingPageListSubpages ("/en-US/Add-ons/SDK/Low-Level_APIs", 5) }}

-

 

diff --git a/files/zh-tw/mozilla/add-ons/themes/obsolete/index.html b/files/zh-tw/mozilla/add-ons/themes/obsolete/index.html deleted file mode 100644 index d420b6ebf0..0000000000 --- a/files/zh-tw/mozilla/add-ons/themes/obsolete/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Obsolete -slug: Mozilla/Add-ons/Themes/Obsolete -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/Themes/Obsolete ---- -

This page collects theme docs that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs.

-

{{ ListSubPages ("/en-US/Add-ons/Themes/Obsolete", 5) }}

diff --git a/files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html b/files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html deleted file mode 100644 index 14b56484b5..0000000000 --- a/files/zh-tw/mozilla/adding_phishing_protection_data_providers/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: 新增偽造網站清單來源 -slug: Mozilla/Adding_phishing_protection_data_providers -tags: - - 待翻譯 -translation_of: Mozilla/Adding_phishing_protection_data_providers ---- -

詐騙網站偵測技術讓 Firefox 能將當前網頁與黑名單兩相比對,藉此得知此網站是否為詐騙網站,並於確認後提醒使用者。

- -

安裝新資料來源

- -

要安裝詐騙網站清單的資料來源,必須調整一些相關設定,以便提供資料來源的細節。

- -

每個資料來源都有其獨一無二的 ID 號碼,而 ID 號碼為 0 者即是 Firefox 出廠時的預設資料來源。當安裝新的資料來源時,你應該指定另一個未使用的號碼。

- -

要知道哪些號碼能用,必須以迴圈循序取出設定值,例如先是 browser.safebrowsing.provider.0.name、而後為browser.safebrowsing.provider.1.name,以此類推。當取值時無傳回內容,代表這個數字可以用。

- -

你可以從為擴充套件新增偏好設定文章中找到讀寫設定值的相關範例。

- -

必備設定

- -
-
browser.safebrowsing.provider.idnum.name
-
資料來源的名稱,讓使用者方便識別。
-
- -
-
browser.safebrowsing.provider.idnum.keyURL
-
用來為其他要求編碼的私鑰 URL。
-
- -
-
browser.safebrowsing.provider.idnum.lookupURL
-
The URL to use to look up URLs to see if they're blacklisted. This request must be encrypted using the private key returned by the keyURL request.
-
- -

選用設定

- -
-
browser.safebrowsing.provider.idnum.reportURL
-
An URL used for reporting when users visit phishing pages and whether or not they decided to heed the warning or to ignore it.
-
- -
-
browser.safebrowsing.provider.idnum.updateURL
-
An URL used to request an updated list of phishing sites. The server either provides a full list or incremental updates in order to bring the client's tables up to date.
-
- -
-
browser.safebrowsing.provider.idnum.reportGenericURL
-
Not currently used; intended for use in reporting other issues with the phishing protection service.
-
- -
-
browser.safebrowsing.provider.idnum.reportErrorURL
-
An URL to which the user is directed in order to report a safe page that is incorrectly being reported as a phishing site.
-
- -
-
browser.safebrowsing.provider.idnum.reportPhishURL
-
An URL to which the user is directed in order to report a phishing site that isn't detected by the phishing protection system.
-
- -

Determining the currently-selected data provider

- -

If you need to determine the ID number of the currently selected anti-phishing data provider, you can look at the current value of the preference browser.safebrowsing.dataProvider.

diff --git a/files/zh-tw/mozilla/chrome_registration/index.html b/files/zh-tw/mozilla/chrome_registration/index.html deleted file mode 100644 index f2cde3f964..0000000000 --- a/files/zh-tw/mozilla/chrome_registration/index.html +++ /dev/null @@ -1,348 +0,0 @@ ---- -title: Chrome registration -slug: Mozilla/Chrome_Registration -translation_of: Mozilla/Chrome_Registration ---- -

馬桶裡有個 chrome?

- -

Chrome 是一拖拉庫在文件 window 範圍之外 AP 視窗的 UI 元件。 管它 Toolbars 、 menu bars、progress bars 還是 window title bars 基本上都是 chrome 的一部份。

- -
-

Mozilla 會尋找並讀取主題佈景和附加元件根目錄的 chrome.manifest 檔。

-
- -
-

古早的 Gecko 1.9.2 (及更古早版本),Mozilla 是從 AP 讀取chrome/*.manifest 檔。 從 Gecko 2.0 {{ geckoRelease("2.0") }} 開始,就只剩根目錄的 chrome.manifest 還有再用;若要增加更多的內容,就在其中利用 manifest 指令來擴充。

-
- -

Chrome providers

- -

基於某種 window type (例如針對 browser window) 提供 chrome 者稱為 chrome provider。所有的 provider 同心協力針對特定的 window 提供整套的 chrome,從工具列上的圖案到文字或內容描述檔,以及 window 本身的外觀。

- -

以下是三種基本的 chrome provider :

- -
-
Content
-
視窗描述主要是來自於 content provider,格式可以是任何一種 Mozilla 看得懂的類型。通常會是個  XUL file,因為它本來就是專門設計來描述 window 和 dialog 的。用來定義 UI 的 JavaScript 檔也會跟在這包,多數的 XBL binding files 也是。
-
Locale
-
多語系的應用程式會將語系資訊交給 locale providers。醬子譯者就可以翻譯並插進一個另外的 chrome package 而不去更動其它的程式。Java-style properties 檔和 DTD 檔是兩種主要的多語系檔案類型。
-
Skin
-
Skin provider 就負責 chrome 整套外觀的描述檔,通常是 CSS 和圖形。
-
- -
-

註: 從 skin packages 載入的 scripts (包括 XBL 裡的) 並不會執行喔。

-
- -

Chrome 登錄 (chrome registry)

- -

Gecko runtime 會保持一份稱為 chrome registry 的記錄,用來對登錄 chrome package 名稱和實際檔案路徑。

- -

Chrome registry 可以設定並且會保存;且有賴於 xpinstall 和 extension manager,這樣 user 就可以很多套 chrome provider 然後選擇喜歡的語系和外觀。

- -

XULRunner application、主題布景或附加元件要讓 chrome registry 知道有這麼一個 chrome,那就要在自己的根目錄下放一個 純文字格式的 manifest,也就是 `chrome.manifest`。

- -

這個純文字的 manifests 是簡單的逐行格式,會被一行一行地解析。 chrome registry 看懂一行就處理一行,看不懂就跳過;當然,有問題的會 log 在 console 中。

- -
locale packagename localename path/to/files
-skin packagename skinname path/to/files
-
- -

Firefox 2 、 Thunderbird 2 和 SeaMonkey 1.1 無法辨識大小寫夾雜的 packagename 。 要是把範例中的 packagename 改成 CamelCasePackage 就會跑出類似 "No chrome registered for chrome://camelcasepackage/path/to/files" 的訊息。 Firefox 3 、 Thunderbird 3 還有 SeaMonkey 2 已經支援這個功能。Bug resolved 於 Mozilla 1.9; see {{bug(132183)}}.

- -

Manifest 指令

- -

comments

- -

如果一行的開頭是 '#' 那這整行就變成註解。

- -
# this line is a comment - you can put whatever you want here
-
- -

manifest

- -

{{ gecko_minversion_inline("2.0b4") }}

- -
manifest subdirectory/foo.manifest [flags]
-
- -

這行會載入另一份 manifest 檔。這在拆分元件、chrome 登錄項或是各平台相依登錄資料時尤其有用。

- -

binary-component

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
binary-component components/mycomponent.dll [flags]
-
- -

叫 Mozilla 登錄並應用 binary component,由於 binary components 為 ABI-specific,應與 abi flag 並用。 在 Firefox 4 之前 ,components 資料夾裡的檔案會自動被登錄。

- -

interfaces

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
interfaces component/mycomponent.xpt [flags]
-
- -

叫 Mozilla 從經由 XPIDL 產生的 typelib 檔載入 interface 資訊。在 Firefox 4 之前,components 資料夾裡的檔案會自動被登錄。

- -

component

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
component {00000000-0000-0000-0000-000000000000} components/mycomponent.js [flags]
-
- -

告訴 Mozilla 一個由 XPCOM 元件以 JavaScript (或是其它可接受的 scripting language) 實作之元件的 CID。ClassID {0000 ...} 一定要和該元件所實現的 ClassID 相同。可利用程式或線上 UUID 產生器產生唯一的 ClassID。

- -

contract

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
contract @foobar/mycontract;1 {00000000-0000-0000-0000-000000000000} [flags]
-
- -

將特定實作的 contract ID (一個語意化字串) 對應到 ClassID。通常 contract ID 就和它頂頭所列的 component entry 一組。
-  

- -

category

- -

{{ gecko_minversion_inline("2.0b2") }}

- -
category category entry-name value [flags]
-
- -

登錄在 category manager ,至於項目的格式和用意就要看它是哪個 category 了。

- -

content

- -

下面這行登錄一個 content package :

- -
content packagename uri/to/files/ [flags]
-
- -

這會將 package 登錄在一個像 `chrome://packagename/content/..` 的位置,也就是之後它被存取的位置。這個 URI 可以是絕對位置或是相對於 manifest file 的位置,但要注意結尾的 '/' 不可省略。

- -

locale

- -

下面這行登錄一個 locale package :

- -
locale packagename localename uri/to/files/ [flags]
-
- -

這會將 locale package 登錄在解析 `chrome://packagename/locale/..` 所用的位置。 localename 通常直接用語系名稱像是 "zh" 或有時候用 語系-地區 像 "zh-TW"。如果同一 package 有多個語系 chrome registry 會根據使用者偏好中的設定值選擇最接近的語系。

- -

skin

- -

下面這行登錄一個 skin package :

- -
skin packagename skinname uri/to/files/ [flags]
-
- -

這會將 skin package 登錄在 chrome://packagename/skin/.. , skinname is 是用來識別所安裝 skin 的一個非透明化字串。同樣地,若同一 package 登記了多個 skin , chrome registry 會根據使用者偏好中的設定值選擇最合適的。

- -

style

- -

Style overlay (套用在chrome page上的自訂 CSS) 以下列語法登錄:

- -
style chrome://URI-to-style chrome://stylesheet-URI [flags]
-
- -
注意: 只有位於 chrome URI 的 stylesheet 可以這樣用。
- -

override

- -

chrome 登錄 manifest 允許 override 指令以便讓某些 extension 或其它嵌入物件可以改寫 XULRunner 或 AP 預設的 chrome file 設定。

- -
override chrome://package/type/original-uri.whatever new-resolved-URI [flags]
-
- -

注意:override 路徑不會遞迴 (所以將 chrome://foo/content/bar/ override 為 file:///home/john/blah/ 之後,其行為通常不會是預期的那樣)。而且 override 之後路徑是相對於被重寫掉的路徑而不是用來重寫的路徑 (從 CSS 的角度來說,這搞不好是個偏門也搞不好使人抓狂) 。

- -
-

在 Gecko 1.8.1.5 (Firefox 2.0.0.5) 和較早的版本中有個 new-resolved-URI 參數 只能用絕對路徑而不能用相對路徑的 bug。詳見: {{ Bug(323455) }}.

-
- -

resource

- -

{{ Fx_minversion_inline("3") }}

- -

在 extension 和 AP 中使用 Components.utils.import 來載入 JavaScript code modules 時,建立 resource protocol 別名 (aliases) 有時是必須的。請使用 resource 指令來建立別名:

- -
resource aliasname uri/to/files/ [flags]
-
- -

這會將目的路徑對映到 resource://<aliasname>/.. 。

- -
-

沒有安全性限制防止網頁內容 include 以 resource: 開頭的 URI,故請留意此處所開啟的能見度

-
- -

Manifest 旗號

- -

Manifest 指令行允許多個以空白分隔的旗號附加於行尾。這些旗號將會設定 package 中 chrome 的特殊屬性,或限制這些指令行本身於什麼條件下作用。

- -

application

- -

Extension 可以安裝於多個應用程式,而有些 chrome registration 可能只需作用於特定的應用程式。以下旗號

- -
application=app-ID
-
- -

代表這個指令只應在 extension 安裝於符合 app-ID 的應用程式時作用。同一行可以指定多個應用程式,此時只要其中一項符合即會作用。

- -

以下示範如何為多個應用程是分別指定 overlay :

- -
overlay chrome://browser/content/browser.xul chrome://myaddon/content/ffOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
-overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://myaddon/content/sbOverlay.xul application=songbird@songbirdnest.com
-
- -

appversion

- -

Extension 可以安裝於同一應用程式的多個不同版本,而有些 chrome registration 可能只需作用於特定的版本。以下旗號

- -
appversion=version
-appversion<version
-appversion<=version
-appversion>version
-appversion>=version
-
- -

代表這個指令只應在 extension 安裝於符合特定版本的應用程式時作用。同一行可以指定多個 appversion ,此時只要其中一項符合即會作用。版本字串應遵循 Toolkit version format

- -
-

Gecko 在 1.8.0.13 之前以及版本 1.8.1.5 有一個 bug , 就是本字串必須超過一個字元(也就是最少兩個) 才能使用 < 、 > 及 =,否則會在 console 中收到 appversion flag was not recognized 的錯誤訊息。參見: {{ Bug(380398) }} 。

-
- -

platformversion

- -

{{ gecko_minversion_inline("8.0") }} 當附加元件尤其是 binary components支援一種以上的應用程式時,若能指定所相容的 Gecko 版本將為其帶來更多的方便性。若某些 chrome registration 只作用於定特定 Gecko 版本,以下旗號

- -
platformversion=version
-platformversion<version
-platformversion<=version
-platformversion>version
-platformversion>=version
-
- -

代表這個指令只應在 extension 安裝於符合特定 Gecko 版本的應用程式時作用。同一行可以指定多個 platformversion,此時只要其中一項符合即會作用。

- -

contentaccessible

- -

{{ Fx_minversion_inline("3") }} Chrome resources 已不能被非信任來源內容中的 <img>、<script> 及其他包含或添加的 elements 所參照。 這個限制不僅適用於非信任來源中所定義的 elements , 同時也適用於受信任的附加元件中所定義的 elements。若參照需要明確地被允許,請將 contentaccessible 旗號設定為 yes 來達到如舊版 Firefox 中的行為。 See {{ bug("4369")}}

- -

contentaccessible 只能用於 content package ,言下之意,它不會被 locale 或 skin registration 所識別。好在於 content package 所對應到的 locale 和 skin packages 對 content 而言是可見的。

- -

注意:由於舊版的 Firefox 根本看不懂 contentaccessible flag , 若要讓附加元件同時支援 Firefox 3 及古董版的話就得來個倒退嚕,您倒是看看:

- -
content packagename chrome/path/
-content packagename chrome/path/ contentaccessible=yes
-
- -

os

- -

{{ Fx_minversion_inline("3") }} Extensions (or themes) may offer different features depending on the operating system on which Firefox is running. The value is compared to the value of OS_TARGET for the platform.

- -
os=WINNT
-os=Darwin
-
- -

See OS_TARGET for a more complete list of os names. The os name is case insensitive.

- -

osversion

- -

{{ Fx_minversion_inline("3") }} An extension or theme may need to operate differently depending on which version of an operating system is running. For example, a theme may wish to adopt a different look on Mac OS X 10.5 than 10.4:

- -
osversion>=10.5
-
- -

abi

- -

{{ Fx_minversion_inline("4") }} If a component is only compatible with a particular ABI, it can specify which ABI/OS by using this directive. The value is taken from the nsIXULRuntime OS and XPCOMABI values (concatenated with an underscore). For example:

- -
binary-component component/myLib.dll abi=WINNT_x86-MSVC
-binary-component component/myLib.so abi=Linux_x86-gcc3 
-
- -

See XPCOM ABI for more details.

- -

platform (Platform-specific packages)

- -

Some packages are marked with a special flag indicating that they are platform specific. Some parts of content, skin, and locales may be different based on the platform being run. These packages contain three different sets of files, for Windows and OS/2, Macintosh, and Unix-like platforms. For example, the order of the "OK" and "Cancel" buttons in a dialog is different, as well as the names of some items.

- -

The "platform" modifier is only parsed for content registration; it is not recognized for locale or skin registration. However, it applies to content, locale, and skin parts of the package, when specified.

- -

To indicate that a package is platform-specific, add the "platform" modifier to the "content" line after the path, for example:

- -
content global-platform jar:toolkit.jar!/toolkit/content/global-platform/ platform
-
- -

Once that is specified in your manifest you then ensure that under the directory global-platform are subdirectories win (Windows/OS2), mac (OS9/OSX), or unix (Everything Else). Anything residing outside of these subdirectories will be ignored.

- -

xpcnativewrappers

- -

Chrome packages can decide whether to use the XPCNativeWrapper security mechanism to automatically protect their code against malicious content that they might access. See Safely accessing content DOM from chrome for details.

- -

This flag is enabled by default since Firefox 1.5. Disabling it manually was possible by specifying xpcnativewrappers=no until Firefox 4.

- -
-

{{ gecko_callout_heading("2.0") }}

- -

Support for this flag has been removed in Gecko 2.0 {{ geckoRelease("2.0") }}. You can no longer disable XPCNativeWrappers. To update your add-on to work without this flag:

- - -
- -

The xpcnativewrappers flag applies only to content packages; it is not recognized for locale or skin registration.

- -

Example chrome manifest

- -
content       necko                   jar:comm.jar!/content/necko/
-locale        necko       en-US       jar:en-US.jar!/locale/en-US/necko/
-content       xbl-marquee             jar:comm.jar!/content/xbl-marquee/
-content       pipnss                  jar:pipnss.jar!/content/pipnss/
-locale        pipnss      en-US       jar:en-US.jar!/locale/en-US/pipnss/
-# Firefox-only
-overlay chrome://browser/content/pageInfo.xul           chrome://pippki/content/PageInfoOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-# SeaMonkey-only
-overlay chrome://navigator/content/pageInfo.xul         chrome://pippki/content/PageInfoOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-overlay chrome://communicator/content/pref/preftree.xul chrome://pippki/content/PrefOverlay.xul
-content       pippki                  jar:pippki.jar!/content/pippki/
-locale        pippki      en-US       jar:en-US.jar!/locale/en-US/pippki/
-content       global-platform         jar:toolkit.jar!/content/global-platform/ platform
-skin          global      classic/1.0 jar:classic.jar!/skin/classic/global/
-override chrome://global/content/netError.xhtml jar:embedder.jar!/global/content/netError.xhtml
-content       inspector               jar:inspector.jar!/content/inspector/
-
- -

Instructions supported in bootstrapped add-ons

- -

The following instructions are supported in Bootstrapped extensions:

- - - -

Debugging a chrome manifest file

- -

The Chrome List extension (for Firefox 3.6 and older) shows all registered chrome. This is very helpful when trying to write a chrome.manifest file as you can inspect where the files are being mapped from (jar files, local directory, etc.)

- -

Old-style contents.rdf manifests

- -

Before the plaintext manifests were introduced (which happened in Firefox 1.5, Toolkit 1.8), RDF manifests named "contents.rdf" were used to register chrome. This format is deprecated; however, SeaMonkey versions before version 2 do not support the plaintext manifest format yet, so contents.rdf manifests are required for extensions that wish to maintain backwards compatibility with Firefox 1.0 or the suite.

- -

{{ gecko_minversion_note("1.9.2", "The contents.rdf manifest format is no longer supported at all starting with Gecko 1.9.2; add-ons already installed using this format will continue to work but can no longer be installed. Be sure to remove your add-on and reinstall it to ensure that it installs correctly after updating it to use a plaintext manifest.") }}

- -

Official references for Toolkit API

- -

{{ page("en-US/docs/Toolkit_API/Official_References") }}

- -

{{ languages( { "fr": "fr/Enregistrement_chrome", "ja": "ja/Chrome_Registration", "pl": "pl/Rejestracja_Chrome" ,"zh-cn":"zh-cn/Chrome_Registration"} ) }}

diff --git a/files/zh-tw/mozilla/connect/index.html b/files/zh-tw/mozilla/connect/index.html deleted file mode 100644 index 2e7b782447..0000000000 --- a/files/zh-tw/mozilla/connect/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: Connect with Mozilla -slug: Mozilla/Connect -tags: - - 繁體中文TW -translation_of: Mozilla/Connect ---- -
-

Enable, inspire and collaborate to make the Web the primary platform used to create experiences across all connected devices.

-
- -
-
-
- -
- -
- -
- -
- -
-
- -
-

與 Mozilla 連結

- -

Developers are creating the future by building services and apps for people all over the world. The goal of Mozilla Developer Relations is to help developers to use open and standardized web technologies to succeed in achieving their goals. In addition to the documentation here on MDN, we offer help and other resources towards this goal, through various channels. We invite you to connect, learn, and share your own knowledge.

- -

We are offering help through Q&A on Stack Overflow, to solve specific technical issues and challenges you might have. We also have a newsletter keeping you informed on the latest happenings in the web scene around web apps and more. Subscribe to the Apps & Hacks newsletter.

- -

If you share Mozilla's mission and principles, and want to help spread them to more developers, check out the ways you can get involved with technical evangelism, and join our evangelism discussion group.

- -

We have a lot of plans and ideas for iteratively expanding our Developer Relations offerings, and we want you involved as we do so! So, follow the tags on Stack Overflow, subscribe to the Hacks blog, subscribe to the newsletter, and sign up for an account!

- -

加入 Mozilla

- -

If you want to go beyond connecting with Mozilla, you can join Mozilla and help realize Mozilla's mission of building a better Internet. As a developer, you have skills to contribute in many areas, as well as the opportunity to enhance your skills. Mozilla is an open source project, so we "default to open." You can "view source" and contribute to our software development projects, like the Firefox browser for desktop and Android, Firefox OS, and Mozilla's own websites. You can become part of an international community and get recognition for your efforts. Here are some of the advantages of contributing to the Mozilla project.

- -

學習新東西的機會

- -
-

In writing code for an open source project, you may face problems you have not encountered before, which present learning opportunities for you. You can try out new tools and techniques in an open source project. For example, if you've never done any unit testing, and cannot get permission from your boss to do so in your regular job, writing some code for an open source project would be an excellent place to try it out. Contributing to open source gives you the opportunity to collaborate with and get to know many people around the world who have similar interests. Moreover, an open source organization like Mozilla has many contributors who can help you in solving problems you encounter. If you're just getting started contributing, you can look for "mentored" bugs, where an experienced contributor has offered to help a newcomer fix them.

- -

我可以從貢獻中得到什麼?

- -

Exploring many things and getting recognition in the community -- these are the intangible benefits of contributing to Mozilla. While we can't guarantee specific tangible benefits, many valued contributors receive free Mozilla gear and invitations to Mozilla-related events, and are first in line to be considered for internships. Moreover, your experience in contributing to an open source project might help you find a job. More and more employers of developers are looking at open source contributions. They like to see that you're blogging and contributing to mailing lists, and they really like to see you listed as a committer on an open source project. It can also help with the work experience section of your resume.

- -

我可以如何貢獻 Mozilla?

- -

There are many project area for which you can contribute to Mozilla. You can find a current, complete list on the main Mozilla Get Involved page. Some areas that may interest you as a developer include:

- - -
-
- -
-
-

Stack Overflow 上的問與答 查看所有 Q&A…

- -

We have Q&A to discuss challenges and issues when developing, in particular for Firefox OS and the Open Web on mobile. It's available on Stack Overflow under the easy URL http://stackoverflow.com/r/mozilla.

- -
Stack form
- -

最新 Q&A 主題

-
- -
 
-
- -

Developers at a Firefox OS workshop in Madrid.

- -
-
-

Mozilla 在哪裡? 在活動頁面上查看訪客與詳細說明…

- -

Here is a listing of events where Mozilla representatives will be speaking. Make sure to talk to them!

-
- - -
-
diff --git a/files/zh-tw/mozilla/creating_mozsearch_plugins/index.html b/files/zh-tw/mozilla/creating_mozsearch_plugins/index.html deleted file mode 100644 index d41978c6ee..0000000000 --- a/files/zh-tw/mozilla/creating_mozsearch_plugins/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: 製作 MozSearch 搜尋模組 -slug: Mozilla/Creating_MozSearch_plugins -tags: - - 搜尋模組 -translation_of: Mozilla/Creating_MozSearch_plugins ---- -

Firefox 2 使用簡化的 OpenSearch 格式儲存搜尋模組,而 MozSearch 搜尋模組則是描述搜尋引擎、URL 及相關參數的 XML 檔。 -

-
警告:MozSearch 並非標準格式,也只應於 Mozilla 專案內部使用。除非要包裝在 Firefox 擴充套件中或直接與 Firefox 安裝檔一起發佈,否則不該使用這種格式。要製作能由網頁安裝的搜尋模組,請參考製作 OpenSearch 搜尋模組
-

搜尋模組檔

-

MozSearch 格式檔與 OpenSearch 格式很像,只是根元素及 XML 名稱空間不同。 -

-

範例:Yahoo! 搜尋

-

下列 XML 是內建於英文版 Firefox 2 的 Yahoo! 搜尋模組: -

-
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>Yahoo</ShortName>
-<Description>Yahoo Search</Description>
-<InputEncoding>UTF-8</InputEncoding>
-<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==</Image>
-<Url type="application/x-suggestions+json" method="GET"
-     template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchTerms}" />
-<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
-  <Param name="p" value="{searchTerms}"/>
-  <Param name="ei" value="UTF-8"/>
-
-  <MozParam name="fr" condition="pref" pref="yahoo-fr" />
-</Url>
-<SearchForm>http://search.yahoo.com/</SearchForm>
-</SearchPlugin>
-
-

假設使用者選擇 Yahoo! 搜尋模組,然後在搜尋欄內輸入「mozilla」後按下 Enter 鍵。接著 Firefox 會依據上面的搜尋模組敘述前往這個搜尋 URL: -

-
http://search.yahoo.com/search?p=mozilla&ei=UTF-8&fr=moz2
-
-

若使用者只單純按下搜尋欄的放大鏡圖示,或者在搜尋欄隱藏時點選「工具>網路搜尋」,則瀏覽器會前往 <SearchForm> 指定的 <tt>http://search.yahoo.com/</tt>。 -

-

範例:搜尋 MDC

-

此搜尋模組能協助你輕鬆搜尋 Mozilla 開發者中心英文版的文件: -

-
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>MDC</ShortName>
-<Description>Mozilla Developer Center search</Description>
-<InputEncoding>UTF-8</InputEncoding>
-<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz%2F%2Fz8DJQAggJiQOe%2Ffv2fv7Oz8rays%2FN%2BVkfG%2FiYnJfyD%2F1%2BrVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw%2F8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi%2FG%2BQKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo%2BMXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia%2BCuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq%2FvLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg%2FkdypqCg4H8lUIACnQ%2FSOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD%2BaDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg%3D%3D</Image>
-<Url type="text/html" method="GET" template="http://developer.mozilla.org/en/docs/Special:Search?search={searchTerms}"/>
-<SearchForm>http://developer.mozilla.org/en/docs/Special:Search</SearchForm>
-</SearchPlugin>
-
-

這個範例中單純將參數加到 URL 中,而不是使用 <Param> 指定參數。這也是使用 GET 時的建議做法,而 <Param> 應於以 POST 方式傳送表單時才使用。 -

-

延伸閱讀

- -{{ languages( { "ca": "ca/Creaci\u00f3_de_connectors_MozSearch", "en": "en/Creating_MozSearch_plugins", "es": "es/Creaci\u00f3n_de_plugins_MozSearch", "fr": "fr/Cr\u00e9ation_de_plugins_MozSearch", "ja": "ja/Creating_MozSearch_plugins", "it": "it/Creare_Plugin_MozSearch", "pl": "pl/Tworzenie_wtyczek_MozSearch" } ) }} diff --git a/files/zh-tw/mozilla/firefox/developer_edition/index.html b/files/zh-tw/mozilla/firefox/developer_edition/index.html deleted file mode 100644 index d912a36470..0000000000 --- a/files/zh-tw/mozilla/firefox/developer_edition/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Firefox 開發者版本 -slug: Mozilla/Firefox/Developer_Edition -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Firefox/Developer_Edition ---- -
{{FirefoxSidebar}}

一個專為 Web 開發者量身定做的 Firefox 版本。

- -

下載 Firefox 開發者版本

- -
-
-
-

最新的 Firefox 功能

- -

Firefox Developer Edition 取代了 Firefox 釋出流程中的 Aurora 頻道。如同 Aurora,各功能會在 Nightly builds 中穩定下來後,每隔六週下放到 Developer Edition 裡面。

- -

透過 Developer Edition,您可以在至少 12 週前接觸到 Firefox 正式釋出的工具及平台功能。

- -

來看看 Developer Edition 有哪些新功能

-
- -
-

清晰的界面

- -

更快找到開發者工具。

- -

實驗性的開發者工具

- -

我們加入了尚未準備好正式釋出的實驗性工具。

- -

例如,Developer Edition 加入了 Valence 附加元件,一個可以讓您透過 Firefox 開發者工具連到其他瀏覽器,像是 Android 上面的 Chrome 及 iOS 上面的 Safari。

-
-
- -
-
-

獨立的設定檔

- -

Firefox Developer Edition 使用一個獨立於其他已經安裝在您電腦上 Firefox 版本的設定檔。這意味著您可以簡單的在執行 Developer Edition 的同時使用正式或測試版的 Firefox。

- -
-

註:這表示在您第一次啟動  Developer Edition 後,將會看到一個完全沒有自訂外觀﹑沒有擴充套件、沒有書籤、也沒有歷史紀錄的瀏覽器。若您想讓您的  Developer Edition 跟您其他版本的  Firefox 使用一樣的設定,您可以使用  Firefox Sync 來達成同步。

-
-
- -
-

針對 Web 開發者的設置

- -

我們針對 Web 開發者的需求調整了預設的設定值。例如,chrome 及遠端除錯功能預設為開啟。

-
-
- -

 

diff --git a/files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html b/files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html deleted file mode 100644 index 0a83335196..0000000000 --- a/files/zh-tw/mozilla/firefox/developer_edition/reverting/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: 回到過去 -slug: Mozilla/Firefox/Developer_Edition/Reverting -translation_of: Mozilla/Firefox/Developer_Edition/Reverting ---- -
{{FirefoxSidebar}}

換掉 Developer Edition 佈景主題

- -


- 如果您想繼續使用 Developer Edition, 可是比較喜歡目前套用在 Firefox 及 Firefox Beta 的 Australis 界面,您可以切換到一般的 Firefox 佈景主題:只要打開「自訂模式」面板並點擊「使用 Firefox Developer Edition 佈景主題」按鈕即可。

- -

{{EmbedYouTube("OvJwofTjsNg")}}

- -

注意,目前 Developer Edition 佈景主題尚未與個性面板相容。所以如果您想套用個性面板,您必須先切回 Australis 界面。

- -

回到 Firefox Aurora

- -


- 如果您想保留所有 Firefox Developer Edition 的前期測試功能,但是又不想要有其他的改變,您可以回復到看起來就像是以前的 Firefox Aurora。請依序執行下面兩步驟:

- -
    -
  1. 開啟 Developer Edition 的選項頁面,並將「允許 Firefox Developer Edition 與 Firefox 同時執行」選項的勾選取消掉。您將會收到重新啟動瀏覽器的提示。
  2. -
  3. 瀏覽器重新啟動後,您可以打開「自訂模式」面板並點擊「使用 Firefox Developer Edition 佈景主題」按鈕來關閉 Developer Edition 佈景主題。
  4. -
- -

{{EmbedYouTube("0Ofq-vlw8Qw")}}

diff --git a/files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html b/files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html deleted file mode 100644 index 6afe2dd67d..0000000000 --- a/files/zh-tw/mozilla/firefox/multiprocess_firefox/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: 多處理程序的 Firefox -slug: Mozilla/Firefox/Multiprocess_Firefox -tags: - - Elecrolysis - - Firefox - - Multiprocess - - e10s -translation_of: Mozilla/Firefox/Multiprocess_Firefox ---- -
{{FirefoxSidebar}}

在舊的 Firefox 桌面版本中,整個瀏覽器都是執行在單一的作業系統處理程序裡。特別是用來執行瀏覽器使用者介面(又稱為「chrome code」)的 JavaScript 和網頁裡的程式碼(又稱為「內容」或「網頁內容」)都在同一個處理程序中。
-
-最新版的 Firefox 會分別在單獨的處理程序中執行瀏覽器的介面和網頁內容。在這個架構的第一個版本中,所有瀏覽器分頁在同一個處理程序中執行,而瀏覽器介面則在另外的一個處理程序中。在未來幾個版本後,我們希望能有不只一個處理程序。這個提供多處理程序 Firefox 的專案稱為 Electrolysis,有時候會縮寫成 e10s。

- -

多處理程序的 Firefox 不會影響一般的網頁。只有 Firefox 本身和附加元件的開發者們需要直接存取網頁內容時才會受到影響。

- -

使用者介面的 chrome JavaScript 必須使用 message manager 來間接存取網頁內容。為了緩解過渡期的影響,我們已經實作了 Cross Process Object Wrappers 和一些給附加元件開發者的相容替代方案。如果你是附加元件的開發者,想知道這會不會影響到你,請參閱多處理程序 Firefox 的工作指南

- -
-
-
-
-
技術總覽
-
非常高階的多處理程序 Firefox 實作解釋。
-
網頁內容相容性指南
-
過渡期可能出現的潛在網站相容性問題的指南和細節。提示:不是很多!
-
用語表
-
多處理程序 Firefox 的術語參考。
-
Message manager
-
溝通介面與內容的元件完整指南。
-
基於 SDK 的附加元件
-
如何移植使用 Add-on SDK 開發的附加元件。
-
各種 URIs 在哪裡載入
-
URIs(chrome:, about:, file:, resource:)在哪個處理程序中載入的快速指南。
-
-
- -
-
-
動機
-
為什麼我們要實作多處理程序的 Firefox:效能、安全和穩定。
-
附加元件移植指南
-
如果你是附加元件的開發者,來這裡看看你要如何處理程式碼。
-
跨處理程序元件包裝(Cross Process Object Wrappers)
-
Cross Process Object Wrappers 是一個移植工具,讓 chrome code 可以同步存取內容。
-
內容處理程序的除錯
-
如何在內容處理程序、包含框架和處理程序腳本中進行除錯。
-
多處理程序 Firefox 的分頁處理
-
在多處理程序的 Firefox 中分頁是如何切換的。
-
-
-
- -
-
-
-
-
Chrome 程式碼的限制
-
不再有用的 Chrome 程式碼,以及如何修正。
-
-
- -
-
-
框架程式碼的限制
-
不再有用的框架程式碼,以及如何替代。
-
-
-
- -
-

聯絡我們

- -

了解更多關於項目、參與、或者來問問題。

- - diff --git a/files/zh-tw/mozilla/firefox/privacy/index.html b/files/zh-tw/mozilla/firefox/privacy/index.html deleted file mode 100644 index 1f42ab5be0..0000000000 --- a/files/zh-tw/mozilla/firefox/privacy/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: 隱私 -slug: Mozilla/Firefox/Privacy -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Firefox/Privacy ---- -
{{FirefoxSidebar}}

{{ ListSubpages () }}

diff --git a/files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html b/files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html deleted file mode 100644 index a52f8b815d..0000000000 --- a/files/zh-tw/mozilla/firefox/privacy/tracking_protection/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: 追蹤保護 -slug: Mozilla/Firefox/Privacy/Tracking_Protection -translation_of: Mozilla/Firefox/Privacy/Tracking_Protection ---- -
{{FirefoxSidebar}}

追蹤保護是什麼?

- -

在第 42 版後,Firefox Desktop 與 Firefox for Android 導入了追蹤保護。在隱私視窗(Firefox for Android 則是隱私標籤)內,Firefox 會封鎖從其他用戶追蹤網站載入的內容。

- -

有些被封鎖的內容,屬於頁面排版的一部分。如果 Firefox 因為封鎖了這些內容而造成跑版,用戶很可能會注意到。但如果針對遭封鎖的元素,以其他元素填充的話,用戶也可能完全不會注意到。

- -

當 Firefox 封鎖內容的時候,網頁主控台的訊息會跳出如下面般的紀錄:

- -
因為啟用了追蹤保護,位於「http://some/url」的資源已被封鎖。
- -

請記得在使用 Firefox for Android 的時候,你可以透過遠端除錯訪問主控台。

- -

Firefox UI 會在封鎖內容的時候告訴用戶,並同時告知用戶可以在此次瀏覽階段解除封鎖。用戶也可以選擇完全停用追蹤保護。

- -

Firefox 如何決定封鎖什麼?

- -

載入內容的封鎖與否,取決於該內容來自哪個網域。

- -

Firefox 會傳送一個確定參與用戶追蹤的網域列表。當追蹤保護啟動的時候,Firefox 會封鎖來自列表網站的內容。

- -

追蹤用戶的網站通常來自第三方廣告網站與分析網站。

- -

這對我的網站有什麼意義?

- -

當追蹤保護啟用時,最明顯的意義是:

- - - -

更值得注意的是,如果你的網站有部分依賴於追蹤器的運作程式碼,那這些追蹤程式碼將會被封鎖和禁止並可能導致你的網站失去正常運作當追蹤保護被啟用。例如,當你的網站包含程式碼,那些程式碼依賴於追蹤網站所提供的程式碼的功能,那麼這些追蹤網站的程式碼的功能將會失敗,不會運作,停止呼叫程式碼,失去網站的運作功能。

- -

像是說,不要這樣用 Google Analytics:

- -
<a href="http://www.example.com" onclick="trackLink('http://www.example.com', event);">Visit example.com</a>
-<script>
-function trackLink(url,event) {
-    event.preventDefault();
-    ga('send', 'event', 'outbound', 'click', url, {
-     'transport': 'beacon',
-     'hitCallback': function() {
-       document.location = url;
-     }
-   });
-}
-</script>
- -

而是要在使用物件以前偵測該物件是否存在或被停用,防止程式運作的失敗。像是:

- -
<a href="http://www.example.com" onclick="trackLink('http://www.example.com', event);">Visit example.com</a>
-<script>
-function trackLink(url,event) {
-    event.preventDefault();
-    if (window.ga && ga.loaded) {
-         ga('send', 'event', 'outbound', 'click', url, {
-         'transport': 'beacon',
-         'hitCallback': function() { document.location = url; }
-       });
-    } else {
-        document.location = url;
-    }
-}
-</script>
-
- -

關於此技術的詳細資訊可參見 Google Analytics, Privacy, and Event Tracking.

- -

取決於那些第三方網站程式的程式碼寫法和運作方式,這樣的程式碼寫法不會是適合和適用於你的網站的程式碼。所以說,你的網站將會失敗停止運作如果這些第三方外掛程式碼回應過慢或不可用或追蹤程式碼被外掛程式停用。

diff --git a/files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html b/files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html deleted file mode 100644 index bbad0696a8..0000000000 --- a/files/zh-tw/mozilla/firefox/releases/3/firefox_3_css_improvement/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Firefox 3 CSS Improvement -slug: Mozilla/Firefox/Releases/3/Firefox_3_CSS_Improvement -translation_of: Mozilla/Firefox/releases/3/CSS_improvements ---- -
{{FirefoxSidebar}}

Firefox 3 CSS 的改善

- -

參考資訊

- -

延伸閱讀

- diff --git a/files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html b/files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html deleted file mode 100644 index faa28e0f03..0000000000 --- a/files/zh-tw/mozilla/gecko/chrome/api/browser_api/index.html +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: Browser API -slug: Mozilla/Gecko/Chrome/API/Browser_API -translation_of: Mozilla/Gecko/Chrome/API/Browser_API/Using ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('privileged') }}

-

摘要

-

HTML Browser API 其實是 HTML <iframe> 元素的延伸,可讓 Web Apps 建構瀏覽器或類似瀏覽器的 Apps。主要可分為 2 大項:

- -

另在「嵌入式內容就是 1 個 Open Web App」的情況下,將於合適的 Apps 環境 (如權限) 中載入該內容。

-

用途

-

設定了 mozbrowser 屬性之後,即可將 <iframe> 轉為瀏覽器框架:

-
<iframe src="http://hostname.tld" mozbrowser>
-

如果要嵌入 Open Web Apps,就必須提供 mozapp 屬性,且導向 Apps 的 manifest 檔案之路徑應為:

-
<iframe src="http://hostname.tld" mozapp='http://path/to/manifest.webapp' mozbrowser>
-

最後透過 remote 屬性,<iframe> 內容可載入至本身的子處理程序 (Child process) 中,藉以分離出「嵌入此 <iframe> 頁面」的處理程序。

-
<iframe src="http://hostname.tld" mozbrowser remote>
-
-

警告:因應安全考量,若要從未知/未經信任的來源下載內容,則必備最後一項屬性。若要略過此屬性,則 Apps 可能受到惡意網站的危害。

-
-

權限

-

任何 Apps 若要嵌入瀏覽器框架,則其 app manifest 檔案中必備 browser 權限。

-
{
-  "permissions": {
-    "browser": {}
-  }
-}
-

此外,若要嵌入 Open Web Apps,則該 App 亦需具備 embed-apps 權限。

-
{
-  "permissions": {
-    "browser": {},
-    "embed-apps": {}
-  }
-}
-

其他函式

-

為因應瀏覽器 <iframe> 的需求,Firefox OS 另擴充了 HTMLIFrameElement DOM 介面。下列新函式將為 <iframe> 提供更多功能:

-

存取 (Navigation) 函式

-

這些函式可存取 <iframe> 的瀏覽記錄,為建構「停止」、「上一頁」、「下一頁」、「重新載入」等按鈕所必備。

- -

效能函式

-

這些函式可管理瀏覽器 <iframe> 所使用的資源。特別適於建構分頁式瀏覽器的應用。

- -

事件函式

-

為了管理瀏覽器 <iframe> 的內容,另新增了許多新事件 (如下所示)。下列函式即用以處理這些事件:

- -

其他函式

-

這些函式適於使用瀏覽器 <iframe> 的 Apps。

- -

事件

-

若要讓 Apps 管理瀏覽器 <iframe>,則該 Apps 將監聽瀏覽器 <iframe> 中發生的新事件。監聽的新事件如下:

- -

範例

-

此範例可建構最基本的瀏覽器 Apps。

-

HTML

-

在 HTML 中,我們只要新增 1 組 URL 位址列、1個「Go」與「Stop」按鈕、1 組瀏覽器 <iframe>

-
<header>
-  <input id="url">
-  <button id="go">Go</button>
-  <button id="stop">Stop</button>
-</header>
-
-<iframe src="about:blank" mozbrowser remote></iframe>
-
-

CSS

-

變個小小的 CSS 戲法,即可切換按鈕為「Go」與「Stop」。

-
button:disabled {
-  display: none;
-}
-

JavaScript

-

現在可加進必要的功能:

-
document.addEventListener("DOMContentLoaded", function () {
-  var url  = document.getElementById("url");
-  var go   = document.getElementById("go");
-  var stop = document.getElementById("stop");
-
-  var browser = document.getElementsByTagName("iframe")[0];
-
-  // This function is used to switch the Go and Stop button
-  // If the browser is loading content, "Go" is disabled and "Stop" is enabled
-  // Otherwise, "Go" is enabled and "Stop" is disabled
-  function uiLoading(isLoading) {
-      go.disabled =  isLoading;
-    stop.disabled = !isLoading;
-  }
-
-  go.addEventListener("touchend", function () {
-    browser.setAttribute("src", url.value);
-  });
-
-  stop.addEventListener("touchend", function () {
-    browser.stop();
-  });
-
-  // When the browser starts loading content, we switch the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowserloadstart', function () {
-    uiLoading(true);
-  });
-
-  // When the browser finishes loading content, we switch back the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowserloadend', function () {
-    uiLoading(false);
-  });
-
-  // In case of error, we also switch back the "Go" and "Stop" buttons
-  browser.addEventListener('mozbrowsererror', function (event) {
-    uiLoading(false);
-    alert("Loading error: " + event.detail);
-  });
-
-  // When a user follows a link, we make sure the new location is displayed in the address bar
-  browser.addEventListener('mozbrowserlocationchange', function (event) {
-    url.value = event.detail;
-  });
-});
-

另可參閱

- diff --git a/files/zh-tw/mozilla/gecko/chrome/api/index.html b/files/zh-tw/mozilla/gecko/chrome/api/index.html deleted file mode 100644 index 7c32384981..0000000000 --- a/files/zh-tw/mozilla/gecko/chrome/api/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Chrome-only API reference -slug: Mozilla/Gecko/Chrome/API -translation_of: Mozilla/Gecko/Chrome/API ---- -
{{FirefoxSidebar}}
- -

此頁面列出了僅能在 Gecko Chrome 中執行的 APIs(and sometimes in other privileged circumstances.)。

- -
-

Note: Most of the APIs exposed to the Web in general are also usable in Chrome code: see Web APIs for a list of these.

-
- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/mozilla/gecko/chrome/index.html b/files/zh-tw/mozilla/gecko/chrome/index.html deleted file mode 100644 index 5701f56b12..0000000000 --- a/files/zh-tw/mozilla/gecko/chrome/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Gecko Chrome -slug: Mozilla/Gecko/Chrome -tags: - - Chrome - - Gecko - - Mozilla - - Overview -translation_of: Mozilla/Gecko/Chrome ---- -
{{FirefoxSidebar}}
- -

此頁面包含了於 Gecko 中執行 Chrome 程式碼的相關資訊。

- -

{{SubpagesWithSummaries}}

diff --git a/files/zh-tw/mozilla/gecko/index.html b/files/zh-tw/mozilla/gecko/index.html deleted file mode 100644 index ce55ea402f..0000000000 --- a/files/zh-tw/mozilla/gecko/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Gecko -slug: Mozilla/Gecko -translation_of: Mozilla/Gecko ---- -
-

Gecko是一個排版引擎,一開始叫做NGLayout,屬於Mozilla專案。Gecko的功能就是讀取網頁內容,如 HTML, CSS, XUL, JavaScript,然後解析將內容顯示在螢幕上或印出來,在以XUL為基礎的應用程式中,Gecko也是用來解析生成應用程式的UI介面。

-
- -

許多應用程式中都有使用到Gecko,包括一些瀏覽器,如Firefox, SeaMonkey等等 (完整列表請參考維基百科Gecko的文章.) 。使用相同版本Gecko的程式對於標準都有著相同的支援。

- - - - - - - - -
-

文件

- -
-
Chrome
-
-

這個頁面包含 Gecko 運行 Chrome 專有程式碼的訊息。

-
-
- -
-
Gecko FAQ
-
常見問題
-
Gecko DOM 參考
-
DOM參考文件
-
Gecko 事件參考
-
Gecko和Mozilla程式內各項事件的參考文件;對於網頁標準的DOM事件,請參考 DOM event reference.
-
Gecko 版本和對應的應用程式
-
Geck版本和各應用程式所用的Gecko版本列表
-
Mozilla 的排版介紹
-
排版相關的技術探討
-
應用 Mozilla
-
在你自己的應用程式中使用Gecko
-
Gecko支援的字符集
-
Gecko支援的字符集列表
-
HTML 解析器運作
-
HTML解析器相關的執行緒探討
-
{{interwiki('wikimo', 'Gecko:Home_Page', 'Gecko Homepage on MozillaWiki')}}
-
使用者、產品規劃圖和最新資源的入口首頁
-
- -

全部...

-
-

社群

- -
    -
  • View Mozilla forums... {{DiscussionList("dev-tech-layout", "mozilla.dev.tech.layout")}}
  • -
- - - -
-
Web Standards, XUL, Embedding Mozilla, Developing Mozilla
-
-
- -

 

diff --git a/files/zh-tw/mozilla/infallible_memory_allocation/index.html b/files/zh-tw/mozilla/infallible_memory_allocation/index.html deleted file mode 100644 index 06844eedd5..0000000000 --- a/files/zh-tw/mozilla/infallible_memory_allocation/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: 絕對可靠的記憶體配置 -slug: Mozilla/Infallible_memory_allocation -tags: - - 分配 - - 記憶體 -translation_of: Mozilla/Infallible_memory_allocation ---- -
{{gecko_minversion_header("2.0")}}
- -

There's ongoing work to implement infallible memory allocators. These are memory allocation routines that never return null; that is, they always successfully return the requested block of memory. This is in contrast to a traditional, fallible memory allocator that can return null indicating that the request failed.

- -

Currently, while code is transitioned to be compatible with infallible memory allocators, you have to explicitly decide whether to use infallible allocation or not. Eventually, however, the generic memory allocators (malloc() and realloc()) will become infallible.

- -

記憶體配置要怎樣才能萬無一失?

- -

「萬無一失」這個詞代表了配置記憶體時絕對會成功:你的程式碼永遠不會看到請求失敗,也就無須對失敗的情況做出處置。

- -

平常在配置記憶體時,情況則不太一樣。在有限記憶體的狀況下,記憶體配置是有可能失敗的。然而,在平常配置失敗的程序中程式將不會返回到你的程式碼中,而是直接停止程式。不過這情況可能有點少見,因為記憶體管理系統通常都會為你要求的記憶體想盡辦法找到空間。

- -

選擇記憶體分配器

- -

當你在寫需要配置記憶體的程式時,可能需要遵守幾個規則以便幫助你決定是否在分配器使用萬無一失的策略:

- - - -

明示的萬無一失記憶體分配器

- -

下面的記憶體分配器都明確地標示出他們是萬無一失的,並且會一直保持下去。他們保證會回傳可用的記憶體指標:

- -
p = moz_xmalloc();
-p = moz_xrealloc();
-
- -
f = new Foo();
-fArray = new Foo[];
-
- -
n = ::operator new(...);
-nArray = ::operator new[](...);
-
- -

Explicitly fallible memory allocators

- -

These memory allocators are explicitly fallible, and will remain so. When using these, you must check to ensure the resulting value isn't null before attempting to use the returned memory.

- -
p = moz_malloc();
-p = moz_realloc();
-
- -
namespace mozilla {
-  f = new (fallible) Foo();
-  fArray = new (fallible) Foo[];
-}
-
- -
namespace mozilla {
-  n = ::operator new(..., fallible);
-  nArray = ::operator new[](..., fallible);
-}
-
- -

最終萬無一失分配器

- -

下面的記憶體目前是可能出錯的,但在未來將會變成萬無一失的:

- -
p = malloc();
-p = realloc();
-
- -

你也可以參看

- - diff --git a/files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html b/files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html deleted file mode 100644 index 0c0c5388db..0000000000 --- a/files/zh-tw/mozilla/introduction_to_layout_in_mozilla/index.html +++ /dev/null @@ -1,358 +0,0 @@ ---- -title: Introduction to Layout in Mozilla -slug: Mozilla/Introduction_to_Layout_in_Mozilla -translation_of: Mozilla/Introduction_to_Layout_in_Mozilla ---- -

概要

- - - -

基本數據流

- - - -

- -

關鍵數據結構

- -

- - - -

- -

關鍵數據結構

- - - -

詳細執行步驟

- - - -

設置

- - - -

- -

內容模型的構建

- - - -

- -

框架 Frame 的構建

- - - -

- -

Style 選定

- - - -

回流

- - - -

回流

- - - -

增量回流

- -

- - - -

增量回流

- -

- - - -

增量回流

- -

- - - -

增量回流

- -

- - - -

繪畫

- - - -

漸進

- - - -

- -

未來(?)技術講座

- - - -

結論

- - - -
-

原始文檔信息

- - -
diff --git a/files/zh-tw/mozilla/javascript_code_modules/index.html b/files/zh-tw/mozilla/javascript_code_modules/index.html deleted file mode 100644 index 72f737df9e..0000000000 --- a/files/zh-tw/mozilla/javascript_code_modules/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: JavaScript code modules -slug: Mozilla/JavaScript_code_modules -tags: - - Add-ons - - Extensions - - JavaScript - - Landing - - Modules - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/JavaScript_code_modules ---- -
{{gecko_minversion_header("1.9")}}
- -

JavaScript code modules let multiple privileged JavaScript scopes share code. For example, a module could be used by Firefox itself as well as by extensions, in order to avoid code duplication.

- -

General topics

- -
-
Using JavaScript code modules
-
An introduction to how to use JavaScript code modules.
-
Components.utils.import
-
How to import a JavaScript code module.
-
Components.utils.unload {{gecko_minversion_inline("7.0")}}
-
How to unload a JavaScript code module.
-
Code snippets: Modules
-
Examples of how to use code modules.
-
Mozilla Labs JS Modules
-
This page features a list of JS modules, along with download links and documentation, that extension developers can use in their code.
-
- -
-
- -

Standard code modules

- -
-
AddonManager.jsm {{gecko_minversion_inline("2.0")}}
-
Interface to install, manage, and uninstall add-ons.
-
AddonRepository.jsm {{gecko_minversion_inline("2.0")}}
-
Allows searching of the add-ons repository.
-
Assert.jsm {{gecko_minversion_inline("28.0")}}
-
Implements the CommonJS Unit Testing specification version 1.1, which provides a basic, standardized interface for performing in-code logical assertions with optional, customizable error reporting.
-
ctypes.jsm {{fx_minversion_inline("3.6")}}
-
Provides an interface that allows JavaScript code to call native libraries without requiring the development of an XPCOM component.
-
CustomizableUI.jsm {{fx_minversion_inline("29")}}
-
Allows you to interact with customizable buttons and items in Firefox's main window UI.
-
DeferredTask.jsm {{gecko_minversion_inline("18.0")}}
-
Run a task after a delay.
-
Dict.jsm {{gecko_minversion_inline("5.0")}}
-
Provides an API for key/value pair dictionaries.
-
DownloadLastDir.jsm {{gecko_minversion_inline("2.0")}}
-
Provides the path to the directory into which the last download occurred.
-
Downloads.jsm {{gecko_minversion_inline("23.0")}}
-
Provides a single entry point to interact with the downloading capabilities of the platform.
-
FileUtils.jsm {{gecko_minversion_inline("1.9.2")}}
-
Provides helpers for dealing with files.
-
Geometry.jsm {{gecko_minversion_inline("2.0")}}
-
Provides routines for performing basic geometric operations on points and rectangles.
-
HTTP.jsm {{gecko_minversion_inline("25.0")}}
-
A wrapper for XMLHttpRequest that provides convenient and simplified API for dealing with HTTP requests.
-
JNI.jsm {{fx_minversion_inline("17.0")}}
-
Abstracts the js-ctypes to provide an interface that allows JavaScript code to call code running in native JVMs.
-
ISO8601DateUtils.jsm
-
Provides routines to convert between JavaScript Date objects and ISO 8601 date strings.
-
Log.jsm (formerly log4moz) {{gecko_minversion_inline("27.0")}}
-
Provides a log4j style API for logging log messages to various endpoints, such as the Browser Console or a file on disk. This module was formerly
-
NetUtil.jsm
-
Provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously.
-
openLocationLastURL.jsm {{gecko_minversion_inline("1.9.1.4")}}
-
Provides access to the last URL opened using the "Open Location" option in the File menu.
-
OSFile.jsm {{gecko_minversion_inline("16.0")}}
-
Provides routines to access files. Read, write, rename, create directories, ...
-
PerfMeasurement.jsm {{fx_minversion_inline("4.0")}}
-
Provides access to low-level hardware and OS performance measurement tools.
-
PluralForm.jsm
-
Provides an easy way to get the correct plural forms for the current locale, as well as ways to localize to a specific plural rule.
-
PopupNotifications.jsm {{gecko_minversion_inline("2.0")}}
-
Provides an easy way to present non-modal notifications to users.
-
Promise.jsm {{gecko_minversion_inline("25.0")}}
-
Implements the Promises/A+ proposal as known in April 2013.
-
PromiseWorker.jsm {{gecko_minversion_inline("20.0")}}
-
A version of {{domxref("ChromeWorker")}} which uses promises to return the worker's result instead of using an event to do so.
-
Services.jsm {{gecko_minversion_inline("2.0")}}
-
Provides getters for conveniently obtaining access to commonly-used services.
-
source-editor.jsm {{fx_minversion_inline("11.0")}}
-
The Source Editor is used by developer tools such as the Style Editor; this interface implements the editor and lets you interact with it.
-
Sqlite.jsm {{gecko_minversion_inline("20.0")}}
-
A Promise-based API to {{ interface("mozIStorage") }}/SQLite.
-
Task.jsm {{gecko_minversion_inline("17.0")}}
-
Implements a subset of Task.js to make sequential, asynchronous operations simple, using the power of JavaScript's yield operator.
-
Timer.jsm {{gecko_minversion_inline("22.0")}}
-
A pure JS implementation of window.setTimeout.
-
Webapps.jsm {{gecko_minversion_inline("??.0")}}
-
Provides an interface to manager Open Web Apps.
-
WebRequest.jsm {{gecko_minversion_inline("41.0")}}
-
Provides an API to add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request.
-
XPCOMUtils.jsm
-
Contains utilities for JavaScript components loaded by the JS component loader.
-
diff --git a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html b/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html deleted file mode 100644 index fc54b6e846..0000000000 --- a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/index.html +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: Promise.jsm -slug: Mozilla/JavaScript_code_modules/Promise.jsm -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/JavaScript_code_modules/Promise.jsm ---- -

{{ gecko_minversion_header("25") }}

- -

The Promise.jsm JavaScript code module implements the Promises/A+ proposal as known in April 2013.

- -
-

This module was used before DOM Promises were made globally available in Gecko 29. Its usage is not suggested for new code.

- -

If you just need a Promise, consider using a DOM Promise instead.

- -

If you need a Deferred, because you want to create a Promise and manually resolve or reject it, consider using PromiseUtils.jsm instead.

-
- -

To use it, you first need to import the code module into your JavaScript scope:

- -
Components.utils.import("resource://gre/modules/Promise.jsm");
-
- -
-

Note: A preliminary promise module is also available starting from Gecko 17, though it didn't conform to the Promises/A+ proposal until Gecko 25:

- -
Components.utils.import("resource://gre/modules/commonjs/promise/core.js");     // Gecko 17 to 20
-Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // Gecko 21 to 24
-
- -

This implementation also includes helper functions that are specific to the Add-on SDK. While you may still import this module from the above paths, the recommended way for loading it is through the Add-on SDK loader.

-
- -

Introduction

- -

For an introduction to promises, you may start from the Add-on SDK documentation, keeping in mind that only the core subset is implemented in this module.

- -

A promise is an object representing a value that may not be available yet. Internally, a promise can be in one of three states:

- - - -

A reference to an existing promise may be received by different means, for example as the return value of a call into an asynchronous API. In this case, the state of the promise can be observed but not directly controlled.

- -

To observe the state of a promise, its then method must be used. This method registers callback functions that are called as soon as the promise is either fulfilled or rejected. The method returns a new promise, that in turn is fulfilled or rejected depending on the state of the original promise and on the behavior of the callbacks. For example, unhandled exceptions in the callbacks cause the new promise to be rejected, even if the original promise is fulfilled. See the documentation of the then method for details.

- -

Promises may also be created using the new Promise() constructor.

- -

Method overview

- - - - - - - - - - - - - -
Deferred defer(); {{ obsolete_inline("30") }}
Promise resolve([optional] aValue);
Promise reject([optional] aReason);
- -

Methods

- -

defer()

- -

Creates a new pending promise and provides methods to resolve or reject it.

- -
Deferred defer(); {{ obsolete_inline("30") }}
-
- -
Parameters
- -

None.

- -
Return value
- -

A new object, containing the new promise in the promise property, and the methods to change its state in the resolve and reject properties. See the Deferred documentation for details.

- -

resolve()

- -

Creates a new promise fulfilled with the specified value, or propagates the state of an existing promise.

- -
Promise resolve(
-  aValue
-);
-
- -
Parameters
- -
-
aValue {{ optional_inline() }}
-
If this value is not a promise, including undefined, it becomes the fulfillment value of the returned promise. If this value is a promise, then the returned promise will be resolved with the value, i.e. it will eventually assume the same state as the provided promise.
-
- -
Return value
- -

A promise that can be pending, fulfilled, or rejected.

- -

reject()

- -

Creates a new promise rejected with the specified reason.

- -
Promise reject(
-  aReason
-);
-
- -
Parameters
- -
-
aReason {{ optional_inline() }}
-
-

The rejection reason for the returned promise. Although the reason can be undefined, it is generally an Error object, like in exception handling.

- -
Note: This argument should not be a promise. Specifying a rejected promise would make the rejection reason equal to the rejected promise itself, and not its rejection reason.
-
-
- -
Return value
- -

A rejected promise.

- -

Examples

- -

See the examples page.

- -

See also

- - diff --git a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html b/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html deleted file mode 100644 index 44c0b22181..0000000000 --- a/files/zh-tw/mozilla/javascript_code_modules/promise.jsm/promise/index.html +++ /dev/null @@ -1,215 +0,0 @@ ---- -title: Promise -slug: Mozilla/JavaScript_code_modules/Promise.jsm/Promise -tags: - - JavaScript - - Promise.jsm -translation_of: Mozilla/JavaScript_code_modules/Promise.jsm/Promise ---- -

一個 Promise 物件代表一個可能還不能使用的值。

- -

可以用不同的方式接收一個 promise 的參照,比如作為一個異步 API 的回傳值。一但你有了 promise 的參照,你就可以呼叫它的 then() 方法來在它的值準備好後,或是,當錯誤發生時執行一些動作。

- -

Promises 物件也可以透過 new Promise() 建構子來創建。當你使用一個 Promise 物件的參照時,並不需要額外引入 Promise.jsm 模組 。

- -

一個 promise 可以處於三種內部狀態:

- - - -
-

註: 你永遠應該處理、轉送或是回報錯誤(或是拒絕的原因)。如果你看到 "A promise chain failed to handle a rejection",那很有可能是程式碼中有東西需要修正。請參考 handling errors and common pitfalls 。

-
- -

文件規範

- -

在說明文件中,完成值的型別通常被定義在角括號中。舉例來說,OS.File.exists 方法回傳的 promise 最終將會履行一個 boolean。

- -
Promise<boolean> exists(string path);
-
- -

拒絕原因通常可以分別在方法的文件中定義,而且當沒有特別說明時它將被當作是一個 Error 物件。

- -

方法總覽

- - - - - - - - - - -
Promise then([optional] Function onFulfill, [optional] Function onReject);
Promise catch([optional] Function onReject);
- -

建構子

- -

創建一個新的 promise ,初始化等待狀態,並提供一些 resolving 方法的參照,這些方法將可以用來改變它的狀態。

- -
new Promise(executor);
-
- -

參數

- -
-
executor
-
-

這個方法將立刻被呼叫,伴隨著兩個 resolving 方法作為其參數:

- -
executor(resolve, reject);
-
- -

建構子在 executor 結束之前不會結束。那些 resolving 方法可以在任何時候被使用,包含 executor 完成前和完成後,用來控制 promise 的最終狀態。如果 executor 拋出了例外,例外的值將被當作參數傳入 reject 方法。

-
-
- -

Resolving 方法

- -

resolve()

- -

執行將特定值連結到 promise 的工作,或是傳遞狀態到一個已存在的 promise。如果被連結的 promise 已經處於被解決的狀態,無論是被連結到值、拒絕原因、或另外一個 promise,這個方法將不會做任何事。

- -
註: 用一個等待中的 promise 當作此方法的 aValue 參數,並在這個 promise 被解決或被拒絕前再次呼叫此方法,第二次的呼叫並不會有任何效果,因為原本的 promise 已經被連結到這個等待中的 promise。
- -
void resolve(
-  aValue
-);
-
- -
參數
- -
-
aValue Optional
-
如果這個值不是一個 promise,包含 undefined,它將成為被連結 promise 的完成值。如果這個值是一個 promise,則被連結的 promise 將會連結到這個傳入的 promise,並和它保持一樣的狀態(包含任何未來的轉變)。
-
- -

reject()

- -

用指定的原因拒絕被連結的 promise。如果該 promise 已經被解決,無論是連結到值、拒絕原因、或另外一個 promise,這個方法將不會做任何事。

- -
void reject(
-  aReason
-);
-
- -
參數
- -
-
aReason Optional
-
-

被連結 promise 的拒絕原因。雖然原因可以是 undefined,它通常會是一個 Error 物件對象,就像例外處理那樣。

- -
註: 這個參數不應該是一個 promise。指定一個拒絕 promise 作為拒絕原因會讓拒絕原因等於這個拒絕 promise 物件本身,而不是該 promise 的拒絕原因。
-
-
- -

方法

- -

then()

- -

在 promise 被完成或是被拒絕後立刻呼叫提供的方法。一個新的 promise 將被回傳,新 promise 的狀態改變將基於此 promise 和提供的 callback 方法。

- -

一個適當的 callback 總是在這個方法回傳後調用,無論此 promise 是否已經被完成或是被拒絕。你也可以在同一個 promise 上多次呼叫 then 方法,callback 們將被依照它們的註冊順序依序被調用。

- -
-

警告: 如果 onFulfill callback 拋出例外, onReject callback 並不會被調用,錯誤也不會顯示在 console(你將會看到 promise 鍊失敗錯誤)。作為替代方法,你可以在你準備回傳的 promise 上註冊一個拒絕 callback 方法(使用 catch() 或是 then()),用於處理任何此 promise 上註冊的 callback 中拋出的例外。

-
- -
註: 當你在同一個 promise 上呼叫多次 then 方法時,註冊的 callback 們將被獨立的調用。舉例來說,如果任何例外發生在其中一個 callback 中,它將不會影響其餘 callback 的執行。callback 的行為只會影響它註冊的 then 方法回傳的 promise。實際上,每次調用 then 方法將回傳完全不同的 promise。
- -
Promise then(
-  Function onFulfill,
-  Function onReject
-);
-
- -
參數
- -
-
onFulfill Optional
-
如果 promise 被完成,這個方法將被調用,完成值將作為它的唯一參數,此方法的回傳值將決定 then 方法回傳的新 promise 的狀態。若此參數不是一個方法(通常為null),then 方法回傳的新 promise 將被用和原本 promise 相同的完成值完成。
-
onReject Optional
-
-

如果 promise 被拒絕,這個方法將被調用,拒絕原因將作為它的唯一參數,此方法的回傳值將決定 then 方法回傳的新 promise 的狀態。若此參數不是一個方法(通常為null),then 方法回傳的新 promise 將被用和原本 promise 相同的拒絕原因拒絕。

-
-
- -
回傳值
- -

一個預設等待的 promise ,接著可以假設其狀態基於 callback 方法的結果:

- - - -

catch()

- -

相當於呼叫 then() ,並使用 undefined 作為 onFulfill 參數的值。如果你串接 then(onFulfile).catch(onReject)onFulfill 拋出的例外將會被攔截並傳入 onReject ,這和直接將 onReject 傳入 then() 中不同。

- -
Promise catch(
-  Function onReject
-);
-
- -

因此以下的呼叫是等價的:

- -
p.then(undefined, logError);
-p.catch(logError);
-
- -

除錯

- -

基於 promise 的設計, promise 對象的狀態和值無法在不調用 then() 的前提下同步地檢視。

- -

為了幫助除錯,只有在手動檢視 promise 對象時,才能看到更多資訊,這些資訊是代碼無法訪問的特殊屬性(目前,這是透過隨機化屬性名稱來實現的,因為缺少更複雜的語言或調適器的支持)。

- -

這些代碼無法訪問,可檢視的屬性為:

- - - -

Promise properties are visible in the debugger.Promise handlers can be watched from the Console.

- -

範例

- -

參見 examples.

- -

錯誤處理和常見的陷阱

- -

你應該回報沒有被處理的錯誤,除非你將 promise 移交給調用者或是交給其他的代碼來處理這些錯誤。

- -
// ###### WRONG: Silently drops any rejection notified by "OS.File.Exists".
-OS.File.exists(path).then(exists => { if (exists) myRead(path); });
-
-// ###### WRONG: Silently drops any exception raised by "myRead".
-OS.File.exists(path).then(exists => { if (exists) myRead(path); }, Components.utils.reportError);
-
-// CORRECT (for example, might report the exception "myRead is not defined")
-OS.File.exists(path).then(exists => { if (exists) myRead(path); })
-                    .catch(Components.utils.reportError);
-
-// CORRECT (the function returns a promise, and the caller will handle the rejection)
-function myReadIfExists(path)
-{
-  return OS.File.exists(path).then(exists => { if (exists) myRead(path); });
-}
- -

參見

- - diff --git a/files/zh-tw/mozilla/js-ctypes/index.html b/files/zh-tw/mozilla/js-ctypes/index.html deleted file mode 100644 index a49961f677..0000000000 --- a/files/zh-tw/mozilla/js-ctypes/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: js-ctypes -slug: Mozilla/js-ctypes -translation_of: Mozilla/js-ctypes ---- -

{{jsctypesSidebar("Introduction")}}

- -

js-ctypes allows application and extension code to call back and forth to native code written in C. C++ support is possible through vtable pointers see 使用 COM. For a discussion on extended C++ support see {{bug("505907")}}. Unlike binary XPCOM components, It allows developers to ship a single binary for use with multiple versions of Firefox.

- -
Note: js-ctypes 只能使用在 chrome 的應用程式和擴展裡,
- - - - - - - - -
-

文件

- -
-
使用 JS-Ctypes
-
- -
-
JS-ctypes 參考
-
參考 js-ctypes API. - -
-
- -

View All...

- -

範例

- -
-
Add to iPhoto
-
A Firefox extension that uses js-ctypes to call Carbon and Core Foundation framework routines on Mac OS X to implement an "Add image to iPhoto" feature in Firefox.
-
使用 C 結構和指針
-
 
-
使用 COM
-
 
-
使用 Objective-C
-
- -

使用 JNI/Java

- -
-
Github :: ochameau / jscpptypes
-
A mangling library to use C++ from js-ctypes
-
-
-

社群

- - - - - - -
- -

 

diff --git a/files/zh-tw/mozilla/localization/index.html b/files/zh-tw/mozilla/localization/index.html deleted file mode 100644 index eee1265f5f..0000000000 --- a/files/zh-tw/mozilla/localization/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Mozilla 在地化 -slug: Mozilla/Localization -tags: - - Landing - - Localization - - Mozilla - - NeedsTranslation - - TopicStub - - Translation - - l10n -translation_of: Mozilla/Localization ---- -

在地化(Localization、L10n)指的是翻譯軟體的使用者介面,從一個語言到另一個語言,並調整到適合該語言的文化。這些資源提供給所有對於在地化的技術層面感興趣的人。像是開發者和貢獻者。

- -

延伸閱讀

- -
-
Localizing MDN
-
這些資源涵蓋了 MDN 文件的在地化。
-
App localization
-
這一系列文件特別用於在地化應用程式,包含 Firefox OS 應用程式。
-
L10n
-
Mozilla 用於在地化 Firefox OS 的 L10n API 參考文件。
-
diff --git a/files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html b/files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html deleted file mode 100644 index 08461fecd6..0000000000 --- a/files/zh-tw/mozilla/localization/localizing_with_pontoon/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: 使用 Pontoon 來在地化 -slug: Mozilla/Localization/Localizing_with_Pontoon -translation_of: Mozilla/Localization/Localizing_with_Pontoon ---- -

Pontoon 是一個基於web網頁的、所見即所得(WYSIWYG)的在地化(l10n即localization)工具。在Mozilla基金會,我們使用Pontoon本地化Mozilla網站和Firefox OS(火狐移動操作系統)的應用層(app)接口,就是Gaia。 Pontoon是一個非常簡單和直觀的,僅需要很少甚至沒有技術背景,就能在l10n本地化工作流程中,學會使用的工具。以下,我們將討論如何在本地化項目中使用Pontoon,從最初的註冊登錄到最終面對你的貢獻者(參與該項目的志願者或工作人員)。在這個過程中,我們將挑出Pontoon的一些貼心特性,那將使你十分有效率,並將使l10n本地化共享項目變得更容易。

- -
-

你是位開發者嗎? 閱讀 在你的網站上使用 Pontoon 或學習如何在 GitHub 上使用。

-
- -

第一步

- -

Pontoon 的首頁 is very easy to use. To begin localizing the project, click on the Persona icon and sign in. Next, simply select the project you want to work on and your locale from the dropdown menus. Pontoon will automatically open that locale's project for you to get started. Note that for our purposes here, we'll be using Firefox Affiliates website to demo Pontoon's functionality and workflow. And there it is, opened inside Pontoon:

- -

Browser app and workspace

- -

主要工具列

- -

如你所見,most of the interface is taken by the website being translated. Only the toolbar on top belongs to Pontoon, containing the following items (from left to right):

- -

Main toolbar

- -

字串列表

- -

Opens a sidebar with a list of all strings to localize.

- -

Project selector (Affiliates)

- -

Switches between projects to localize.

- -

Resource selector (Homepage)

- -

Switches between project resources to localize, like subpages or localization files. Hidden if no resources available for project.

- -

- -
-
- -

Locale selector (Slovenian)

- -

Switches between languages to localize.

- -

Go

- -

Opens project-resource-locale selection.

- -

Progress indicator

- -

Displays your progress on the resource being localized. More details are available in the popup.

- -
-
- -

使用者清單

- -

Allows for user-specific tasks, like commiting to repository, downloading files and signing out.

- -

資訊清單

- -

Gives important information, like the anticipated project timeline and a list of keyboard shortcuts.

- -
-
- -

好了,我們現在是不是該來翻譯啦~

- -
-
- -

翻譯字串

- -

當使用 Pontoon 來在地化時,你有多種選擇來翻譯你的字串,你可以直接修改內容、在內容外或是兩種混和。We'll start with looking at in-context translation.

- -

內容中

- -

Pontoon's in-context translation mode is what puts it above others. It opens a web page (or web app) and enables real-time editing of that page. Here's how you translate your first string:

- -

In-context localization

- -
    -
  1. Hover over the text you want to translate with your mouse.
  2. -
  3. An edit button appears over that text. Click on it to enable the translate mode.
  4. -
  5. Replace the original text with its translation into your language.
  6. -
  7. Click the save button to save your translation.
  8. -
- -
-

內容外

- -

Some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural forms. By clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. You can also use the sidebar for out-of-context localization:

- -

Out-of-context localization: list Out-of-context localization: translate

- -
    -
  1. 點擊你想要翻譯的字串。
  2. -
  3. Translation panel with original string and its details (e.g. comments) opens.
  4. -
  5. Translate the string in the translation area below.
  6. -
  7. 按下儲存按鈕來儲存你的翻譯。
  8. -
- -

當你在內容外翻譯,成果將會直接在內容上呈現,if they could also be translated in-context.

- -

翻譯小助手

-
- -

如你所見,suggestions from history, translation memory, machine translation and other locales are also available in the out-of-context translation panel. We call all of these translation helpers and here's how each of them will help you as you translate strings:

- -

Translation helpers: History Translation helpers: Machinery Translation helpers: Other locales Translation helpers: Search

- -

歷史紀錄

- -

Displays previously suggested translations, including from other users.

- -

Machinery

- -

Displays matches from various services: internal translation memory, Mozilla Transvision, open source translation memory, Microsoft terminology and machine translation.

- -

其他語言

- -

Displays matching translations from other locales.

- -

搜尋

- -

Almost like machinery, but takes provided keyword as input parameter instead of the original string.

- -

By clicking a suggestion, it gets copied into translation area.

- -
-
- -

發布你的在地化

- -

Suppose you now want to publish your l10n work by committing it to a repo. Pontoon lets you do that too! Actually, it does that for you by automatically syncing with repositories on hourly basis. You can now pat yourself on the back, do a little dance, go to sleep or do something else to celebrate your work!

diff --git a/files/zh-tw/mozilla/mathml_project/index.html b/files/zh-tw/mozilla/mathml_project/index.html deleted file mode 100644 index dea19cfe6f..0000000000 --- a/files/zh-tw/mozilla/mathml_project/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Mozilla MathML Project -slug: Mozilla/MathML_Project -tags: - - MathML - - MathML Project - - NeedsTranslation - - TopicStub -translation_of: Mozilla/MathML_Project ---- -

The Mozilla MathML project is Mozilla's project to build and enhance MathML support within Firefox and other Mozilla-based applications. For a quick overview, see the slides for the innovation fairs at Mozilla Summit 2013.

-

Updates

-

Mathzilla

- -

Community

- - - -

Sample MathML Documents

- -

Create MathML Documents

- -
-

Original Document Information

- -
-

 

diff --git a/files/zh-tw/mozilla/mathml_project/screenshots/index.html b/files/zh-tw/mozilla/mathml_project/screenshots/index.html deleted file mode 100644 index 880c0ddd35..0000000000 --- a/files/zh-tw/mozilla/mathml_project/screenshots/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: MathML 快照 -slug: Mozilla/MathML_Project/Screenshots -translation_of: Mozilla/MathML_Project/Screenshots ---- - diff --git "a/files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" "b/files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" deleted file mode 100644 index 6572d9e913..0000000000 --- "a/files/zh-tw/mozilla/mathml_project/\351\226\213\351\240\255/index.html" +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: 使用 MathML -slug: Mozilla/MathML_Project/開頭 -tags: - - MathML -translation_of: Mozilla/MathML_Project/Start ---- -

使用 MathML

-

你有看到這頁面理那些精巧的數學算式嗎? 沒有嗎? 太糟糕了, 來這邊看一下你錯過了什麼東西吧。 並快下載支援這個功能的 Mozilla 板本來補救這哀傷的場面!

-

還是你發現你看到的畫面根螢幕截圖不一樣呢? 這牆況通常是因為你少了某些關鍵的 MathML 字型

-

現在準備萬全了, 你應該看得到這個行內等式的尖角符號: x ^ + xy ^ + xyz ^ .  旁邊這個則是小小的公式, det | a c b d | = a d - b c , 也可以被設定成這樣的顯示方式: det | a b c d | = a d - b c .

-

數學的排版非常的挑剔。 MathML in Mozilla 正是著眼於實踐 MathML 標準 - - - 以能達到 所標記即所得 、或者說 所製即所得 - - - ,簡短點就是所謂的 "WYSIWYM"。 而這兩者的差異可以在下面的兩行算式表現出來!( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) n p ( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) n p

-

而這粗體等式的根 y 3 + p y + q = 0  也用粗體呈現 y = - q 2 + q 2 4 + p 3 27 2 3 + - q 2 - q 2 4 + p 3 27 2 3 .

-

而等式 a x 2 + b x + c = 0 ,  的根 在下面的黃色區域內點可以縮放它

-
-

Zoomable Math

-

HTML Content

-
    <p>
-      <math display="block">
-        <mstyle id="zoomableMath" mathbackground="yellow">
-          <mrow>
-            <mi>x</mi>
-            <mo>=</mo>
-            <mfrac>
-              <mrow>
-                <mrow>
-                  <mo>-</mo>
-                  <mi>b</mi>
-                </mrow>
-                <mo>&#xB1;</mo>
-                <msqrt>
-                  <mrow>
-                    <msup>
-                      <mi>b</mi>
-                      <mn>2</mn>
-                    </msup>
-                    <mo>-</mo>
-                    <mrow>
-                      <mn>4</mn>
-                      <mi>a</mi>
-                      <mi>c</mi>
-                    </mrow>
-                  </mrow>
-                </msqrt>
-              </mrow>
-              <mrow>
-                <mn>2</mn>
-                <mi>a</mi>
-              </mrow>
-            </mfrac>
-          </mrow>
-        </mstyle>
-      </math>
-    </p>
-
-
-

JavaScript Content

-
      function zoomToggle()
-      {
-      if (this.hasAttribute("mathsize")) {
-      this.removeAttribute("mathsize");
-      } else {
-      this.setAttribute("mathsize", "200%");
-      }
-      }
-
-      function load()
-      {
-      document.getElementById("zoomableMath").
-      addEventListener("click", zoomToggle, false);
-      }
-
-      window.addEventListener("load", load, false);
-
-

{{ EmbedLiveSample('Zoomable_Math') }}

-

還這邊這個有趣的筆記 { u t + f ( u ) x = 0 u ( 0 , x ) = { u - if  x < 0 u + if  x > 0

-

或是這個複雜的筆記 Ell ^ Y ( Z ; z , τ ) := Y ( l ( y l 2 π i ) θ ( y l 2 π i - z ) θ ( 0 ) θ ( - z ) θ ( y l 2 π i ) ) × ( k θ ( e k 2 π i - ( α k + 1 ) z ) θ ( - z ) θ ( e k 2 π i - z ) θ ( - ( α k + 1 ) z ) ) π ( n ) = m = 2 n ( k = 1 m - 1 ( m / k ) / m / k ) - 1 ϕ W s k ( Ω g ) ( | α | k α ϕ ξ α L s ( Ω g ) s ) 1 / s

-

想要看更多的範例你可以點 MathML Project 頁面的任一連結; 如果你有在編譯自己的版本,可以看一下這個資料夾 - - mozilla/layout/mathml/tests - 。

-

所以你可以做些什麼呢? 你在 Mozilla 上使用時有沒有遇到任何 MathML 標準是沒正常運作的? 或者是一些煩人的東西你覺得需要改進? 或是你之前做的某些東西沒辦法正常運作了(像是 迴歸 )? 如果有遇到這些狀況,快去 BugZilla 回報這些異常吧。BugZilla 世有辦法收錄這些東西的。而且,如果你遇到問題不回報,我們也沒辦法去修正啊?!

-

如果你想要讓 Gecko 成為一個更精巧更完善的 MathML 繪製引擎,加入我們。 你的回應可以以 網站上的 MathML 內容呈現、或者去 BugZilla 回報錯誤。或者,如果你能在在程式碼方面提供協助, 來 檢查或改進目前的程式碼 , 或者是處理我們待處理清單的項目。

-
-  
diff --git a/files/zh-tw/mozilla/performance/about_colon_memory/index.html b/files/zh-tw/mozilla/performance/about_colon_memory/index.html deleted file mode 100644 index f9895899dd..0000000000 --- a/files/zh-tw/mozilla/performance/about_colon_memory/index.html +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: 'about:memory' -slug: 'Mozilla/Performance/about:memory' -translation_of: 'Mozilla/Performance/about:memory' ---- -

about:memory 在Firefox 裡是個特別分頁可讓你你看、存、讀、Firefox 的記憶體處理詳細測量出的差異。 此頁也讓你進行其他記憶體相關的操作例如觸發垃圾回收 (GC) 和循環回收 (CC)、轉存 GC & CC 紀錄和轉存無效堆疊偵測 ( DMD) 報告。 此頁出現在所有版本且不須任何準備即可用它。

- -

如何產生記憶體報告

- -

讓我們假設你想去量測 Firefox 的記憶體使用量。 或許你想自己去調查它、也或許某人要球你使用 about:memory 去產生"記憶體報告"以讓他們可以研究你碰到的問題。 跟著下列步驟走:

- - - -

注意在兩個例子中產生的資料含有私人敏感的細節例如你開在其他分頁的完整清單。如果你不想分享這些訊息,你可以選擇 "anonymize" 核取格,在按下 "Measure and save..." 或 "Measure..."之前。 這將造成私人敏感資料被剝掉,但也可能會造成其他人難以去研究記憶體用量。

- -

從檔案讀取記憶體報告

- -

最簡單的方法從檔案讀取記憶體報告就是用 "Load..." 按鈕。 你也可以用 "Load and diff..." 按鈕去獲得在兩個記憶體報告檔中的差異。

- -

單一記憶體報告檔也可以自動被讀取,當附加一個檔案查詢字串,例如:

- -
about:memory?file=/home/username/reports.json.gz
-
- -

這是從其他Firefox裝置系統讀取記憶體報告檔最有用的。

- -

記憶體報告被儲存到壓縮的格式 (gzipped JSON)。 這些檔案可以被直接讀或解壓縮後讀入。

- -

解釋記憶體報告

- -

幾乎在 about:memory 中你看到東西都有工具提示的解釋。停留在任何按鈕將看到它作用的描述。停留在任何文字量測值上將看到它意義的描述。

- -

量測基本

- -

大多數量測使用位元組為他們的單位,但某些是百分比計算。

- -

多數量測值表示在樹狀目錄結構中。例如:

- -
 585 (100.0%) -- preference-service
- └──585 (100.0%) -- referent
-    ├──493 (84.27%) ── strong
-    └───92 (15.73%) -- weak
-        ├──92 (15.73%) ── alive
-        └───0 (00.00%) ── dead
-
- -

枝葉節點表示實際量測值:每個內部節點值是子節點的總和。

- -

樹狀目錄的使用允許量測值分成進一步的目錄、次目錄、次次目錄…….如果需要可到任意深度。一個目錄中所有的量測值不會重疊。

- -

樹狀可以用斜線 '/' 作為分隔符號被描寫。 例如, preference/referent/weak/dead 表示上列中到最後枝葉節點的路徑。

- -

次目錄按它可以被縮起或展開。如果你發現任何特別的樹狀目錄,這可以幫你馬上縮起主根下所有分枝,然後慢慢展開感興趣的。

- -

報告區間 Sections

- -

記憶體報告依照每個預處理原則、每個區間一個程序被顯示,在每個程序的量測值中,還有更多小區間。

- -

Explicit Allocations

- -

這個區間包含一個單一樹狀目錄,叫做 "explicit",量測所有經由表層呼叫(explicit calls)去堆疊配置函數和非堆疊配置函數(例如 mmap and VirtualAlloc)的記憶體。

- -

這裡是瀏覽器區間的例子,分頁打開了 cnn.com、 techcrunch.com、 和 arstechnica.com。不同的次目錄被展開,其他的因展示緣故被縮起。

- -
191.89 MB (100.0%) -- explicit
-├───63.15 MB (32.91%) -- window-objects
-│   ├──24.57 MB (12.80%) -- top(http://edition.cnn.com/, id=8)
-│   │  ├──20.18 MB (10.52%) -- active
-│   │  │  ├──10.57 MB (05.51%) -- window(http://edition.cnn.com/)
-│   │  │  │  ├───4.55 MB (02.37%) ++ js-compartment(http://edition.cnn.com/)
-│   │  │  │  ├───2.60 MB (01.36%) ++ layout
-│   │  │  │  ├───1.94 MB (01.01%) ── style-sheets
-│   │  │  │  └───1.48 MB (00.77%) -- (2 tiny)
-│   │  │  │      ├──1.43 MB (00.75%) ++ dom
-│   │  │  │      └──0.05 MB (00.02%) ── property-tables
-│   │  │  └───9.61 MB (05.01%) ++ (18 tiny)
-│   │  └───4.39 MB (02.29%) -- js-zone(0x7f69425b5800)
-│   ├──15.75 MB (08.21%) ++ top(http://techcrunch.com/, id=20)
-│   ├──12.85 MB (06.69%) ++ top(http://arstechnica.com/, id=14)
-│   ├───6.40 MB (03.33%) ++ top(chrome://browser/content/browser.xul, id=3)
-│   └───3.59 MB (01.87%) ++ (4 tiny)
-├───45.74 MB (23.84%) ++ js-non-window
-├───33.73 MB (17.58%) ── heap-unclassified
-├───22.51 MB (11.73%) ++ heap-overhead
-├────6.62 MB (03.45%) ++ images
-├────5.82 MB (03.03%) ++ workers/workers(chrome)
-├────5.36 MB (02.80%) ++ (16 tiny)
-├────4.07 MB (02.12%) ++ storage
-├────2.74 MB (01.43%) ++ startup-cache
-└────2.16 MB (01.12%) ++ xpconnect
- -

某些專家才需要瞭解這裡所有的細節,但有很多東西值得解釋。

- - - -

某些附加元件 add-ons 的記憶體用量有識別性, 像下列例子所示:

- -
├───40,214,384 B (04.17%) -- add-ons
-│   ├──21,184,320 B (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([System Principal], jar:file:///Users/njn/Library/Application%20Support/Firefox/Profiles/puna0zr8.new/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js (from: resource://gre/modules/addons/XPIProvider.jsm:4307))
-│   ├──11,583,312 B (01.20%) ++ jid1-xUfzOsOFlzSOXg@jetpack/js-non-window/zones/zone(0x100496800)
-│   ├───5,574,608 B (00.58%) -- {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
-│   │   ├──5,529,280 B (00.57%) -- window-objects
-│   │   │  ├──4,175,584 B (00.43%) ++ top(chrome://chatzilla/content/chatzilla.xul, id=4293)
-│   │   │  └──1,353,696 B (00.14%) ++ top(chrome://chatzilla/content/output-window.html, id=4298)
-│   │   └─────45,328 B (00.00%) ++ js-non-window/zones/zone(0x100496800)/compartment([System Principal], file:///Users/njn/Library/Application%20Support/Firefox/Profiles/puna0zr8.new/extensions/%7B59c81df5-4b7a-477b-912d-4e0fdf64e5f2%7D/components/chatzilla-service.js)
-│   └───1,872,144 B (00.19%) ++ treestyletab@piro.sakura.ne.jp/js-non-window/zones/zone(0x100496800)
- -

更多細節值得解釋如下:

- - - -

其他量測值

- -

這個區間包含多目錄,包括許多在 "explicit" 目錄中橫跨的量測值。 例如, 在 "explicit"目錄所有的 DOM 和 layout 量測值是被打散成一個又一個視窗, 但在 "Other Measurements" 這些量測值是整合為由整個瀏覽器來的總和, 如下例所示:

- -
26.77 MB (100.0%) -- window-objects
-├──14.59 MB (54.52%) -- layout
-│  ├───6.22 MB (23.24%) ── style-sets
-│  ├───4.00 MB (14.95%) ── pres-shell
-│  ├───1.79 MB (06.68%) ── frames
-│  ├───0.89 MB (03.33%) ── style-contexts
-│  ├───0.62 MB (02.33%) ── rule-nodes
-│  ├───0.56 MB (02.10%) ── pres-contexts
-│  ├───0.47 MB (01.75%) ── line-boxes
-│  └───0.04 MB (00.14%) ── text-runs
-├───6.53 MB (24.39%) ── style-sheets
-├───5.59 MB (20.89%) -- dom
-│   ├──3.39 MB (12.66%) ── element-nodes
-│   ├──1.56 MB (05.84%) ── text-nodes
-│   ├──0.54 MB (02.03%) ── other
-│   └──0.10 MB (00.36%) ++ (4 tiny)
-└───0.06 MB (00.21%) ── property-tables
- -

在這區間的某些目錄量測那些在 "explicit" 目錄中不是橫跨目錄的量測值,例如在上上個例子中的這個 "preference-service" 。

- -

最後, 在這區間結尾是獨立的量測值, 如下例所示:

- -
    0.00 MB ── canvas-2d-pixels
-    5.38 MB ── gfx-surface-xlib
-    0.00 MB ── gfx-textures
-    0.00 MB ── gfx-tiles-waste
-          0 ── ghost-windows
-  109.22 MB ── heap-allocated
-        164 ── heap-chunks
-    1.00 MB ── heap-chunksize
-  114.51 MB ── heap-committed
-  164.00 MB ── heap-mapped
-      4.84% ── heap-overhead-ratio
-          1 ── host-object-urls
-    0.00 MB ── imagelib-surface-cache
-    5.27 MB ── js-main-runtime-temporary-peak
-          0 ── page-faults-hard
-    203,349 ── page-faults-soft
-  274.99 MB ── resident
-  251.47 MB ── resident-unique
-1,103.64 MB ── vsize
- -

某些量測值標示如下:

- - - -

系統 System

- -

這區間只顯示在Firefox OS。 它包含全裝置從操作系統所測得值。在其之中, 這些區間有助於精確瞭解裝置的記憶體如何被使用。

- -

......翻譯完雖然瞭解不少,卻僅知哪些資訊可以給改善者參考,要解決使用者記憶體的問題,還是建議各位設計師可以整合One Tab之類的軟體,限制記憶體使用例如最大800MB,如果超過了,依使用者習慣分為100個分頁中有20個維持開啟活動、剩下的逐步變成例如完整保存的網頁檔之類,平時留個分頁籤名字只是看看而已,點到了才載入,就不會讓人難忍受了,也不會吃太多記憶體就依照個人使用狀況自行分配就好,畢竟閒置的除了影像外,很多只是在播放廣告,一點感想。

diff --git a/files/zh-tw/mozilla/performance/index.html b/files/zh-tw/mozilla/performance/index.html deleted file mode 100644 index f8261ab133..0000000000 --- a/files/zh-tw/mozilla/performance/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: Performance -slug: Mozilla/Performance -tags: - - NeedsTranslation - - Performance - - TopicStub -translation_of: Mozilla/Performance ---- -

被連接到此的這篇文章將幫助你改進效能,不論你是開發 Mozilla 核心碼或附加元件。

- - - - - - - - -
-

Documentation

- -
-
回報性能問題 Rorting a Performance Problem
-
對使用者友善的指導以報告性能問題。不需要開發環境。
-
性能最好的實踐在擴充元件中
-
給擴充元件開發者性能"最好的實踐"指引。
-
測量附加元件啟動效能
-
給附加元件開發者指引如何設定測試環境。
-
XUL School: 附加元件效能
-
給附加元件開發者提示去幫他們避免損害應用效能。
-
GPU 效能
-
當使用GPU時給研究和改進效能的可靠建議
-
- -

查看所有頁面以 "Performance" 標籤的...

- -

記憶體研究和漏洞偵測工具

- -
-
about:memory
-
about:memory 是最輕巧使用工具給量測記憶體用量使用在 Mozilla 程式碼,且是最好出發地。它也讓你進行其他記憶體相關的操作像觸發垃圾回收 (GC) 和循環回收 (CC)、轉存 GC & CC 紀錄和轉存無效堆疊偵測 ( DMD) 報告。 about:memory 是建立在 Firefox's memory reporting 構造上.
-
DMD
-
無效堆疊偵測 (DMD) 是個可識別在about:memory中的量測值問題點,而且可以作各式各樣的一般堆疊研究。
-
areweslimyet.com
-
areweslimyet.com (又名 AWSY) 是記憶體用和回歸偵測系統。
-
BloatView
-
BloatView 在配置和引用計數時列印按類別統計資料,且依類別提供記憶體中洩漏的分解總數目。它常用為 Mozilla持續整合測試的一部分。
-
引用計數追蹤與平衡
-
引用計數追蹤與平衡是個手段要追蹤由引用計數不正確的使用造成的洩漏。 他們遲緩又不那麼容易使用,且因此大多數適合專家級開發者使用。
-
GC and CC logs
-
觸發垃圾回收 (GC) 和循環回收 (CC)紀錄可被產生與分析以不同方式。特別是,他們能幫助瞭解為何特定勿建一直保持存在記憶體。
-
Valgrind
-
Valgrind 是個即時偵測種種記憶體相關的問題含洩漏的工具。 Valgrind 常作為Mozilla's持續整合測試的 部份  ,雖然Valgrind的遲緩讓應用範圍受限。
-
LeakSanitizer
-
LeakSanitizer (又叫 LSAN) 相似於 Valgrind。 但它跑得快一些因為它使用靜態來源碼架構。LSAN常作為Mozilla's持續整合測試的一部分,雖然多數測試執行時它也是 AddressSanitizer (又叫 ASAN) 測試工作的一部分。
-
Apple tools
-
Apple provides some tools for Mac OS X that report similar problems to those reported by LSAN and Valgrind. The "leaks" tool is not recommended for use with SpiderMonkey or Firefox, because it gets confused by tagged pointers and thinks objects have leaked when they have not (see bug 390944).
-
Leak Gauge
-
Leak Gauge is a tool that can be used to detect certain kinds of leaks in Gecko, including those involving documents, window objects, and docshells.
-
LogAlloc
-
LogAlloc is a tool that dumps a log of memory allocations in Gecko. That log can then be replayed against Firefox's default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload.
-
Memory Profiler
-
The memory profiler samples allocation events and provides different views to analyze the allocation characteristic.
-
- -

See also the documentation on Leak-hunting strategies and tips.

-
-

Profiling and performance tools

- -
-
Profiling with the Developer Tools Profiler
-
The profiler built into the developer tools has a high-level waterfall, detailed call tree, allocations and GC profiling, and flame graphs. It is available on all platforms and release channels, and also supports remote profiling b2g and Fennec.
-
- -
-
Profiling with the Gecko Profiler Addon {{ gecko_minversion_inline("16.0") }}
-
The Gecko Profiler Addon is a good tool to start with.
-
Profiling with Instruments
-
How to use Apple's Instruments tool to profile Mozilla code.
-
Profiling with Xperf
-
How to use Microsoft's Xperf tool to profile Mozilla code.
-
Profiling with Concurrency Visualizer
-
How to use Visual Studio's Concurrency Visualizer tool to profile Mozilla code.
-
Profiling with Zoom
-
Zoom is a profiler for Linux done by the people who made Shark
-
Measuring performance using the PerfMeasurement.jsm code module {{ gecko_minversion_inline("2.0") }}
-
Using PerfMeasurement.jsm to measure performance data in your JavaScript code.
-
Adding a new Telemetry probe
-
Information on how to add a new measurement to the Telemetry performance-reporting system
-
Profiling JavaScript with Shark {{ gecko_minversion_inline("1.9") }}
-
How to use the Mac OS X Shark profiler to profile JavaScript code in Firefox 3.5 or later.
-
Profiling with Shark
-
How to use Apple's Shark tool to profile Mozilla code.
-
Investigating CSS Performance
-
How to figure out why restyle is taking so long
-
- -

Power profiling

- -
-
Power profiling overview
-
This page provides an overview of relevant information, including details about hardware, what can be measured, and recommended approaches. It should be the starting point for anybody new to power profiling.
-
tools/power/rapl (Mac, Linux)
-
tools/power/rapl is a command-line utility in the Mozilla codebase that uses the Intel RAPL interface to gather direct power estimates for the package, cores, GPU and memory.
-
powermetrics (Mac-only)
-
powermetrics is a command-line utility that gathers and displays a wide range of global and per-process measurements, including CPU usage, GPU usage, and various wakeups frequencies.
-
TimerFirings logging (All platforms)
-
TimerFirings logging is a built-in logging mechanism that prints data on every time fired.
-
dtrace (Mac-only)
-
dtrace is a powerful kernel instrumentation tool. One of its many features is the ability to instrument wakeups in a high-context fashion.
-
Activity Monitor, Battery Status Menu and top (Mac-only)
-
The battery status menu, Activity Monitor and top are three related Mac tools that have major flaws but often consulted by users, and so are worth understanding.
-
Intel Power Gadget (Windows, Mac, Linux)
-
Intel Power Gadget provides real-time graphs for package and processor RAPL estimates. It also provides an API through which those estimates can be obtained.
-
perf (Linux-only)
-
perf is a powerful command-line utility that can measure many different things, including energy estimates and high-context measurements of things such as wakeups.
-
turbostat (Linux-only)
-
turbostat is a command-line utility that gathers and displays various power-related measurements, with a focus on per-CPU measurements such as frequencies and C-states.
-
powertop (Linux-only)
-
powertop is an interactive command-line utility that gathers and displays various power-related measurements.
-
- - - -
-
JavaScript, XPCOM, Developing Mozilla, Extensions, Addons
-
-
- -

 

diff --git a/files/zh-tw/mozilla/preferences/index.html b/files/zh-tw/mozilla/preferences/index.html deleted file mode 100644 index 1169ecabf1..0000000000 --- a/files/zh-tw/mozilla/preferences/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: Preferences -slug: Mozilla/Preferences -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Preferences ---- -

The preference system makes it possible to store data for Mozilla applications using a key/value pairing system. These articles provide information about how to use the preference system.

- - - - - - - -
-

Documentation

-
-
Preferences system
-
An introduction to using the preference system in Mozilla.
-
XUL School: Handling preferences
-
The XUL School tutorial chapter on preferences.
-
Mozilla preference reference
-
A reference guide to all Mozilla preferences; currently a work in progress.
-
A brief guide to Mozilla preferences
-
An introductory guide to where preferences are stored and other useful information about the core preference system.
-
Using preferences from application code {{gecko_minversion_inline("6.0")}}
-
Firefox 6 introduced static functions for accessing preferences efficiently from within application code. This API is not available for add-ons, but if you're working on a Gecko application, this API is the preferred way to access preferences.
-
Mozilla networking preferences
-
A guide to key networking-related preferences.
-
Mozilla preferences for uber-geeks
-
A guide to preferences that only truly elite geeks should play with.
-
-

View all pages tagged with "Preferences"...

-
-

Examples

-
-
Code snippets
-
Preference-related code snippets.
-
Adding preferences to an extension
-
How to add preferences to an existing extension.
-
- - -
diff --git a/files/zh-tw/mozilla/preferences/preferences_system/index.html b/files/zh-tw/mozilla/preferences/preferences_system/index.html deleted file mode 100644 index 965cd97480..0000000000 --- a/files/zh-tw/mozilla/preferences/preferences_system/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Preferences system -slug: Mozilla/Preferences/Preferences_system -tags: - - NeedsTranslation - - Preferences system - - TopicStub - - XUL -translation_of: Mozilla/Preferences/Preferences_system ---- -

This document describes Toolkit's preferences system. Using this system it is possible to create preferences windows that display and operate appropriately on various platforms (Windows, MacOS X and GNOME).

- -

The system is implemented through a few XUL elements and attributes. Reference information about them is available below:

-

Preferences System documentation:

-

Use

-

Code for a typical preferences window may look like this:

-
<prefwindow id="appPreferences"
-            xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <prefpane id="pane1" label="&pane1.title;">
-    <preferences>
-      <preference id="pref1" name="pref.name" type="bool"/>
-    </preferences>
-
-   .. UI elements that refer to the preferences above, e.g.:
-    <checkbox id="check1" preference="pref1"
-              label="&check1.label;" accesskey="&check1.accesskey;"/>
-  </prefpane>
-
-  <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/>
-</prefwindow>
-
-

Pane content can be specified inline or an external chrome URI supplied for pane content to be loaded in via a dynamic overlay. You should be careful to read the HIGs for the platforms you are targeting and use the XUL preprocessor if necessary to set different window titles as appropriate. You should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. Windows).

-

Usage in XULRunner applications

-

When calling openDialog() to open a preferences dialog, "toolbar" should be included in the features string.  Not using "toolbar" will cause the preferences dialog to only display one preference pane.

-

Example:

-
var features = "chrome,titlebar,toolbar,centerscreen,modal";
-window.openDialog(url, "Preferences", features);
-
-

Bugzilla

-

The component for bugs in the Preferences bindings (but not in Firefox/Thunderbird Options UI) is Toolkit:Preferences (file a bug list open bugs)

diff --git a/files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html b/files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html deleted file mode 100644 index f583b29b26..0000000000 --- a/files/zh-tw/mozilla/preferences/preferences_system/new_attributes/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Preference XUL Attributes -slug: Mozilla/Preferences/Preferences_system/New_attributes -translation_of: Mozilla/Preferences/Preferences_system/New_attributes ---- -

 

-

<prefwindow> 裡的 Widgets 可能有下述屬性 (除此以外,尚有標準屬性).

-

preference

-

Specifies id of the linked <preference> element. preference 和 widget 兩者的 value 將保持同步.

-

如下例,當 pane 被載入時, textbox 從名稱 extensions.example.mypref 的 preference 來自動初始化它的 value ;反過來說,當使用者改變 textbox 的 value 時,<preference>元素的 value 會同步更新,並將在適當的時候儲存至 preferences system.

-
<preference id="my_pref" name="extensions.example.mypref" type="unichar"/>
-<textbox preference="my_pref"/>
-
-

preference-editable

-

By default, the <preference> element will automatically modify the value of a few standard widgets: checkbox, colorpicker, radiogroup, textbox, listitem, listbox, and menulist.

-

If you wish it to update the value of an element with different local name, for example your own XBL widget, you need to set the preference-editable="true" attribute on it.

-

For your widget to modify the <preference>'s value, you need to make sure a change, command, or input event is fired after the widget's value changes.

-

bug # or any testcases ? Note: this does not currently work on the tree widget. It may not work on anything so far (the API says it is to be available in version 1.8).

-

onsyncfrompreference/onsynctopreference

-

Often you will have UI whose construction does not map easily to a given preference type. 例如,你可能有一個 checkbox,當一個整數值是 3 時它被打勾,是 2 時不被打勾。為了初始化這個 UI 元素,你不能依賴預設的 initialization routine,因為這兩個數值對 checkbox 元素來說是無意義的. 你需要寫轉換函數來轉換 preference value 成 UI 元素可用的初始值,並且也轉換 UI 元素的 value 成某些格式來儲存至 preferences file. 這就是 onsyncfrompreference/onsynctopreference 的作用.

-

onsyncfrompreference 被呼叫,當一個元素從 preferences 被初始化。 明確地說, 當一個 preference 元素的 value 被載入, 所有使用那個 preference 的元素將使他們的 onsyncfrompreference handler 被呼叫.

-
- Be careful when writing onsyncfrompreference handlers.  <preference> elements defined after the preference element  being dealt with will not yet have their value set, so referring to them from the handler will lead to a null result. Reorder the <preference> elements or directly fetch the preference value via Services.prefs
-

If you supply an implementation of this event, your implementation will be invoked during initialization and you can return the value with which to initialize the UI element with, or undefined to tell the preferences system to initialize the UI element with the default value (i.e. to attempt to initialize with the preference value). In the above example, you might write the checkbox like this:

-
<checkbox preference="foo.bar" onsyncfrompreference="return onsyncfrompreference();"/>
-
-.. script:
-function onsyncfrompreference()
-{
-  var preference = document.getElementById("foo.bar");
-  // .value === undefined means the preference is set to the default value
-  var actualValue = preference.value !== undefined ?
-                      preference.value : preference.defaultValue;
-  // actualValue may be |null| here if the pref didn't have the default value.
-  return preference.value == 3;
-
-  // If foo.bar was boolean and we wanted to use its value to initialize
-  // the checkbox, we could still implement this method if we wanted to
-  // perform any other initialization actions at this time.
-}
-
-

onsynctopreference is called when preferences are being written - the preferences system asks each element to translate its current state into a value suitable for writing to the specified preference. You can return a special value or undefined to tell the preferences system to use its standard means for obtaining the value. In the above example:

-
<checkbox preference="foo.bar" onsynctopreference="return onsynctopreference();"/>
-.. script:
-function onsynctopreference()
-{
-  var checkbox = document.getElementById("checkbox");
-  return checkbox.checked ? 3 : 2;
-}
-
-// If foo.bar was boolean and we wanted to use its value to write to
-// preferences, we could still implement this method if we wanted to
-// perform any other initialization actions at this time.
-
-

Preferences System documentation:

diff --git a/files/zh-tw/mozilla/projects/index.html b/files/zh-tw/mozilla/projects/index.html deleted file mode 100644 index 7e832a9616..0000000000 --- a/files/zh-tw/mozilla/projects/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Projects -slug: Mozilla/Projects -tags: - - Landing - - Mozilla - - NeedsContent - - NeedsTranslation - - Projects - - TopicStub -translation_of: Mozilla/Projects ---- -

Below you'll find links to documentation about various Mozilla projects; these are often parts of Firefox or other products, but may also be used in other projects as well.

-

{{ LandingPageListSubpages() }}

diff --git a/files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html b/files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html deleted file mode 100644 index 83eb55baba..0000000000 --- a/files/zh-tw/mozilla/projects/nss/getting_started_with_nss/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Getting Started With NSS -slug: Mozilla/Projects/NSS/Getting_started_with_NSS -translation_of: Mozilla/Projects/NSS/Getting_started_with_NSS ---- -

如何參與NSS

- -

網絡安全服務(NSS)是Mozilla軟件使用的加密算法和安全網絡協議的基礎庫。
-
- 您想參與並幫助我們改善Mozilla Firefox和其他使用NSS的應用程序的核心安全性嗎?我們期待著您的貢獻!
-
- 我們有大量任務等待您關注,我們很樂意協助您確定與您的興趣或技能相匹配的領域。您可以在Mozilla IRC#nss頻道中找到我們,也可以在mozilla.dev.tech.crypto新聞組中提問。

- -

NSS庫及其支持的命令行工具使用C編程語言編寫。它的構建系統和自動化測試基於makefile和bash腳本。

- -

隨著時間的流逝,已經產生了許多描述NSS各個方面的文檔。您可以從以下內容開始:

- - - -

(不幸的是,NSS項目目前沒有技術撰稿人,因此我們的文檔沒有我們想要的那樣井井有條。您可以通過更好的組織方式來做出貢獻。)

- -

NSS示例代碼

- -

由NSS開發人員維護的命令行工具是開始學習如何編寫NSS應用程序的好地方。您可以在子目錄mozilla / security / nss / cmd中找到它們

- -

或看看一些基本的NSS示例代碼

- -

目前正在開發和審查一組新的樣本,請參閱創建新的NSS樣本

- -

歡迎您通過以下方式下載示例:hg clone https://hg.mozilla.org/projects/nss; cd nss; hg更新SAMPLES_BRANCH

- -

如何貢獻

- -

...(此部分仍在建設中,但是有很多貢獻的機會)

- -

如果您沒有,請先在bugzilla.mozilla.org上打開一個bugzilla帳戶。

- -

NSS ::庫組件可解決您要處理的問題。我們維護了一個標記為“ good-first-bug”NSS錯誤列表,您可以查看這些錯誤

- -

創建補丁

- -

請參閱有關NSS來源,構建和測試的部分,以開始製作補丁。當您對此感到滿意時,就需要進行代碼審查。

- -

代碼審查

- -

http://phabricator.services.mozilla.com/是我們的代碼審查工具,它使用您的Bugzilla帳戶。使用我們的Phabricator用戶說明上傳補丁進行審核

- -

Github上的清單形式列出了一些在代碼審查期間將要評估的項目

- -

通過審查後,您的補丁程序可以由NSS小組的成員登陸。您可以在Mozilla IRC#nss頻道中找到我們。

- -

請注意,我們不會發布未經審查和測試的代碼。代碼僅在具有測試的情況下才有效,而測試僅在它們屬於自動化的一部分時才有效。

diff --git a/files/zh-tw/mozilla/projects/nss/index.html b/files/zh-tw/mozilla/projects/nss/index.html deleted file mode 100644 index 186df02c73..0000000000 --- a/files/zh-tw/mozilla/projects/nss/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: Network Security Services -slug: Mozilla/Projects/NSS -tags: - - JSS - - NSS - - NeedsMigration - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Projects/NSS ---- -

Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Applications built with NSS can support SSL v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security standards.

- -

For detailed information on standards supported, see Overview of NSS. For a list of frequently asked questions, see the FAQ.

- -

NSS is available under the Mozilla Public License. For information on downloading NSS releases as tar files, see Download PKI Source.

- -

If you're a developer and would like to contribute to NSS, you might want to read the documents highlevel overview of internal details of NSS and getting started with NSS.

- - - - - - - - -
-

Documentation

- -

Background Information

- -
-
Overview of NSS
-
Provides a brief summary of NSS and its capabilities.
-
NSS FAQ
-
Answers basic questions about NSS.
-
Introduction to Public-Key Cryptography
-
Explains the basic concepts of public-key cryptography that underlie NSS.
-
Introduction to SSL
-
Introduces the SSL protocol, including information about cryptographic ciphers supported by SSL and the steps involved in the SSL handshake.
-
- -

Getting Started

- -
-
NSS Releases
-
This page contains information about the current and past releases of NSS.
-
Get the source code and Build it
-
Instructions on how to build NSS on the different supported platforms.
-
Get Mozilla Source Code Using Mercurial
-
Information about with working with Mercurial.
-
Get Mozilla Source Code Using CVS (deprecated)
-
Old deprecated CVS documentation.
-
- -

NSS APIs

- -
-
Introduction to Network Security Services
-
Provides an overview of the NSS libraries and what you need to know to use them.
-
NSS SSL Public Functions
-
Summarizes the SSL APIs exported by the NSS shared libraries.
-
NSS SSL Reference
-
API used to invoke SSL operations.
-
NSS API Guidelines
-
Explains how the libraries and code are organized, and guidelines for developing code (naming conventions, error handling, thread safety, etc.)
-
NSS Technical Notes
-
Links to NSS technical notes, which provide latest information about new NSS features and supplementary documentation for advanced topics in programming with NSS.
-
- -

Tools, testing, and other technical details

- -
-
Build Instructions for NSS
-
Describe how to check out and build NSS releases.
-
- -
-
NSS Developer Tutorial
-
How to make changes in NSS. Coding style, maintaining ABI compatibility.
-
- -
-
NSS Tools
-
Tools for developing, debugging, and managing applications that use NSS.
-
Sample Code
-
Demonstrates how NSS can be used for cryptographic operations, certificate handling, SSL, etc.
-
Third-Party Code
-
A list of third-party code included in the NSS library.
-
NSS 3.2 Test Suite
-
Archived version. Describes how to run the standard NSS tests.
-
NSS Performance Reports
-
Archived version. Links to performance reports for NSS 3.2 and later releases.
-
Encryption Technologies Available in NSS 3.11
-
Archived version. Lists the cryptographic algorithms used by NSS 3.11.
-
NSS 3.1 Loadable Root Certificates
-
Archived version. Describes the scheme for loading root CA certificates.
-
cert7.db
-
Archived version. General format of the cert7.db database.
-
- -

PKCS #11 information

- - - -
-
- -

CA certificates pre-loaded into NSS

- - - -
-
- -

NSS is built on top of Netscape Portable Runtime (NSPR)

- -
-
Netscape Portable Runtime
-
NSPR project page.
-
NSPR Reference
-
NSPR API documentation.
-
- -

Additional Information

- - - -

Planning

- -

Information on NSS planning can be found at wiki.mozilla.org, including:

- - -
-

Community

- -
    -
  • View Mozilla Security forums...
  • -
- -

{{ DiscussionList("dev-security", "mozilla.dev.security") }}

- -
    -
  • View Mozilla Cryptography forums...
  • -
- -

{{ DiscussionList("dev-tech-crypto", "mozilla.dev.tech.crypto") }}

- - - - -
diff --git a/files/zh-tw/mozilla/projects/rhino/index.html b/files/zh-tw/mozilla/projects/rhino/index.html deleted file mode 100644 index 9167cbfaac..0000000000 --- a/files/zh-tw/mozilla/projects/rhino/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Rhino -slug: Mozilla/Projects/Rhino -tags: - - JavaScript - - Mozilla - - NeedsTranslation - - NeedsUpdate - - Rhino - - TopicStub -translation_of: Mozilla/Projects/Rhino ---- -

Image:rhino.jpg

- -

Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. It is embedded in J2SE 6 as the default Java scripting engine.

- -

Rhino downloads

- -

How to get source and binaries

- -

Rhino documentation

- -

Information on Rhino for script writers and embedders.

- -

Rhino help

- -

Some resources if you get stuck.

diff --git a/files/zh-tw/mozilla/projects/rhino/license/index.html b/files/zh-tw/mozilla/projects/rhino/license/index.html deleted file mode 100644 index 951430039e..0000000000 --- a/files/zh-tw/mozilla/projects/rhino/license/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Rhino license -slug: Mozilla/Projects/Rhino/License -translation_of: Mozilla/Projects/Rhino/License ---- -

Rhino可在開源許可下使用。

- -

MPL / GPL許可

- -

Rhino的大部分源代碼都是在MPL 1.1 / GPL 2.0許可下提供的。

- -

部分Rhino調試器的許可證

- -

此外,一些文件(目前是toolsrc / org / mozilla / javascript / tools / debugger / treetable /的內容)在以下許可下可用:

- -
 *版權所有1997,1998 Sun Microsystems,Inc。保留所有權利。
- *
- *重新分發和使用源和二進制形式,有或沒有
- *修改,如果滿足以下條件,則允許
- *符合:
- *
- *  - 源代碼的重新分發必須保留上述版權
- *通知,此條件清單和以下免責聲明。
- *
- *  - 二進制形式的再分發必須複製上述版權
- *通知,此條件清單和以下免責聲明
- *隨分發提供的文件和/或其他材料。
- *
- *  -  Sun Microsystems的名稱和名稱
- *貢獻者可用於支持或推廣衍生產品
- *未經事先書面許可,不得使用本軟件。
- *
- *本軟件由版權所有者和貢獻者“提供
- *“是”以及任何明示或暗示的擔保,包括但不限於,
- *對適銷性和特定適用性的暗示保證
- *目的不承擔任何責任。在任何情況下都不應該是版權所有者或
- *貢獻者對任何直接,間接,偶然,特殊的,
- *示範性或後續性損害(包括但不限於,
- *購買替代商品或服務; 丟失使用,數據或
- *利潤; 或商業中斷)然而,導致和任何理論
- *責任,無論是合同,嚴格責任還是侵權(包括
- *疏忽或以其他方式)以任何方式使用此產品
- *軟件,即使被告知此類損害的可能性。
-
- -
-

Norrisboyd 2008年4月14日06:16(PDT)

diff --git a/files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html b/files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html deleted file mode 100644 index 57d1cc41db..0000000000 --- a/files/zh-tw/mozilla/qa/bug_writing_guidelines/index.html +++ /dev/null @@ -1,246 +0,0 @@ ---- -title: Bug writing guidelines -slug: Mozilla/QA/Bug_writing_guidelines -tags: - - 錯誤回報 -translation_of: Mozilla/QA/Bug_writing_guidelines ---- -
-

If you need help with Mozilla software (for example with Firefox, Seamonkey or Thunderbird), use one of the available support options. Do not edit this page!

-
- -

This page assumes you'd like to contribute to the Mozilla project by collecting enough information to enter a useful bug report in Bugzilla, the Mozilla bug tracking system. Thank you!

- -

If you're new to reporting bugs, you may want to try getting help from the more experienced contributors. See the Community section on the QA page for pointers. If you're going to report a Firefox bug, you can also get assistance in the #firefox channel on irc.mozilla.org. For other projects (e.g., Thunderbird, SeaMonkey)  you can find the appropriate channel on IRC.

- -

如何回報錯誤

- -

每次回報一個錯誤

- -

如此一來能夠有效率地處理每個錯誤。

- -

其他需要您注意的事項

- -
    -
  1. 釐清如何 重現您遇到的錯誤: - -
      -
    • 如果能夠 完整描述重現錯誤過程 —太棒了! — 您將提供有收穫的錯誤回報。
    • -
    • 有時能夠重現問題,但不確定是用什麼特定的方法,則您需要提供有幫助的額外資訊。
    • -
    • 如果無法重現問題,回報該問題可能沒有太大的幫助,除非在發現錯誤時,您有獨特的發現。
    • -
    -
  2. -
  3. 檢查軟體是否已更新至最新版本。建議先測試開發中版本來確認錯誤是不是早就修正(例如:Firefox Beta, Aurora, 或是走在科技前端的 Nightly
  4. -
  5. When reporting a Firefox bug, first check if you can reproduce the bug in a new Firefox profile. If the bug only happens in your existing profile, try to figure out what settings, extensions, or files in your profile are needed to reproduce the bug. -
      -
    • If the bug seems egregious (i.e. obviously affecting a large portion of users), there's probably something unusual about your setup that's a necessary part of the steps to reproduce the bug. You have much better chances of figuring it out than a developer who does not have access to your system.
    • -
    • If the bug falls into one of specific types of bugs listed in a section below, it may still be useful even if you can't reproduce it in a new Firefox profile.
    • -
    -
  6. -
  7. Open the Enter a new bug form, which will guide you through most of the bug reporting process: -
      -
    • Create a Bugzilla account if you don't have one already, select the product having the bug.
    • -
    • Enter a clear unique summary as described below; check if the bug has already been reported (if you want to be more thorough, there's an advanced guide on screening duplicate bugs).
    • -
    • Provide precise steps to reproduce, expected results and actual results as described in the following section.
    • -
    • Provide additional information (also described below), especially if you can't reproduce the bug in a new profile; and/or by reporting a crash, memory usage, performance, regression bug; or if the problem is with a specific web site.
    • -
    -
  8. -
  9. 如果遇到多個錯誤時,請分開一個一個回報。
  10. -
- -

簡短明確描述問題

- -

您會怎麼用大概十幾個字描述問題? 開發者會先看到這一部分文字。

- -

好的錯誤回報會快速且清楚說明錯誤。這是用來解釋問題的來龍去脈,請不要給予針對問題的建議。

- - - - - -

描述可以重現問題的詳細的步驟

- -

How can a developer reproduce the bug on his or her own computer?

- -

Steps to reproduce are the most important part of any bug report. If a developer is able to reproduce the bug, the bug is very likely to be fixed. If the steps are unclear, it might not even be possible to know whether the bug has been fixed.

- - - - - - - - - - - - - - - - - - - - - - - - -
在問題回報裡應該寫些什麼 ?好的例子(描述細節) -

不好的例子(敘述籠統)

-
-

說說你能不能控制卡 bug 的時機。

- -

可以故意卡、偶爾遇到、不能控制。

-
照著下面的步驟做問題就出現了: 
-

描述如何命令 Firefox 做你想做的事。

-
-

1. 點桌面捷徑打開 Firefox
- 2. 按下 Cmd+N (Windows 系統按 Ctrl+N )來打開新的視窗。

- -

3. 把 https://mail.google.com/ 複製貼上到網址列然後按Enter。

-
在新視窗打開Gmail
-

照著步驟做後,清楚地描述你看到的 (實際) 結果預期結果。 請將這兩項分開來寫。

-
預期結果: 我的收件匣正常顯示。
- 實際結果: 我的收件匣顯示 '您的瀏覽器不支援 Cookies (錯誤 -91)'。
-

 

- -

"網頁跑不出來"

-
- -

提供額外的資訊

- -

The following information is requested for most bug reports. You can save time by providing this information below the Expected results. If you need to attach multiple files, you can do so after submitting the report.

- -

For specific types of bugs

- -

If you are reporting a crash bug, please include a Breakpad ID or attach stack trace, and include the crash signature in the bug summary as well as in the Crash Signature field.

- -

If you are reporting a memory use or leak bug, please attach the output of about:memory. Ideally, find steps to reproduce an increase in what is shown in about:memory (even after clicking the "Minimize memory usage" button at the bottom). If you have trouble finding steps to reproduce, try the Firefox Support page titled Firefox Uses Too Much Memory (Ram) - How to Fix. If you are a C++ developer, more precise tools are available.

- -

If you are reporting a bug about slowness or high CPU usage, please provide a link to the performance profile in the bug.

- -

If you are reporting a hang (beachball on OS X or "not responding" on Windows), please follow the instructions in How to Report a Hung Firefox.

- -

If you are reporting a bug involving a Flash hang, please visit https://wiki.mozilla.org/Flash/Hang_Debugging to learn how to provide useful information for developers.

- -

If you are reporting a bug involving a specific web page, please try to make a reduced testcase and attach it to the bug report. If you don't have time or expertise, please report the issue to webcompat.com instead, where our volunteers will do this for you.

- -

If the bug was recently introduced, finding a regression window can help identify the cause of the bug.

- -

What if my bug seems "random" or "intermittent"?

- -

For most Firefox bugs

- -

You should provide the following information for most Firefox bugs.

- - - - - - - - - - - - - - - - - - - - -
What should you include in a bug report?Example
Indicate if the problem can be reproduced using a new Firefox profile and any changes you need to make in order to reproduce.The problem can be reproduced in a new profile, but only if Preferences -> Privacy & Security -> Tracking Protection is selected.
If you can only reproduce with an existing profile try to figure out what settings, extensions, or files in your profile are needed to reproduce the bug. If you skip the step, save the troubleshooting information from about:support to a file and attach it to the bug report.I can't reproduce in a new profile, about:support information from the offending profile is attached.
-

Indicate if the problem can be reproduced using the latest Nightly build. Include the Build ID from about:support.

- -

If possible, test using the new Firefox profile you created. If you need to test the Nightly build with your regular profile, you might want to back up the profile first, since the pre-release build may corrupt your data.

-
The problem can be reproduced on the latest Nightly (Build ID 20170416100136).
- -

 

- -
-

Original document information

- - -
- -

 

- -
-

Advanced

- -

Finding the correct product and component

- -

You will be asked to categorize your bug into a "product" and a "component" within that product, in order to direct your report to the correct developers.

- -

If you're using Firefox, the bug is most likely in "Firefox", "Toolkit", or "Core".

- - - -

When in doubt, search for similar bugs and see which component they are in.

- -

If none of the components seem appropriate, look for a "General" component in the most appropriate product.

- -

General Outline of a Bug Report

- -
-

Most of the following article has been merged into this page from QMO: How to write a proper bug

-
- - - -

 

- -
-

Original document information

- - -
diff --git a/files/zh-tw/mozilla/qa/index.html b/files/zh-tw/mozilla/qa/index.html deleted file mode 100644 index 99a8a38dd2..0000000000 --- a/files/zh-tw/mozilla/qa/index.html +++ /dev/null @@ -1,251 +0,0 @@ ---- -title: 'QA: Quality assurance at Mozilla' -slug: Mozilla/QA -tags: - - Landing - - NeedsTranslation - - QA - - Testing - - TopicStub -translation_of: Mozilla/QA ---- -

The Mozilla Quality Assurance (QA) team drives software quality assurance activities across Mozilla and plays a key role in releasing a diverse range of software products on schedule. Within each project in Mozilla, we work to explore new features, write and execute tests, uncover and file bugs, build and maintain tools, collect and analyze metrics, and support the release world-class products that promote the open Web.

- -

Here you'll find articles and tools to help you gear up to join the QA team testing Firefox to ensure that each release is as good as it can be.

- -

Get started

- - - -

Bugs

- -
-
-

Reporting bugs

- -
-
Bugzilla
-
All Mozilla projects use Bugzilla to track bugs. You will need to create an account with Bugzilla in order to report bugs and triage them.
-
Bug writing guidelines
-
The more effectively a bug is reported, the more likely that an engineer will actually fix it. By following these guidelines, you can help ensure that your bugs stay at the top of the Mozilla engineers' heap, and get fixed.
-
A Bug's Life
-
This tutorial will give an overview of what happens in the states that a bug will go through as well as how it will go from one to the next within its total life. It also explains the meaning of flags/keywords used in QA.
-
Filing Crash Bugs
-
This document lists guidelines and tips on how to file bug reports for crashes in a way that helps in debugging and fixing the reported issue.
-
-
- -
-

Triaging bugs

- -
-
Confirming unconfirmed bugs
-
Identify useful bug reports and close the rest.
-
Triaging Bugs for Firefox
-
Information about the entire bug triaging process – from processing incoming bugs to narrowing down the steps to reproducing bugs.
-
Screening duplicate bugs
-
Help get bugs fixed faster by screening incoming reports for duplicates.
-
General Guidelines
-
What to do and what not to do in Bugzilla.
-
-
-
- -
-

Manual testing

- -
-
-
-
Manual Test Case Writing Primer
-
How to write proper manual test cases
-
-
- -
-
-
TestRail
-
Mozilla QA's manual test cases reside in TestRail. You will need an LDAP account in order to login and execute test cases. Learn more on the TestRail wiki page.
-
-
-
- -
-

Automated testing

- -
-
-
-
Automated testing at Mozilla
-
Documentation about creating and using automated tests for Mozilla code.
-
Running automated tests
-
-

This page lists the steps required to run Mozilla's automated test suites.

-
-
Developing tests
-
Ensure that future changes to Mozilla don't break things that currently work correctly.
-
Avoiding intermittent test failures
-
Suggestions for ways to make your tests more reliable, thereby helping to avoid random, intermittent test failures.
-
Test Verification
-
When a changeset adds a new test, or modifies an existing test, the test verification (TV) test suite performs additional testing to help find intermittent failures in the modified test as quickly as possible.
-
Mozharness FAQ
-
Answers to common questions about Mozharness.
-
-
- -
-
-
Robocop
-
Robocop is the automated testing system used for Firefox for Android. Learn its code style guidelines
-
Marionette
-
Get started with Marionette UI testing.
-
web-platform-tests
-
Learn how to use the industry standard, cross-browser, cross-platform Web runtime testing system from the W3C used by Mozilla and others to ensure browser interoperability.
-
External Media Tests
-
Get started testing HTML5-based video elements using VideoPuppeteer, a Marionette- -based test suite used to test sites like YouTube and Netflix.
-
Chrome tests
-
A chrome test is basically a Mochitest running with chrome privileges.
-
-
-
- -
-

Firefox QE

- -
-
-
-
Triaging Bugs for Firefox
-
Information about the entire bug triaging process – from processing incoming bugs to narrowing down the steps to reproduce a bug.
-
- -
-
Tips and Tricks
-
These tips and tricks will make your life easier when you are testing.
-
-Downloading Nightly or Trunk Builds - -
-
Every 24 hours, a "nightly" build is created that testers all over the world download and test, reporting as they go along on any bugs that hit them.
-
-
- -
-
-
Command Line Options
-
Command line options are used to specify various startup options for Firefox.
-
Reporting a Performance Problem
-
This article will guide you in reporting a performance problem using the Gecko Profiler extension.
-
Crash reporting
-
Firefox ships with an open-source crash reporting system.
-
-
-
- -
-

Firefox for Android

- -
-
-
-
Mobile Firefox
-
Firefox for Android is the mobile version of Firefox with a native Android look and feel.
-
Compatibility Testing
-
Help us identify websites that do not work well in Firefox by reporting the specific issues that you find in your investigation.
-
-
- -
-
-
Logging with the Android Debug Bridge and Logcat
-
This article will provide a walkthrough in downloading and setting up an environment to which one can gain access to and view Android system logs.
-
Enabling the Error Console
-
See the Mozilla Hacks article on Remote Debugging on Firefox for Android for web content. If you need to debug the Firefox browser itself use Android's adb logcat.
-
-
-
- -
-

Firefox OS

- -
-
-

Manual testing

- -
-
Simulator vs Emulator vs Device
-
These are three basic options when it comes to getting a Firefox OS environment in order to work on, or developing for, Firefox OS.
-
Debugging
-
Discover the different tools at your disposal to debug your Firefox OS code.
-
Reporting Bugs
-
This article provides a guide to filing bugs against the Firefox OS project, including Gaia and B2G.
-
-
- -
-

Platform (Gecko)

- -
-
Automated Testing
-
Learn various aspects of testing Firefox OS, including running different tests, automation, and result reporting and tracking.
-
Gaia Performance Tests
-
This article provides information about running performance tests on Gaia, as well as how to create new tests.
-
Feature Support Chart
-
There are several different builds of Firefox OS you can download or build for yourself, and there are some differences between the types of features available on each device.
-
-
-
- -
-

Web QA

- -
-
-
-
Reducing testcases
-
Improve bug reports by turning broken web pages into simple testcases, which can help developers understand the bug and can also be used for creating automated tests.
-
Managing XFails
-
One of the ongoing tasks of the Web QA department is managing xfails. This document will explain what xfails are, and describe the steps one can take to investigate and update them.
-
-
- -
-
-
Running Automated Tests
-
So you’re interested in contributing to Mozilla Web QA automation projects but don’t know where to start? This doc will help you get up and running a set of tests locally.
-
-
-
- -
-

Glossary

- -
-
-
Smoke Test
-
-
-
- -

See also

- - diff --git a/files/zh-tw/mozilla/rust/index.html b/files/zh-tw/mozilla/rust/index.html deleted file mode 100644 index 28f46deb33..0000000000 --- a/files/zh-tw/mozilla/rust/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Rust 程式語言 -slug: Mozilla/Rust -translation_of: Mozilla/Rust ---- -

Rust logoRust 是個由 Mozilla 及社區志願者所建立的開源系統程式語言,旨在幫助開發者建立快速安全,並充分使用當代多核心處理器強大功能的程式。它會阻止記憶體區段錯誤(segmentation fault)並確保執行緒(thread)安全、並使用簡單明瞭的語法。

- -

另外,Rust 提供了 zero-cost abstractions, move semantics, guaranteed memory safety, threads with no data races, trait-based generics, pattern matching, type inference, and efficient C bindings, with a minimum runtime size.

- -

要學習 Rust,可以透過:

- - - -

Rust and the future of systems programming

- -

{{EmbedYouTube("8EPsnf_ZYU0")}}

- -

Unlocking the power of parallelism with Rust

- -

{{EmbedYouTube("cNeIOt8ZdAY")}}

- -

Rust for web developers

- -

{{EmbedYouTube("FfoXFnzZbBM")}}

- -

Safe systems programming with Rust

- -

{{EmbedYouTube("P3sfNGtpuxc")}}

- -

Growing the Rust community

- -

{{EmbedYouTube("duv0tuPAnO0")}}

- -

Putting Rust into production at Mozilla

- -

{{EmbedYouTube("2RhbYpgVpg0")}}

diff --git a/files/zh-tw/mozilla/tech/index.html b/files/zh-tw/mozilla/tech/index.html deleted file mode 100644 index f9682e62e1..0000000000 --- a/files/zh-tw/mozilla/tech/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Mozilla technologies -slug: Mozilla/Tech -tags: - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XUL -translation_of: Mozilla/Tech ---- -

Mozilla has several technologies used as components of its projects. These are documented here. (flesh out this text).

-

{{LandingPageListSubpages}}

diff --git a/files/zh-tw/mozilla/tech/xpcom/reference/index.html b/files/zh-tw/mozilla/tech/xpcom/reference/index.html deleted file mode 100644 index 29d07953d6..0000000000 --- a/files/zh-tw/mozilla/tech/xpcom/reference/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: XPCOM reference -slug: Mozilla/Tech/XPCOM/Reference -tags: - - Add-ons - - Extensions - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference ---- -

This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.

- -
-

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

-
- -
-

If you're working on a module in the Mozilla codebase that's compiled with the MOZILLA_INTERNAL_API flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the XPCOM internal string guide for documentation of the internal string API used within the Mozilla codebase.

-
- -

{{LandingPageListSubpages}}

- -

Many XPCOM pages return an nsresult. Prior to Gecko 19 {{geckoRelease(19)}}, this was an integer that simply returned an error code. It is now a strongly typed enum when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.

diff --git a/files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html b/files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html deleted file mode 100644 index d098cf8402..0000000000 --- a/files/zh-tw/mozilla/tech/xpcom/reference/interface/index.html +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: XPCOM Interface Reference -slug: Mozilla/Tech/XPCOM/Reference/Interface -tags: - - NeedsTranslation - - TopicStub - - XPCOM - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface ---- -

This is a reference to the XPCOM interfaces provided by the Mozilla platform.

- -
{{tree('','1')}}
- -

See also

- - diff --git a/files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html b/files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html deleted file mode 100644 index 6ed47b6c80..0000000000 --- a/files/zh-tw/mozilla/tech/xpcom/reference/interface/nsicontentpolicy/index.html +++ /dev/null @@ -1,491 +0,0 @@ ---- -title: nsIContentPolicy -slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPolicy -translation_of: Archive/Mozilla/nsIContentPolicy ---- -

{{IFSummaryStart(“DOM /鹼/ nsIContentPolicy.idl”,“編寫腳本”)}}接口用於實現內容策略的機制。這個接口的實現可以被用來控制各種類型的外的線的內容,或者某些類型的內聯內容的處理的負荷。{{IFSummaryEnd(“nsIContentPolicyBase”,42,“1.0”)}}

- -

可以觀察到,正在通過實施{{接口(“nsIContentPolicy”)}}加載到瀏覽器中的內容。如果你正在開發一個內容感知的插件(攔截廣告或改變內容的外觀,例如)該接口是非常有用的,或者如果你想停止或允許用戶瀏覽的網址。

- -

{{WarningStart()}}不要阻塞調用者在你的實施方式{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}(例如,通過啟動一個對話框,以提示用戶東西)。“){{WarningEnd()}}

- -
-

注:在現實中,很多這種接口在{{接口(“nsIContentPolicyBase”)}}接口定義,但現在,直到有人有時間來拆東西記錄在這裡。

-
- -

方法概述

- - - - - - - - - - -
short shouldLoad(in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra, in nsIPrincipal aRequestPrincipal);
short shouldProcess(in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeType, in nsISupports aExtra, in nsIPrincipal aRequestPrincipal);
- -

常量

- -

內容類型

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
不變描述
TYPE_OTHER1指示內容,其類型是未知的,或者是不感興趣的一個有限的使用情況之外。在一般情況下,你應該盡量不要使用這種類型的,除非沒有其他人是合適的。{{gecko_minversion_inline(“1.8”)}}
TYPE_SCRIPT2表示的可執行script(例如JavaScript)。{{gecko_minversion_inline(“1.8”)}}
TYPE_IMAGE3指示image(例如,{{HTMLElement的(“IMG”)}}的元素)。{{gecko_minversion_inline(“1.8”)}}
TYPE_STYLESHEET4指示stylesheet(例如,{{HTMLElement的(“風格”)}}的元素)。{{gecko_minversion_inline(“1.8”)}}
TYPE_OBJECT5代表一個普通object(插件,處理內容通常這一類下降)。{{gecko_minversion_inline(“1.8”)}}
TYPE_DOCUMENT6表示DOM {{domxref(“文件”)}}在頂層(即,直接在瀏覽器標籤)。{{gecko_minversion_inline(“1.8”)}}
TYPE_SUBDOCUMENT7 -

表示包含在另一個一{{domxref(“文件”)}} document例如,{{HTMLElement的(“IFRAME”)}}和{{HTMLElement的(“幀”)}}的元素)。{{gecko_minversion_inline(“1.8”)}}

- -
-

注:壁虎使用TYPE_INTERNAL_FRAME,並TYPE_INTERNAL_IFRAME以內部辨別其差異。這些類型映射到TYPE_SUBDOCUMENT被傳遞到內容政策實施前,不應外壁虎代碼中使用。{{gecko_minversion_inline(41)}}

-
-
TYPE_REFRESH8 -

指示定時刷新。

- -

{{manch(“shouldLoad”)}}將永遠不會得到這個,因為它並不代表內容被加載(通過刷新觸發的實際負載將通過{{manch(“shouldLoad”)}}如預期)。

- {{manch(“為ShouldProcess”)}}將收到此為,例如{{HTMLElement的(“元”)}}刷新元件和HTTP刷新頭。{{gecko_minversion_inline(“1.8”)}}
TYPE_XBL9指示XBL綁定請求,觸發或者通過{{cssxref(“ - MOZ結合”)}} CSS屬性或{{domxref(“Document.addBinding()”)}}方法。{{gecko_minversion_inline(“1.8”)}}
TYPE_PING10表示通過在{{HTML元素(“A”)}}使用元素{{htmlattrxref(“平”,“一”)}}屬性的點擊觸發的平。{{gecko_minversion_inline(“1.9”)}}
TYPE_XMLHTTPREQUEST11表示{{domxref(“XMLHttpRequest的”)}}。也用於{{domxref(“Document.load()”)}} {{gecko_minversion_inline(“1.9”)}}
TYPE_OBJECT_SUBREQUEST12表示由一個插件的請求。{{gecko_minversion_inline(“1.9”)}}
TYPE_DTD13表示通過XML加載的DTD document{{gecko_minversion_inline(“1.9”)}}
TYPE_FONT14指示經由{{cssxref(“@字體面”)}}規則加載的字體。{{gecko_minversion_inline(“1.9.1”)}}
TYPE_MEDIA15表示視頻或音頻負載。{{gecko_minversion_inline(“1.9.1”)}}
TYPE_WEBSOCKET16表示的WebSocket的負荷。{{gecko_minversion_inline(“11”)}}
TYPE_CSP_REPORT17表示一個內容安全策略報告。{{gecko_minversion_inline(“20”)}}
TYPE_XSLT18表示一個樣式表轉換。{{gecko_minversion_inline(“27”)}}
TYPE_BEACON19表示信標後。{{gecko_minversion_inline(“30”)}}
TYPE_FETCH20指示通過發起的負載的{{domxref(“GlobalFetch.fetch()”)}}方法,其可作為在全球都{{domxref(“窗口”)}}和{{domxref(“工人”)} }上下文。{{gecko_minversion_inline(36)}}
TYPE_IMAGESET21指示要加載的{{HTML元素(“IMG”)}}(與該{{htmlattrxref(“srcset”,“IMG”)}}屬性或{{HTMLElement的(“圖片”)}}。{{gecko_minversion_inline(請求36)}}
TYPE_WEB_MANIFEST22指示要加載一個Web清單的請求。{{gecko_minversion_inline(41)}}
TYPE_INTERNAL_SCRIPT23 -

用於表示使用{{HTMLElement的(“腳本”)}}元素加載的腳本的內部常數。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SCRIPT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_WORKER24 -

用於表示通過專用工人加載的腳本的內部常數。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SCRIPT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_SHARED_WORKER25 -

用於表示通過共享工人加載的腳本的內部常數。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SCRIPT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_EMBED26 -

內部常量用於表示從{{HTML元素(“嵌入”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_OBJECT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_OBJECT27 -

內部常量用於表示從{{HTMLElement的(“對象”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_OBJECT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_FRAME28 -

內部常量用於表示從{{HTML元素(“幀”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SUBDOCUMENT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_IFRAME29 -

內部常量用於表示從{{HTML元素(“IFRAME”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_SUBDOCUMENT傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_AUDIO30 -

內部常量用於表示從{{HTML元素(“音頻”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_MEDIA傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_VIDEO31 -

內部常量用於表示從{{HTML元素(“視頻”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_MEDIA傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
TYPE_INTERNAL_TRACK32 -

內部常量用於表示從{{HTML元素(“軌道”)}}元素加載的內容。{{gecko_minversion_inline(41)}}

- -
-

重要說明:此類型映射到TYPE_MEDIA傳遞給內容政策實施之前,不宜在室外的Gecko內核代碼中使用。

-
-
REJECT_REQUEST-1從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}返回如果負載或處理請求是基於所述請求的細節拒絕。{{gecko_minversion_inline(“1.8”)}}
REJECT_TYPE-2 -

從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}返回如果負載/過程僅僅基於(上述標誌)它的類型拒絕。

- {{注(“這甩只適用於該服務器上的當前請求,而不是同一類型的未來需求。”)}} {{gecko_minversion_inline(“1.8”)}}
REJECT_SERVER-3 -

從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}如果負載/過程是基於在服務器上拒絕它託管在或從請求(返回aContentLocationaRequestOrigin),例如,如果塊的IMAGE,因為它是從goatse.cx服務(即使你不一定阻止other從該服務器/域類型)。

- {{注(“這甩只適用於該服務器上的當前請求,而不是同一類型的未來需求。”)}} {{gecko_minversion_inline(“1.8”)}}
REJECT_OTHER-4 -

從{{manch(“shouldLoad”)}}或返回{{manch(“為ShouldProcess”)}}如果負載/過程是基於一些拒絕other標準。Mozilla的呼叫者會處理這個喜歡REJECT_REQUEST; 第三方實現者,例如,用這個來指導自己的來電諮詢額外參數的更多細節。{{gecko_minversion_inline(“1.8”)}}

- -

{{注(“這甩只適用於該服務器上的當前請求,而不是同一類型的未來需求。”)}}

-
ACCEPT1從{{manch(“shouldLoad”)}}或{{manch(“為ShouldProcess”)}}如果負載或處理請求不被拒絕返回。{{gecko_minversion_inline(“1.8”)}}
OTHER0{{obsolete_inline(“1.8”)}}
SCRIPT1{{obsolete_inline(“1.8”)}}
IMAGE2{{obsolete_inline(“1.8”)}}
STYLESHEET3{{obsolete_inline(“1.8”)}}
OBJECT4{{obsolete_inline(“1.8”)}}
SUBDOCUMENT5{{obsolete_inline(“1.8”)}}
CONTROL_TAG6{{obsolete_inline(“1.8”)}}
RAW_URL7{{obsolete_inline(“1.8”)}}
DOCUMENT8{{obsolete_inline(“1.8”)}}
- -

方法

- -

shouldLoad()

- -

打電話讓自己的內容政策的執行決定在給定位置的資源是否應該被加載。這種方法是通過加載指定aContentLocation的資源,以確定是否要開始加載所請求的資源之前調用。

- -

shouldLoad()可以稱為同時所涉及的文檔的DOM和佈局是不一致的狀態。這意味著,該方法的實施者不得做任何以下內容:

- -
    -
  1. 以任何方式修改DOM中(例如,設置屬性是一個沒有沒有)。
  2. -
  3. 查詢依賴於佈局(例如,任何DOM屬性offset*屬性)。
  4. -
  5. 查詢依賴於任何風格的DOM屬性(例如,計算方式)。
  6. -
  7. 查詢依賴於DOM的當前狀態的“上下文”節點(例如,節點列表的長度)之外的任何DOM屬性。
  8. -
  9. [JavaScript實現僅]不使用XPCNativeWrapper(顯式或隱式地)的任何對象上的任何類型的訪問屬性。由於各種DOM0的事情,這會導致項目4。
  10. -
- -

如果你在做這些事情shouldLoad()的實現,期望不可預知的行為,可能包括死機,沒有顯示出來的內容,內容顯示了一倍,等等。如果你不需要做任何的事情上面,做他們關閉超時或事件。

- -
:當多個內容策略用於(例如,通過幾個擴展),如果其中一人拒絕的請求,該政策的其餘部分不叫。參考:http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsContentPolicy.cpp#146
- -
:內容政策在上述情況下的順序取決於安裝的優先級。
- -
短shouldLoad(
-  在無符號長aContentType,
-  在nsIURI aContentLocation,
-  在nsIURI aRequestOrigin,
-  在nsISupports aContext,
-  在ACString aMimeTypeGuess,
-  在nsISupports aExtra,
-  在nsIPrincipal aRequestPrincipal
-);
-
- -
參數
- -
-
aContentType
-
的類型的內容進行測試。這將是一個一個{{ANCH(“內容類型”)}}在上面列出。
-
aContentLocation
-
的內容的URI被檢查; 一定不能null
-
aRequestOrigin {optional_inline}}
-
啟動此加載請求的資源的位置; null如果不適用。
-
aContext {optional_inline}}
-
的{{接口(“nsIDOMNode”)}}或{{接口(“nsIDOMWindow”)}}發起請求,或一些可以QueryInterface()向其中的一個; null如果不適用。
-
{{音符(“aContext是當用戶使用的上下文菜單中的新選項卡/窗口或CMD / CTRL +打開鏈接的新選項卡/窗口點擊鏈接(即,aContext不是該鏈路是在拉片在這些情況下)。“)}}
-
 
-
 
-
aMimeTypeGuess
-
可選的。用於所請求的內容的MIME類型猜測,基於可用於請求發起(例如,信息OBJECT的類型屬性); 不能可靠地反映實際的MIME類型所請求的內容。
-
aExtra
-
一個可選的參數,直通非壁虎呼叫者額外的數據傳遞給被調用者。
-
- -
-
aRequestPrincipal
-
可選的。定義了導致負載的主體。這僅適用於可選的非壁虎代碼:所有的壁虎代碼應該設置此參數。對於導航事件,這是導致該加載頁面的主體。
-
- -
返回值
- -

ACCEPT 要么 REJECT_*

- -

為ShouldProcess()

- -

如果資源被處理?{{manch(“為ShouldProcess”)}}將被調用一次傳遞給它的所有資料已被確定有關資源,資源的一部分已經被加載後一般。“處理”是指通過處理應用程序。例如,為ShouldProcess可以用來允許來自服務器的響應根據MIME類型的響應的處理或忽略。

- -

{{NoteStart()}} {{manch(“為ShouldProcess”)}}可以被稱為當DOM和佈局document涉及處於不一致的狀態。查看{{manch(“shouldLoad”)}}筆記,看看這是什麼意思了這種方法的實現者。{{NoteEnd()}}

- -
短為ShouldProcess(
-  在無符號長aContentType,
-  在nsIURI aContentLocation,
-  在nsIURI aRequestOrigin,
-  在nsISupports aContext,
-  在ACString aMimeType,
-  在nsISupports aExtra,
-  在nsIPrincipal aRequestPrincipal
-);
-
- -
參數
- -
-
aContentType
-
的類型的內容進行測試。這將是TYPE_ *常量之一。
-
aContentLocation
-
可選的。被請求的資源的位置:可能是,例如,一個重定向後的URI資源。
-
aRequestOrigin
-
可選的。啟動此加載請求的資源的位置; null如果不適用。
-
aContext
-
可選的。的{{接口(“nsIDOMNode”)}}或發起請求{{接口(“nsIDOMWindow”)}},或一些可以查詢接口的那些中的一個; null如果不適用。
-
aMimeType
-
MIME類型所請求的資源(例如,圖像/ PNG)的,所報告的網絡庫,如果可用的話(可以是空的,如果不適合的類型,例如,TYPE_REFRESH)。
-
aExtra
-
一個可選的參數,直通非壁虎呼叫者額外的數據傳遞給被調用者。
-
- -
-
aRequestPrincipal
-
可選的。提出請求的主體。
-
- -
返回值
- -

ACCEPT 要么 REJECT_*

- -

- -

您可以通過包括容易實現這個接口nsIContentPolicy.h的頭文件和實現public nsIContentPolicy到類,如下所示:

- -
//將這個變成你的頭文件
-
-#包括“_path_to_sdk /包括/內容/ nsIContentPolicy.h”
-
-MyClass類:公共nsISupports,公共nsIContentPolicy {
-  ...
-  NS_DECL_NSICONTENTPOLICY
-  ...
-}
-
-//這到您的實現文件 
-NS_IMPL_ISUPPORTSn(MyClass的,nsISupports,nsIContentPolicy,...)
-
- -

{{NoteStart()}}之前,你能接受的通知,你必須註冊你的插件{{接口(“nsICategoryManager”)}}。見下面的例子。{{NoteEnd()}}

- -
字符*以前= nsnull; 
-
-nsCOMPtr的的<nsICategoryManager> catman; 
-
-servman-> GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
-NS_GET_IID(nsICategoryManager)
-getter_AddRefs(catman)); 
-
-RV = catman-> AddCategoryEntry(“內容的策略”,
-COMPONENT_CLASSNAME,
-COMPONENT_CONTRACTID,
-PR_TRUE,   
-PR_TRUE,
-以前);
- -

JavaScript開發人員也可以實現XPCOM組件擴展nsIContentPolicy

diff --git a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html b/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html deleted file mode 100644 index fafd0dffa0..0000000000 --- a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/howto/index.html +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: 'Autoconfig: How to create a configuration file' -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo ---- -

Definition

-

Authoritative definition

-

Example

-

Real-world example

-

 

-

<?xml version="1.0" encoding="UTF-8"?>

-

<clientConfig version="1.1">
-   <emailProvider id="freenet.de">
-     <domain>freenet.de</domain>
-     <displayName>Freenet Mail</displayName>
-     <displayShortName>Freenet</displayShortName>
-     <incomingServer type="imap">
-       <hostname>imap.freenet.de</hostname>
-       <port>993</port>
-       <socketType>SSL</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <incomingServer type="imap">
-       <hostname>imap.freenet.de</hostname>
-       <port>143</port>
-       <socketType>STARTTLS</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <incomingServer type="pop3">
-       <hostname>pop.freenet.de</hostname>
-       <port>995</port>
-       <socketType>SSL</socketType>
-       <authentication>password-cleartext</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <incomingServer type="pop3">
-       <hostname>pop.freenet.de</hostname>
-       <port>110</port>
-       <socketType>STARTTLS</socketType>
-       <authentication>password-cleartext</authentication>
-       <username>%EMAILADDRESS%</username>
-     </incomingServer>
-     <outgoingServer type="smtp">
-       <hostname>smtp.freenet.de</hostname>
-       <port>465</port>
-       <socketType>SSL</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </outgoingServer>
-     <outgoingServer type="smtp">
-       <hostname>smtp.freenet.de</hostname>
-       <port>587</port>
-       <socketType>STARTTLS</socketType>
-       <authentication>password-encrypted</authentication>
-       <username>%EMAILADDRESS%</username>
-     </outgoingServer>
-     <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/index.html">
-       <descr lang="de">Allgemeine Beschreibung der Einstellungen</descr>
-       <descr lang="en">Generic settings page</descr>
-     </documentation>
-     <documentation url="http://kundenservice.freenet.de/hilfe/email/programme/config/thunderbird/imap-thunderbird/imap/index.html">
-       <descr lang="de">TB 2.0 IMAP-Einstellungen</descr>
-       <descr lang="en">TB 2.0 IMAP settings</descr>
-     </documentation>
-   </emailProvider>
- </clientConfig>

-

How to probe mail servers

-

To determine a server's capabilities, you can contact the server directly and talk the POP/IMAP/SMTP protocol manually (assuming you already know the hostname).
- For non-SSL, use netcat -v hostname port (preferred) or telnet hostname port as "client".

- -

In all cases, the server should respond with a list of capabilities.

-

SSL / STARTTLS

-

There are 2 SSL variants: normal SSL and STARTTLS.

-

Normal SSL

-

The old-style SSL (including TLS, which is just the new name for SSL) has a special port:

- -

On Linux, you can contact the server via

-

-

openssl s_client -connect hostname:port

-

You should see output about the SSL handshake and the certificate. Important is what is listed as "CN=". This must be the same as the hostname that you contacted, otherwise the certificate is not valid (or you need to use another hostname).
- If you see nothing, then probably the server does not support SSL.
- After that, you can have the same protocol exchange as with netcat on standard ports, as listed above.

-

STARTTLS

-

STARTTLS is a special, new form of SSL, which works on the standard ports (e.g. port 143 for IMAP). You can contact the server via netcat as mentioned above. If you see "STARTTLS" (for IMAP, SMTP) or "STLS" (for POP) listed as one of the capabilities, the server should support STARTTLS.
- To try it out, on Linux, you can contact the server via

-

 

-

openssl s_client -connect hostname:port -starttls proto

-

...where "proto" is imap, pop3 or smtp. For example:

-

-

openssl s_client -connect imap.example.com:143 -starttls imap

-

You should get the same response as described above for openssl.

-

Configuration file format

-

Add the appropriate port and socket type for each server, depending on protocol and SSL support. For example,
- for IMAP with SSL:

-

 

-

<port>993<port>

-

<socketType>SSL</socketType>

-

for IMAP with STARTTLS:

-

 

-

<port>143<port>
- <socketType>STARTTLS</socketType>

-

for IMAP without any SSL (deprecated!):

-

 

-

<port>143<port>

-

<socketType>plain</socketType>

-

Use SSL

-

Please do not submit or serve any configurations without SSL! There's no reason in 2010 why users still need to read mail entirely unprotected.
- If you are an ISP and think the server load is too high, try adding an SSL accelerator. They are cheap and widely used. In fact, even most freemail (!) providers these days support SSL, so if users pay you money for ISP service, that's all the more reason to give them proper service. But first simply try to enable software SSL - small servers may be fine with SSL and without any additional installations.

-

Valid certificate

-

Either way, be sure to use a valid certificate:

- -

Authentication

-

Probe the mail server, as explained above for STARTTLS. If you see CRAM-MD5 or APOP in the response, the server should support encrypted passwords. If you only see AUTH LOGIN and/or PLAIN, or no AUTH at all, the server probably does not support secure authentication. In the former case, select "Encrypted passwords" as "Authentication method" (in Thunderbird Account Settings UI, incoming server and SMTP server), and test whether you can actually log in with a real account (because some servers are unfortunately broken with regards to authentication, often due to a wrong or misconfigured SASL installation).

-

Configuration file format

-

In the configuration file, for each IMAP, POP and SMTP server, you need to specify the authentication method.
-
- For plaintext passwords:

-

 

-

<authentication>password-cleartext</authentication>

-

For CRAM-MD5:

-

 

-

<authentication>password-encrypted</authentication>

-


- Discouraged settings (SMTP only):
- If the SMTP server can only be used after checking incoming mail, please use

-

 

-

<authentication>smtp-after-pop</authentication>

-

Note that RFC 4409 disallows that and requires the customer-facing SMTP server to support proper authentication via AUTH.
- If the SMTP server can only be used within the ISP's network, and requires no authentication, use:

-

 

-

<authentication>client-IP-address</authentication>

-

or, if it requires authentication in addition to the user being in the ISP network, use e.g.:

-

 

-

<authentication>password-cleartext</authentication>

-

<restriction>client-IP-address</restriction>

-

However, that means that users on the road or in the office are unable to send mail, which is a real problem for many of our users. This violates RFC 4409 as well and is an outdated configuration. Please try find a configuration that works in all cases, for the sake of the users.

-

Please support MD5 passwords

-

Please support authentication with CRAM-MD5. It is simple to implement, and to set up, and you can still use RADIUS or a database that stores passwords in plaintext, so you don't need to make changes to your mail server or authentication infrastructure apart from installing some software and configuring it correctly. CRAM-MD5 is particularly important when no SSL is used: Never make users send their passwords in plaintext over the network! (Not even in your ISP network.) We warn users in the Mail Account Creation dialog about such insecure configurations, and we reserve the right to block them in the future.
-
- As an ISP, you should ideally store passwords in encrypted format, which removes the risk of mass password theft (and possibly reuse on other sites) if somebody hacks your servers. You can still support plaintext passwords in this case, and encrypt passwords on the fly before comparing. (Users who use plaintext passwords would still be somewhat exposed, but at least you don't have the risk of the whole plaintext password database being stolen.) You can use both plaintext and encrypted authentication transmission with plaintext or encrypted password databases - the two issues are independent.

-

Username

-

If the user's IMAP login name is the same as his email address (for example, if "fred@example.com" is the login name), add:

-

 

-

<username>%EMAILADDRESS%</username>

-

Note: Use %EMAILADDRESS% as literal. Thunderbird will replace it with the email address that the user entered. Same for %EMAILLOCALPART% and other placeholders.

-

If the login name is the same as the first segment before the @ of the email address (for example, "fred" for "fred@example.com"), use:

-

 

-

<username>%EMAILLOCALPART%</username>

-

Aliases, or username not part of email address

-

Note that the above must be true for any email address that the user would set up - even for aliases.
-
- You can ignore aliases like info@, if that's an alias for fred@ (or both fred@ and wilma@) and Fred would set up fred@example.com in Thunderbird, not info@.
-
- If, however, Fred can set up hero@example.com as alias for fred@example.com, and neither "hero" nor "hero@example.com" would work as login name on your IMAP server, you need to set up a lookup of alias -> username on your autoconfig server. So, if you get a request for <http://autoconfig.example.com/mail/c...ro@example.com>, your autconfig server must have a script which responds to /mail/config-v1.1.xml and returns the concrete username, for example:

-

 

-

<username>fred</username>

-

... (or <username>fred@example.com</username>, as appropriate) for hero@example.com. This is the only way to enable automatic configuration without users having to remember what their primary login name was, which is a serious problem in practical experience. Even if you have told them all the necessary information in your welcome letter, they usually cannot find the letter. That's exactly where autoconfiguration tries to help.

-

Enable visiturl

-

Some providers do not provide IMAP or POP service by default, but require it to be enabled via a web UI. If that is the case, add the URL that a logged-in user would use into this field, and the application can prompt the user to visit it.

-

This is not yet supported by Thunderbird 3.1, but should be in the future, so please add this critical information where it applies.

-

If you are an ISP, please by all means avoid this. It's one of those "walls" against which users run the hard way.

-

Documentation URL

-

If the configuration is (partially) based on a help webpage of the ISP that describes the configuration that end users should use, you can record its URL here. You may add several of them, as several elements. It is for informational purposes only and mainly for the maintenance of the config file, the client currently does not use them at all.

-

If your URL contains ampersands (&), please remember to replace them with HTML entities (&amp;). For example:

-

 

-

<documentation url="http://example.com/help.php?client=thunderbird&amp;lang=en"/>

-

Otherwise your XML file will be incorrect and Thunderbird will neither be able to parse it, nor to return any error message.

diff --git a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html b/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html deleted file mode 100644 index 76a90f2777..0000000000 --- a/files/zh-tw/mozilla/thunderbird/autoconfiguration/fileformat/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Autoconfig file format -slug: Mozilla/Thunderbird/Autoconfiguration/FileFormat -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Thunderbird/Autoconfiguration/FileFormat ---- - diff --git a/files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html b/files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html deleted file mode 100644 index 84cc17039c..0000000000 --- a/files/zh-tw/mozilla/thunderbird/autoconfiguration/index.html +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Autoconfiguration in Thunderbird -slug: Mozilla/Thunderbird/Autoconfiguration -tags: - - Administration - - NeedsTranslation - - TopicStub - - enterprise -translation_of: Mozilla/Thunderbird/Autoconfiguration ---- -

Author: Ben Bucksch
- Please do not change this document without consulting the author

-

Thunderbird 3.1 and later (and 3.0 to some degree) includes mail account autoconfiguration functionality. The goal of autoconfiguration is to make it very easy for users to configure the connection of Thunderbird to their email servers. In many cases, people should be able to download and install Thunderbird, enter their real name, email address and password in the Account Setup Wizard and have a fully functioning mail client and get and send their mail as securely as possible.

-

See also:

- -

This document describes how Autoconfiguration in Thunderbird works, and what to do to allow mail servers to be autoconfigured.

-

Mechanisms

-

Thunderbird gets the server settings via different means, each of which is intended for different cases:

- -

All the lookup mechanisms use the email address domain as base for the lookup. For example, for the email address fred@example.com , the lookup is performed as (in this order):

-
    -
  1. tb-install-dir/isp/example.com.xml on the harddisk
  2. -
  3. check for autoconfig.example.com
  4. -
  5. look up of "example.com" in the ISPDB
  6. -
  7. look up "MX example.com" in DNS, and for mx1.mail.hoster.com, look up "hoster.com" in the ISPDB
  8. -
  9. try to guess (imap.example.com, smtp.example.com etc.)
  10. -
-

We may in the future add DNS SRV records as supported mechanism in the future, but we currently do not.

-

How to add support for your domain

-

Classification

-

If you are a big ISP (> 100,000 users) providing email addresses solely under a few domains like "example.com" and "example.de", you may either submit the configuration to the ISPDB or set up a configuration server.
-
- If you support email aliases and the user's login name is not part of the email address (for example, users may have "hero@example.com" as email address, but the IMAP/POP/SMTP login name is neither "hero" nor "hero@example.com", but "u67578"), you need to set up a configuration server, which does the email address -> login name lookup.
-
- If you host customer domains, i.e. you are "hoster.com", but your customers have "fred@flintstone.com" and "louis@kent.com" as domains, with only a few users per domain, you need to set up a configuration server (or rely on DNS MX).
-
- If you are a small company installing Thunderbird on your employees' desktops, you can place a configuration file in the Thunderbird installation folder.

-

ISPDB

-

Database URL is <https://live.mozillamessaging.com/autoconfig/v1.1/>, append domain name, e.g. <https://live.mozillamessaging.com/autoconfig/v1.1/freenet.de>.
-
- Current process: File a bug in Bugzilla, Product "Webtools", Component "ISPDB Database Entries", with a configuration file that matches the requirements described below. Request review from bwinton, gozer or ben.bucksch.
-
- Future: add the configuration to the ISPDB server app.

-

Configuration server at ISP

-

Given the email address "fred@example.com", Thunderbird first checks <http://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=fred@example.com> and then <http://example.com/.well-known/autoconfig/mail/config-v1.1.xml>.

-

Small company

-

If you are a small company, you can put the XML configuration file on your web server, at URL <http://example.com/.well-known/autoconfig/mail/config-v1.1.xml>. (This is not yet finalized and subject to change.)

-

Domain hoster

-

If you are an ISP that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers accept and serve the mail for example.com -, you should set up an autoconfig server.

-

DNS

-

For each customer domain, you add a DNS record (in addition to the existing MX, A www etc. DNS records):
- autoconfig IN A 10.2.3.4
- or
- autoconfig IN CNAME autoconfig.hoster.com.
- ... where 10.2.3.4 and autoconfig.hoster.com are IP addresses / hostnames you own.
- This allows Thunderbird to find you as hoster.

-

To make the Version without an autoconfig DNS Entry work you have to make sure that example.com points to the Webserver you will place the config-v1.1.xml on.

-

Example: example.com A 10.2.3.4

-

Web server

-

You set up a web server bound to a physical IP address. This may be on the same machine as other web servers, but the web server must be configured to the content to any requested domain.
-
- You must use an virtual host that match all autoconfig.* domains of your customers. In Apache terms, you can use a "ip-based virtual host". In the Apache configuration files, that means something like: Listen 10.2.3.4:80 (of course, you use a public IP address that you own)

-
<VirtualHost 10.2.3.4:80> #Must be the first and only virtual host with this ip!
-    DocumentRoot /var/www/autoconfig/
-    ServerName autoconfig.hoster.com
-    <Directory /var/www/autoconfig>
-	Order allow,deny
-	allow from all
-    </Directory>
-</VirtualHost>
-

Place the configuration file at the URL /mail/config-v1.1.xml on that host.

-

All config files must be served as Content-Type: text/xml (or application/xml), otherwise the file will be ignored. Also, they must use charset UTF-8 (esp. if there are any non-ASCII-characters).

-

If you like to use name-based virtual hosts. You probably don't want to setup the autoconfig subdomain for every domain of your customers.
- You can add a Rewriterule in the default virtual host (on debian /etc/apache2/sites-enabled/000-default)  to match all autoconfig.* subdomains:

-
<VirtualHost *:80> #Must be the first Virtual host
-	ServerAdmin webmaster@hoster.com
-	ServerName www
-	DocumentRoot /var/www
-	RewriteEngine On
-	RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
-	RewriteRule ^/(.*)	http://autoconfig.hoster.com/$1 [L,R=301,NE]
-        #...
-</VirtualHost>
-<VirtualHost *:80>
-    DocumentRoot /var/www/autoconfig/
-    ServerName autoconfig.hoster.com
-    <Directory /var/www/autoconfig>
- 	Order allow,deny
-	allow from all
-    </Directory>
-</VirtualHost>
-
-

 

-

 

-

Configuration file

-

This is described at How to create a configuration file and defined on the sub-pages.

-

{{ languages( { "ja": "ja/Thunderbird/Autoconfiguration" } ) }}

diff --git a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html b/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html deleted file mode 100644 index 0873a7d1f2..0000000000 --- a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Deploying Thunderbird in the Enterprise -slug: Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise -tags: - - Corporate - - Corporation - - NeedsTranslation - - Thunderbird 3 - - TopicStub - - enterprise - - thunderbird -translation_of: Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise ---- -

These documents and references are provided to help those involved in deploying Thunderbird in large institutions. 

-

The documents are maintained primarily by volunteers and are a work in progress.  In other words, there are improvements and additions still be made, and you can help make those changes.  If you have skills, experience or information that will make these items better in small ways or large, please edit the documents directly, after creating an MDN account or registering with mozilla wiki if you don't already have an account.  You may also comment on the Talk page to note items that may be missing or inaccurate.

-

References

- -

Related information

- -

{{ languages( { "ja": "ja/Thunderbird/Deploying_Thunderbird_in_the_Enterprise" } ) }}

diff --git a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html b/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html deleted file mode 100644 index b067ae50fd..0000000000 --- a/files/zh-tw/mozilla/thunderbird/deploying_thunderbird_in_the_enterprise/upgrading_thunderbird_in_the_enterprise/index.html +++ /dev/null @@ -1,260 +0,0 @@ ---- -title: 於企業內升級 Thunderbird -slug: >- - Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise/Upgrading_Thunderbird_in_the_Enterprise -translation_of: >- - Mozilla/Thunderbird/Deploying_Thunderbird_in_the_Enterprise/Upgrading_Thunderbird_in_the_Enterprise ---- -
{{ draft }}
- -

這是一篇關於幫助大型組織使用 Thunderbird 升級到 3 版的升級手冊 (也可稱之為 "企業")。 這份初步草稿是從草稿作者知識庫摘要 auto-sync / offline settings (bug 562589) 與 Thunderbird 3 與管理者相關的搬遷問題 (bug 562589#c7) (如同 2010/05/06).

- -

背景

- -

此份搬遷手冊針對典型的企業環境做出一些假設:

- - - -

(The above requirements may not be compatible with the fact that the new global search (Gloda) is enabled by default on upgrade and IMAP folder automatic synchronization is enabled by default on upgrade. This is discussed further below.)

- -

企業環境通常需要執行大規模軟件升級,而不是為個人用戶升級軟件,此升級目標也許會是:

- - - -

相關資訊:

- - - -

遷移指南 (Thunderbird 2 升級到 Thunderbird 3.0)

- -

The major changes in Thunderbird 3.0 that are relevant to enterprise administrators include:

- - - -

For more detailed information about the changes between Thunderbird 2 and Thunderbird 3, see:

- - - -

As a general rule, administrators should deal with the process of upgrading Thunderbird and enabling new features separately. That is, they should try to keep the user setup as similar as possible between Thunderbird 2 and 3 and wait until the Thunderbird 3 upgrade is complete and stable before enabling Thunderbird 3 features.

- -

在遷移前,停用附加元件以進行安全升級

- -

Problems due to add-on are known. For example;

- - - -

To avoid such unwanted problems due to add-ons, next upgrade procedure is recommended for safe migration.

- -
    -
  1. Start Tb 2 with -safe-mode to make all add-ons disabled before upgrade.
  2. -
  3. Keep backup of profile directory before upgrade.
  4. -
  5. If possible, do uninstall of Thunderbird 2 and clean install of Thunderbird 3, instead of upgrade by software update by Thunderbird 2, for both safe migration and reducing of network traffic.
  6. -
- -

停用遷移幫手

- -

Enterprise sites that perform mass upgrades generally want to prevent users from performing Thunderbird upgrades on their own. An upgrade dialogue in the Thunderbird Migration Assistant should be disabled.

- -
lockPref("mail.ui.show.migration.on.upgrade",false);
- -

停用全域 (全域搜索與索引) 以避免遷移後的索引

- -

Initail purpose of Gloda was solution of of problem like Bug 383895 (slowness in body text search of local mail data). With enhancements and many improvements by Thuderbird 3 on auto-sync of IMAP folder, Gloda can be used also for IMAP folders very easily. So, gloda is very useful for everyday usage even for IMAP users: It can search messages very fast, much faster than an IMAP server can, and so notably increase productivity. Also, it will in the future have increased functionality in other areas.

- -

However, the new Thunderbird 3 search and index functionality initially impacts performance. (The indexer runs when Thunderbird 3 is first started and will continue to work until all the user's email is indexed. The more messages a user has, the longer the indexer will run.) Also, it uses diskspace on the client (about 1/2 (?) of mailbox size), which is a problem for roaming profiles.

- -

Gloda can be enabled by only single action after upgrade - check an option at Tools/Options/Advanced/General tab. So, to minimize user support workload after migration, we  recommend you to disable automatic enabling of Gloda durng migration by Thunderbird 3.

- -
怎麼會? 可能嗎? 需要加強?
- -

停用自動同步,保持每個資料夾 "離線使用" 設定,以避免遷移後每個巨大的 IMAP 資料夾下載所有郵件

- -

Auto-sync of IMAP folders is enabled by default for all IMAP accounts. The per folder "offline use" setting of all IMAP folders is changed to "offline use=On" when Thunderbird 3 is launched the first time. To keep same settings as Thunderbird 2, disable the auto-sync and offline-use settings upon upgrade.

- -

完全停用自動同步 (auto-sync):

- -
lockPref("mail.server.default.autosync_offline_stores", false);
-lockPref("mail.server." + serverFromAccount + ".autosync_offline_stores", false);
-
- -

停用每個資料夾 "離線使用 (offline use)" 設定在遷移時設定變更 (Tb 3.0.5 到 Tb 3.1rc1):

- -
lockPref("mail.server." + serverFromAccount + ".offline_download", false);
-
- -

To disable per folder "offline use" setting change upon migration (Tb 3.1rc2 or later):

- -
lockPref("mailnews.ui.show.migration.on.upgrade",false);
-
- -

注意:

- - - -

在遷移後,如何啟用自動同步

- -

Account Settings/Synchronization & Disk Space

- - - -

Current behavior of UI for auto-sync setting.

- - - -

Note: There is a request for a design change in bug 537943.

- -

Gloda and auto-sync/offline-use are possibly independent, although relevant.

- - - -

修改資料夾面板檢視從 "聰明資料夾 " 為 "所有資料夾"

- -

By default, Thunderbird 3 displays "Smart Folders" in the folder pane. (Smart Folders combine the messages in similarly named folders in multiple accounts, for example grouping Inbox messages from all accounts into a single Inbox on the Smart Folder pane.) If you want to preserve the default Thunderbird 2 behavior of showing "All Folders", advice users to select View | Folders | All from the menu.

- -

Can "forcing Smart Folders view" upon migration be stopped? How? Is it possible? Enhancement is needed?

- -

Note: "Smart Folders" is renamed to "Unified Folders" by Tb 3.1, and Tb 3.1 won't force it upon migration from Tb2 any more.

- -

注意事項

- -

由自動配置 (autoconfig) 帳戶定義

- -

When new accounts are created, the new "autoconfig" functionality is automatically invoked. Unless users have the correct account definition parameters, it may be confusing for them to configure their own accounts (if this is permitted).

- -

IMAP 資料夾檔案的位置

- -

By default, the IMAP folder file is located in each user's profile directory. If the user is storing a lot of messages for off-line access, this can result in too much data for a roaming profile. Regardless of whether or not there is a roaming profile, there may be if the profile is located on a network resource or if Microsoft Window's Offline File (CSC) is used for the offline storage file.

- -

If that is the case, you have two options:

- -

If the Gloda search and index is mandatory for IMAP mail data:

- -
    -
  1. Locate mail directory for IMAP account at location with which remote/network access won't happen(e.g. "Local Settings" of MS Win)
  2. -
  3. Enable auto-sync, and set offline use=on of IMAP folders.
  4. -
  5. Accept download of all mails to any PC which uses the IMAP account.
  6. -
  7. Accept per PC thread pane column setting of the IMAP accout. -
      -
    • -
      -
       
      -
      - -
      -
      As thread pane column setting is currently saved in .msf file, and as you selected folder location other than profile directory, data in .msf can not be shared among PCs, even when you use Roaming Profile.
      -
      -
    • -
    -
  8. -
- -

When Gloda is not needed for IMAP mail data:

- -
    -
  1. Locate IMAP folder file at any place you want.
  2. -
  3. Disable auto-sync, and/or set offline use=off of all IMAP folders. -
      -
    • -
      -
       
      -
      - -
      -
      As new feature of "Disk Cache for mail in IMAP folder of offline-use=off" is added to Tb 3, mail data of viewed mail is held in far larger Disk Cache than very small memory cache of Thunderbird 2. So, frequency of problem like "repeatedly downloaded big attachment data" is reduced very much compared to Thunderbird 2.
      -
      -
    • -
    -
  4. -
- -

As Gloda is first solution of problem of Bug 383895 (slowness in body text search of local mail data), and as many IMAP servers have excellent body text search functionality, consider utilizing of online search first for IMAP mail data. If online search is usable, enabling of auto-sync/offline-use merely for Gloda can be avoided.

- -

線上搜尋 IMAP 資料夾

- -

There is known with regards to online search (documented in Bug 546925 "Run search on server" of Edit/Find/Search Messages doesn't work). For now, users must use Quick Search or Virtual Folder (Saved Search folder) for online searches.

- -

搜尋、自動同步、離線使用與 "聰明資料夾"

- -

If IMAP folder of offline-use=off, full text search by Gloda won't work because of offline-use=off.

- -

And, if not all mails of IMAP folder of offline-use=on is downloaded into local offline-store file because of your setting for offline-store file size limitation, Gloda can't find not-downloaded mails of the IMAP folder.

- -

And, as "Smart Folder" is internally Virtual Folder(Saved Search Folder), a "Smart Folder" can be Virtual Folder with multiple search target folders in mixture of local mail folders, IMAP folders of offline-use=on(all mails are sync'ed), IMAP folders of offline-use=on(not all mails are sync'ed), and IMAP folders of offline-use=off.

- -

Never open bug at bugzilla.mozilla.org for "Search can't find my mail!" without sufficient checking of "what mail at what kind of folder is not hit by what kind of search at where", please.

- -

遷移手冊 (Thunderbird 2 到 Thunderbird 3.1)

- -

(content needed)

- -

遷移手冊 (Thunderbird 3.0 到 Thunderbird 3.1)

- -

(content needed)

diff --git a/files/zh-tw/mozilla/thunderbird/index.html b/files/zh-tw/mozilla/thunderbird/index.html deleted file mode 100644 index f0a48a2be0..0000000000 --- a/files/zh-tw/mozilla/thunderbird/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Thunderbird -slug: Mozilla/Thunderbird -tags: - - NeedsTranslation - - TopicStub - - thunderbird -translation_of: Mozilla/Thunderbird ---- -

Thunderbird is Mozilla's mail/messaging application. These pages document Thunderbird and also provide links to documentation about the MailNews backend which is also used in other projects such as Eudora/Penelope, Seamonkey, Correo, etc.

-

Thunderbird is Firefox's kid sibling, and is built on the same technical platform as the web browser. In development for many years, and currently one of the most popular open source email clients, it is used by millions of people around the world to bring together all their email accounts, newsgroup and feed reading in a familiar high-productivity environment.  (From early 2007 to early 2011 Thunderbird was developed by Mozilla Messaging, a subsidiary that was owned by Mozilla.)

- - - - - - - -
-

Documentation

-
-
- Building Thunderbird
-
- Information about building Thunderbird with the comm-central repository. There's also information about how comm-central works, how the review process works and how to use the Mozilla symbol server to help with debugging.
-
- MailNews Protocols
-
- Rough documentation about mail protocols..
-
- Database views
-
- Backend information about {{ Interface("nsIMsgDBView") }} and related interfaces..
-
- Thunderbird API documentation
-
- Thunderbird API documentation
-
- Extension documentation
-
- Tutorials and tips for building Thunderbird extensions
-
- Automated Testing
-
- Details of Thunderbird's automated testing facilities
-
- Thunderbird in the Enterprise
-
- Help with deploying Thunderbird in large organizations
-
-

View All...

-
-

Community

- -

Tools

- - - -
-

 

diff --git a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html b/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html deleted file mode 100644 index 4ce42f41a7..0000000000 --- a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Thunderbird extensions -slug: Mozilla/Thunderbird/Thunderbird_extensions -tags: - - Add-ons - - Extensions - - NeedsTranslation - - TopicStub - - thunderbird -translation_of: Mozilla/Thunderbird/Thunderbird_extensions ---- -
Building a Thunderbird extension
-Step-by-step explanation on how to build an extension for Thunderbird.
- -
-

{{AddonSidebar}}

-The following documentation provides help for creating extensions for Mozilla's Thunderbird email client. Although there are many similarities with Firefox extensions there are also some differences that may confound the starting developer.
- -

-Please help! You can add a how-to (a question or an answer or a code snippet), summarize and link to a relevant newsgroup discussion, or create a tutorial. Need help? Contact jenzed.
- - - - - - - - -
-

Documentation

- -

Getting started with Thunderbird

- -

A brave, young developer wants to develop an add-on for Thunderbird. Here's a few links to help them through this journey.

- -
    -
  • Start by reading the tutorial and learn how to build a Thunderbird extension (Outdated, still talks about overlays and the add-on builder is no longer available but the tutorial has not been updated.)
  • -
  • Read about the main windows so that you know what one means when they say « thread pane », « preview pane », and « folder pane ».
  • - -
  • Want to do some real stuff? See how to inspect a message (demo add-on included!)
  • -
  • Play with our other demo add-on that exercises some more advanced Thunderbird-specific features
  • -
  • Want to do even more stuff? Don't reinvent the wheel: steal functions from the thunderbird-stdlib project (doc here). Functions for dealing with messages (delete them, archive them, change their tags, etc.) are included.
  • -
  • Haven't found what you're looking for? Read the Thunderbird how-tos; they contain a lot of recipes for things extensions want to do.
  • -
  • Still haven't managed to do what you wanted? See the list of all Thunderbird communication channels so that you know where to ask when you get stuck :-).
  • -
  • Feeling really brave? Read the source using a fancy interface; you can often find tests that demonstrate how to do what you're trying to achieve.
  • -
- -

The Gloda database

- -

Thunderbird has a subsystem called Gloda. Gloda stands for « Global Database », and creates Thunderbird-wide relations between objects. Gloda provides concepts such as Conversations, Messages, Identities, Contacts. All these concepts are related together: a Conversation contains Messages which are linked to Identities (from field, to field) which are themselves part of a Contact: indeed, a contact has multiple identities.

- -

Typical use cases for Gloda: find all messages whose subject matches [search term], find all messages from [person], find all messages in the same thread as [a given message], find all messages involving [person], etc. etc.

- -

Gloda is extremely powerful and is used heavily by add-ons such as Thunderbird Conversations. Learn more about Gloda:

- - - - - -

Some of these links may be wildly out of date, but they still provide valuable information on the codebase.

- - - - - - -
-

Community

- - - -

{{ DiscussionList("dev-extensions", "mozilla.dev.extensions") }}

- - - -

Tools

- - - -

... more tools ...

- -

View All...

- - - -
-
XUL, JavaScript, XPCOM, Themes, Developing Mozilla
-
-
- -

Categories

- -

{{ languages( { "ja": "ja/Extensions/Thunderbird" } ) }}

diff --git a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html b/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html deleted file mode 100644 index 9aeb61d94f..0000000000 --- a/files/zh-tw/mozilla/thunderbird/thunderbird_extensions/theme_packaging/index.html +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: 包裝佈景主題 -slug: Mozilla/Thunderbird/Thunderbird_extensions/Theme_Packaging -tags: - - Toolkit API - - 佈景主題 -translation_of: Mozilla/Thunderbird/Thunderbird_extensions/Theme_Packaging ---- -

本文描述包裝 Firefox 及 Thunderbird 之佈景主題的方法。

-

需求

-

製作 Firefox 或 Thunderbird 的佈景主題需要懂層疊樣式表(CSS)、會一點 XBL、還要有美術繪圖設計等能力(不過也不見得一定要)。本文只說明包裝佈景主題以便顯示於 Firefox 佈景主題視窗的方法。

-

佈景主題檔案架構

-

Firefox 及 Thunderbird 的佈景主題是一個將資料以下列結構包裝的 JAR 檔案:

-
theme.jar:
-  install.rdf
-  contents.rdf
-  preview.png
-  icon.png
-  browser/一堆檔案
-  global/一堆檔案
-  mozapps/一堆檔案
-  communicator/一堆檔案
-  ...
-
-
- -

install.rdf

-

install.rdf 清單長得像這樣:

-
<?xml version="1.0"?>
-
- <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">
-     <em:type>4</em:type>
-     ''其他特性''
-   </Description>
- </RDF>
-
-

必備特性

-

install.rdf 檔中必須含有下列特性:

- -

詳細資訊請見 install.rdf 參考

-

選用特性

- -

如果你想將佈景主題送上 addons.mozilla.org,則 updateURL 就是必備的特性。

-

範例

-
<?xml version="1.0"?>
-
- <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">
-     <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id>
-     <em:version>1.0</em:version>
-     <em:type>4</em:type>
-
-     <!-- 擴充套件的適用軟體,含最低需求及上限版本資訊。 -->
-     <em:targetApplication>
-       <Description>
-         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-         <em:minVersion>0.8</em:minVersion>
-         <em:maxVersion>0.9</em:maxVersion>
-       </Description>
-     </em:targetApplication>
-
-     <!-- 使用者會看到的資訊 -->
-     <em:name>New Theme 1</em:name>
-     <em:description>A test theme for Firefox</em:description>
-     <em:creator>Ben Goodger</em:creator>
-     <em:contributor>John Doe</em:contributor>
-     <em:homepageURL>http://www.bengoodger.com/</em:homepageURL>
-
-     <!-- 佈景主題管理員內部所用的識別名稱 -->
-     <em:internalName>newtheme1</em:internalName>
-   </Description>
- </RDF>
-
-

以下是幾個 targetApplication 特性常用的應用程式 GUID:

-
Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}
-Sunbird      {718e30fb-e89b-41dd-9da7-e25a45638b28}
-
-

Toolkit API 官方參考文件

-
- {{page("/zh-TW/docs/Toolkit_API/Official_References")}}
-
-  
-- cgit v1.2.3-54-g00ecf