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 --- files/ja/extensions/bootstrap.js/index.html | 71 ---- .../extensions/bootstrapped_extensions/index.html | 386 --------------------- files/ja/extensions/community/index.html | 22 -- files/ja/extensions/firefox/index.html | 62 ---- files/ja/extensions/index.html | 100 ------ files/ja/extensions/inline_options/index.html | 172 --------- files/ja/extensions/other_resources/index.html | 14 - files/ja/extensions/seamonkey/index.html | 16 - .../building_a_thunderbird_extension/index.html | 61 ---- .../index.html | 23 -- .../index.html | 62 ---- .../index.html | 31 -- .../index.html | 29 -- files/ja/extensions/thunderbird/faq/index.html | 29 -- .../add_new_tab/index.html | 15 - .../add_toolbar_button/index.html | 28 -- .../get_thunderbird_version/index.html | 46 --- .../index.html | 10 - files/ja/extensions/thunderbird/howtos/index.html | 127 ------- files/ja/extensions/thunderbird/index.html | 81 ----- .../index.html | 65 ---- 21 files changed, 1450 deletions(-) delete mode 100644 files/ja/extensions/bootstrap.js/index.html delete mode 100644 files/ja/extensions/bootstrapped_extensions/index.html delete mode 100644 files/ja/extensions/community/index.html delete mode 100644 files/ja/extensions/firefox/index.html delete mode 100644 files/ja/extensions/index.html delete mode 100644 files/ja/extensions/inline_options/index.html delete mode 100644 files/ja/extensions/other_resources/index.html delete mode 100644 files/ja/extensions/seamonkey/index.html delete mode 100644 files/ja/extensions/thunderbird/building_a_thunderbird_extension/index.html delete mode 100644 files/ja/extensions/thunderbird/building_a_thunderbird_extension_2_colon__extension_filesystem/index.html delete mode 100644 files/ja/extensions/thunderbird/building_a_thunderbird_extension_3_colon__install_manifest/index.html delete mode 100644 files/ja/extensions/thunderbird/building_a_thunderbird_extension_4_colon__chrome_manifest/index.html delete mode 100644 files/ja/extensions/thunderbird/building_a_thunderbird_extension_5_colon__xul/index.html delete mode 100644 files/ja/extensions/thunderbird/faq/index.html delete mode 100644 files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_new_tab/index.html delete mode 100644 files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_toolbar_button/index.html delete mode 100644 files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/get_thunderbird_version/index.html delete mode 100644 files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/index.html delete mode 100644 files/ja/extensions/thunderbird/howtos/index.html delete mode 100644 files/ja/extensions/thunderbird/index.html delete mode 100644 files/ja/extensions/using_the_dom_file_api_in_chrome_code/index.html (limited to 'files/ja/extensions') diff --git a/files/ja/extensions/bootstrap.js/index.html b/files/ja/extensions/bootstrap.js/index.html deleted file mode 100644 index d41402dbe0..0000000000 --- a/files/ja/extensions/bootstrap.js/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: bootstrap.js -slug: Extensions/bootstrap.js -tags: - - Add-ons - - Bootstrap - - Extensions -translation_of: Extensions/bootstrap.js ---- -

bootstrap.js スクリプトにはいくつかの特定の関数を含める必要があります。それらは拡張機能を管理するブラウザによって呼び出されます。このスクリプトは特権付きサンドボックス内で実行され、拡張機能の終了時までキャッシュされます。詳しくは ブートストラップ型拡張機能 を参照してください。

-

以下の例には必要な関数が vsdoc 形式で含まれています。

-
function startup(data, reason) {
-    /// <summary>
-    /// ブートストラップデータ構造 @see https://developer.mozilla.org/ja/docs/Extensions/Bootstrapped_extensions#Bootstrap_data
-    /// &#10;  string id
-    /// &#10;  string version
-    /// &#10;  nsIFile installPath
-    /// &#10;  nsIURI resourceURI
-    /// &#10;
-    /// 理由の種類:
-    /// &#10;  APP_STARTUP
-    /// &#10;  ADDON_ENABLE
-    /// &#10;  ADDON_INSTALL
-    /// &#10;  ADDON_UPGRADE
-    /// &#10;  ADDON_DOWNGRADE
-    /// </summary>
-}
-function shutdown(data, reason) {
-    /// <summary>
-    /// ブートストラップデータ構造 @see https://developer.mozilla.org/ja/docs/Extensions/Bootstrapped_extensions#Bootstrap_data
-    /// &#10;  string id
-    /// &#10;  string version
-    /// &#10;  nsIFile installPath
-    /// &#10;  nsIURI resourceURI
-    /// &#10;
-    /// 理由の種類:
-    /// &#10;  APP_SHUTDOWN
-    /// &#10;  ADDON_DISABLE
-    /// &#10;  ADDON_UNINSTALL
-    /// &#10;  ADDON_UPGRADE
-    /// &#10;  ADDON_DOWNGRADE
-    /// </summary>
-}
-function install(data, reason) {
-    /// <summary>
-    /// ブートストラップデータ構造 @see https://developer.mozilla.org/ja/docs/Extensions/Bootstrapped_extensions#Bootstrap_data
-    /// &#10;  string id
-    /// &#10;  string version
-    /// &#10;  nsIFile installPath
-    /// &#10;  nsIURI resourceURI
-    /// &#10;
-    /// 理由の種類:
-    /// &#10;  ADDON_INSTALL
-    /// &#10;  ADDON_UPGRADE
-    /// &#10;  ADDON_DOWNGRADE
-    /// </summary>
-}
-function uninstall(data, reason) {
-    /// <summary>
-    /// ブートストラップデータ構造 @see https://developer.mozilla.org/ja/docs/Extensions/Bootstrapped_extensions#Bootstrap_data
-    /// &#10;  string id
-    /// &#10;  string version
-    /// &#10;  nsIFile installPath
-    /// &#10;  nsIURI resourceURI
-    /// &#10;
-    /// 理由の種類:
-    /// &#10;  ADDON_UNINSTALL
-    /// &#10;  ADDON_UPGRADE
-    /// &#10;  ADDON_DOWNGRADE
-    /// </summary>
-}
diff --git a/files/ja/extensions/bootstrapped_extensions/index.html b/files/ja/extensions/bootstrapped_extensions/index.html deleted file mode 100644 index ed72d81d3d..0000000000 --- a/files/ja/extensions/bootstrapped_extensions/index.html +++ /dev/null @@ -1,386 +0,0 @@ ---- -title: ブートストラップ型拡張機能 -slug: Extensions/Bootstrapped_extensions -tags: - - Add-ons - - Extensions - - Firefox 4 - - Gecko 2.0 - - Guide - - Localization - - NeedsTechnicalReview -translation_of: Archive/Add-ons/Bootstrapped_extensions ---- -

{{ gecko_minversion_header("2.0") }}

- -
-

なお、Add-on SDKを使って作成された拡張機能はすべて bootstrappedです!ブート処理コードは自動的に生成されるので、それについて考える必要はまったくありません。 Add-on SDKを使っていない? 読むべきです...

-
- -

従来型の拡張機能はオーバーレイを含んでおり、アプリケーションが拡張機能のパッケージから XUL を読み込み、その UI 部品をアプリケーションのユーザインタフェース (UI) 上へ自動的に適用します。この仕組みを使うと、アプリケーションの UI へ部品を追加する拡張機能を比較的簡単に作成できますが、拡張機能の更新、インストール、無効化を行う際にアプリケーションの再起動が必要となります。

- -

Gecko 2.0 {{ geckoRelease("2.0") }} では新たにブートストラップ型拡張機能 (bootstrapped extension) という仕組みが導入されました。これは特別な拡張機能で、オーバーレイを使って独自の UI 部品をアプリケーションへ適用する代わりに、アプリケーションへ動的に部品を挿入できるようにするものです。この処理は、拡張機能のインストール、削除、起動、終了時にブラウザが呼び出す関数を記述した、拡張機能に含まれる特別なスクリプトファイルを使って行われます。

- -

アプリケーションが行うのはこのスクリプトファイルに書かれた関数を呼び出すことだけで、UI 部品の追加や削除、その他必要とされる起動・終了時の処理などはすべて拡張機能自身が責任を持って行う必要があります。

- -

この記事ではブートストラップ型拡張機能の仕組みを解説します。移行の段階的で実験的なガイドについては、オーバーレイ拡張機能から再起動なしへの変換に関するこのチュートリアルを参照して下さい。

- -

起動・終了プロセス

- -

ブートストラップ型拡張機能の重要な機能のひとつに、アプリケーションの指示による任意のタイミングで起動や終了が可能であることが挙げられます。拡張機能の startup() 関数が呼び出されたとき、UI 部品やその他の動作をアプリケーションへ動的に挿入する必要があります。同じように、shutdown 関数が呼び出されたときは、アプリケーションへ追加した部品やそのオブジェクトへの参照をすべて削除しなければなりません。

- -

startup 関数が呼び出される場面はいくつかあります。例えば、

- - - -

shutdown 関数が呼び出される場面は次のようなときです。

- - - -

アプリケーションの UI 変更に関する注意

- -

ブートストラップ型拡張機能内の chrome.manifest

- -

ブートストラップ型拡張機能に chrome.manifest ファイルを含めると次のようなことが可能となります。

- -
    -
  1. 拡張機能に含まれるコンテンツを chrome:// URI を通じて利用可能にする (マニフェスト内の contentlocaleskin 命令文を使う)
  2. -
  3. 既存の chrome:// URI を自作コンテンツで置き換える (override 命令文を使う)
  4. -
- -

ブートストラップ型拡張機能の中では使えないマニフェスト命令文もあります。例えば XUL オーバーレイ を登録することはできません。詳しくは chrome.manifest の記事を参照してください。

- -

Firefox 10 以降では、拡張機能 XPI ファイル内のルートに (install.rdf と同列で) 置かれている chrome.manifest ファイルは自動的に読み込まれます。Firefox 8 と 9 では、{{ ifmethod("nsIComponentManager", "addBootstrappedManifestLocation") }} と {{ ifmethod("nsIComponentManager", "removeBootstrappedManifestLocation") }} を使ってマニフェストを動的に読み込み、終了時に読み込み解除する必要があります。この機能は Firefox 8 未満のバージョンでは使用できません。

- -

UI 部品の動的な追加

- -

ここまで読んで、アプリケーションの UI を変更するブートストラップ型拡張機能を作り始めようと思ったら、最初に次のようなコードを考えましょう。

- -

まず、関連するアプリケーションの UI 要素を、{{ domxref("document.getElementById()") }} を使って、その ID で参照します。次に、それらを操作して独自の UI 部品を挿入します。例えば、Firefox のメニューバーは document.getElementById("main-menubar") で参照可能です。

- -

終了時には、追加した UI 部品を必ず削除しましょう。

- -

ブートストラップ型拡張機能の作成

- -

拡張機能がブートストラップ型であることを示すには、以下の要素を インストールマニフェスト へ追加する必要があります。

- -
<em:bootstrap>true</em:bootstrap>
- -

それから、必要な関数を記述する bootstrap.js ファイル を追加します。これは拡張機能パッケージ内の install.rdf ファイル と同列で配置します。

- -

後方互換性

- -

Firefox の旧バージョンは bootstrap プロパティや bootstrap.js ファイルを認識できないため、ブートストラップ型と従来型を兼ねた拡張機能の開発は非常に難しいと言えます。まずはブートストラップ型拡張機能として作成し、次に従来のオーバーレイも追加することになります。そうすることで、Firefox の新バージョンは bootstrap.js スクリプトを使い、コンポーネントやオーバーレイを無視しますが、旧バージョンにはオーバーレイを使わせられます。

- -

ブート処理が呼び出されるタイミング (エントリーポイント)

- -

bootstrap.js スクリプトにはいくつかの特定の関数を含める必要があります。それらは拡張機能を管理するブラウザによって呼び出されます。このスクリプトは特権付きサンドボックス内で実行され、拡張機能の終了時までキャッシュされます。

- -

startup

- -

拡張機能がそれ自身を起動する必要があるときに呼び出されます。アプリケーションの起動時や、無効化されている拡張機能が有効化されるとき、更新をインストールするときにも呼び出されます。そのため、アプリケーションの起動中に何度も呼び出される可能性があります。

- -

このタイミングで、独自の UI 部品を挿入したり、必要な処理を開始したりします。

- -
void startup(
-  data,
-  reason
-);
-
- -
引数
- -
-
data
-
ブートストラップデータ構造
-
reason
-
理由定数 のひとつで、拡張機能が起動されようとしている理由を示します。APP_STARTUPADDON_ENABLEADDON_INSTALLADDON_UPGRADEADDON_DOWNGRADE のいずれかになります。
-
- -

shutdown

- -

拡張機能がそれ自身を終了する必要があるときに呼び出されます。アプリケーションの終了時や、拡張機能が更新あるいは無効化されるときなどです。このタイミングで、挿入した UI 部品をすべて削除し、処理を停止し、オブジェクトを破棄する必要があります。

- -
void shutdown(
-  data,
-  reason
-);
-
- -
引数
- -
-
data
-
ブートストラップデータ構造
-
reason
-
理由定数 のひとつで、拡張機能が終了されようとしている理由を示します。APP_SHUTDOWNADDON_DISABLEADDON_UNINSTALLADDON_UPGRADEADDON_DOWNGRADE のいずれかになります。
-
- -

install

- -

ブートストラップスクリプトにはオプションで install 関数を含めることができます。これは、拡張機能がインストール、更新、あるいはダウングレードされた後、startup 関数の初回呼び出し前に、アプリケーションによって呼び出されます。

- -
注: この関数は、拡張機能が一度も起動されていない場合は呼び出されません。例えば、拡張機能がインストールされたもののアプリケーションの現在のバージョンと互換性がなく、互換性が確保される前に削除された場合、install 関数は一度も呼び出されません。しかし、拡張機能がそのアプリケーションと互換性のあるバージョンへ更新された場合、install 関数はその時点で、startup 関数の初回呼び出し前に呼び出されます。
- -
void install(
-  data,
-  reason
-);
-
- -
引数
- -
-
data
-
ブートストラップデータ構造
-
reason
-
理由定数 のひとつで、拡張機能がインストールされようとしている理由を示します。ADDON_INSTALLADDON_UPGRADEADDON_DOWNGRADE のいずれかになります。
-
- -

uninstall

- -

このオプション関数は、拡張機能の特定のバージョンが削除された後、shutdown 関数の最終呼び出し後に呼び出されます。これは、install 関数が一度も呼び出されていない場合は呼び出されません。

- -
注: uninstall 関数は、拡張機能が無効化されている場合や、アプリケーションの現在のバージョンと互換性がない場合でも呼び出される場合があることに注意してください。このため、この関数を実装する場合は、使用している API がアプリケーションに実装されていない可能性も考慮し、適切に処理することが重要です。なお、この関数は Firefox が起動していないときに外部アプリケーションによって拡張機能が削除された場合には呼び出されません。
- -
Note: Simply having function install() {} IS NOT ENOUGH because if you have code in uninstall it will not run. You MUST run some code in the install function; at the least you must set parameters for the install function, such as: function install(aData, aReason) {}; then uninstall WILL WORK.
- -
Note: If you open the add-on manager and then click "Remove" on an add-on, it will not call uninstall function right away. This is a soft uninstall because of the available "Undo" option. If the add-on manager is closed or another event takes place such that the "Undo" option becomes unavailable, then the hard uninstall takes place and the uninstall function is called.
- -
Note: The uninstall function fires on downgrade and upgrade as well so you should make sure it is an uninstall by doing this:
-function uninstall(aData, aReason) {
-     if (aReason == ADDON_UNINSTALL) {
-          console.log('really uninstalling');
-     } else {
-          console.log('not a permanent uninstall, likely an upgrade or downgrade');
-     }
-}
- -
void uninstall(
-  data,
-  reason
-);
-
- -
引数
- -
-
data
-
ブートストラップデータ構造
-
reason
-
理由定数 のひとつで、拡張機能が削除されようとしている理由を示します。ADDON_UNINSTALLADDON_UPGRADEADDON_DOWNGRADE のいずれかになります。
-
- -

理由定数

- -

ブートストラップ関数は reason 引数を取ることができます。拡張機能は、その関数が呼び出された理由をこの引数で確かめられます。理由定数は以下の通りです。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数意味
APP_STARTUP1アプリケーションが起動されようとしている
APP_SHUTDOWN2アプリケーションが終了されようとしている
ADDON_ENABLE3拡張機能が有効化されようとしている
ADDON_DISABLE4拡張機能が無効化されようとしている (削除時にも送信されます)
ADDON_INSTALL5拡張機能がインストールされようとしている
ADDON_UNINSTALL6拡張機能が削除されようとしている
ADDON_UPGRADE7拡張機能が更新されようとしている
ADDON_DOWNGRADE8拡張機能がダウングレードされようとしている
- -

ブートストラップデータ

- -

上記の各関数 (エントリーポイント) には、その拡張機能に関する有用な情報が含まれるシンプルなデータ構造が渡されます。拡張機能に関するより詳しい情報は AddonManager.getAddonByID() を呼び出すことで取得できます。このデータは単純な JavaScript オブジェクトで、以下のプロパティが含まれます。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
プロパティ意味
idstringブート処理される拡張機能の ID
versionstringブート処理される拡張機能のバージョン
installPathnsIFileブート処理される拡張機能がインストールされている場所。これは、拡張機能がインストール時に展開されているかどうかによって、ディレクトリもしくは XPI ファイルとなります
resourceURInsIURI -

拡張機能ファイルのルートを示す URI。これは、拡張機能がインストール時に展開されているかどうかによって、jar: もしくは file: URI となります {{ gecko_minversion_inline("7.0") }}

-
- - - - - - - - - - - - - - -
oldVersionstringThe previously installed version, if the reason is ADDON_UPGRADE or ADDON_DOWNGRADE, and the method is install or startup. {{ gecko_minversion_inline("22.0") }}
newVersionstringThe version to be installed, if the reason is ADDON_UPGRADE or ADDON_DOWNGRADE, and the method is shutdown or uninstall. {{ gecko_minversion_inline("22.0") }}
- -
-

Note: An add-on may be upgraded/downgraded at application startup, in this case the startup method reason is APP_STARTUP, and the oldVersion property is not set. Also be aware that in some circumstances an add-on upgrade/downgrade may occur without the uninstall method being called.

-
- -

Add-on debugger

- -

From Firefox 31 onwards, you can use the Add-on Debugger to debug bootstrapped add-ons.

- -

Localization (L10n)

- -

Localizing bootstrapped add-ons is very much the same since Firefox 7, as that is when chrome.manifest compatibility landed.

- -

JS and JSM Files - Using Property Files

- -

To localize your .js and .jsm files you have to use property files.

- -

The absolute minimum needed here is:

- -
    -
  1. File: install.rdf
  2. -
  3. File: chrome.manifest
  4. -
  5. File: bootstrap.js
  6. -
  7. Folder: locale -
      -
    1. Folder: VALID_LOCALE_HERE -
        -
      1. File: ANYTHING.properties
      2. -
      -
    2. -
    -
  8. -
- -

In the locale folder you must have folders for each of the languages you want to provide; each folder must be named a valid locale (ex: en-US). Inside this folder must be a property file. Inside the chrome.manifest file these locale must be defined. For example if you had a subfolder of en-US in locale folder your chrome.manifest file will have to contain: locale NAME_OF_YOUR_ADDON en-US locale/en-US/

- -

Here is an example: GitHub :: l10n-properties - on startup of this add-on it will show a prompt saying USA or Great Britain, which ever it deems closest to your locale. You can test different locale by going to about:config and changing preference of general.useragent.locale to en-US and then to en-GB and disabling then re-enabling the add-on.

- -

XUL and HTML Files - Using Entities from DTD Files

- -

Many times HTML pages are used, however they cannot be localized with DTD files. There are three changes you must make:

- -
    -
  1. You have to change the HTML file's extension to be .xhtml
  2. -
  3. The doctype must be defined point to a DTD file in your locale folder such as: <!DOCTYPE html SYSTEM "chrome://l10n/locale/mozilla.dtd">
  4. -
  5. Must add xmlns attribute to html tag for example: <html xmlns="http://www.w3.org/1999/xhtml">
  6. -
  7. If you have multiple DTD files read on here: Using multiple DTDs
  8. -
- -

The bare minimum needed is:

- -
    -
  1. File: install.rdf
  2. -
  3. File: chrome.manifest
  4. -
  5. File: bootstrap.js
  6. -
  7. Folder: locale -
      -
    1. Folder: VALID_LOCALE_HERE -
        -
      1. File: ANYTHING.dtd
      2. -
      -
    2. -
    -
  8. -
- -

The chrome.manifest file must include a definition for content for example: content NAME_OF_YOUR_ADDON ./

- -

The chrome.manifest file must also include a line pointing to the locale, just like in the above property section, if you had a folder named en-US in locale, the chrome.manifest file should contain: locale NAME_OF_YOUR_ADDON en-US locale/en-US/

- -

Here is an example add-on that opens an HTML page and a XUL page on install: GitHub :: l10n-xhtml-xul. Here is an example showing how to use a localized HTML page as an options page: GitHub :: l10n-html-options. You can go to about:config and change the value of the preference general.useragent.locale to en-US and then to en-GB and then reload the open pages to see the localization change.

- -

参考資料

- - - -

日本語の参考資料

- - diff --git a/files/ja/extensions/community/index.html b/files/ja/extensions/community/index.html deleted file mode 100644 index 6c7aa3594f..0000000000 --- a/files/ja/extensions/community/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: 拡張機能関連コミュニティ -slug: Extensions/Community -tags: - - Add-ons - - Community - - Extensions - - Links -translation_of: Extensions/Community ---- -

もしあなたが拡張の開発に関係するメーリングリストやニュースグループ、フォーラムあるいは他のコミュニティを知っていたら、ここにリンクを追加してください。

- diff --git a/files/ja/extensions/firefox/index.html b/files/ja/extensions/firefox/index.html deleted file mode 100644 index 6432119d3e..0000000000 --- a/files/ja/extensions/firefox/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Firefox -slug: Extensions/Firefox -tags: - - Extensions - - Firefox -translation_of: Mozilla/Add-ons ---- -

以下の記事は、Firefox のための拡張機能開発の手引きです。すべての Mozilla アプリケーションに適用される全般的な拡張機能のドキュメントも参照してください。将来、Mozilla labs の Jetpack プロジェクトによって開発されている、より小型でシンプルな API を持つ新しい拡張機能を開発することになるかもしれません。

- - - - - - - -
-

ドキュメンテーション

- -
-

コミュニティ

-
    -
  • Mozilla フォーラムを見る...
  • -
  • {{DiscussionList("dev-extensions", "mozilla.dev.extensions")}}
  • -
- -

ツール

- -

... その他のツール ...

-

すべて見る...

- - -
diff --git a/files/ja/extensions/index.html b/files/ja/extensions/index.html deleted file mode 100644 index 193a81c7e7..0000000000 --- a/files/ja/extensions/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: 拡張機能 -slug: Extensions -tags: - - Add-ons - - Extensions - - 要更新 -translation_of: Mozilla/Add-ons ---- -
-

{{ NoteStart }} WebExtensions 移行以前の情報を含んでいます。原文(英語版)ではこのページは Add-ons に自動転送されています。 {{NoteEnd}}

- -

拡張機能 (Extensions) は、Firefox や Thunderbird, SeaMonkey などの Mozilla アプリケーションに新しい機能を付け加える小さなアドオンです。ツールバーボタンから全く新しい機能まで何でも付け加えることができます。ダウンロードのサイズが小さく、追加の機能を必要としているユーザに対して、その個々の必要性にあった機能を提供できます。

- -

プラグイン は拡張機能とは異なり、ブラウザと外部のプログラムを連携するソフトウェアのことです。検索プラグイン (検索エンジン) は拡張機能ともプラグインとも異なり、ブラウザの検索バーに検索エンジンを追加します。

-
- - - - - - - - -
-

ドキュメンテーション

- -


- 全般 (すべての Mozilla アプリケーションに適用):

- - - -

Firefox

- -

Thunderbird

- -

SeaMonkey  

- -

Fennec (モバイルブラウザ)

- -

 

- -

すべて見る...

-
-

コミュニティ

- -
    -
  • Mozilla 拡張機能開発フォーラムを見る...
  • -
  • {{ DiscussionList("dev-extensions", "mozilla.dev.extensions") }}
  • -
- - - -

ツール

- - - ... その他のツール ... - - - -
-
XUL, JavaScript, XPCOM, テーマ, Mozilla の開発
-
-
- -

Categories

- -

Interwiki Language Links

diff --git a/files/ja/extensions/inline_options/index.html b/files/ja/extensions/inline_options/index.html deleted file mode 100644 index 83665cffab..0000000000 --- a/files/ja/extensions/inline_options/index.html +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: インラインオプション -slug: Extensions/Inline_Options -tags: - - Add-ons - - Extensions - - XUL -translation_of: Archive/Add-ons/Inline_Options ---- -

{{ gecko_minversion_header("7.0") }}

-

Firefox 7 以降、拡張機能の設定を定義する新たな構文が使えるようになりました。これは ブートストラップ型 と従来型のいずれでも使用可能です。この新たな構文で定義された設定のユーザインタフェース (UI) は、アドオンマネージャ 内の拡張機能詳細画面に追加されます。この機能は元々 Android 版 Firefox 向けに提供されたもので、後にデスクトップ版 Firefox も対応しました。

-

オプションファイル

-

インラインオプションに使用可能な XUL は いくつかの新要素 に限られています。以下が options.xul ファイルの例です。

-
<?xml version="1.0"?>
-
-<!DOCTYPE mydialog SYSTEM "chrome://myaddon/locale/mydialog.dtd">
-
-<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <setting type="bool" pref="extensions.myaddon.bool" title="Boolean" desc="真偽値の設定として保存されます" />
-</vbox>
-
-

なお、ここで実際に使われるのは <setting> 要素だけです。ルートの <vbox> は単なるコンテナとして機能し、メイン画面には組み込まれません。スクリプトによる処理を追加したい場合は、下記 表示通知 の項目を参照してください。

-

設定の種類

-

<setting> にはいくつかの種類があり、それぞれ異なる type 属性を持ちます。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
type 属性表示形式設定の保存形式
bool{{ XULElem("checkbox") }}真偽値
boolint{{ XULElem("checkbox") }}整数値 (保存される値を指定するには on/off 属性を使用します)
integer{{ XULElem("textbox") }}整数値
string{{ XULElem("textbox") }}文字列
color{{ XULElem("colorpicker") }}文字列 (#123456 の形式)
file参照ボタンとラベル文字列
directory参照ボタンとラベル文字列
menulist {{ gecko_minversion_inline("8.0") }}{{ XULElem("menulist") }}メニュー項目の値による
radio {{ gecko_minversion_inline("8.0") }}{{ XULElem("radio") }} ボタンラジオボタンの値による
control{{ XULElem("button") }}設定は保存されません
-

-pref 属性には保存する設定をフルネームで記述します。 -title 属性はコントロールのラベルとして使われます。説明を追加するには、desc 属性を使うか、<setting> の子ノードとしてテキストを記述します。

-

設定は実際の設定値と紐付けられます。ただし、主にアクションに設計されているボタン形式の設定は除きます。

-

以下にいくつかの例を挙げます。

-
<!-- 真偽値の例 -->
-<setting pref="extensions.myaddon.bool1" type="bool" title="真偽値 1"/>
-<setting pref="extensions.myaddon.bool2" type="bool" title="真偽値 2">
-  真偽値 2 の説明
-</setting>
-
-<!-- 整数値として保存される真偽値 -->
-<setting pref="extensions.myaddon.boolInt" type="boolint" title="真偽値 3" on="1" off="2"/>
-
-<!-- 整数値の例 -->
-<setting pref="extensions.myaddon.int" type="integer" title="整数値"/>
-
-<!-- 文字列の例 -->
-<setting pref="extensions.myaddon.text" type="string" title="テキスト"/>
-<setting pref="extensions.myaddon.password" type="string" title="パスワード" inputtype="password"/>
-
-<!-- 色の例 -->
-<setting pref="extensions.myaddon.color" type="color" title="色"/>
-
-<!-- ファイルとディレクトリの例 -->
-<setting pref="extensions.myaddon.file" type="file" title="ファイル"/>
-<setting pref="extensions.myaddon.directory" type="directory" title="ディレクトリ"/>
-
-<!-- リストの例 (この例では整数値として保存されます) -->
-<setting pref="extensions.myaddon.options1" type="menulist" title="オプション 1">
-  <menulist>
-    <menupopup>
-      <menuitem value="500" label="小"/>
-      <menuitem value="800" label="中"/>
-      <menuitem value="1200" label="大"/>
-    </menupopup>
-  </menulist>
-</setting>
-
-<!-- ラジオボタンの例 (この例では真偽値として保存されます) -->
-<setting pref="extensions.myaddon.options2" type="radio" title="オプション 2">
-  <radiogroup>
-    <radio value="false" label="無効"/>
-    <radio value="true" label="有効"/>
-  </radiogroup>
-</setting>
-
-<!-- ボタンの例 - 設定と紐付けられておらず、代わりにコマンドが設定されています -->
-<setting title="何かする" type="control">
-  <button id="myaddon-button" label="ここをクリック" oncommand="alert('ありがとう!');"/>
-</setting>
-
-

表示通知

-

設定を保存する用途以外にも設定 UI を使いたい場合は、最初に画面へ組み込まれる前に UI を初期化する必要があるでしょう。オプション XUL がアドオンマネージャ画面へ読み込まれるまではそうした処理ができないため、addon-options-displayed 通知を監視し、設定を初期化します。例えば、

-
var observer = {
-  observe: function(aSubject, aTopic, aData) {
-    if (aTopic == "addon-options-displayed" && aData == "MY_ADDON@MY_DOMAIN") {
-      var doc = aSubject;
-      var control = doc.getElementById("myaddon-pref-control");
-      control.value = "テスト";
-    }
-  }
-};
-
-Services.obs.addObserver(observer, "addon-options-displayed", false);
-// アドオンの終了時にオブザーバを削除するのを忘れないでください
-
-

このコードは、ブートストラップ型拡張機能の場合は bootstrap.js (startup() 関数内) に記述します。従来型拡張機能の場合は (オーバーレイではなく) XPCOM コンポーネントか JavaScript コードモジュール に記述します。

-
-

{{ gecko_callout_heading("13.0") }}

-

Gecko 13.0 {{ geckoRelease("13.0") }} 以降、addon-options-hidden 通知も監視できるようになりました。これは上と同じサブジェクトとデータを持ち、UI が削除されようとするタイミングを把握できます。この通知を使って、イベントリスナーなど、削除しないとリークする可能性のある参照を削除しましょう。

-
-

オプションファイルの場所の指定

-

アドオンマネージャがインラインオプションファイルを見つけられるようにする方法は 2 通りあります。

- -

参考資料

- diff --git a/files/ja/extensions/other_resources/index.html b/files/ja/extensions/other_resources/index.html deleted file mode 100644 index 080c30c10a..0000000000 --- a/files/ja/extensions/other_resources/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: その他の情報源 -slug: Extensions/Other_Resources -tags: - - Add-ons - - Extensions -translation_of: Extensions/Other_Resources ---- - diff --git a/files/ja/extensions/seamonkey/index.html b/files/ja/extensions/seamonkey/index.html deleted file mode 100644 index fd7e36b3d4..0000000000 --- a/files/ja/extensions/seamonkey/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: SeaMonkey -slug: Extensions/SeaMonkey -tags: - - Add-ons - - SeaMonkey - - extensiones -translation_of: Archive/Add-ons/SeaMonkey_2 ---- -

ドキュメンテーション

-

 

- -
-

{{ languages( { "en": "en/Extensions/SeaMonkey" } ) }}

-
diff --git a/files/ja/extensions/thunderbird/building_a_thunderbird_extension/index.html b/files/ja/extensions/thunderbird/building_a_thunderbird_extension/index.html deleted file mode 100644 index 9c5ceab673..0000000000 --- a/files/ja/extensions/thunderbird/building_a_thunderbird_extension/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: 'Thunderbird 拡張機能のビルド その1: 導入' -slug: Extensions/Thunderbird/Building_a_Thunderbird_extension -tags: - - Add-ons - - Extensions - - thunderbird -translation_of: Mozilla/Thunderbird/Thunderbird_extensions/Building_a_Thunderbird_extension ---- -

{{AddonSidebar}}

- -

Thunderbird は、Mozilla のオープンソースのメールアプリケーションです。 Thunderbird では、JavaScriptGecko(レイアウトエンジン、XUL(XMLユーザインタフェース言語)、XPCOM(クロスプラットフォームコンポーネントオブジェクトモデル)など、 Firefox で用いられる多くの技術が利用されています。Firefoxと同じように、Thunderbirdの機能は 拡張機能を使ってカスタマイズできます。

- -

このチュートリアルでは、Thunderbird 拡張機能の導入とビルド方法を説明します。チュートリアルの構成は次の通りです。

- -
    -
  1. 導入(このページ)
  2. -
  3. 拡張機能のファイル構成 (開発環境の準備)
  4. -
  5. インストール マニフェストinstall.rdfファイルに拡張機能のメタ情報を記載)
  6. -
  7. Chrome マニフェスト(パッケージとオーバーレイの一覧)
  8. -
  9. XUL (XML ユーザインタフェース言語で、Thunderbirdのユーザインタフェースを変更する)
  10. -
  11. JavaScriptの追加 (作成したThunderbird拡張機能に簡単なJavaScriptを追加する方法)
  12. -
  13. 開発環境へのインストール (開発環境のThunderbirdで拡張機能を動作させる)
  14. -
  15. パッケージ化 (拡張機能を配布するためのパッケージを作る)
  16. -
  17. 配布 (自分のサイト、または、 http://addons.mozilla.org/で)
  18. -
- -

このチュートリアルは、Thunderbird2,3,5 を対象とします。 Thunderbird のビルドはすべて FTPサイトから手に入れることが出来ます。

- -

リファレンスとリソース

- -

ツールとヘルパー拡張機能

- -

Thunderbird 拡張機能の開発を助ける多くのツールがありますが、少なくとも以下のツールが必要になります。

- - - -

この他にも、テストやデバックのための多くの拡張機能やアプリケーションがあります(JavaScriptコンソール、XPCOMインスペクターなど)。これらに関しては、『Setting up an extension development environment』をご覧ください。

- -

アドオンビルダー

- -

Firefox もしくは Thunderbird 拡張機能フレームワークを自動生成するアドオンビルダーがあり、開発者センターから利用できます。アドオンビルダーは web ベースのユーティリティーで、単純なアドオンファイルのスケルトンを zip 形式で作成します。ウィザードを通してアドオンの基本情報を入力することで、必要なフォルダ構成とメタデータとソースファイル群が作成されます。ソースファイル群にはサンプルコードが記入されていて、すぐに手を入れられるようになっています。

- -

このチュートリアルで学ぶことのできる多くは、アドオンビルダーによって自動生成されますが、ファイル同士の関係性や内容の構成を説明します。このチュートリアルを読み終わるころには、アドオンの一般的な構成とレイアウトを理解できているはずです。アドオンビルダーを使うことで、新しいアドオンの作成を速くすることができます。

- -

ドキュメント

- - - -

コミュニティ

- -

Thunderbird の開発コミュニティにはメーリングリストがあり、検索可能なアーカイブもあります。さらに、 IRC チャンネル (#maildev) を通じて、コミュニティとコンタクトを取ることが可能です。

- -
{{Next("Extensions/Thunderbird/Building_a_Thunderbird_extension_2:_extension_filesystem")}}
diff --git a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_2_colon__extension_filesystem/index.html b/files/ja/extensions/thunderbird/building_a_thunderbird_extension_2_colon__extension_filesystem/index.html deleted file mode 100644 index e76b389cdc..0000000000 --- a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_2_colon__extension_filesystem/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: 'Thunderbird 拡張機能のビルド その2: 拡張機能のファイルレイアウト' -slug: >- - Extensions/Thunderbird/Building_a_Thunderbird_extension_2:_extension_filesystem -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/Building_a_Thunderbird_extension_2:_extension_filesystem ---- -

拡張機能は Bundle としても知られる XPI 形式の圧縮ファイルにパッケージ化され、配布されます。それは install.rdf と、 chrome.manifestchrome フォルダを含みます。 chrome フォルダは実際のコンテンツファイルを含む、 content フォルダを含みます。コンテンツファイルには実際に何かをする機能拡張のコードを含みます。このチュートリアルが終わったとき、あなたの拡張機能は以下のようになるでしょう:

-
myfirstext.xpi:                                //created in step 8
-              /install.rdf                     //created in step 3
-              /chrome.manifest                 //created in step 4
-              /chrome/
-              /chrome/content/
-              /chrome/content/myhelloworld.xul //created in step 5
-              /chrome/content/overlay.js       //created in step 6
-              /chrome/locale/*                 //Building an Extension# Localization
-              /defaults/preferences/           //Building an Extension# Defaults Files
-
-

あなたはこれらのファイルを手動で作成するのではなく、開発者センターにあるアドオンビルダーを使用することが出来ます。これは必須のファイルとフォルダを含んだ拡張機能フレームワークを含む圧縮パッケージを作成します。解凍した圧縮パッケージの中には、 'myfirstext' と呼ばれるディレクトリがあり、このチュートリアルに従うことでそれらのファイルを編集します。

-

チュートリアルページに従うことで、 locale フォルダと defaults フォルダの記述方法、XPIファイルへのそれらのファイルのパッケージの方法を経験するでしょう。 あなたはより一般的なドキュメント『拡張機能のビルド』により locale フォルダと defaults フォルダについての情報を見つけることが出来るでしょう。
-
- {{ Previous("Extensions/Thunderbird/Building_a_Thunderbird_extension") }}

-

{{ Next("Extensions/Thunderbird/Building_a_Thunderbird_extension_3:_install_manifest") }}

diff --git a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_3_colon__install_manifest/index.html b/files/ja/extensions/thunderbird/building_a_thunderbird_extension_3_colon__install_manifest/index.html deleted file mode 100644 index bdb84748b9..0000000000 --- a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_3_colon__install_manifest/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: 'Thunderbird 拡張機能のビルド その3: インストールマニフェスト' -slug: 'Extensions/Thunderbird/Building_a_Thunderbird_extension_3:_install_manifest' -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/Building_a_Thunderbird_extension_3:_install_manifest ---- -

install.rdf は拡張機能についての一般的な情報を提供するXMLファイルです。

-


- もし前のステップにて記述にアドオンビルダーを使用した場合、圧縮パッケージ内にある  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:id>myfirstext@jen.zed</em:id>
-    <em:name>My First Extension</em:name>
-    <em:version>1.0</em:version>
-    <em:creator>jenzed</em:creator>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
-        <em:minVersion>1.5</em:minVersion>
-        <em:maxVersion>5.0.*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
-
-

以下のアイテムはあなたのアプリケーションに合わせて、カスタマイズされるべきです:

- -

install.rdf に記述することが出来るオプション値はもっとあります。それらはInstall Manifests』に記載されています。
- Description 要素の子要素である限り、任意の順番で指定できます。

-

{{ Previous("Extensions/Thunderbird/Building_a_Thunderbird_extension_2:_extension_filesystem") }}

-

{{ Next("Extensions/Thunderbird/Building_a_Thunderbird_extension_4:_chrome_manifest") }}

diff --git a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_4_colon__chrome_manifest/index.html b/files/ja/extensions/thunderbird/building_a_thunderbird_extension_4_colon__chrome_manifest/index.html deleted file mode 100644 index e12df260ba..0000000000 --- a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_4_colon__chrome_manifest/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: 'Thunderbird 拡張機能のビルド その4: chrome マニフェスト' -slug: 'Extensions/Thunderbird/Building_a_Thunderbird_extension_4:_chrome_manifest' -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/Building_a_Thunderbird_extension_4:_chrome_manifest ---- -

chrome.manifest は Thunderbird に対して、パッケージと拡張機能によって提供されるオーバーレイを伝えます。
- 作成した chrome.manifest を開き、以下のコードを追加してください。

-
content     myfirstext    chrome/content/
-
- -

この行はクロムパッケージである myfirstext のため、私たちが chrome.manifest からの相対パスである chrome/content/ から、それらの content ファイルを見つけることが出来ることを表しています。

-

拡張機能のサポート用に Thunderbird のユーザーインタフェースを変更するため、あなたはオーバレイを作成し、デフォルトの Thunderbird のインターフェースへ統合します。このチュートリアルの後、私たちはデフォルトの messenger.xul に統合するための、 XUL オーバレイファイル を作成するでしょう。ここでのポイントは、私たちはchrome.manifest に作成した後のオーバレイの存在を記入することでしょう。

-

 chrome.manifest の最終行に以下の行を追加してください。

-
-
overlay chrome://messenger/content/messenger.xul chrome://myfirstext/content/myhelloworld.xul
-
- これは Thunderbird に対して、 messenger.xul が読み込まれた際に、 messenger.xul の中に myhelloworld.xul を統合することを伝えます。
- chrome マニフェストのより多くの情報とプロパティをサポートしています。
- 『 Chrome Manifest 』リファレンスを見てください。 -

 

-

もし前のステップにて記述にアドオンビルダーを使用した場合、圧縮パッケージ内にある  chrome.manifest をテキストエディタで開いてください。あなたは最初の行にある content の行を見るでしょう。最終行に overlay の行を追加してください。他のoverlay の行があったとしても問題にはなりません。

-
-
- XUL ファイルのレイアウトについてより理解し、あなた自身のオーバレイをデバッグするために DOM Inspector のようなアドオンをインストールすることでより便利にすることが出来ます。
-

{{ Previous("Extensions/Thunderbird/Building_a_Thunderbird_extension_3:_install_manifest") }}

-

{{ Next("Extensions/Thunderbird/Building_a_Thunderbird_extension_5:_XUL") }}

diff --git a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_5_colon__xul/index.html b/files/ja/extensions/thunderbird/building_a_thunderbird_extension_5_colon__xul/index.html deleted file mode 100644 index 30d7902fe8..0000000000 --- a/files/ja/extensions/thunderbird/building_a_thunderbird_extension_5_colon__xul/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: 'Thunderbird 拡張機能のビルド その5: XUL' -slug: 'Extensions/Thunderbird/Building_a_Thunderbird_extension_5:_XUL' -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/Building_a_Thunderbird_extension_5:_XUL ---- -

Thunderbird のユーザインタフェースは XUL JavaScript で記述されています。 XUL はボタン、メニュー、ツールバー、ツリーなどのようなユーザーインタフェースウィジェットを提供する XML です。私たちは新しい XUL DOM 要素をアプリケーションウィンドウに挿入するか、スクリプトを使用する、もしくはイベントハンドラをアタッチしてそれらを変更することによって、ウィジェットを追加します。 While XUL provides the elements of the user interface, actions are written in JavaScript.

-

私たちの最初の拡張機能で、 Thunderbird のステータスバーにいくつかのテキストを追加します。ステータスバーは messenger.xul の中で実装されています。 To view this XUL file use the DOM Inspector extension or look inside the omni.jar archive. messenger.xul の中で、以下のようなステータスバーの記述を見つけるでしょう。

-
<statusbar id="status-bar">
- ... <statusbarpanel>s ...
-</statusbar>
-
-

<statusbar id="status-bar"> is a "merge point" for a XUL overlay. XUL Overlays are a way of attaching other UI widgets to a XUL document at run time. A XUL Overlay is a .xul file that specifies XUL fragments to insert at specific merge points within a "master" document. These fragments can specify widgets to be inserted, removed or modified.

-

In this example you are adding a line to the indented statusbar. Therefore it becomes an item owned by the id called "status-bar". This shows how the Thunderbird architecture allows extensions to modify the user experience without modifying the installation files. This also enables version independence between Thunderbird and Thunderbird extensions.

-

Example XUL Overlay Document

-
<?xml version="1.0"?>
-<overlay id="sample"
-xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://myfirstext/content/overlay.js"/><!-- A reference to your JavaScript file -->
- <statusbar id="status-bar">
-  <statusbarpanel id="my-panel" label="Date"/>
- </statusbar>
-</overlay>
-
-

The <statusbar> widget named status-bar specifies the merge point within the application window that we want to attach to. When parsing our overlay file, the XUL engine will take all child elements of the <statusbar> tag and merge them with the original XUL document's <statusbar> tag. In the example above we have defined a new <statusbarpanel> item (that can be referred to as my-panel) which will create a new instance of this widget type and add it at the end of the statusbar. In Thunderbird it will appear as a label at the right side of Thunderbird's statusbar and display "Date".  We have also added a <script> tag that contains a reference to the JavaScript file overlay.js. In the next section you will learn how to use JavaScript to modify your label so that it shows the current date.

-

Take the sample code from above and save it into a new file called myhelloworld.xul within the content folder you created earlier.

-
- The overlay.js file will be created in a later section and your add-on will still work if the file is missing. For now you can ignore this line, but remember that this is how you reference a JavaScript file.
-

{{ PreviousNext("Extensions/Thunderbird/Building_a_Thunderbird_extension_4:_chrome_manifest", "Extensions/Thunderbird/Building_a_Thunderbird_extension_6:_Adding_Javascript") }}

diff --git a/files/ja/extensions/thunderbird/faq/index.html b/files/ja/extensions/thunderbird/faq/index.html deleted file mode 100644 index 72abe3fb68..0000000000 --- a/files/ja/extensions/thunderbird/faq/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: FAQ -slug: Extensions/Thunderbird/FAQ -tags: - - Add-ons - - Extensions - - 要更新 -translation_of: Mozilla/Thunderbird/Thunderbird_extensions/FAQ ---- -

これは Thunderbird 拡張機能の開発における最も一般的な問題に対する簡単な回答集です。

-

開発についてのドキュメントは、私たちのチュートリアルや Thunderbird 拡張機能の構築または MozillaZine の Getting started tutorial(英語) をお試しください。

-

{{ 英語版章題("Setting up a development environment") }}

-

開発環境をセットアップする

-

開発の前に拡張機能の開発環境のセットアップを読むのを忘れないでください!

-

{{ 英語版章題("Creating a Development Profile") }}

-

開発用プロファイルを作成する

-

Thunderbird のナイトリービルドや拡張機能の開発は、あなたのプロファイルやメールを破壊する可能性があるため、プロファイルを分けて開発したものを実行する必要があります。新しいプロファイルを作成するには、シェル (または DOS プロンプト) を開き、次のコマンドを実行してください:

-
thunderbird -ProfileManager
-

このプロファイルの内部を調べるために、他のプロファイルよりもアクセスしやすいパスと名前にしたいでしょう。

-

新しいプロファイルで起動するのは簡単です:

-
thunderbird -P "profile name"
-

{{ 英語版章題("Running Simultaneous Copies of Thunderbird With Different Profiles") }}

-

異なるプロファイルで Thunderbird のコピーを同時に起動する

-

Thunderbird を異なるプロファイルで起動するには、あなたの個人プロファイルで実行する Thunerbird を残したまま起動するために、次のように環境変数 MOZ_NO_REMOTE を設定する必要があります:

-
Windows: set MOZ_NO_REMOTE=1
-*nix: export MOZ_NO_REMOTE=1
-
-

便利な方法として、この変数をエクスポートしたシェルスクリプトやバッチファイルから Thunderbird を開発用のプロファイルで起動すると手軽に行うことができます。

-

{{ languages( { "en": "en/Extensions/Thunderbird/FAQ" } ) }}

diff --git a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_new_tab/index.html b/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_new_tab/index.html deleted file mode 100644 index 5d27fc45e1..0000000000 --- a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_new_tab/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: 新しいタブの追加 -slug: >- - Extensions/Thunderbird/HowTos/Common_Thunderbird_Extension_Techniques/Add_New_Tab -tags: - - missing - - thunderbird -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/HowTos/Common_Thunderbird_Extension_Techniques/Add_New_Tab ---- -
var aURL = "chrome://myext/mytab.xul";
-let tabmail = getMail3Pane().document.getElementById("tabmail");
-
-tabmail.openTab("chromeTab", { chromePage: aUrl });
-
diff --git a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_toolbar_button/index.html b/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_toolbar_button/index.html deleted file mode 100644 index 70e174ce3f..0000000000 --- a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/add_toolbar_button/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ツールバーボタンの追加 -slug: >- - Extensions/Thunderbird/HowTos/Common_Thunderbird_Extension_Techniques/Add_Toolbar_Button -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/HowTos/Common_Thunderbird_Extension_Techniques/Add_Toolbar_Button ---- -

XUL オーバーレイのコード例を示します。

-
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://demo/skin/overlay.css" type="text/css" ?>
-
-<overlay id="messengerWindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/x-javascript" src="overlay.js" />
-  <toolbarpalette id="MailToolbarPalette">
-    <toolbarbutton id="demo-button"
-      class="demo-button toolbarbutton-1"
-      label="Demo"
-      type="button"
-      oncommand="Demo.load();"
-      />
-  </toolbarpalette>
-</overlay>
-
-

以下のコードを CSS ファイルに追加し、 XUL ファイルから参照して下さい。

-
#demo-button, [place="palette"] > #demo-button {
-  list-style-image: url("chrome://demo/skin/icon.png") !important;
-}
-
diff --git a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/get_thunderbird_version/index.html b/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/get_thunderbird_version/index.html deleted file mode 100644 index 4432c0d93c..0000000000 --- a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/get_thunderbird_version/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Thunderbird のバージョンの取得 -slug: >- - Extensions/Thunderbird/HowTos/Common_Thunderbird_Extension_Techniques/Get_Thunderbird_version -tags: - - thunderbird -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/HowTos/Common_Thunderbird_Extension_Techniques/Get_Thunderbird_version ---- -

Thunderbird 3.0b3pre とそれ以降のバージョンでは、以下のスニペットを用いて Thunderbird のバージョンを取得する事ができます。
-(※ 3.0b3pre は STEEL がインクルードされた最初のバージョンでした)

- - -
var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"].getService(
-  Components.interfaces.nsIVersionComparator
-);
-
-if (versionChecker.compare(Application.version, "3.0b4") >= 0) {
-  // code for >= 3.0b4
-} else {
-  // code for <  3.0b4
-}
- -

3.0b3pre より前のバージョンでは、以下のスニペットで取得可能です。

- - -
var version;
-
-if ( "@mozilla.org/xre/app-info;1" in Components.classes ) {
-  version = Components.classes["@mozilla.org/xre/app-info;1"].getService(
-    Components.interfaces.nsIXULAppInfo
-  ).version;
-} else {
-  version = Components.classes["@mozilla.org/preferences-service;1"].getService(
-    Components.interfaces.nsIPrefBranch).getCharPref("app.version");
-}
-
-var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"].getService(
-  Components.interfaces.nsIVersionComparator
-);
-
-if ( versionChecker.compare( version, "3.0b3" ) >= 0 ) {
-  // code for >= 3.0b3
-} else {
-  // code for < 3.0b3
-}
diff --git a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/index.html b/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/index.html deleted file mode 100644 index 2368543e28..0000000000 --- a/files/ja/extensions/thunderbird/howtos/common_thunderbird_extension_techniques/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Thunderbird 拡張機能の一般的なテクニック -slug: Extensions/Thunderbird/HowTos/Common_Thunderbird_Extension_Techniques -tags: - - thunderbird -translation_of: >- - Mozilla/Thunderbird/Thunderbird_extensions/HowTos/Common_Thunderbird_Extension_Techniques ---- -
- {{tree}}
diff --git a/files/ja/extensions/thunderbird/howtos/index.html b/files/ja/extensions/thunderbird/howtos/index.html deleted file mode 100644 index 47430a8154..0000000000 --- a/files/ja/extensions/thunderbird/howtos/index.html +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: Thunderbird HowTos -slug: Extensions/Thunderbird/HowTos -tags: - - Add-ons - - Extensions - - NeedsTranslation - - TopicStub - - thunderbird - - 要更新 -translation_of: Mozilla/Thunderbird/Thunderbird_extensions/HowTos ---- -

Please add questions or answers to this page so that other people can benefit from your work. Also, you will see that there are many topics for which there is a question, but no answer. Please help by adding an answer! (Adding another question helps too!)

- -

To get started creating the most basic extension framework, please see Building a Thunderbird Extension.

- -

This page is organized into two parts: common TB use cases and common techniques. This provides a quick way to get you started. Both parts are about accomplishing things programatically, but these parts split everything into things users do that you would like to improve, and things you need to do to accomplish that goal.

- -

See also "An overview of Thunderbird components". Many of the components described on that page have links to related examples.

- -

Part 1: Common Thunderbird Use Cases

- -

Each of the pages listed in this section contains a number of related topics. For example, the "Compose New Message" page contains sections that describe how to open a new message window, modify a message body, etc.

- - - - - - - - -
-

Access address book

- - - -

Compose new messages

- - -
-

Folders and messages

- - - -

View message

- - - -

Reply to message

- - -
- -

Part 2: Common Thunderbird Extension Techniques

- -
- - -

Activity Manager

-
- - diff --git a/files/ja/extensions/thunderbird/index.html b/files/ja/extensions/thunderbird/index.html deleted file mode 100644 index 0fc66c657d..0000000000 --- a/files/ja/extensions/thunderbird/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Thunderbird -slug: Extensions/Thunderbird -tags: - - Add-ons - - Extensions -translation_of: Mozilla/Thunderbird/Thunderbird_extensions ---- -
Thunderbird 用の拡張機能のビルド
-Thunderbird の拡張機能をビルドする方法をステップバイステップで説明します。
- -
以下のドキュメンテーションは、Mozilla の Thunderbird メールクライアント用の拡張機能の作成について説明します。Firefox の拡張機能と多くの類似点がありますが、始めたばかりの開発者を混乱させるような違いがあります。
- -

-寄稿者募集中! how-to 記事の追加 (質問や答え、コードスニペットなど)、関連するニュースグループの議論へのリンクと要約、またはチュートリアルの作成など。分からないことがあれば jenzed に尋ねてください。
- - - - - - - - -
-

ドキュメント

- - -
-

コミュニティ

- -
    -
  • Mozilla のフォーラムをみる
  • -
- -

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

- - - -

ツール

- - - -

... その他のツール ...

- -

すべてを見る...

- - - -
-
XUL, JavaScript, XPCOM, テーマ, Mozilla の開発
-
-
diff --git a/files/ja/extensions/using_the_dom_file_api_in_chrome_code/index.html b/files/ja/extensions/using_the_dom_file_api_in_chrome_code/index.html deleted file mode 100644 index edb3a7a87c..0000000000 --- a/files/ja/extensions/using_the_dom_file_api_in_chrome_code/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: DOM File API を chrome code で使う -slug: Extensions/Using_the_DOM_File_API_in_chrome_code -translation_of: Extensions/Using_the_DOM_File_API_in_chrome_code ---- -

{{ gecko_minversion_header("6.0") }}

- -

DOM File API を chrome code で使いたければ、 制限なしにそうすることができます。 実際に、 おまけの機能を一つ得ます: ユーザーのコンピューターのファイルへのパスを指定して {{ domxref("File") }} オブジェクトを作ることができます。 これは、特権のあるコードでのみ動きます。 そのため、ウエッブコンテンツでは動きません。 これは、ウエッブコンテンツが自由に彼らのディスクにアクセスすることに関係した危険 から、ユーザーを保護します。 もし、特権無しのコード(ウエッブコンテンツのような)から {{ domxref("File") }} コンストラクタにパスを通せば、 例外が発生します。

- -

スコープの可用性

- -

JSM スコープでは、Fileは、特別なことを何一つ必要とせずに、有効です。

- -

Bootstrap スコープでは、このようにインポートすることが必要です:

- -
Cu.importGlobalProperties( [ "File" ] )
- -

パスを直接書き込んでのファイルの利用

- -

パスによるファイルへの参照、単純に直接文字列として書き込むことができます:

- -
var file = File("path/to/some/file");
-
- -

クロスプラットホームでの注釈: とはいえ、 直接書き込まれたパスは、プラットホームに依存したセパレータ (これ "/") に起因する、クロスプラットホームでの問題が発生します。 XUL/Mozilla プラットホームでは、Java と同等にひどくない。File.pathSeparator (システムに依存する、パスセパレータ文字)、これは、すべてのパスセパレータを定義することを避ける、良い方法です。 それよりも、次の章で説明する、nsIFile::append() メソッドを使え。

- -

特殊なディレクトリにあるファイルの利用

- -

あなたは、ファイルを利用するためのパスを、獲得し作成するために、ディレクトリサービスを使うことができます。 例えば、あなたのアドオンが、ユーザープロファイル内のファイルを利用する必要があれば、このようにできます:

- -
var dsFile = Components.classes["@mozilla.org/file/directory_service;1"]
-                    .getService(Components.interfaces.nsIProperties)
-                    .get("ProfD", Components.interfaces.nsIFile);
-
-dsFile.append("myfilename.txt");
-
-var file = File(dsFile.path);
-
- -

この、プロファイルディレクトリへのディレクトリサービスの使用 (ロケーションキー "ProfD" を用いる、 詳細は下記を参照)。そして、 作業をしたいファイルの名前をそえて {{ ifmethod("nsIFile", "append") }}を呼び出す。 最後に、 {{ domxref("File") }} のコンストラクタへ通す文字列を返す{{ ifmethod("nsIFile", "path") }}渡し、{{ domxref("File") }} の実体を作ります。

- -

さらにもっと簡単にすることができます!実は、 {{ interface("nsIFile") }} オブジェクト自身を直接  File のコンストラクタに渡すことができます。 次のコードにあるように:

- -
var dsFile = Components.classes["@mozilla.org/file/directory_service;1"]
-                    .getService(Components.interfaces.nsIProperties)
-                    .get("ProfD", Components.interfaces.nsIFile);
-
-dsFile.append("myfilename.txt");
-
-var file = File(dsFile);
- -

"ProfD" キーなどのような、他のキーも用意されています。  known locations  を確認してください。

- -

注釈

- -

Gecko 8.0 {{ geckoRelease("8.0") }}から始まりました。コンポーネントコードの中でもこれは行えます。

- -

こちらも見て

- - -- cgit v1.2.3-54-g00ecf