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/web/api/alarm_api/index.html | 240 --------- files/ja/web/api/camera_api/index.html | 32 -- files/ja/web/api/cameracapabilities/index.html | 78 --- files/ja/web/api/cameracontrol/index.html | 105 ---- .../ja/web/api/cameramanager/getcamera/index.html | 133 ----- .../api/cameramanager/getlistofcameras/index.html | 51 -- files/ja/web/api/cameramanager/index.html | 49 -- files/ja/web/api/device_storage_api/index.html | 254 --------- .../api/domapplicationsmanager/getall/index.html | 38 -- files/ja/web/api/domapplicationsmanager/index.html | 82 --- .../checkinstalled/index.html | 49 -- .../getinstalled/index.html | 40 -- .../api/domapplicationsregistry/getself/index.html | 47 -- .../ja/web/api/domapplicationsregistry/index.html | 45 -- .../api/domapplicationsregistry/install/index.html | 96 ---- .../installpackage/index.html | 46 -- files/ja/web/api/domcursor/done/index.html | 68 --- files/ja/web/api/domcursor/index.html | 102 ---- files/ja/web/api/domrequest/error/index.html | 45 -- files/ja/web/api/domrequest/index.html | 102 ---- .../ja/web/api/fmradio/antennaavailable/index.html | 40 -- files/ja/web/api/fmradio/cancelseek/index.html | 45 -- files/ja/web/api/fmradio/channelwidth/index.html | 31 -- files/ja/web/api/fmradio/disable/index.html | 41 -- files/ja/web/api/fmradio/enable/index.html | 49 -- files/ja/web/api/fmradio/enabled/index.html | 41 -- files/ja/web/api/fmradio/frequency/index.html | 36 -- .../web/api/fmradio/frequencylowerbound/index.html | 30 -- .../web/api/fmradio/frequencyupperbound/index.html | 30 -- files/ja/web/api/fmradio/index.html | 120 ----- .../fmradio/onantennaavailablechange/index.html | 29 - files/ja/web/api/fmradio/ondisabled/index.html | 28 - files/ja/web/api/fmradio/onenabled/index.html | 28 - .../web/api/fmradio/onfrequencychange/index.html | 28 - files/ja/web/api/fmradio/seekdown/index.html | 43 -- files/ja/web/api/fmradio/seekup/index.html | 43 -- files/ja/web/api/fmradio/setfrequency/index.html | 53 -- .../api/htmliframeelement/getvisible/index.html | 33 -- files/ja/web/api/htmliframeelement/stop/index.html | 32 -- files/ja/web/api/identitymanager/get/index.html | 48 -- .../identitymanager/getverifiedemail/index.html | 40 -- files/ja/web/api/identitymanager/index.html | 45 -- files/ja/web/api/identitymanager/logout/index.html | 40 -- .../ja/web/api/identitymanager/request/index.html | 75 --- files/ja/web/api/identitymanager/watch/index.html | 143 ----- .../using_indexeddb_in_chrome/index.html | 33 -- files/ja/web/api/moznfc/index.html | 130 ----- files/ja/web/api/moznfc/onpeerfound/index.html | 28 - files/ja/web/api/mozsocial/closepanel/index.html | 20 - files/ja/web/api/mozsocial/index.html | 44 -- files/ja/web/api/mozsocial/isvisible/index.html | 23 - files/ja/web/api/moztimemanager/index.html | 44 -- files/ja/web/api/navigator/id/index.html | 52 -- files/ja/web/api/navigator/mozcameras/index.html | 52 -- files/ja/web/api/navigator/mozfmradio/index.html | 36 -- files/ja/web/api/navigator/mozpay/index.html | 101 ---- files/ja/web/api/navigator/mozsettings/index.html | 32 -- files/ja/web/api/navigator/mozsms/index.html | 53 -- files/ja/web/api/navigator/mozsocial/index.html | 49 -- files/ja/web/api/settings_api/index.html | 96 ---- files/ja/web/api/simple_push_api/index.html | 189 ------- files/ja/web/api/web_activities/index.html | 586 --------------------- files/ja/web/api/webfm_api/index.html | 135 ----- .../webvr_api/webvr_environment_setup/index.html | 110 ---- 64 files changed, 4686 deletions(-) delete mode 100644 files/ja/web/api/alarm_api/index.html delete mode 100644 files/ja/web/api/camera_api/index.html delete mode 100644 files/ja/web/api/cameracapabilities/index.html delete mode 100644 files/ja/web/api/cameracontrol/index.html delete mode 100644 files/ja/web/api/cameramanager/getcamera/index.html delete mode 100644 files/ja/web/api/cameramanager/getlistofcameras/index.html delete mode 100644 files/ja/web/api/cameramanager/index.html delete mode 100644 files/ja/web/api/device_storage_api/index.html delete mode 100644 files/ja/web/api/domapplicationsmanager/getall/index.html delete mode 100644 files/ja/web/api/domapplicationsmanager/index.html delete mode 100644 files/ja/web/api/domapplicationsregistry/checkinstalled/index.html delete mode 100644 files/ja/web/api/domapplicationsregistry/getinstalled/index.html delete mode 100644 files/ja/web/api/domapplicationsregistry/getself/index.html delete mode 100644 files/ja/web/api/domapplicationsregistry/index.html delete mode 100644 files/ja/web/api/domapplicationsregistry/install/index.html delete mode 100644 files/ja/web/api/domapplicationsregistry/installpackage/index.html delete mode 100644 files/ja/web/api/domcursor/done/index.html delete mode 100644 files/ja/web/api/domcursor/index.html delete mode 100644 files/ja/web/api/domrequest/error/index.html delete mode 100644 files/ja/web/api/domrequest/index.html delete mode 100644 files/ja/web/api/fmradio/antennaavailable/index.html delete mode 100644 files/ja/web/api/fmradio/cancelseek/index.html delete mode 100644 files/ja/web/api/fmradio/channelwidth/index.html delete mode 100644 files/ja/web/api/fmradio/disable/index.html delete mode 100644 files/ja/web/api/fmradio/enable/index.html delete mode 100644 files/ja/web/api/fmradio/enabled/index.html delete mode 100644 files/ja/web/api/fmradio/frequency/index.html delete mode 100644 files/ja/web/api/fmradio/frequencylowerbound/index.html delete mode 100644 files/ja/web/api/fmradio/frequencyupperbound/index.html delete mode 100644 files/ja/web/api/fmradio/index.html delete mode 100644 files/ja/web/api/fmradio/onantennaavailablechange/index.html delete mode 100644 files/ja/web/api/fmradio/ondisabled/index.html delete mode 100644 files/ja/web/api/fmradio/onenabled/index.html delete mode 100644 files/ja/web/api/fmradio/onfrequencychange/index.html delete mode 100644 files/ja/web/api/fmradio/seekdown/index.html delete mode 100644 files/ja/web/api/fmradio/seekup/index.html delete mode 100644 files/ja/web/api/fmradio/setfrequency/index.html delete mode 100644 files/ja/web/api/htmliframeelement/getvisible/index.html delete mode 100644 files/ja/web/api/htmliframeelement/stop/index.html delete mode 100644 files/ja/web/api/identitymanager/get/index.html delete mode 100644 files/ja/web/api/identitymanager/getverifiedemail/index.html delete mode 100644 files/ja/web/api/identitymanager/index.html delete mode 100644 files/ja/web/api/identitymanager/logout/index.html delete mode 100644 files/ja/web/api/identitymanager/request/index.html delete mode 100644 files/ja/web/api/identitymanager/watch/index.html delete mode 100644 files/ja/web/api/indexeddb_api/using_indexeddb_in_chrome/index.html delete mode 100644 files/ja/web/api/moznfc/index.html delete mode 100644 files/ja/web/api/moznfc/onpeerfound/index.html delete mode 100644 files/ja/web/api/mozsocial/closepanel/index.html delete mode 100644 files/ja/web/api/mozsocial/index.html delete mode 100644 files/ja/web/api/mozsocial/isvisible/index.html delete mode 100644 files/ja/web/api/moztimemanager/index.html delete mode 100644 files/ja/web/api/navigator/id/index.html delete mode 100644 files/ja/web/api/navigator/mozcameras/index.html delete mode 100644 files/ja/web/api/navigator/mozfmradio/index.html delete mode 100644 files/ja/web/api/navigator/mozpay/index.html delete mode 100644 files/ja/web/api/navigator/mozsettings/index.html delete mode 100644 files/ja/web/api/navigator/mozsms/index.html delete mode 100644 files/ja/web/api/navigator/mozsocial/index.html delete mode 100644 files/ja/web/api/settings_api/index.html delete mode 100644 files/ja/web/api/simple_push_api/index.html delete mode 100644 files/ja/web/api/web_activities/index.html delete mode 100644 files/ja/web/api/webfm_api/index.html delete mode 100644 files/ja/web/api/webvr_api/webvr_environment_setup/index.html (limited to 'files/ja/web/api') diff --git a/files/ja/web/api/alarm_api/index.html b/files/ja/web/api/alarm_api/index.html deleted file mode 100644 index b3b3842838..0000000000 --- a/files/ja/web/api/alarm_api/index.html +++ /dev/null @@ -1,240 +0,0 @@ ---- -title: Alarm API -slug: Web/API/Alarm_API -translation_of: Archive/B2G_OS/API/Alarm_API ---- -

{{ SeeCompatTable() }}

- -

要約

- -

Alarm APIが、アプリケーションが予定された行動を実行することを可能にするのは未来のことです。例として、アラームクロックのようなもの、カレンダーなど。また、自動更新は指定された時刻にデバイスを動作させるために、アラームAPIを利用しなければならない場合があります。

- -

それ単体では、Alarm APIは単にアラームを予定することができます。アラームはSystem Message APIを介してアプリケーションに派遣されているので、 アラームに反応するようにしたいアプリケーションは、アラームメッセージに自分自身を登録する必要があります。

- -

Alarms are set using the {{domxref("window.navigator.mozAlarms")}} object which is an instance of the {{domxref("MozAlarmsManager")}} interface.

- -
-

Note: The term alarm in the Alarms API is not the same as an alarm used by the Clock app. The Alarms API wakes up applications, the Clock wakes up humans. The Clock uses the Alarm API to be notified when the time is right to wake up humans.

-
- -

Schedule alarms

- -

The first things to do when using alarm is to schedule alarms. There are two kind of alarms based on the respect of the time zone. In both case it's done using the {{domxref("MozAlarmsManager.add")}} method.

- -
-

Note: If an alarm is not targeted at a specific application, the system will dispatch all the alarms to all the applications listening for alarms.

-
- -
-

Note: You need to use the same URL for setting and receiving an alarm. For example, If you invoke navigator.mozAlarms.add() on foo.html or index.html?foo=bar, but have { "alarm": "/index.html" } in your manifest messages field, you'll never receive the alarm.

-
- -

Alarms ignoring time zones

- -

Those kind of alarms is dispatched based on the local time of the device. If the user of the device changes its time zone, the alarm will be dispatched based on the new time zone. For example, if a user is in Paris and sets an alarm that should be dispatched at 12 PM CET (Central European Time) and that user travels to San Francisco, the alarm will be dispatched at 12 PM PDT (Pacific Daylight Time).

- -
// This the date to schedule the alarm
-var myDate  = new Date("May 15, 2012 16:20:00");
-
-// This is arbitrary data pass to the alarm
-var data    = {
-  foo: "bar"
-}
-
-// The "ignoreTimezone" string is what make the alarm ignoring it
-var request = navigator.mozAlarms.add(myDate, "ignoreTimezone", data);
-
-request.onsuccess = function () {
-  console.log("The alarm has been scheduled");
-};
-
-request.onerror = function () {
-  console.log("An error occurred: " + this.error.name);
-};
-
- -

Alarms honoring time zones

- -

Those kind of alarms are dispatched based on the time in the time zone that defines when the alarm has been scheduled. If for some reason, the user of the device changes its time zone the alarm will be dispatched based on the original time zone. For example, if a user is in Paris and set an alarm that should be dispatched at 12pm CET (Central European Time) and if that user travel to San Francisco, the alarm will be dispatched at 3 AM PDT (Pacific Daylight Time).

- -
// This the date to schedule the alarm
-var myDate  = new Date("May 15, 2012 16:20:00");
-
-// This is arbitrary data pass to the alarm
-var data    = {
-  foo: "bar"
-}
-
-// The "honorTimezone" string is what make the alarm honoring it
-var request = navigator.mozAlarms.add(myDate, "honorTimezone", data);
-
-request.onsuccess = function () {
-  console.log("The alarm has been scheduled");
-};
-
-request.onerror = function () {
-  console.log("An error occurred: " + this.error.name);
-};
-
- -

Managing alarms

- -

Once an alarm is scheduled, it's still possible to manage it.

- -

The {{domxref("MozAlarmsManager.getAll")}} method will return the complete list of alarms currently scheduled by the application. This list is an Array of {{Anch("mozAlarm")}} objects.

- -

mozAlarm

- -

{{page("/en-US/docs/Web/API/MozAlarmsManager.getAll","mozAlarm")}}

- -
var request = navigator.mozAlarms.getAll();
-
-request.onsuccess = function () {
-  this.result.forEach(function (alarm) {
-    console.log('Id: ' + alarm.id);
-    console.log('date: ' + alarm.date);
-    console.log('respectTimezone: ' + alarm.respectTimezone);
-    console.log('data: ' + JSON.stringify(alarm.data));
-  });
-};
-
-request.onerror = function () {
-  console.log("An error occurred: " + this.error.name);
-};
-
- -

The {{domxref("MozAlarmsManager.remove")}} method is used to unschedule an existing alarm.

- -
var alarmId;
-
-// Set an alarm and store it's id
-var request = navigator.mozAlarms.add(new Date("May 15, 2012 16:20:00"), "honorTimezone");
-
-request.onsuccess = function () {
-  alarmId = this.result;
-}
-
-// ...
-
-// Later on, removing the alarm if it exists
-if (alarmId) {
-  navigator.mozAlarms.remove(alarmId);
-}
-
- -

Handling alarms

- -

Any application can react when an alarm is dispatched by the system. In order to be able to handle any alarms, an application must register itself as an alarm handler. This is done through the System Messaging API in two steps:

- -

First, the applications must include alarm to the messages property of its application manifest with the URL to the document which registers the callback function to be used when an alarm is dispatched.

- -
"messages": [
-  { "alarm": "/index.html" }
-]
- -

Second, the application must bind a callback function with the alarm message. This is done using the {{domxref("window.navigator.mozSetMessageHandler","navigator.mozSetMessageHandler")}} method. This callback function will receive a {{Anch("mozAlarm")}} object containing the data attached to the alarm.

- -
navigator.mozSetMessageHandler("alarm", function (mozAlarm) {
-  alert("alarm fired: " + JSON.stringify(mozAlarm.data));
-});
-
- -

If an application wants to know if there is a pending alarm at the system level, it's possible to use the {{domxref("window.navigator.mozHasPendingMessage","navigator.mozHasPendingMessage")}} method with the value alarm.

- -
navigator.mozHasPendingMessage("alarm");
-
- -

Permissions for the Alarm API

- -

Please note that while the Alarm API is not privileged or certified, you should still include permissions and messages entries in your manifest.webapp file when including it in an installable open Web app.

- -
"permissions": {
-    "alarms": {
-      "description": "Required to schedule alarms"
-    }
-  },
-  "messages": [
-    { "alarm": "/index.html" }
-  ]
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Alarm API')}}{{Spec2('Alarm API')}}Initial specification.
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatUnknown()}}{{CompatGeckoDesktop("16")}} {{ property_prefix("moz") }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{ CompatNo() }}{{CompatGeckoMobile("10")}} {{ property_prefix("moz") }}1.0.1{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
- -

See also

- - diff --git a/files/ja/web/api/camera_api/index.html b/files/ja/web/api/camera_api/index.html deleted file mode 100644 index 38f638d9f3..0000000000 --- a/files/ja/web/api/camera_api/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: Camera API -slug: Web/API/Camera_API -tags: - - API - - Firefox OS - - Graphics - - Reference - - WebAPI - - camera -translation_of: Archive/B2G_OS/API/Camera_API ---- -

{{ DefaultAPISidebar("Camera API") }}

- -

{{ non-standard_header() }}

- -

Camera API は、アプリケーションが端末のカメラを管理できるようにします。写真撮影や動画記録をしたり、カメラのフォーカスやズーム、ホワイトバランス、フラッシュライトなどの情報を取得できます。これは特権 API であり、認証済みアプリケーションのみが使用できます。

- -

この API は認証済みアプリケーションのみが使用できましたが、Firefox OS 2.0 以降で特権アプリも使用できるようになりました。

- -
-

注記: 標準搭載の カメラ アプリケーションの置き換えを実装するのでない限り、この API を使用するべきではありません。代わりに、端末でカメラを使用したいときは、Web Activities API を使用してください。

-
- -

関連情報

- - diff --git a/files/ja/web/api/cameracapabilities/index.html b/files/ja/web/api/cameracapabilities/index.html deleted file mode 100644 index 5f4dfe9422..0000000000 --- a/files/ja/web/api/cameracapabilities/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: CameraCapabilities -slug: Web/API/CameraCapabilities -tags: - - API - - DOM - - DOM Reference - - Firefox OS - - Graphics - - JavaScript - - Reference - - WebAPI -translation_of: Archive/B2G_OS/API/CameraCapabilities ---- -

{{ ApiRef("Camera API") }}

- -

{{ non-standard_header() }}

- -
-

{{domxref("CameraControl.capabilities")}} プロパティは、CameraCapabilities オブジェクトを返します。これは、カメラのすべてのキャパビリティを説明します。

-
- -

プロパティ

- -
-
{{domxref("CameraCapabilities.effects")}} {{readonlyinline}}
-
カメラにサポートされたエフェクトを識別する文字列 (normal, sepia, mono など) の 配列 です。
-
{{domxref("CameraCapabilities.fileFormats")}} {{readonlyinline}}
-
カメラにサポートされたファイル形式を識別する文字列 (jpeg, rgb565 など) の 配列 です。
-
{{domxref("CameraCapabilities.flashModes")}} {{readonlyinline}}
-
カメラにサポートされた各フラッシュモードを識別する文字列の 配列 です。取りうる値は、auto, off, on または torch です。
-
{{domxref("CameraCapabilities.focusModes")}} {{readonlyinline}}
-
カメラにサポートされた各フォーカスモードを識別する文字列 (auto, fixed, macro など) の 配列 です。
-
{{domxref("CameraCapabilities.maxExposureCompensation")}} {{readonlyinline}}
-
サポートされた露光補正値の最大値を定義する数値です。
-
{{domxref("CameraCapabilities.maxFocusAreas")}} {{readonlyinline}}
-
カメラにサポートされたフォーカス領域数の最大値を定義する数値です。
-
{{domxref("CameraCapabilities.maxMeteringAreas")}} {{readonlyinline}}
-
カメラにサポートされた計測領域数の最大値を定義する数値です。
-
{{domxref("CameraCapabilities.minExposureCompensation")}} {{readonlyinline}}
-
サポートされた露光補正値の最小値を定義する数値です。
-
{{domxref("CameraCapabilities.pictureSizes")}} {{readonlyinline}}
-
写真撮影時にサポートされた写真の heightwidth を含むオブジェクトの 配列 です。
-
{{domxref("CameraCapabilities.previewSizes")}} {{readonlyinline}}
-
動画プレビューストリームにサポートされた動画の heightwidth を含むオブジェクトの 配列 です。
-
{{domxref("CameraCapabilities.recorderProfiles")}} {{readonlyinline}}
-
サポートされた各レコーダープロファイル属性を持つオブジェクトです。
-
{{domxref("CameraCapabilities.sceneModes")}} {{readonlyinline}}
-
カメラにサポートされたシーンモードを識別する文字列 (auto, night, beach など) の 配列 です。
-
{{domxref("CameraCapabilities.stepExposureCompensation")}} {{readonlyinline}}
-
露光補正の最小ステップサイズを定義する数値です。
-
{{domxref("CameraCapabilities.videoSizes")}} {{readonlyinline}}
-
動画撮影時にサポートされた動画の heightwidth を含むオブジェクトの 配列 です。
-
{{domxref("CameraCapabilities.whiteBalanceModes")}} {{readonlyinline}}
-
カメラにサポートされたホワイトバランスの各モードを識別する文字列 (auto, fluorecent など) の 配列 です。
-
{{domxref("CameraCapabilities.zoomRatios")}} {{readonlyinline}}
-
サポートされたすべてのズーム率を表す数値の 配列 です。カメラにズームキャパビリティが無い場合、この値は null です。
-
- -

メソッド

- -

なし。

- -

仕様

- -

{{page("/ja/docs/Web/API/Navigator/mozCameras","Specification")}}

- -

許可設定

- -

{{page("/ja/docs/Web/API/Navigator/mozCameras","Permissions")}}

- -

関連情報

- - diff --git a/files/ja/web/api/cameracontrol/index.html b/files/ja/web/api/cameracontrol/index.html deleted file mode 100644 index 1427d5ea3f..0000000000 --- a/files/ja/web/api/cameracontrol/index.html +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: CameraControl -slug: Web/API/CameraControl -tags: - - API - - DOM - - DOM Reference - - Firefox OS - - Graphics - - JavaScript - - Reference - - WebAPI -translation_of: Archive/B2G_OS/API/CameraControl ---- -

{{APIRef("Camera API")}}

- -

{{ non-standard_header() }}

- -

{{B2GOnlyHeader2('privileged')}}

- -

{{domxref("CameraManager.getCamera()")}} メソッドを使用してカメラへの参照を取得する時、成功時に呼び出されるコールバック関数を指定します。この関数は、引数として CameraControl オブジェクトを受け取ります。このオブジェクトのメソッドとプロパティは、カメラの管理と使用に使います。

- -

プロパティ

- -
-
{{domxref("CameraControl.capabilities")}} {{readonlyinline}}
-
{{domxref("CameraCapabilities")}} オブジェクトは、与えられたカメラについてのすべてのキャパビリティ示します。
-
{{domxref("CameraControl.effect")}}
-
カメラで使用するエフェクトを定義する文字列 (デフォルトは none) です。この値は、{{domxref("CameraCapabilities.effects")}} に定義された値のいずれかでなければなりません。
-
{{domxref("CameraControl.exposureCompensation")}} {{readonlyinline}}
-
カメラの露光補正に使用する値です。この属性は読み取り専用です。露光値を変更するには、{{domxref("CameraControl.setExposureCompensation()")}} メソッドを呼び出す必要があります。
-
{{domxref("CameraControl.flashMode")}}
-
フラッシュの仕方を定義する文字列です。何らかの値が設定されると、カメラにフラッシュが搭載されていれば、この値はデフォルトで auto、搭載されていなければ none になります。値を設定する時は、{{domxref("CameraCapabilities.flashModes")}} に定義されたオプションのリストから選択しなければなりません。
-
{{domxref("CameraControl.focalLength")}} {{readonlyinline}}
-
カメラの焦点距離を絞るミリメートル単位の数値です。
-
{{domxref("CameraControl.focusAreas")}}
-
カメラのオートフォーカスする領域を定義するオブジェクトの 配列 です。
-
{{domxref("CameraControl.focusDistanceFar")}} {{readonlyinline}}
-
この値は、画像の被写界深度を定義するための {{domxref("CameraControl.focusDistanceNear")}} と共に使用する、メートル単位の距離です。このプロパティの値は、Infinity になる可能性があります。
-
{{domxref("CameraControl.focusDistanceNear")}} {{readonlyinline}}
-
この値は、画像の被写界深度を定義するための {{domxref("CameraControl.focusDistanceFar")}} と共に使用する、メートル単位の距離です。
-
{{domxref("CameraControl.focusDistanceOptimum")}} {{readonlyinline}}
-
この値は、被写体が最も鮮明に映るメートル単位の距離です。
-
{{domxref("CameraControl.focusMode")}}
-
カメラが使用するフォーカスモードの種類を定義する文字列 (デフォルトで auto または fixed) です。この値は {{domxref("CameraCapabilities.focusModes")}} から選択されなければなりません。
-
{{domxref("CameraControl.meteringAreas")}}
-
カメラがオートフォーカスする領域を定義するオブジェクトの 配列 です。
-
{{domxref("CameraControl.onShutter")}}
-
カメラの "shutter" イベントのイベントハンドラです。シャッター音または視覚的なシャッター効果を発生させる関数を指定します。
-
{{domxref("CameraControl.onClosed")}}
-
同じアプリ内で新しい CameraControl オブジェクトに引き継がれた時に呼び出されるイベントハンドラです。
-
{{domxref("CameraControl.onRecorderStateChange")}}
-
レコーダーの状態が変更された時、つまり、記録処理中にエラーが発生した時や記録データのいずれかの制限 ({{domxref("CameraControl.startRecording()")}} 参照) に達した時に呼び出される関数です。
-
{{domxref("CameraControl.sceneMode")}}
-
カメラが使用するシーンモードを定義する文字列 (デフォルトで auto) です。この値は、{{domxref("CameraCapabilities.sceneModes")}} から選択されなければなりません。
-
{{domxref("CameraControl.whiteBalanceMode")}}
-
カメラのホワイトバランスのモードを定義する文字列 (デフォルトで auto) です。この値は、{{domxref("CameraCapabilities.whiteBalanceModes")}} から選択されなければなりません。
-
{{domxref("CameraControl.zoom")}}
-
カメラが使用するズームファクタモードの種類を定義する数値 (デフォルトで 1) です。この値は、{{domxref("CameraCapabilities.zoomRatios")}} から選択されなければなりません。
-
- -

メソッド

- -
-
{{ domxref("CameraControl.autoFocus()") }}
-
カメラ画像のフォーカスを合わせます。
-
{{ domxref("CameraControl.getPreviewStream()") }}
-
カメラから動画ストリームを取得します。このメソッドは任意のタイミングで使用できます。
-
{{ domxref("CameraControl.getPreviewStreamVideoMode()") }}
-
カメラから動画ストリームを取得します。特定の動画モードで使用できます。
-
{{ domxref("CameraControl.release()") }}
-
カメラをリリースし、他のアプリケーションがカメラを使えるようにします。
-
{{ domxref("CameraControl.resumePreview()") }}
-
{{domxref("CameraControl.takePicture()")}} メソッドの呼び出しで一時停止された動画ストリームのプレビューを再開します。
-
{{ domxref("CameraControl.setConfiguration()") }}
-
アドホックな設定変更をします。
-
{{ domxref("CameraControl.setExposureCompensation()") }}
-
露光補正ファクタを指定します。
-
{{ domxref("CameraControl.startRecording()") }}
-
動画ストリームの記録を開始します。
-
{{ domxref("CameraControl.stopRecording()") }}
-
動画ストリームの記録を停止します。
-
{{ domxref("CameraControl.pauseRecording()") }}
-
動画ストリームの記録を一時停止します。
-
{{ domxref("CameraControl.resumeRecording()") }}
-
一時停止された動画ストリームの記録を再開します。
-
{{ domxref("CameraControl.takePicture()") }}
-
写真を撮ります。写真データは {{domxref("Blob")}} で受け取ります。
-
- -

仕様

- -

{{page("/ja/docs/Web/API/Navigator/mozCameras","Specification")}}

- -

許可設定

- -

{{page("/ja/docs/Web/API/Navigator/mozCameras","Permissions")}}

- -

関連情報

- - diff --git a/files/ja/web/api/cameramanager/getcamera/index.html b/files/ja/web/api/cameramanager/getcamera/index.html deleted file mode 100644 index 9877900d67..0000000000 --- a/files/ja/web/api/cameramanager/getcamera/index.html +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: CameraManager.getCamera() -slug: Web/API/CameraManager/getCamera -tags: - - API - - Firefox OS - - Graphics - - JavaScript - - Method - - Non Standard - - Reference - - WebAPI -translation_of: Archive/B2G_OS/API/CameraManager/getCamera ---- -
{{APIRef("Camera API")}}{{ non-standard_header() }}{{B2GOnlyHeader2('privileged')}}
- -

概要

- -

このメソッドは、端末上の利用可能なカメラの一つに、そのカメラの識別子を指定してアクセスするために使用します。利用可能なカメラのリストは、{{domxref("CameraManager.getListOfCameras()")}} メソッドを呼び出して取得してください。

- -

構文 (Firefox OS 2.1 まで)

- -
CameraManager.getCamera(camera, cameraConfiguration, onsuccess[, onerror]);
- -

引数

- -
-
camera
-
利用したいカメラを指定します (端末には複数のカメラが搭載されているでしょう)。
-
cameraConfiguration
-
このカメラのオプションを設定するオブジェクト: mode, previewSize および recorderProfile
-
onsuccess
-
{{domxref("CameraControl")}} オブジェクトを引数に取るコールバック関数。
-
onerror
-
エラー文字列を引数に取るオプションのコールバック関数。
-
- -

- -
var options = {
-  mode: 'picture',
-  recorderProfile: 'jpg',
-  previewSize: {
-    width: 352,
-    height: 288
-  }
-};
-
-var camera = navigator.mozCameras.getListOfCameras()[0];
-
-function onSuccess(camera) {
-  // Do stuff with the camera
-};
-
-function onError(error) {
-  console.warn(error);
-};
-
-navigator.mozCameras.getCamera(camera, options, onSuccess, onError);
-
- -

構文 (Firefox OS 2.2 以降)

- -
Promise CameraManager.getCamera(camera, cameraConfiguration);
- -

Parameters

- -
-
camera
-
利用したいカメラを指定します (端末には複数のカメラが搭載されているでしょう)。
-
cameraConfiguration
-
このカメラのオプションを設定するオブジェクト: mode, previewSize および recorderProfile
-
- -

戻り値

- -

{{domxref("Promise")}} を返します。Promise の .then() 関数は以下の 2 個の引数を受け取ります:

- -
-
onsuccess
-
カメラオブジェクトを引数に取るコールバック関数。このオブジェクトには、{{domxref("CameraControl")}} オブジェクトである camera プロパティと端末の実際の設定値を含む configuration プロパティが含まれます。
-
onerror
-
エラー文字列を引数に取るオプションのコールバック関数。
-
- -

- -
var options = {
-  mode: 'picture',
-  recorderProfile: 'jpg',
-  previewSize: {
-    width: 352,
-    height: 288
-  }
-};
-
-var camera = navigator.mozCameras.getListOfCameras()[0];
-
-function onSuccess(cameraObj) {
-  var cameraControl = cameraObj.camera;
-  // Do stuff with the cameraControl
-};
-
-function onError(error) {
-  console.warn(error);
-};
-
-navigator.mozCameras.getCamera(camera, options).then(onSuccess, onError);
-
- -

仕様

- -

標準仕様には含まれていません。WebRTC がモバイル端末で広くサポートされるようになった時、これと置き換えられる予定です。

- -

許可設定

- -

Firefox OS 1.4 まで Camera API は Certified API だったため、サードパーティアプリからはアクセスできませんでした。Firefox OS 2.0 からは許可レベルが Privileged に下げられたため、開発者が独自のアプリで利用できるようになりました。

- -
"type": "privileged"
- -
"permissions": {
-  "camera": {
-    "description": "Required for accessing cameras on the device."
-  }
-}
- -

関連情報

- - diff --git a/files/ja/web/api/cameramanager/getlistofcameras/index.html b/files/ja/web/api/cameramanager/getlistofcameras/index.html deleted file mode 100644 index 3ae9d281d5..0000000000 --- a/files/ja/web/api/cameramanager/getlistofcameras/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: CameraManager.getListOfCameras() -slug: Web/API/CameraManager/getListOfCameras -tags: - - API - - Firefox OS - - Graphics - - JavaScript - - Method - - Non Standard - - Reference - - WebAPI -translation_of: Archive/B2G_OS/API/CameraManager/getListOfCameras ---- -
{{APIRef("Camera API")}} {{ non-standard_header() }}{{B2GOnlyHeader2('privileged')}}
- -

概要

- -

このメソッドは、端末上の利用可能なすべてのカメラの識別子を含む 配列 を取得するために使用します。

- -

構文

- -
var cameras = navigator.mozCameras.getListOfCameras();
- -

戻り値

- -
-
camera
-
利用可能なすべてのカメラの識別子の 配列
-
- -

仕様

- -

標準仕様には含まれていません。WebRTC がモバイル端末で広くサポートされるようになった時、これと置き換えられる予定です。

- -

許可設定

- -

Firefox OS 1.4 まで Camera API は Certified API だったため、サードパーティアプリからはアクセスできませんでした。Firefox OS 2.0 からは許可レベルが Privileged に下げられたため、開発者が独自のアプリで利用できるようになりました。

- -
"permissions": {
-  "camera": {
-    "description": "Required for accessing cameras on the device."
-  }
-}
- -

関連情報

- - diff --git a/files/ja/web/api/cameramanager/index.html b/files/ja/web/api/cameramanager/index.html deleted file mode 100644 index f4afb2039f..0000000000 --- a/files/ja/web/api/cameramanager/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: CameraManager -slug: Web/API/CameraManager -tags: - - API - - DOM - - DOM Reference - - Firefox OS - - Graphics - - JavaScript - - Reference - - WebAPI -translation_of: Archive/B2G_OS/API/CameraManager ---- -

{{ apiref("Camera API") }}

- -

{{ non-standard_header() }}

- -

{{B2GOnlyHeader2('privileged')}}

- -

CameraManager インターフェースは、ユーザの端末上で利用可能な任意のカメラへのアクセスを提供します。

- -

プロパティ

- -

このインターフェースは実装されていないか、いかなるプロパティも継承しません。

- -

メソッド

- -
-
{{ domxref("CameraManager.getCamera()") }}
-
カメラの識別子に基づいて camera インスタンスを取得します。
-
{{ domxref("CameraManager.getListOfCameras()") }}
-
端末上の利用可能なすべてのカメラの識別子が格納された 配列 を返します。
-
- -

仕様

- -

{{page("/ja/docs/Web/API/Navigator/mozCameras","Specification")}}

- -

許可設定

- -

{{page("/ja/docs/Web/API/Navigator/mozCameras","Permissions")}}

- -

関連情報

- - diff --git a/files/ja/web/api/device_storage_api/index.html b/files/ja/web/api/device_storage_api/index.html deleted file mode 100644 index 0dc35b0527..0000000000 --- a/files/ja/web/api/device_storage_api/index.html +++ /dev/null @@ -1,254 +0,0 @@ ---- -title: Device Storage API -slug: Web/API/Device_Storage_API -translation_of: Archive/B2G_OS/API/Device_Storage_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('privileged') }}

-

概要

-

Device Storage API はwebアプリがファイルシステムへアクセスするために使われます。 ファイルシステムへのアクセスは非常に注意を要するため、このAPIはprivilleged アプリのみが使用できます。

-
-

Note: デバイスストレージへのアクセスは物理レベルの制限で遅いです。多くの場合、IndexedDB を使用することで高速化できます。

-
-

デバイスストレージへのアクセス

-

このセクションはデバイスストレージへのアクセスに必要なことを説明します。

-

エントリーポイント

-

記憶領域へのアクセスは次のように記述することができます。

-

{{domxref("window.navigator.getDeviceStorage()","navigator.getDeviceStorage()")}}
- {{domxref("window.navigator.getDeviceStorages()","navigator.getDeviceStorages()")}}

- -

Firefox OS は次の記憶領域名を定めています。:

- -
var pics = navigator.getDeviceStorage('pictures');
- -

When using {{domxref("window.navigator.getDeviceStorages()","navigator.getDeviceStorages()")}}, if there is more than one storage area then the internal one will be named for example sdcard and the physical storage area will be called something else (sometimes it's extsdcard, sometimes it's sdcard1). This varies by device manufacturer. The names of files on the sdcard storage area will be /sdcard/path/filename, and the names of files on the sdcard1 storage area will be /sdcard1/path/filename, or whatever.

-

Note that the /sdcard and /sdcard1 are storage names. Their actual mount points on the system are determined via vold and/or /system/etc/volume.cfg file.) DeviceStorage transparently maps the storageName into the actual mountPoint (so you don't need the mount point if you're just accessing the files through device storage).

-

If you want to determine the mount point to examine the filesystem from an adb shell, then you can determine the vold mount points by using the command adb shell vdc volume list  (this requires a root shell).

-

On the Flame, you'll see something like this:

-

110 0 sdcard /storage/sdcard 4
- 110 0 sdcard1 /storage/sdcard1 4
- 200 0 Volumes listed.

-

For volumes that aren't managed by vold (for example, the sdcard volume on a Nexus 4/5), the mount point is found in /system/etc/volume.cfg.

-
-

Note: In Gaia engineering builds there is a ds-test app, which is useful for device storage testing.

-
-

 

-

デバイスストレージのパーミッション

-

これらの記憶領域を使用するためにアプリケーションはマニフェストにて宣言しておく必要があります。たとえばもしアプリケーションが sdcard 領域にアクセスしたい場合、マニフェストの permissionに "device-storage:sdcard" を記述しなければなりません。

-
"permissions": {
-  "device-storage:videos":{ "access": "readonly" },
-  "device-storage:pictures":{ "access": "readwrite" }
-}
-

前述のように、 device-storage:apps は特別な権限が必要です。open web apps のインストールを管理する navigator.mozApps.mgmt APIを使うために  webapps-manage permissionが必要となります。

-
"permissions": {
-  "device-storage:apps":{ "access": "readwrite" },
-  "webapps-manage":{ }
-}
-

appsを除くすべての device-storage 記憶領域は privileged level の権限を必要とします。 apps は certifiedです。webapps-manage は certified levelの権限で使用できます。

-

ストレージの利用

-

アプリケーションは記憶領域へのアクセスを取得すると、その記憶領域内のファイルを追加、取得、および削除することが可能です。

-

ファイルの追加

-

Adding a file is done using the {{domxref("DeviceStorage.addNamed()","addNamed")}} or {{domxref("DeviceStorage.add()","add")}} methods. The former allows to set an explicit name when storing a file while the latter creates a name automatically when the file is stored. Both methods are asynchronous and return a {{domxref("DOMRequest")}} object to handle the success or error of the operation. This is very important as writing and reading files on a physical support is a slow process.

-

Those two methods expect a {{domxref("Blob")}} as their first parameter. This object will be turned into a file under the hood and stored. When creating a {{domxref("Blob")}} object, it's mandatory to give it a type. This type, which is a mime type, is important because some storage areas have restrictions based on the type:

- -
var sdcard = navigator.getDeviceStorage("sdcard");
-var file   = new Blob(["This is a text file."], {type: "text/plain"});
-
-var request = sdcard.addNamed(file, "my-file.txt");
-
-request.onsuccess = function () {
-  var name = this.result;
-  console.log('File "' + name + '" successfully wrote on the sdcard storage area');
-}
-
-// An error typically occur if a file with the same name already exist
-request.onerror = function () {
-  console.warn('Unable to write the file: ' + this.error);
-}
-
-
-

Note: Repository in a storage area are implicit. It's not possible to create explicitly an empty repository. If you want to use a repository structure you have to make it part of the name of the file to store. So if you want to store the file bar inside the foo repository, you have to use the {{domxref("DeviceStorage.addNamed()","addNamed")}} method with the complete path name of the file addNamed(blob, "foo/bar"). This is also true when you want to retrieve a file using it's name (see below).

-

As file are added in a given restricted storage area for security reason, a file path name cannot start with "/" nor "../" (and "./" is pointless).

-
-

ファイルの取得

-

Retrieving a file can be done in both ways: by using its name or by iterating the whole list of files.

-

The easiest way is to retrieve a file by its name using the {{domxref("DeviceStorage.get()","get")}} and {{domxref("DeviceStorage.getEditable","getEditable")}} methods. The former provides a {{domxref("File")}} object (which act like a read only file) when the latter provides a {{domxref("FileHandle")}} object (which allows updating the underlaying file). Both methods are asynchronous and return a {{domxref("DOMRequest")}} object to handle the success or error of the operation.

-
var sdcard = navigator.getDeviceStorage('sdcard');
-
-var request = sdcard.get("my-file.txt");
-
-request.onsuccess = function () {
-  var file = this.result;
-  console.log("Get the file: " + file.name);
-}
-
-request.onerror = function () {
-  console.warn("Unable to get the file: " + this.error);
-}
-
-

The other way to retrieve files is by browsing the content of the storage area. This is possible using the {{domxref("DeviceStorage.enumerate()","enumerate")}} and {{domxref("DeviceStorage.enumerateEditable()","enumerateEditable")}} methods. The former provides {{domxref("File")}} objects when the latter provides {{domxref("FileHandle")}} objects. Both methods are asynchronous and return a {{domxref("DOMCursor")}} object to iterate along the list of files. A {{domxref("DOMCursor")}} is nothing less than a {{domxref("DOMRequest")}} with extra power to iterate asynchronously along a list of things (files in that case).

-
var pics = navigator.getDeviceStorage('pictures');
-
-// Let's browse all the images available
-var cursor = pics.enumerate();
-
-cursor.onsuccess = function () {
-  var file = this.result;
-  console.log("File found: " + file.name);
-
-  // Once we found a file we check if there is other results
-  if (!this.done) {
-    // Then we move to the next result, which call the cursor
-    // success with the next file as result.
-    this.continue();
-  }
-}
-
-cursor.onerror = function () {
-  console.warn("No file found: " + this.error);
-}
-
-

It's possible to limit the number of result by passing two optional parameters to the {{domxref("DeviceStorage.enumerate()","enumerate")}} and {{domxref("DeviceStorage.enumerateEditable()","enumerateEditable")}} methods.

-

The first parameter can be a string representing a sub folder to search inside.

-

The second parameter can be an object with a since property, which allow to limit the search to a given time period.

-
var pics = navigator.getDeviceStorage('pictures');
-
-// Lets retrieve picture from the last week.
-var param = {
-  since: new Date((+new Date()) - 7*24*60*60*1000)
-}
-
-var cursor = pics.enumerate(param);
-
-cursor.onsuccess = function () {
-  var file = this.result;
-  console.log("Picture taken on: " + file.lastModifiedDate);
-
-  if (!this.done) {
-    this.continue();
-  }
-}
-
-

ファイルの削除

-

A file can be removed from the storage area by simply using the {{domxref("DeviceStorage.delete()","delete")}} method. This method just need the name of the file to delete. As all the other methods from the {{domxref("DeviceStorage")}} interface, this one is also asynchronous and return a {{domxref("DOMRequest")}} object to handle the success or error of the operation.

-
var sdcard = navigator.getDeviceStorage('sdcard');
-
-var request = sdcard.delete("my-file.txt");
-
-request.onsuccess = function () {
-  console.log("File deleted");
-}
-
-request.onerror = function () {
-  console.log("Unable to delete the file: " + this.error);
-}
-
-

ストレージ情報

-

Beyond accessing files, a storage area provide a few methods to easily reach some important information

-

利用可能領域

-

One of the most important thing to know when storing files on a device is the amount of space available. The {{domxref("DeviceStorage")}} interface provide two useful function dedicated to space:

- -

As those methods are asynchronous, they return a {{domxref("DOMRequest")}} object to handle the success or error of the operation.

-
var videos = navigator.getDeviceStorage('videos');
-
-var request = videos.usedSpace();
-
-request.onsuccess = function () {
-  // The result is express in bytes, lets turn it into megabytes
-  var size = this.result / 1048576;
-  console.log("The videos on your device use a total of " + size.toFixed(2) + "Mo of space.");
-}
-
-request.onerror = function () {
-  console.warn("Unable to get the space used by videos: " + this.error);
-}
-
-

変更の監視

-

As many applications can use a same storage area at the same time, it's sometime useful for an application to be aware of a change in that storage area. It's also useful for an application who want to perform asynchronous action without relaying on all the {{domxref("DOMRequest")}} objects return by each method of the {{domxref("DeviceStorage")}} interface.

-

To that end, a {{event("change")}} event is triggered each time a file is created, modified or deleted. This event can be capture using the {{domxref("DeviceStorage.onchange","onchange")}} property or the {{domxref("EventTarget.addEventListener()","addEventListener()")}} method. The event handler get a {{domxref("DeviceStorageChangeEvent")}} object which is a regular {{domxref("Event")}} object with two extra properties:

- -
var sdcard = navigator.getDeviceStorage('sdcard');
-
-sdcard.onchange = function (change) {
-  var reason = change.reason;
-  var path   = change.path;
-
-  console.log('The file "' + path + '" has been ' + reason);
-}
-
-

仕様

-

Not part of any specification.

-

ブラウザ互換性

-

{{ CompatibilityTable() }}

-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
-
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
-
-

関連項目

- diff --git a/files/ja/web/api/domapplicationsmanager/getall/index.html b/files/ja/web/api/domapplicationsmanager/getall/index.html deleted file mode 100644 index 3c01a9c81a..0000000000 --- a/files/ja/web/api/domapplicationsmanager/getall/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Apps.mgmt.getAll -slug: Web/API/DOMApplicationsManager/getAll -tags: - - API - - Apps - - Apps API - - Firefox OS - - Method -translation_of: Archive/Marketplace/API/DOMApplicationsManager/getAll ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

概要

-

ユーザのレポジトリにインストールされているアプリ一覧を取得します。

-

構文

-
window.navigator.mozApps.mgmt.getAll()
-
-

引数

-

ありません。

-

戻り値

-

getAll()pendingGetAll オブジェクトを返します。呼び出し元は戻り値オブジェクトの onsuccessonerror コールバックプロパティを設定することが期待されます。

-

pendingGetAll.result は、現在のブラウザにインストールされているすべてのアプリを含んだ App オブジェクトの配列となります。何もアプリがインストールされていない場合、pendingGetAll.result は空の配列となります。アプリの取得時に深刻な問題が発生した場合、onerror が呼び出されます。

-

これは特権付き呼び出しです。アプリを取得する特権がない場合、navigator.mozApps.mgmtnull となります。

-

エラー

-

以下のエラーが DOMRequest.error で返される可能性があります。

-
-
-
-
- DENIED
-
- 権限なし。
-
- - diff --git a/files/ja/web/api/domapplicationsmanager/index.html b/files/ja/web/api/domapplicationsmanager/index.html deleted file mode 100644 index d30d16fa32..0000000000 --- a/files/ja/web/api/domapplicationsmanager/index.html +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: DOMApplicationsManager -slug: Web/API/DOMApplicationsManager -tags: - - API -translation_of: Archive/Marketplace/API/DOMApplicationsManager ---- -

{{ ApiRef("Apps") }}

- -

{{ non-standard_header() }}

- -

Provides support for managing, and Open Web apps in a browser. A manager can be accessed via {{domxref("DOMApplicationsRegistry.mgmt", "Navigator.mozApps.mgmt")}}

- -

Property

- -
-
{{domxref("DOMApplicationsManager.oninstall")}}
-
Is an {{domxref("EventManager")}} call when install event is received.
-
{{domxref("DOMApplicationsManager.onuninstall")}}
-
Is an {{domxref("EventManager")}} call when uninstall event is received.
-
{{domxref("DOMApplicationsManager.onenablestatechange")}}
-
Is an {{domxref("EventManager")}} call when enablestatechange event is received.
-
- -

Methods

- -
-
{{ domxref("DOMApplicationsManager.getAll()") }}
-
Returns all applications.
-
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{ CompatUnknown() }}16.0{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}16.0{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
-
- -

 

diff --git a/files/ja/web/api/domapplicationsregistry/checkinstalled/index.html b/files/ja/web/api/domapplicationsregistry/checkinstalled/index.html deleted file mode 100644 index 88b7ededb5..0000000000 --- a/files/ja/web/api/domapplicationsregistry/checkinstalled/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Apps.checkInstalled -slug: Web/API/DOMApplicationsRegistry/checkInstalled -tags: - - API - - Apps - - Apps API - - Firefox OS - - Method -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/checkInstalled ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

概要

-

指定されたアプリについての情報を取得します。これを使って、そのアプリがインストールされているかどうかを判別できます。

-

構文

-
var request = window.navigator.mozApps.checkInstalled(url);
-
-

引数

-
-
- url
-
- アプリの マニフェスト の場所を含んだ 文字列型 の URL。
-
-

戻り値

-

checkInstalled() 関数は {{ domxref("DOMRequest") }} オブジェクトを返します。DOMRequest.result プロパティには App オブジェクト が含まれており、これはインストールされているアプリの情報を提供する JavaScript オブジェクトです。アプリがインストールされていない場合、DOMRequest.resultnull となります。

-

-
var request = window.navigator.mozApps.checkInstalled("http://example.com/manifest.webapp");
-request.onerror = function(e) {
-  alert("checkInstalled 呼び出しエラー: " + request.error.name);
-};
-request.onsuccess = function(e) {
-  if (request.result) {
-    console.log("アプリはインストールされています");
-  }
-  else {
-    console.log("アプリはインストールされていません");
-  }
-};
-

呼び出し元スクリプトは、この例のように、戻り値オブジェクトの onsuccess/onerror コールバックプロパティを設定することが期待されます。呼び出しが成功した場合、戻り値オブジェクトの result プロパティには App オブジェクト が含まれています。この例では request.result に当たります。

-

エラー

-

DOMRequest.error において文字列の ERROR が返ります。

-

マニフェストが情報を要求したページとは異なるドメインにある場合、checkInstalled が呼び出された直後に例外 NS_ERROR_DOM_BAD_URI が投げられます。

- - diff --git a/files/ja/web/api/domapplicationsregistry/getinstalled/index.html b/files/ja/web/api/domapplicationsregistry/getinstalled/index.html deleted file mode 100644 index 1bfc36d895..0000000000 --- a/files/ja/web/api/domapplicationsregistry/getinstalled/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Apps.getInstalled -slug: Web/API/DOMApplicationsRegistry/getInstalled -tags: - - API - - Apps - - Apps API - - Firefox OS - - Method -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/getInstalled ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

概要

-

この生成元からインストールされたアプリの一覧を取得します。例えば、これを Mozilla Marketplace を呼び出した場合、Mozilla Marketplace によってインストールされたアプリの一覧を取得できます。

-
-

注: ひとつの生成元 (オリジン) に複数のアプリをホストすることはできません。ひとつのドメインで複数のアプリを登録したい場合は、例えば myapp.mydomain.comotherapp.mydomain.com のように、アプリごとにサブドメインを用意してください

-
-

構文

-
var request = window.navigator.mozApps.getInstalled();
-
-

引数

-

ありません。

-

-
var request = window.navigator.mozApps.getInstalled();
-request.onerror = function(e) {
-  alert("getInstalled の呼び出し時にエラーが発生しました: " + request.error.name);
-};
-request.onsuccess = function(e) {
-  alert("成功しました。アプリの数は " + request.result.length);
-  var appsRecord = request.result;
-};
-

呼び出し元スクリプトは、この例のように、戻り値オブジェクトの onsuccess/onerror コールバックプロパティを設定することが期待されます。呼び出しが成功した場合、戻り値オブジェクトの result プロパティに App オブジェクト の配列が含まれています。この例では request.result に当たります。

-

エラー

-

DOMRequest.error において文字列の ERROR が返ります。

- - diff --git a/files/ja/web/api/domapplicationsregistry/getself/index.html b/files/ja/web/api/domapplicationsregistry/getself/index.html deleted file mode 100644 index 5fdd46a1ce..0000000000 --- a/files/ja/web/api/domapplicationsregistry/getself/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Apps.getSelf -slug: Web/API/DOMApplicationsRegistry/getSelf -tags: - - API - - Apps - - Apps API - - Firefox OS - - Method -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/getSelf ---- -

{{ ApiRef() }}

-

{{ non-standard_header() }}

-

概要

-

現在のアプリに関する情報を返します。つまり、呼び出し元アプリとドメインが一致するインストール済みアプリの情報です。これを使ってアプリがインストールされているかどうかを判別できます。

-
-

注: ひとつの生成元 (オリジン) に複数のアプリをホストすることはできません。ひとつのドメインで複数のアプリを登録したい場合は、例えば myapp.mydomain.comotherapp.mydomain.com のように、アプリごとにサブドメインを用意してください

-
-

構文

-
var request = window.navigator.mozApps.getSelf();
-
-

引数

-

ありません。

-

戻り値

-

getSelf()DOMRequest オブジェクトを返します。success イベントが DOMRequest に対して通知されると、DOMRequest.result フィールドには、現在のアプリを表す App オブジェクト、あるいは getSelf() がアプリ外部から呼び出された (つまりアプリがインストールされていない) 場合は null が含まれます。操作が完了するまでは、DOMRequest.resultnull です。

-

呼び出しが成功しなかった場合、error イベントが DOMRequest に対して通知され、DOMRequest.error には DOMError オブジェクトが含まれ、これにはエラーに関する情報が含まれます。

-

-

DOMRequest.onsuccessDOMRequest.onerror コールバックプロパティとともに getSelf() を使う方法を示した例です。

-
var request = window.navigator.mozApps.getSelf();
-request.onsuccess = function() {
-  if (request.result) {
-    // App オブジェクトからアプリの名称を取得
-    alert("現在のアプリの名称: " + request.result.manifest.name);
-  } else {
-    alert("アプリ外部から呼び出されました");
-  }
-};
-request.onerror = function() {
-  // DOMError オブジェクトからエラー名を表示
-  alert("エラー: " + request.error.name);
-};
-

呼び出しが成功した場合、戻り値オブジェクトの result プロパティに App オブジェクトが含まれています。この例では request.result に当たります。request.resultnull の場合、アプリがインストールされていないことが分かります。

-

アプリがそのプロトコルを HTTP から HTTPS へ変えている場合は、navigator.mozApps.checkInstalled() を使ってインストールされているか判別した方が良いでしょう。

- - diff --git a/files/ja/web/api/domapplicationsregistry/index.html b/files/ja/web/api/domapplicationsregistry/index.html deleted file mode 100644 index 72bff00c25..0000000000 --- a/files/ja/web/api/domapplicationsregistry/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Apps -slug: Web/API/DOMApplicationsRegistry -tags: - - API - - Apps - - Apps API - - Non-standard -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry ---- -
{{ ApiRef("Apps") }}
- -
-

マーケットプレイス機能の削除
- このページで説明されている機能は動作しなくなりました— Firefox Marketplaceは、Android、デスクトップ、タブレット、および支払い(その他の関連機能)のサポートを終了しました。詳細については、 Future of Marketplace FAQ をご覧ください。

-
- -

ブラウザ内で Open Web apps をインストール、管理する機能を提供します。現時点では {{domxref('window.navigator.mozApps')}} として実装されています。

- -

プロパティ

- -
-
{{domxref("DOMApplicationsRegistry.mgmt")}}
-
ダッシュボードがユーザに代わってアプリを管理、起動できるようにする関数を含む mgmt オブジェクト。
-
- -

メソッド

- -
-
{{ domxref("DOMApplicationsRegistry.checkInstalled()") }}
-
アプリが既にインストールされているかどうかを確認します。マニフェストを引数に取ります。
-
{{ domxref("DOMApplicationsRegistry.install()") }}
-
アプリのインストールを実行します。インストールの過程で、アプリは検証され、ユーザはインストールを許可するかどうか訪ねられます。
-
{{ domxref("DOMApplicationsRegistry.getSelf()") }}
-
該当するアプリの {{domxref('app')}} オブジェクトを含むオブジェクトを返します。
-
{{ domxref("DOMApplicationsRegistry.getInstalled()") }}
-
インストールされているアプリの一覧を取得します。
-
-

Obsolete methods

-
-
DOMApplicationsRegistry.amInstalled() {{Obsolete_Inline}}
-
アプリがインストールされているかどうかを確認する手段を提供します。
-
DOMApplicationsRegistry.getInstalledBy() {{Obsolete_Inline}}
-
呼び出し元のドメインによってインストールされたアプリを返します。 これにより、アプリのディレクトリまたはストアは、現在のユーザーに代わってインストールしたアプリを判別できます。
-
diff --git a/files/ja/web/api/domapplicationsregistry/install/index.html b/files/ja/web/api/domapplicationsregistry/install/index.html deleted file mode 100644 index af89013ff4..0000000000 --- a/files/ja/web/api/domapplicationsregistry/install/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: Apps.install -slug: Web/API/DOMApplicationsRegistry/install -tags: - - API - - Apps - - Apps API - - Firefox OS - - Method -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/install ---- -
- {{ApiRef}} {{non-standard_header}}
-

概要

-

アプリのインストールを実行します。インストールの過程で、アプリは検証され、ユーザはインストールを許可するかどうか訪ねられます。

-

アプリが既に同じドメインからインストールされていた場合、install() を再度呼び出すことで既存のインストールデータが確認なく上書きされます。これは、例えばユーザが無料版からプレミアム版にアップグレードした場合など、購入レシートの変更に使用される場合があります。

-

構文

-
var request = window.navigator.mozApps.install(url, [receipt1, …]);
-

引数

-
- 注: 現在 (2012 年 5 月時点)、url 引数に相対パスを使った場合に生じるバグがあります。{{ Bug("745928") }} を参照してください。
-
-
- url
-
- インストールされる マニフェスト の場所を含んだ string 型の URL。独自配布の場合 (インストール元がアプリの生成元と同じ場合)、インストール元のサイトは URL の生成元部分を省略し、(/ で始まる) 絶対パスを使うことも可能です。
-
- receipts
-
- (オプション) 1 つあるいは複数のレシートの配列を含む配列。例:
-
-
window.navigator.mozApps.install(url, ["receipt"])
-
-
- receipts が省略された場合、これは null として扱われます。詳しくは レシートの検証 を参照してください。
-
-

要求された引数 (url) が欠落していた場合、あるいは非対応の引数が与えられた場合、install() 関数は例外を投げます。

-

戻り値

-

install() 関数は {{ domxref("DOMRequest") }} オブジェクトを返します。DOMRequest.result フィールドには App オブジェクト が含まれ、これはインストールされたばかりのアプリを説明する JavaScript オブジェクトです。操作が完了するまでは、DOMRequest.resultnull です。

-

インストールが成功しなかった場合、DOMRequest.error には DOMError オブジェクト が含まれ、これにはエラーに関する情報が含まれます。

-

-

DOMRequest.onsuccessDOMRequest.onerror コールバックプロパティとともに install() を使う方法を示した例です。

-
var request = window.navigator.mozApps.install(manifestUrl);
-request.onsuccess = function () {
-  // 戻り値の App オブジェクトを保存
-  var appRecord = this.result;
-  alert('インストール成功!');
-};
-request.onerror = function () {
-  // DOMError オブジェクトからエラー情報を表示
-  alert('インストール失敗、エラー: ' + this.error.name);
-};
-
-

インストールが成功した場合、onsuccess コールバックが呼び出されます。これは、ここ に書かれているインストールアクションが発生したことを意味します。

-

インストールが成功しなかった場合、onerror コールバックが呼び出されます。失敗したインストールでは、DOMRequest.error にエラーに関する情報を含む DOMError オブジェクトが含まれます。

-

上のコードでは、既に呼び出された関数の後にリスナーが追加されているため、おかしな感じに見えるかもしれません。しかし、これが DOMRequest オブジェクトの操作方法なのです。関数の呼び出しはリスナーが定義されるまで待機し、リスナーは適切に呼び出されます。install() 関数は onsuccessonerror リスナーが定義されていない場合でも動作します。

-

エラー

-

インストールが成功しなかった場合、以下のエラーのいずれかが DOMRequest.error に含まれて返ります。

-
-
- DENIED
-
- ユーザがインストールをキャンセルした。
-
- INVALID_MANIFEST
-
- マニフェストが、正しい JSON 形式ではあるものの、必要な項目を含んでいないか、何らかの不正な状態。
-
- MANIFEST_URL_ERROR
-
- HTTP 200 以外のステータスコードが返ってきた、あるいは何らかの接続エラー。
-
- MANIFEST_PARSE_ERROR
-
- マニフェストの JSON が不正な形式。
-
- NETWORK_ERROR
-
- 接続エラー。
-
- REINSTALL_FORBIDDEN
-
- アプリの再インストールが禁止されている。
-
- MULTIPLE_APPS_PER_ORIGIN_FORBIDDEN
-
- インストール可能なアプリには「オリジンごとにアプリひとつ」というセキュリティポリシーが適用され、基本的に 1 つのオリジンで 2 つ以上のアプリをホストできません。
-
- - diff --git a/files/ja/web/api/domapplicationsregistry/installpackage/index.html b/files/ja/web/api/domapplicationsregistry/installpackage/index.html deleted file mode 100644 index 12b2912820..0000000000 --- a/files/ja/web/api/domapplicationsregistry/installpackage/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Apps.installPackage -slug: Web/API/DOMApplicationsRegistry/installPackage -tags: - - API - - Apps - - Firefox OS - - Method - - NeedsContent -translation_of: Archive/Marketplace/API/DOMApplicationsRegistry/installPackage ---- -

{{ ApiRef() }} {{non-standard_header}}

-

概要

-

パッケージ型アプリ をインストールします。

-

構文

-
installPackage: function(aURL[, aParams])
-

引数

-
-  
-
-
-
- aURL
-
- インストールしようとするアプリパッケージに関連付けられたミニマニフェストの URL。完全な絶対 URL でなければいけません。
-
- aParams
-
- (オプション) 以下の追加の情報を含むオブジェクト。
-
-
- -

戻り値

-
-
- DOMRequest
-
-

関連情報

- diff --git a/files/ja/web/api/domcursor/done/index.html b/files/ja/web/api/domcursor/done/index.html deleted file mode 100644 index 360e731a56..0000000000 --- a/files/ja/web/api/domcursor/done/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: DOMCursor.done -slug: Web/API/DOMCursor/done -translation_of: Archive/B2G_OS/API/DOMCursor/done ---- -
- {{ApiRef}} {{non-standard_header}}
-

概要

-

The done property indicate if the {{domxref("DOMCursor")}} has reach the last result.

-

構文

-
done = instanceOfDOMCursor.done
-

-

A boolean.

-

ブラウザ互換性

-
- {{CompatibilityTable}}
-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatUnknown}}{{CompatGeckoDesktop("21.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
-
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("21.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
-

仕様

-

Not currently part of any specification.

-

関連情報

- diff --git a/files/ja/web/api/domcursor/index.html b/files/ja/web/api/domcursor/index.html deleted file mode 100644 index 8f1d51f581..0000000000 --- a/files/ja/web/api/domcursor/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: DOMCursor -slug: Web/API/DOMCursor -tags: - - API - - DOM - - DOM Reference - - Gecko DOM Reference - - Non-standard - - Reference - - WebAPI -translation_of: Archive/B2G_OS/API/DOMCursor ---- -
- {{Apiref}} {{non-standard_header}}
-

概要

-

DOMCursor オブジェクトは結果のリスト全体の継続的な操作を可能にしています。これは、結果のリストを非同期で反復することを許可した{{domxref("DOMRequest")}} を拡張したものです。{{domxref("DOMCursor.continue()","continue()")}}メソッドが呼ばれるたびに、DOMCurosr はリストの次の要素へ移動を試み、結果の成功または失敗を呼び出します。

-

属性

-
-
- {{domxref("DOMCursor.done")}}
-
- 最後の要素に達しているかを示します。
-
-

Inherited from {{domxref("DOMRequest")}}:

-

{{page("/en-US/docs/Web/API/DOMRequest","Properties")}}

-

メソッド

-
-
- {{domxref("DOMCursor.continue()")}}
-
- 次のカーソルへと移動します。
-
-

-
var sdcard = navigator.getDeviceStorage('sdcard');
-var cursor = sdcard.enumerate();
-
-cursor.onsuccess = function () {
-  console.log("File found: " + this.result.name);
-
-  // Once we found a file we check if there is other results
-  if (!this.done) {
-    // Then we move to the next result, which call the
-    // cursor success with the next file as result.
-    this.continue();
-  }
-}
-

ブラウザ互換性

-
- {{CompatibilityTable}}
-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatUnknown}}{{CompatGeckoDesktop("21.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
-
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("21.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
-

仕様

-

Not currently part of any specification.

-

関連情報

- diff --git a/files/ja/web/api/domrequest/error/index.html b/files/ja/web/api/domrequest/error/index.html deleted file mode 100644 index 44416750c8..0000000000 --- a/files/ja/web/api/domrequest/error/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: DOMRequest.error -slug: Web/API/DOMRequest/error -tags: - - DOM - - DOMRequest - - Gecko DOM Reference -translation_of: Archive/B2G_OS/API/DOMRequest/error ---- -
{{ApiRef}}{{non-standard_header}}
- -

概要

- -

このプロパティは {{domxref("DOMError")}} オブジェクト内のエラー情報を含みます。

- -

構文

- -
errorname = request.error.name;
-
- - - -

仕様

- -

どの仕様書にも記載されていません。

- -

ブラウザ実装状況

- -
Supported in Firefox 13.
-Available in workers in Firefox 41.
- -

関連情報

- - diff --git a/files/ja/web/api/domrequest/index.html b/files/ja/web/api/domrequest/index.html deleted file mode 100644 index 0e6ef466a3..0000000000 --- a/files/ja/web/api/domrequest/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: DOMRequest -slug: Web/API/DOMRequest -tags: - - DOM - - Gecko DOM Reference -translation_of: Archive/B2G_OS/API/DOMRequest ---- -
- {{ApiRef}}
-

DOMRequest オブジェクトは、進行中の操作を表します。操作の完了時に呼び出されるコールバックと、操作結果への参照を提供します。 進行中の操作を開始する DOM メソッドは、その操作の進行状況の監視に使用できる DOMRequest オブジェクトを返すことがあります。

-

属性

-
-
- {{ domxref("DOMRequest.onsuccess") }}
-
- DOMRequest によって表される、操作の完了時に呼び出されるコールバックハンドラ
-
- {{ domxref("DOMRequest.onerror") }}
-
- 操作の処理中にエラーが発生したときに呼び出されるコールバックハンドラ
-
- {{ domxref("DOMRequest.readyState") }}
-
- 操作が完了しているか否かを示す string。値は "done" もしくは "pending" の何れか。
-
- {{ domxref("DOMRequest.result") }}
-
- 操作結果
-
- {{ domxref("DOMRequest.error") }}
-
- エラー情報(※存在する場合)
-
-

-

{{domxref("App")}} の onsuccessonerrorresulterror の使用例

-
var pending = navigator.mozApps.install(manifestUrl);
-
-pending.onsuccess = function () {
-  // Save the App object that is returned
-  var appRecord = this.result;
-  alert('Installation successful!')
-};
-
-pending.onerror = function () {
-  // Display the name of the error
-  alert('Install failed, error: ' + this.error.name);
-};
-

ブラウザ実装状況

-

{{ CompatibilityTable }}

-
- - - - - - - - - - - - - - - - - - - -
機能ChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本サポート{{ CompatUnknown }}{{ CompatGeckoDesktop("13.0") }}{{ CompatUnknown }}{{ CompatUnknown }}{{ CompatUnknown }}
-
-
- - - - - - - - - - - - - - - - - - - - - -
機能AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本サポート{{ CompatUnknown }}{{ CompatUnknown }}{{ CompatGeckoMobile("13.0") }}{{ CompatUnknown }}{{ CompatUnknown }}{{ CompatUnknown }}
-
-

仕様

-

どの仕様書にも含まれていません。

-

関連情報

- diff --git a/files/ja/web/api/fmradio/antennaavailable/index.html b/files/ja/web/api/fmradio/antennaavailable/index.html deleted file mode 100644 index 231ff03eb6..0000000000 --- a/files/ja/web/api/fmradio/antennaavailable/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: FMRadio.antennaAvailable -slug: Web/API/FMRadio/antennaAvailable -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/antennaAvailable ---- -
- {{ non-standard_header() }}
-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

antennaAvailable プロパティの値は、アンテナが接続されており利用可能かどうかを示します。

-

構文

-
var antenna = instanceOfFMRadio.antennaAvailable
-

-

真偽値を返します。

-

-
navigator.mozFMRadio.onantennaavailablechange = function () {
-  if (navigator.mozFMRadio.antennaAvailable) {
-    console.log("アンテナが接続されています");
-  } else {
-    console.log("アンテナが接続されていません");
-  }
-};
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/cancelseek/index.html b/files/ja/web/api/fmradio/cancelseek/index.html deleted file mode 100644 index 736c88f018..0000000000 --- a/files/ja/web/api/fmradio/cancelseek/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: FMRadio.cancelSeek -slug: Web/API/FMRadio/cancelSeek -tags: - - API - - B2G - - Firefox OS - - Method - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/cancelSeek ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

cancelSeek メソッドは、ラジオチャンネルの周波数の探索を中止するために使用します。

-

構文

-
var request = instanceOfFMRadio.cancelSeek();
-

戻り値

-

命令の成功またはエラーを扱う DOMRequest を返します。

-

-
navigator.mozFMRadio.seekUp();
-
-window.onfrenquencychange = function () {
-  var request = navigator.mozFMRadio.cancelSeek();
-
-  request.onsuccess = function () {
-    console.log("Ok, let's stop seeking.");
-  }
-
-  request.onerror = function () {
-    console.log("Mmmh... ok, but there is actually nothing to cancel.");
-  }
-}
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/channelwidth/index.html b/files/ja/web/api/fmradio/channelwidth/index.html deleted file mode 100644 index 0e69232a4c..0000000000 --- a/files/ja/web/api/fmradio/channelwidth/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: FMRadio.channelWidth -slug: Web/API/FMRadio/channelWidth -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/channelWidth ---- -
- {{ non-standard_header() }}
-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

channelWidth プロパティの値は、周波数範囲のチャンネル幅を MHz 単位で示します。

-

通常、この値は次のいずれかです: 0.05, 0.1 (既定値) または 0.2

-

周波数がラジオに割り当てられる時、channelWidth に与えられた最も近い周波数の値に丸められます。例えば、100MHz が正しい周波数であり、channelWidth の値が 0.2 である場合、100.2 や 99.8 は正しい周波数ですが、100.15 は 100.2 に丸められます。

-

構文

-
var width = instanceOfFMRadio.channelWidth
-

-

真偽値を返します。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/disable/index.html b/files/ja/web/api/fmradio/disable/index.html deleted file mode 100644 index 0ea44dca1b..0000000000 --- a/files/ja/web/api/fmradio/disable/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: FMRadio.disable -slug: Web/API/FMRadio/disable -tags: - - API - - B2G - - Firefox OS - - Method - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/disable ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

disable メソッドは、ラジオを OFF にするために使用します。

-

このメソッドの呼び出しが成功した時に、毎回 {{event("disabled")}} イベントが発生します。

-

構文

-
var request = instanceOfFMRadio.disable();
-

戻り値

-

命令の成功またはエラーを扱う DOMRequest を返します。

-

-
var request = navigator.mozFMRadio.disable(100.0);
-
-request.onsuccess = function () {
-  console.log("The radio is turned off");
-}
-
-request.onerror = function () {
-  console.log("Something goes wrong!");
-}
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/enable/index.html b/files/ja/web/api/fmradio/enable/index.html deleted file mode 100644 index 323607f8ad..0000000000 --- a/files/ja/web/api/fmradio/enable/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: FMRadio.enable -slug: Web/API/FMRadio/enable -tags: - - API - - B2G - - Firefox OS - - Method - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/enable ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

enable メソッドは、与えられた周波数でラジオを ON にするために使用します。

-

この関数は、引数なしで呼び出された場合、エラーを投げます。

-

このメソッドの呼び出しが成功した時に、毎回 {{event("enabled")}} イベントと {{event("frequencychange")}} イベントが発生します。

-

構文

-
var request = instanceOfFMRadio.enable(frequency);
-

引数

-
-
- frenquency
-
- ラジオが受信する信号の周波数の値。
-
-

戻り値

-

命令の成功またはエラーを扱う DOMRequest を返します。

-

-
var request = navigator.mozFMRadio.enable(100.0);
-
-request.onsuccess = function () {
-  console.log("The radio is enable");
-}
-
-request.onerror = function () {
-  console.log("Something goes wrong!");
-}
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/enabled/index.html b/files/ja/web/api/fmradio/enabled/index.html deleted file mode 100644 index c45a6568a9..0000000000 --- a/files/ja/web/api/fmradio/enabled/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: FMRadio.enabled -slug: Web/API/FMRadio/enabled -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/enabled ---- -
- {{ non-standard_header() }}
-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

enabled プロパティの値は、ラジオが再生中 (true) か、そうでない (false) かを示します。

-

構文

-
var playing = instanceOfFMRadio.enabled
-

-

真偽値を返します。

-

-
window.addEventListener('enabled', function () {
-  if (navigator.mozFMRadio.enabled) {
-    console.log("ラジオは再生中です");
-  } else {
-    console.log("ラジオは OFF です");
-  }
-});
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/frequency/index.html b/files/ja/web/api/fmradio/frequency/index.html deleted file mode 100644 index b495dd9516..0000000000 --- a/files/ja/web/api/fmradio/frequency/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: FMRadio.frequency -slug: Web/API/FMRadio/frequency -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/frequency ---- -
- {{ non-standard_header() }}
-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

frequency プロパティの値は、現在のラジオ周波数を返します。

-

構文

-
var frequency = instanceOfFMRadio.frequency
-

-

ラジオ周波数の MHz (MegaHertz) 単位の値を返します。

-

-
window.addEventListener('frequencychange', function () {
-  console.log("周波数が " + navigator.mozFMRadio.frequency + "MHz に変更されました");
-});
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/frequencylowerbound/index.html b/files/ja/web/api/fmradio/frequencylowerbound/index.html deleted file mode 100644 index ac16e95d45..0000000000 --- a/files/ja/web/api/fmradio/frequencylowerbound/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: FMRadio.frequencyLowerBound -slug: Web/API/FMRadio/frequencyLowerBound -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/frequencyLowerBound ---- -
- {{ non-standard_header() }}
-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

frequencyLowerBound プロパティの値は、{{domxref("FMRadio.seek","seek")}} メソッドで検索できるラジオ局の周波数の最小値を示します。

-

構文

-
var max = instanceOfFMRadio.frequencyLowerBound
-

-

MHz (MegaHertz) 単位の数値を返します。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/frequencyupperbound/index.html b/files/ja/web/api/fmradio/frequencyupperbound/index.html deleted file mode 100644 index 2e5e426b61..0000000000 --- a/files/ja/web/api/fmradio/frequencyupperbound/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: FMRadio.frequencyUpperBound -slug: Web/API/FMRadio/frequencyUpperBound -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/frequencyUpperBound ---- -
- {{ non-standard_header() }}
-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

frequencyUpperBound プロパティの値は、{{domxref("FMRadio.seek","seek")}} メソッドで検索できるラジオ局の周波数の最大値を示します。

-

構文

-
var max = instanceOfFMRadio.frequencyUpperBound
-

-

MHz (MegaHertz) 単位の数値を返します。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/index.html b/files/ja/web/api/fmradio/index.html deleted file mode 100644 index 84880d4d92..0000000000 --- a/files/ja/web/api/fmradio/index.html +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: FMRadio -slug: Web/API/FMRadio -tags: - - API - - B2G - - Firefox OS - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

WebFM API は、端末の FM ラジオへのアクセスを提供します。このインターフェースは、FM ラジオの ON、OFF およびチューニングにより他の局への切り替えを可能にします。これらは {{domxref("window.navigator.mozFMRadio","navigator.mozFMRadio")}} プロパティを通してアクセスできます。

-

API 概観

-
interface FMRadio : EventTarget {
-   readonly attribute boolean enabled;
-   readonly attribute boolean antennaAvailable;
-   readonly attribute double frequency;
-   readonly attribute double frequencyUpperBound;
-   readonly attribute double frequencyLowerBound;
-   readonly attribute double channelWidth;
-
-   attribute Function onantennaavailablechange;
-   attribute Function onfrequencychange;
-   attribute Function onenabled;
-   attribute Function ondisabled;
-
-   DOMRequest enable(double frequency);
-   DOMRequest disable();
-   DOMRequest setFrequency(double frequency);
-   DOMRequest seekUp();
-   DOMRequest seekDown();
-   DOMRequest cancelSeek();
-}
-

プロパティ

-
-
- {{domxref("FMRadio.enabled")}}
-
- ラジオが再生中かどうかを示します。
-
- {{domxref("FMRadio.antennaAvailable")}}
-
- アンテナが接続され利用可能かどうかを示します。
-
- {{domxref("FMRadio.frequency")}}
-
- 現在のラジオ周波数を示します。
-
- {{domxref("FMRadio.frequencyUpperBound")}}
-
- seek メソッドで検索するラジオ局の周波数の最大値。
-
- {{domxref("FMRadio.frequencyLowerBound")}}
-
- seek メソッドで検索するラジオ局の周波数の最小値。
-
- {{domxref("FMRadio.channelWidth")}}
-
- 周波数の範囲のチャンネル幅 (MHz 単位)。
-
-

イベントハンドラ

-
-
- {{domxref("FMRadio.onenabled")}}
-
- {{event("enabled")}} イベントのためのハンドラ。ラジオが ON になった時に発火します。
-
- {{domxref("FMRadio.ondisabled")}}
-
- {{event("disabled")}} イベントのためのハンドラ。ラジオが OFF になった時に発火します。
-
- {{domxref("FMRadio.onantennaavailablechange")}}
-
- {{event("antennaavailablechange")}} イベントのためのハンドラ。アンテナが抜き差しされた時に発火します。
-
- {{domxref("FMRadio.onfrequencychange")}}
-
- {{event("frequencychange")}} イベントのためのハンドラ。ラジオ周波数が変更されるたびに発火します。
-
-

メソッド

-
-
- {{domxref("FMRadio.enable()")}}
-
- 与えられた周波数でラジオを ON にします。この関数は、引数なしで呼ばれた場合にエラーを投げます。命令の成功またはエラーを扱う {{domxref("DOMRequest")}} を返します。
-
- {{domxref("FMRadio.disable()")}}
-
- ラジオを OFF にします。{{domxref("DOMRequest")}} を返し、これが成功の場合、ラジオが正しく無効化されたことを示します。
-
- {{domxref("FMRadio.setFrequency()")}}
-
- 非同期でラジオの周波数を変更します。周波数の値は、frequencyLowerBoundfrequencyUpperBound の間にしなければなりません。この範囲外の値をセットしようとするとエラーになります。
-
- {{domxref("DOMRequest")}} を返し、これが成功の場合、周波数が正しく変更されたことを示します。
-
- {{domxref("FMRadio.seekUp()")}}
-
- 次の周波数を探索します (通常は現在よりも高いほうの周波数)。ラジオチャンネルが見つかると、frequencychange イベントが発生します。{{domxref("DOMRequest")}} を返し、これが成功の場合、探索が開始されたことを示します。探索する周波数が上限に達すると、低い周波数に折り返して探索されます。
-
- {{domxref("FMRadio.seekDown()")}}
-
- 上記と同じですが、現在よりも低いほうの周波数を探索します。探索する周波数が下限に達すると、高い周波数に折り返して探索されます。
-
- {{domxref("FMRadio.cancelSeek()")}}
-
- ラジオチャンネルの探索をキャンセルします。{{domxref("DOMRequest")}} を返し、これが成功の場合、周波数の探索がキャンセルされたことを示します。
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/onantennaavailablechange/index.html b/files/ja/web/api/fmradio/onantennaavailablechange/index.html deleted file mode 100644 index caf0caa08d..0000000000 --- a/files/ja/web/api/fmradio/onantennaavailablechange/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: FMRadio.onantennaavailablechange -slug: Web/API/FMRadio/onantennaavailablechange -tags: - - API - - B2G - - DOM - - DOM Reference - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/onantennaavailablechange ---- -

{{ ApiRef() }}

-

概要

-

{{event("antennaavailablechange")}} イベントを受け取るイベントリスナ関数を指定します。このイベントは、端末にアンテナが接続された時、または外された時に発生します。

-

現在のアンテナの状態を確認するには、{{domxref("FMRadio.antennaAvailable")}} プロパティを使用してください。

-

構文

-
navigator.mozFMRadio.onantennaavailablechange = funcRef
-

funcRef の部分は、{{event("antennaavailablechange")}} イベントが発生した時に呼び出される関数です。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/ondisabled/index.html b/files/ja/web/api/fmradio/ondisabled/index.html deleted file mode 100644 index 70b1272f45..0000000000 --- a/files/ja/web/api/fmradio/ondisabled/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: FMRadio.ondisabled -slug: Web/API/FMRadio/ondisabled -tags: - - API - - B2G - - DOM - - DOM Reference - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/ondisabled ---- -

{{ ApiRef() }}

-

概要

-

{{event("disabled")}} イベントを受け取るイベントリスナ関数を指定します。このイベントは、端末の FM ラジオが OFF になると発生します。

-

構文

-
navigator.mozFMRadio.ondisabled = funcRef
-

funcRef の部分は、{{event("disabled")}} イベントが発生した時に呼び出される関数です。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/onenabled/index.html b/files/ja/web/api/fmradio/onenabled/index.html deleted file mode 100644 index 5188ef58ea..0000000000 --- a/files/ja/web/api/fmradio/onenabled/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: FMRadio.onenabled -slug: Web/API/FMRadio/onenabled -tags: - - API - - B2G - - DOM - - DOM Reference - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/onenabled ---- -

{{ ApiRef() }}

-

概要

-

{{event("enabled")}} イベントを受け取るイベントリスナ関数を指定します。このイベントは、端末の FM ラジオが ON になると発生します。

-

構文

-
navigator.mozFMRadio.onenabled = funcRef
-

funcRef の部分は、{{event("enabled")}} イベントが発生した時に呼び出される関数です。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/onfrequencychange/index.html b/files/ja/web/api/fmradio/onfrequencychange/index.html deleted file mode 100644 index bb340ccb5a..0000000000 --- a/files/ja/web/api/fmradio/onfrequencychange/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: FMRadio.onfrequencychange -slug: Web/API/FMRadio/onfrequencychange -tags: - - API - - B2G - - DOM - - DOM Reference - - Firefox OS - - Non Standard - - Property - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/onfrequencychange ---- -

{{ ApiRef() }}

-

概要

-

{{event("frequencychange")}} イベントを受け取るイベントリスナ関数を指定します。このイベントは、ラジオの周波数が変更されるたびに発生します。

-

構文

-
navigator.mozFMRadio.onfrequencychange = funcRef
-

funcRef の部分は、{{event("frequencychange")}} イベントが発生した時に呼び出される関数です。

-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/seekdown/index.html b/files/ja/web/api/fmradio/seekdown/index.html deleted file mode 100644 index cb1caf4d09..0000000000 --- a/files/ja/web/api/fmradio/seekdown/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: FMRadio.seekDown -slug: Web/API/FMRadio/seekDown -tags: - - API - - B2G - - Firefox OS - - Method - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/seekDown ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

seekDown メソッドは、次に低い周波数のラジオチャンネルを探索するために使用します。周波数の下限に到達すると、高い周波数から折り返して検索されます。

-

周波数の変更が成功すると、{{ event("frequencychange")}} イベントが発生します。

-

探索は一度に一回だけが許可されます。seekDown が呼び出されラジオがすでに探索中である場合、要求は失敗します。

-

構文

-
var request = instanceOfFMRadio.seekDown();
-

戻り値

-

命令の成功またはエラーを扱う DOMRequest を返します。

-

-
var request = navigator.mozFMRadio.seekDown();
-
-request.onsuccess = function () {
-  console.log("Searching...");
-}
-
-request.onerror = function () {
-  console.log("I guess we are already seeking.");
-}
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/seekup/index.html b/files/ja/web/api/fmradio/seekup/index.html deleted file mode 100644 index 5a61109c8d..0000000000 --- a/files/ja/web/api/fmradio/seekup/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: FMRadio.seekUp -slug: Web/API/FMRadio/seekUp -tags: - - API - - B2G - - Firefox OS - - Method - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/seekUp ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

seekUp メソッドは、次に高い周波数のラジオチャンネルを探索するために使用します。周波数の上限に到達すると、低い周波数から折り返して検索されます。

-

周波数の変更が成功すると、{{ event("frequencychange")}} イベントが発生します。

-

探索は一度に一回だけが許可されます。seekUp が呼び出されラジオがすでに探索中である場合、要求は失敗します。

-

構文

-
var request = instanceOfFMRadio.seekUp();
-

戻り値

-

命令の成功またはエラーを扱う DOMRequest を返します。

-

-
var request = navigator.mozFMRadio.seekUp();
-
-request.onsuccess = function () {
-  console.log("Searching...");
-}
-
-request.onerror = function () {
-  console.log("I guess we are already seeking.");
-}
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/fmradio/setfrequency/index.html b/files/ja/web/api/fmradio/setfrequency/index.html deleted file mode 100644 index 9cf575a709..0000000000 --- a/files/ja/web/api/fmradio/setfrequency/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: FMRadio.setFrequency -slug: Web/API/FMRadio/setFrequency -tags: - - API - - B2G - - Firefox OS - - Method - - Non Standard - - Reference - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/FMRadio/setFrequency ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

setFrequency メソッドは、ラジオが受信する信号の周波数を変更するために使用します。

-

このメソッドの呼び出しが成功した時に、毎回 {{event("frequencychange")}} イベントが発生します。

-

セットする周波数の値は、{{domxref("FMRadio.frequencyLowerBound","frequencyLowerBound")}} プロパティと {{domxref("FMRadio.frequencyUpperBound","frequencyUpperBound")}} プロパティで定義された範囲内でなければなりません。

-

周波数の値をセットすると、実際にラジオが使用する周波数として渡されますが、{{domxref("FMRadio.channelWidth","channelWidth")}} プロパティの値に従って丸められます。

-

構文

-
var request = instanceOfFMRadio.setFrequency(frequency);
-

引数

-
-
- frequency
-
- セットする新しい周波数の値。これは、MHz (MegaHertz) 単位の数値を表します。
-
-

戻り値

-

命令の成功またはエラーを扱う DOMRequest を返します。

-

-
var request = navigator.mozFMRadio.setFrequency(100.15);
-
-request.onsuccess = function () {
-  console.log("The radio is now listening the frequency: " + navigator.mozFMRadio.frequency + "MHz");
-}
-
-request.onerror = function () {
-  console.log("Something goes wrong!");
-}
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/htmliframeelement/getvisible/index.html b/files/ja/web/api/htmliframeelement/getvisible/index.html deleted file mode 100644 index 6f91260fc9..0000000000 --- a/files/ja/web/api/htmliframeelement/getvisible/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: HTMLIFrameElement.getVisible -slug: Web/API/HTMLIFrameElement/getVisible -tags: - - B2G - - Browser - - Firefox OS - - Non Standard - - WebAPI -translation_of: Mozilla/Gecko/Chrome/API/Browser_API/getVisible ---- -
- {{non-standard_header}} {{B2GOnlyHeader2('privileged')}}
-

概要

-

getVisible メソッドは、 {{HTMLElement("iframe")}} 要素の現在の可視状態の取得に用います。

-

構文

-
instanceOfDOMRequest = instanceOfHTMLIframeElement.getVisible();
-

Return

- -

リクエストの成功とエラーを処理するために {{domxref("DOMRequest")}} オブジェクトを返します。要求が成功した場合、リクエストの result はブラウザ {{HTMLElement("iframe")}} の可視状態を示す真偽値となります。

-

-
var browser = document.querySelector("iframe[mozbrowser]");
-var request = browser.getVisible();
-
-request.onsuccess = function () {
-  console.log("The visible state is: " + this.result ? "true" : "false");
-}
-

仕様

-

どの仕様書にも含まれていません。

-

関連情報

- diff --git a/files/ja/web/api/htmliframeelement/stop/index.html b/files/ja/web/api/htmliframeelement/stop/index.html deleted file mode 100644 index 882a544abb..0000000000 --- a/files/ja/web/api/htmliframeelement/stop/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: HTMLIFrameElement.stop -slug: Web/API/HTMLIFrameElement/stop -tags: - - B2G - - Browser - - Firefox OS - - Non Standard - - WebAPI -translation_of: Mozilla/Gecko/Chrome/API/Browser_API/stop ---- -
{{non-standard_header}} {{B2GOnlyHeader2('privileged')}}
- - -

概要

- -

stop メソッドは {{HTMLElement("iframe")}} のコンテンツの読み込みの停止に用います。

- - -

構文

- -
instanceOfHTMLIframeElement.stop();
- - -

仕様

-

どの仕様書にも含まれていません。

- - -

関連情報

- diff --git a/files/ja/web/api/identitymanager/get/index.html b/files/ja/web/api/identitymanager/get/index.html deleted file mode 100644 index 1d772fd295..0000000000 --- a/files/ja/web/api/identitymanager/get/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: navigator.id.get -slug: Web/API/IdentityManager/get -tags: - - BrowserID - - DOM - - Gecko DOM Reference - - Persona - - Security -translation_of: Archive/IdentityManager/get ---- -
- {{ ApiRef }} {{ non-standard_header }}
-
- 注記: この機能は、まだどのブラウザでもサポートされていません。Persona を使用する Web サイトは、そのページに ポリフィルライブラリ を含めなければなりません。
-

要約

-

この関数は、Web サイトが Persona を使用してユーザの認証ができるようにします。この関数は、コールバック関数を引数に指定した "log in with Persona" ボタンの click ハンドラから呼び出してください。

-

navigator.id.get() は、サインインに使用するメールアドレスの選択をユーザに求めます。ユーザの証明書が期限切れの場合は、Persona のパスワードも求めます。その後、ユーザのメールアドレスとパスワードを含む署名付きの アサーション が生成され、コールバックに渡されます。

-

何らかの理由で署名付きのアサーションが生成できないとき (例えば、ユーザがログインをキャンセルした場合や間違ったパスワードを入力した場合) は、コールバック関数に NULL が渡されて呼び出されます。

-

コールバックが署名付きのアサーションを受け取ったら、検証のためにそれをサーバに送信してください。

-

構文

-
navigator.id.get(gotAssertion);
-navigator.id.get(gotAssertion, {privacyPolicy: "/privacy.html", termsOfService: "/tos.html"});
-

引数

-
-
- gotAssertion
-
- 署名付きのアサーションオブジェクトまたは NULL を引数に持つ関数。コールバック関数で、検証のためにアサーションをサーバに送信してください。
-
- privacyPolicy {{ optional_inline() }}
-
- Web サイトのプライバシーポリシーのページへの絶対パスまたは URL。この引数を指定する場合、termsOfService も指定しなければなりません。termsOfServiceprivacyPolicy の両方を与えた場合、ログインダイアログに "you confirm that you accept this site's Terms of Use and Privacy Policy." というメッセージを表示してサイトの利用規約とプライバシーポリシーを知らせます。これには、それぞれのページへのリンクが含まれます。termsOfService が指定されない場合、この引数は効果がありません。
-
- termsOfService {{ optional_inline() }}
-
- Web サイトの利用規約のページへの絶対パスまたは URL。この引数を指定する場合、privacyPolicy も指定しなければなりません。termsOfServiceprivacyPolicy の両方を与えた場合、ログインダイアログに "you confirm that you accept this site's Terms of Use and Privacy Policy." というメッセージを表示してサイトの利用規約とプライバシーポリシーを知らせます。これには、それぞれのページへのリンクが含まれます。privacyPolicy が指定されない場合、この引数は効果がありません。
-
-

コード例

-

例が必要。

-

仕様

-

まだどの仕様書にも含まれていません。

-

参照

- diff --git a/files/ja/web/api/identitymanager/getverifiedemail/index.html b/files/ja/web/api/identitymanager/getverifiedemail/index.html deleted file mode 100644 index ba681461a2..0000000000 --- a/files/ja/web/api/identitymanager/getverifiedemail/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: navigator.id.getVerifiedEmail -slug: Web/API/IdentityManager/getVerifiedEmail -tags: - - BrowserID - - DOM - - Gecko DOM Reference - - Persona - - Security -translation_of: Archive/IdentityManager/getVerifiedEmail ---- -
- {{ ApiRef }} {{ non-standard_header }} {{ deprecated_header }}
-
- 注記: この機能は、まだどのブラウザでもサポートされていません。Persona を使用する Web サイトは、そのページに ポリフィルライブラリ を含めなければなりません。
-

要約

-

この関数は、Web サイトが BrowserID を使用してユーザの認証ができるようにします。この関数は、コールバック関数を引数に指定した "log in with BrowserID" ボタンの click ハンドラから呼び出してください。

-

navigator.id.getVerifiedEmail() は、サインインに使用するメールアドレスの選択をユーザに求めます。ユーザの証明書が期限切れの場合は、BrowserID のパスワードも求めます。その後、ユーザのメールアドレスとパスワードを含む署名付きの アサーション が生成され、コールバックに渡されます。

-

何らかの理由で署名付きのアサーションが生成できないとき (例えば、ユーザがログインをキャンセルした場合や間違ったパスワードを入力した場合) は、コールバック関数に NULL が渡されて呼び出されます。

-

コールバックが署名付きのアサーションを受け取ったら、検証のためにそれをサーバに送信してください。

-

構文

-
window.navigator.id.getVerifiedEmail(gotAssertion);
-

引数

-
-
- gotAssertion
-
- 署名付きのアサーションオブジェクトまたは NULL を引数に持つコールバック関数。コールバック関数では、検証のためにアサーションをサーバに送信してください。
-
-

コード例

-

例が必要。

-

仕様

-

まだどの仕様書にも含まれていません。

-

参照

- diff --git a/files/ja/web/api/identitymanager/index.html b/files/ja/web/api/identitymanager/index.html deleted file mode 100644 index 561c8e450e..0000000000 --- a/files/ja/web/api/identitymanager/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: IdentityManager -slug: Web/API/IdentityManager -tags: - - API -translation_of: Archive/IdentityManager ---- -

{{APIRef("Persona")}}{{non-standard_header}}

- -

The IdentityManager of the  BrowserID protocol exposes the BrowserID API, via {{domxref("navigator.id")}}. This API has gone through several significant revisions. Each generation is listed separately below.

- -

The "Observer" API (Current)

- -

The Observer API introduces much-requested features, such as an improved post-verification experience for first-time users, automatic persistent logins, and easier integration with native applications.

- -
-
{{ domxref("IdentityManager.watch()")}}
-
Registers callbacks to be invoked when a user logs into or out of a website.
-
{{ domxref("IdentityManager.request()")}}
-
Requests a signed identity assertion from the user.
-
{{ domxref("IdentityManager.logout()")}}
-
Logs the user out of a website and prevents the onlogin action from automatically firing on their next visit.
-
- -
-

Users with third-party cookies disabled may experience problems logging in using the Observer API as detailed in issue 2999.

-
- -

The "Callback" API (Current)

- -

The Callback API was introduced in November 2011. It improved upon the initial API by allowing options to be passed to navigator.id.get() and offering experimental support for BrowserID-managed persistent sessions.

- -
-
{{ domxref("IdentityManager.get()")}}
-
Gets the user's BrowserID in a signed assertion.
-
- -

The "VerifiedEmail" API (Deprecated)

- -

The VerifiedEmail API was BrowserID's first API. It was deprecated at the end of 2011.

- -
-
{{ domxref("IdentityManager.getVerifiedEmail()")}} {{ deprecated_inline() }}
-
Gets the user's BrowserID in a signed assertion. This method is deprecated; {{ domxref("navigator.id.get()")}} is backwards compatible and can be used instead.
-
diff --git a/files/ja/web/api/identitymanager/logout/index.html b/files/ja/web/api/identitymanager/logout/index.html deleted file mode 100644 index e235472220..0000000000 --- a/files/ja/web/api/identitymanager/logout/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: navigator.id.logout -slug: Web/API/IdentityManager/logout -tags: - - BrowserID - - DOM - - Gecko DOM Reference - - Persona - - Security -translation_of: Archive/IdentityManager/logout ---- -
- {{ ApiRef() }} {{ non-standard_header() }}
-
- 注記: この機能は、まだどのブラウザでもサポートされていません。Persona を使用する Web サイトは、そのページに ポリフィルライブラリ を含めなければなりません。
-

要約

-

この関数は、Persona で、Web サイトに対する自動的なログインの持続フラグをリセットするために使用します。この関数が呼び出された後、サイトに自動的にサインインされなくなるので、ユーザが明示的にログインしなおす必要があります。

-

Web サイトは、この関数をサイトの "log out" ボタンの click ハンドラから呼び出さなければなりません。

-

この関数は、ユーザの証明書や署名キーをブラウザに 消去させません。そのため、logout() を呼び出した後、ユーザの ID プロバイダが与えた証明書の新しさに依存して、新たなログインの時に新しいパスワードをユーザに求めたり求めなかったりします。しかし、サインインに使用するメールアドレスの選択は求められます。

-

構文

-
navigator.id.logout();
-

コード例

-
// ユーザが "Sign Out" をクリックした時に navigator.id.logout(); を実行する
-var signoutLink = document.getElementById('signout');
-
-if (signoutLink) {
-  signoutLink.onclick = function(event) {
-    event.preventDefault();
-    navigator.id.logout();
-  };
-};
-

仕様

-

まだどの仕様書にも含まれていません。

-

関連情報

- diff --git a/files/ja/web/api/identitymanager/request/index.html b/files/ja/web/api/identitymanager/request/index.html deleted file mode 100644 index df3d91bdeb..0000000000 --- a/files/ja/web/api/identitymanager/request/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: navigator.id.request -slug: Web/API/IdentityManager/request -tags: - - BrowserID - - DOM - - Gecko DOM Reference - - Persona - - Security -translation_of: Archive/IdentityManager/request ---- -
- {{ ApiRef }} {{ non-standard_header }}
-
- 注記: この機能は、まだどのブラウザでもサポートされていません。Persona を使用する Web サイトは、そのページに ポリフィルライブラリ を含めなければなりません。
-

概要

-

この関数は、Web サイトが Persona を使用してユーザの認証ができるようにします。この関数は click ハンドラから呼び出されなければなりません。例えば、ユーザがページ上の「log in with Persona」ボタンをクリックした時に呼び出します。

-

呼び出された時、navigator.id.request() がユーザにログインするメールアドレスを選択するように求め、さらにユーザの証明書が期限切れの場合は ID プロバイダで認証するように求めます。これらが完了した後、ユーザのメールアドレスとパスワードを含む署名付きの アサーション が生成されます。このアサーションは、{{domxref("navigator.id.watch()")}} で登録された onlogin コールバックに渡されます。

-

この関数は、{{domxref("navigator.id.watch()")}} と連動して 使用されなければなりません

-

構文

-
navigator.id.request();
-navigator.id.request({siteName: 'Example Site', siteLogo: '/logo.png'});
-navigator.id.request({termsOfService: '/tos.html', privacyPolicy: '/privacy.html'});
-
-

引数

-
-
- oncancel {{ optional_inline() }}
-
- この関数は、ユーザが ID をサイトと共有することを拒否した場合に呼び出されます。
-
- privacyPolicy {{ optional_inline() }}
-
- Web サイトのプライバシーポリシーのページへの絶対パスまたは URL。この引数を指定する場合、termsOfService も指定しなければなりません。termsOfServiceprivacyPolicy の両方を与えた場合、ログインダイアログに "you confirm that you accept this site's Terms of Use and Privacy Policy." というメッセージを表示してサイトの利用規約とプライバシーポリシーを知らせます。これには、それぞれのページへのリンクが含まれます。termsOfService が指定されない場合、この引数は効果がありません。
-
- returnTo {{ optional_inline() }}
-
- 新しいユーザが最初にメールアドレスの検証を完了した後に表示されるページへの絶対パス。パスは '/' で始めなければなりません。この引数は、Mozilla のフォールバック ID プロバイダにより証明されたユーザにのみ影響します。
-
- siteLogo {{ optional_inline() }}
-
- ログインダイアログに表示する、画像への絶対パス。パスは '/' で始めなければなりません。また、SSL 経由の読み込みが可能でなければなりません。大きなサイズの画像は 100×100 ピクセルに収まるサイズに縮小されます。
-
- siteName {{ optional_inline() }}
-
- ログインダイアログに表示する、サイトのプレーンテキスト表記。Unicode 文字列とスペースは使えますが、マークアップはできません。
-
- termsOfService {{ optional_inline() }}
-
- Web サイトの利用規約のページへの絶対パスまたは URL。この引数を指定する場合、privacyPolicy も指定しなければなりません。termsOfServiceprivacyPolicy の両方を与えた場合、ログインダイアログに "you confirm that you accept this site's Terms of Use and Privacy Policy." というメッセージを表示してサイトの利用規約とプライバシーポリシーを知らせます。これには、それぞれのページへのリンクが含まれます。privacyPolicy が指定されない場合、この引数は効果がありません。
-
-

-
var signinLink = document.getElementById('signin');
-if (signinLink) {
-  signinLink.onclick = function(evt) {
-    // ユーザから署名付き ID アサーションを要求する
-    navigator.id.request({
-      siteName: 'My Example Site',
-      siteLogo: '/logo.png',
-      termsOfService: '/tos.html',
-      privacyPolicy: '/privacy.html',
-      returnTo: '/welcome.html',
-      oncancel: function() { alert('ユーザが ID の共有を拒否しました。'); }
-    });
-  };
-}
-

仕様

-

まだどの仕様書にも含まれていません。

-

関連情報

- diff --git a/files/ja/web/api/identitymanager/watch/index.html b/files/ja/web/api/identitymanager/watch/index.html deleted file mode 100644 index 7daf89d3ac..0000000000 --- a/files/ja/web/api/identitymanager/watch/index.html +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: navigator.id.watch -slug: Web/API/IdentityManager/watch -tags: - - BrowserID - - DOM - - Persona -translation_of: Archive/IdentityManager/watch ---- -
{{ApiRef}} {{non-standard_header}}
- -
注記: この機能は、まだどのブラウザでもサポートされていません。Persona を使用する Web サイトは、そのページに ポリフィルライブラリ を含めなければなりません。
- -

概要

- -

この関数は、Persona ユーザのログインとログアウトに応答するコールバックを登録します。

- -

構文

- -
navigator.id.watch({
-  loggedInUser: 'bob@example.org',
-  onlogin: function(assertion) {
-    // ユーザがログインしました! ここで必要なことは:
-    // 1. 検証とセッション作成のためのアサーションをバックエンドに送信する。
-    // 2. UI を更新する。
-  },
-  onlogout: function() {
-    // ユーザがログアウトしました! ここで必要なことは:
-    // リダイレクトするかバックエンドの呼び出しを行って、ユーザのセッションを破棄する。
-  }
-});
-
- -

引数

- -
-
loggedInUser {{optional_inline}}
-
このパラメーターはユーザーの状態がどうなっているはずであるかを Persona に伝えるものです。値は文字列か null あるいは undefined です。
-
文字列はユーザーがサイトに現在ログインしているはずであることを表します。この文字列はそのユーザーの E-mail アドレスであって,大文字/小文字は区別します。null は誰もログインしていないはずであることを表します。このパラメーターを省略するか,あるいは undefined を与えるのは,ユーザーがログインしているか否か不明であることを意味します。
-
Persona は常に,ユーザーはサイトにログインしたいか,あるいはしたくないのだと考えています。Persona は loggedInUser の値を自らの信ずるところ(訳注:Persona が認識しているユーザー)と比較し,この二つの状態を一致させるため,(以下の表のごとくに)適切な関数を呼び出します:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loggedInUserPersona's StateCallback
null"foo@example.com"onlogin()
undefined"foo@example.com"onlogin()
"bar@example.com""foo@example.com"onlogin()
"foo@example.com""foo@example.com"none
nullnullnone
"foo@example.com"nullonlogout()
undefinednullonlogout()
-
-
ページが読み込まれた時に Persona が自動的に呼び出すのは onloginonlogoutどちらか であることに注意してください。両方 呼ばれることはありません(訳注:表のとおりどちらも呼ばれないことはある)。loggedInUserfoo@example.com がセットされているのに、Persona が bar@example.com がログインしていると認識している場合、onlogin のみが呼び出されます。この場合、第1引数として bar@example.com のアサーションが渡されます。
-
onlogin
-
ユーザがログインした時に、1 個の引数としてアサーションが渡され、呼び出される関数。この関数は、検証のためにアサーションをサイトのバックエンドに送信します。検証が成功した場合、バックエンドでユーザのセッションを確立し、この関数内で UI (ログインボタン) を適切なものに更新してください。
-
onlogout {{ optional_inline() }}
-
ユーザがログアウトした時に、引数なしで呼び出される関数。この関数で、サイトのバックエンドを呼び出すかユーザをリダイレクトすることにより、ユーザのセッションを破棄してください。
-
onlogout が与えられなかったとき Observer API によるセッション管理は無効化されます。onreadyonlogin だけが呼び出されます。onlogin は、ユーザーによるログイン操作の反応としてしか呼び出されません(つまりユーザーがログインしていた場合に自動的に呼び出されたりはしません)。
-
onready {{ optional_inline() }}
-
A function that will be invoked when the user agent is initialized and able to process calls to id.request and id.logout. The onready callback will be invoked immediately after any automatic invocations of onlogin, onlogout, or onmatch. By waiting to display UI until onready is called, relying parties can avoid UI flicker in cases where the user agent's preferred state is out of sync with the site's session.
-
Note that onready will not be invoked after calls to id.request or id.logout. It is the punctuation mark that concludes the conversation started by watch.
-
- -

コード例

- -
-
navigator.id.watch({
-  loggedInUser: currentUser, // This is email of current user logged into your site
-
-  onlogin: function(assertion) {
-
-    $.ajax({ // This example uses jQuery, but you can use whatever you'd like
-      type: 'POST',
-      url: '/auth/login', // This is a URL on your website.
-      data: {assertion: assertion}
-      success: function(res, status, xhr) { window.location.reload(); },
-      error: function(xhr, status, err) {
-        navigator.id.logout();
-        alert("Login failure: " + err);
-      }
-    });
-  },
-
-  onlogout: function() {
-    $.ajax({
-      type: 'POST',
-      url: '/auth/logout', // This is a URL on your website.
-      success: function(res, status, xhr) { window.location.reload(); },
-      error: function(xhr, status, err) { alert("Logout failure: " + err); }
-    });
-  }
-
-});
-
- -

仕様

- -

まだどの仕様書にも含まれていません。

- -

関連情報

- - diff --git a/files/ja/web/api/indexeddb_api/using_indexeddb_in_chrome/index.html b/files/ja/web/api/indexeddb_api/using_indexeddb_in_chrome/index.html deleted file mode 100644 index c55da4940f..0000000000 --- a/files/ja/web/api/indexeddb_api/using_indexeddb_in_chrome/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: chrome(ブラウザー内部) で IndexedDB を使う -slug: Web/API/IndexedDB_API/Using_IndexedDB_in_chrome -translation_of: Mozilla/Tech/XPCOM/Using_IndexedDB_in_chrome ---- -
{{DefaultAPISidebar("IndexedDB")}}
- -

IndexedDB API は、通常、コンテンツ JavaScript からユーザーのブラウザーにデータを格納するために使用されます(概要については IndexedDB の使用を参照してください) 。ただし、この API には、システム特権の JavaScript から、Components.utils.importGlobalProperties() 関数を使用してアクセスすることもできます:

- -
Components.utils.importGlobalProperties(["indexedDB"]);
-
-// ここからは、コンテンツから IndexedDB を使うのと同様
-var req = indexedDB.open("my-database");
-// ...
- -

サンドボックスを作成していて、その中で indexedDB を使用できるようにするには、Sandbox コンストラクタで wantGlobalProperties オプションを使用します:

- -
var options = {
-  "wantGlobalProperties": ["indexedDB"]
-}
-var principal = Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal);
-var sandbox = Components.utils.Sandbox(principal, options);
-
-// サンドボックスから indexedDB にアクセスできるようになる
-var sandboxScript = 'var req = indexedDB.open("my-database");';
-Components.utils.evalInSandbox(sandboxScript, sandbox);
-
- -

Firefox 33以前では、nsIIndexedDatabaseManager サービスの initWindowless メソッドを使用して chrome コードから indexedDB にアクセスしました。このメソッドは Firefox 33 で削除されました。

- -
-

訳注: ここでの chrome コードとは、Google chrome ではなく、chrome特権付きのコードを指しています

-
diff --git a/files/ja/web/api/moznfc/index.html b/files/ja/web/api/moznfc/index.html deleted file mode 100644 index 221ee0a161..0000000000 --- a/files/ja/web/api/moznfc/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: MozNFC -slug: Web/API/MozNFC -tags: - - API - - Firefox OS - - Interface - - MozNFC - - NFC - - Reference -translation_of: Archive/B2G_OS/API/MozNFC ---- -

- -

MozNFC は、NFC の Reader/Writer モード、P2P モード、カードエミュレーションモードを操作するトップレベル API です。

- -
-

注記: このインターフェイスは Navigator.mozNfc 属性を経由してアクセスされます。

-
- -

イベントハンドラ

- -
-
- -
-
MozNFC.onpeerfound
-
NFC デバイスが検出された場合、onpeerfound イベントのコールバック関数が呼び出されます。 Firefox OS 2.2 以上で利用可能です。
-
- -
-
MozNFC.onpeerlost
-
onpeerfound で検出された peer オブジェクトがアプリケーションから参照できなくなった場合、onpeerlost イベントのコールバック関数が呼び出されます。(peer デバイスが通信範囲外へ移動した場合など)
-
- -
-
MozNFC.ontagfound
-
NFCタグが発見された場合、ontagfound イベントがコールバックされます。Firefox OS 2.2 以上で利用可能です。
-
- -
-
MozNFC.ontaglost
-
ontagfound 中の tag object がアプリケーションから参照できなくなった場合、ontaglost イベントがコールバックされます。(タグが領域外へ移動した場合など) Firefox OS 2.2 以上で利用可能です。
-
- -

仕様

- -

Gecko の NFC の実装は NFC Forum specifications に準拠しています。

- -
-
- -

ブラウザ実装状況

- -

現在、互換性データを可読形式の JSON フォーマットに置き換えているところです。 - この互換性一覧は古い形式を使っており、これに含まれるデータの置き換えが済んでいません。 - 手助けしていただける場合は、こちらから!

- -
- - -

- -
- - - - - - - - - - - - - - - - - - - -
機能ChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
基本サポート -

未サポート

-
未サポート未サポート未サポート未サポート
-
- -
- - - - - - - - - - - - - - - - - - - - - -
機能AndroidFirefox Mobile (Gecko)Firefox OS (Gecko)IE PhoneOpera MobileSafari Mobile
基本サポート未サポート未サポート2.0 moz [1]未サポート未サポート未サポート
-
- -

[1] Firefox OS 2.2 の特権アプリで利用可能です。以前は認証アプリでのみ利用可能でした。

- -

関連情報

- - diff --git a/files/ja/web/api/moznfc/onpeerfound/index.html b/files/ja/web/api/moznfc/onpeerfound/index.html deleted file mode 100644 index 68db382343..0000000000 --- a/files/ja/web/api/moznfc/onpeerfound/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: MozNFC.onpeerfound -slug: Web/API/MozNFC/onpeerfound -tags: - - API - - Reference -translation_of: Archive/B2G_OS/API/MozNFC/onpeerfound ---- -

-

非標準
- この機能は標準ではなく、標準化の予定もありません。公開されているウェブサイトには使用しないでください。ユーザーによっては使用できないことがあります。実装ごとに大きな差があることもあり、将来は振る舞いが変わるかもしれません。

-

- -

- -

MozNFC インターフェースの onpeerfound イベントハンドラは、MozNFCPeer が検出された時にの呼び出されます 。

- -

このイベントを受け取るためには、アプリケーションをフォアグラウンド (システムアプリによって決まります) で実行している必要があります。

- -

このイベントのデフォルトの挙動は、システムアプリで再度このイベントをディスパッチすることです。この場合、システムアプリはデフォルトの挙動を行います(例えばバイブレーションなど)。もしアプリケーションがこのイベントをキャンセルしたい場合は、アプリケーションから event.preventDefault() を呼ぶか、このイベントハンドラ内で false を返す必要があります。

- -

構文

- -
attribute EventHandler onpeerfound;
- -

プロパティ

- -

peer : NFCPeer オブジェクト

diff --git a/files/ja/web/api/mozsocial/closepanel/index.html b/files/ja/web/api/mozsocial/closepanel/index.html deleted file mode 100644 index be59b68ee7..0000000000 --- a/files/ja/web/api/mozsocial/closepanel/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: MozSocial.closePanel -slug: Web/API/MozSocial/closePanel -tags: - - DOM - - Gecko DOM Reference - - Social -translation_of: Archive/Social_API/MozSocial/closePanel ---- -
- {{ApiRef}}{{non-standard_header}}{{fx_minversion_header("17.0")}}
-

概要

-

親のソーシャルメディアプロバイダーパネルの内、現在開いているソーシャルパネルを閉じます。

-

構文

-
MozSocial.closePanel();
-
-

引数

-

無し

-

仕様

-

どの仕様書にも含まれていません。

diff --git a/files/ja/web/api/mozsocial/index.html b/files/ja/web/api/mozsocial/index.html deleted file mode 100644 index a2f559a9df..0000000000 --- a/files/ja/web/api/mozsocial/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: MozSocial -slug: Web/API/MozSocial -tags: - - API -translation_of: Archive/Social_API/MozSocial ---- -
{{ ApiRef("Social API") }} {{non-standard_header}}{{fx_minversion_header("17.0")}}
- -

The MozSocial object, returned by the navigator.mozSocial property, is available within the social media provider's panel to provide functionality it may need.

- -
-

Note: Although Mozilla hopes to submit this API for standardization eventually, it has not yet done so.

-
- -

Properties

- -
-
{{domxref("MozSocial.isVisible")}}
-
Returns a Boolean value; the result is true if the content is visible, otherwise it's false.
-
- -

Methods

- -
-
{{domxref("MozSocial.closePanel()")}}
-
Closes the currently open flyout panel.
-
{{domxref("MozSocial.getAttention()")}}
-
Performs some action designed to get the user's attention; the exact behavior may vary from platform to platform. This might display a visual effect, play an audible notification, flash the screen, or use some other technique.
-
{{domxref("MozSocial.getWorker()")}}
-
Returns a reference to the service worker; once content has this reference, it can call worker.port.postMessage() method to communicate with the service.
-
{{domxref("MozSocial.openChatWindow()")}}
-
Opens a chat window that is anchored to the bottom of the browser window. Each chat window is expected to be a singular chat, but functionality may vary by provider.
-
{{domxref("MozSocial.openPanel()")}}
-
Opens a flyout panel attached to the sidebar at a given vertical offset. This might be, for example, used to display the actual conversation corresponding to a notification in the sidebar.
-
{{domxref("MozSocial.share()")}}
-
Initiates a share action via the SocialAPI Share panel.  One argument is passed, an object containing "url", "title", "description", "source" and "image".
-
- -

See also

- - diff --git a/files/ja/web/api/mozsocial/isvisible/index.html b/files/ja/web/api/mozsocial/isvisible/index.html deleted file mode 100644 index e40fdffd5b..0000000000 --- a/files/ja/web/api/mozsocial/isvisible/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: MozSocial.isVisible -slug: Web/API/MozSocial/isVisible -tags: - - DOM - - Gecko DOM Reference - - Social -translation_of: Archive/Social_API/MozSocial/isVisible ---- -
- {{ApiRef}}{{non-standard_header}}{{fx_minversion_header("17.0")}}
-

概要

-

ソーシャルメディアプロバイダのコンテンツサイドバーが現在表示されているかどうかを示します。

-

構文

-
var visible = navigator.MozSocial.isVisible
-
-

サイドバーが表示されている場合、visibletrue に、非表示の場合 false となります。

-

仕様書

-

どの仕様書にも含まれていません。

-

関連情報

- diff --git a/files/ja/web/api/moztimemanager/index.html b/files/ja/web/api/moztimemanager/index.html deleted file mode 100644 index f841b18ed8..0000000000 --- a/files/ja/web/api/moztimemanager/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: MozTimeManager -slug: Web/API/MozTimeManager -tags: - - B2G - - Firefox OS - - Non-standard - - Time - - WebAPI -translation_of: Archive/B2G_OS/API/MozTimeManager ---- -
{{APIRef("Firefox OS")}} {{non-standard_header}} {{B2GOnlyHeader2('certified')}}
- -

概要

- -

MozTimeManager インタフェースはデバイスのシステム時間の設定に用います。

- -

インタフェースの概要

- -
interface MozTimeManager
-{
-  void set((double or Date) time);
-}
- -

プロパティ

- -

無し

- -

メソッド

- -
-
{{domxref("MozTimeManager.set()")}}
-
システム時間を設定する
-
- -

仕様

- -

標準仕様書には含まれていません。

- -

関連情報

- - diff --git a/files/ja/web/api/navigator/id/index.html b/files/ja/web/api/navigator/id/index.html deleted file mode 100644 index 375c08c5de..0000000000 --- a/files/ja/web/api/navigator/id/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: navigator.id -slug: Web/API/Navigator/id -tags: - - BrowserID - - DOM - - Gecko DOM Reference - - Persona - - Security -translation_of: Archive/Navigator-id ---- -
- {{ ApiRef() }} {{ non-standard_header() }}
-
- 注記: この機能は、まだどのブラウザでもサポートされていません。Persona を使用する Web サイトは、そのページに https://login.persona.org/include.js でホストされているポリフィルライブラリを含めなければなりません。
-

要約

-

BrowserID プロトコル は、BrowserID API を開示する {{ domxref ("window.navigator")}} オブジェクトに新しい id プロパティを定義しています。この API はいくつかの重要なリビジョンを経ています。各世代別の API は以下の通りです。

-

"Observer" API (現在)

-

Observer API は、初めて利用したユーザに対する検証後の振る舞いの改善、自動的なログインの持続、ネイティブアプリケーションへの簡単な統合など、多くのリクエストがあった機能を導入しています。

-
-
- {{ domxref("navigator.id.watch()")}}
-
- ユーザが Web サイトにログインまたはログアウトした時に呼び出されるコールバックを登録します。
-
- {{ domxref("navigator.id.request()")}}
-
- ユーザからの署名付き ID アサーションを要求します。
-
- {{ domxref("navigator.id.logout()")}}
-
- ユーザを Web サイトからログアウトし、次回そのユーザが Web サイトを訪れた時に自動的に onlogin が実行されることを防ぎます。
-
-
-

ユーザがサードパーティーのクッキーを無効にしている場合、Observer API を使用してのログイン時に問題が発生する可能性があります(※参照: onlogout called immediately after onlogin if 3rd party cookies are disabled · Issue #2999 · mozilla/browserid

-
-

"Callback" API (現在)

-

Callback API は、2011 年 11 月に導入されました。この API は、navigator.id.get() にオプションが渡されることを許可し、BrowserID が管理する持続的なセッションの実験的なサポートを提供して初期の API を改善するためのものです。

-
-
- {{ domxref("navigator.id.get()")}}
-
- ユーザの署名付きアサーション内の BrowserID を取得します。
-
-

"VerifiedEmail" API (非推奨)

-

VerifiedEmail API は、BrowserID の最初の API でした。この API は、2011 年末に非推奨になりました。

-
-
- {{ domxref("navigator.id.getVerifiedEmail()")}} {{ deprecated_inline() }}
-
- ユーザの署名付きアサーション内の BrowserID を取得します。このメソッドは非推奨です。代わりに、後方互換性を持つ {{ domxref("navigator.id.get()")}} を使用してください。
-
diff --git a/files/ja/web/api/navigator/mozcameras/index.html b/files/ja/web/api/navigator/mozcameras/index.html deleted file mode 100644 index 2b67cbfe87..0000000000 --- a/files/ja/web/api/navigator/mozcameras/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Navigator.mozCameras -slug: Web/API/Navigator/mozCameras -tags: - - API - - DOM - - Firefox OS - - Gecko DOM Reference - - Graphics - - Non Standard - - Property - - WebAPI -translation_of: Archive/B2G_OS/API/Navigator/mozCameras ---- -

{{APIRef("Firefox OS")}}

- -

{{ non-standard_header() }}

- -

{{B2GOnlyHeader2('privileged')}}

- -

概要

- -

ユーザの端末で利用可能なカメラへのアクセスに用いる {{domxref("CameraManager")}} オブジェクトを返します。

- -

構文

- -
var cameraManager = window.navigator.mozCameras;
-
- -

- -

navigator.mozCameras は、端末で利用可能なカメラへのアクセスに用いる {{domxref("CameraManager")}} オブジェクトです。

- -

仕様

- -

標準仕様には含まれていません。WebRTC がモバイル端末で広くサポートされるようになった時、これと置き換えられる予定です。

- -

許可設定

- -

Firefox OS 1.4 まで、Camera API は Certified API だったためサードパーティアプリからはアクセスできませんでした。Firefox OS 2.0 からは許可レベルが Privileged に下げられたため、開発者が独自のアプリで利用できるようになりました。

- -
"permissions": {
-  "camera": {
-    "description": "Required for accessing cameras on the device."
-  }
-}
- -

関連情報

- - diff --git a/files/ja/web/api/navigator/mozfmradio/index.html b/files/ja/web/api/navigator/mozfmradio/index.html deleted file mode 100644 index 271629e8d7..0000000000 --- a/files/ja/web/api/navigator/mozfmradio/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Navigator.mozFMRadio -slug: Web/API/Navigator/mozFMRadio -tags: - - API - - Non-standard - - Property -translation_of: Archive/B2G_OS/API/Navigator/mozFMRadio ---- -

{{APIRef}}{{ non-standard_header() }}

- -

{{ B2GOnlyHeader2('installed') }}

- -

概要

- -

端末の FM ラジオへのアクセスに使用できる {{ domxref("FMRadio") }} オブジェクトを返します。

- -

構文

- -
var WebFM = navigator.mozFMRadio;
-
- -

- -

navigator.mozFMRadio は {{domxref("FMRadio")}} オブジェクトです。

- -

仕様書

- -

仕様の一部ではありません。

- -

参照

- - diff --git a/files/ja/web/api/navigator/mozpay/index.html b/files/ja/web/api/navigator/mozpay/index.html deleted file mode 100644 index 5226b8eb62..0000000000 --- a/files/ja/web/api/navigator/mozpay/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Navigator.mozPay() -slug: Web/API/Navigator/mozPay -tags: - - API - - Apps - - B2G - - Firefox OS - - Method - - Non Standard - - Web Payment - - WebAPI -translation_of: Archive/Marketplace/API/Navigator/mozPay ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

mozPay 関数は決済の実行に使用され、アプリ内課金を実現します。

-

構文

-
var request = navigator.mozPay(jwts);
-
-
-
- jwts
-
- JSON Web トークン の配列。
-
-
-

警告: 署名は アプリケーション秘密鍵 に由来することから、JSON Web トークンへの署名は必ずサーバサイドで行う必要があります。権限のないユーザがアプリケーション秘密鍵へアクセスすることのないよう注意してください。

-
-

戻り値

-

{{domxref("DOMRequest")}} オブジェクト。

-

-
// 購入を開始します。具体的にはこれを「購入」ボタン上のクリックハンドラに設定します。
-purchaseSomething("A nice unicorn");
-
-function purchaseSomething(productID) {
-  var xhr = new XMLHttpRequest();
-  xhr.responseType = 'json';
-
-  // productID をサーバへ送信し、
-  // JWT の配列を受け取る準備をします。
-  xhr.open('POST', '/create_jwts');
-
-  xhr.addEventListener('load', function () {
-    // JSON レスポンスから JWT と transactionID を受け取ります。これは以下のような形式です。
-    // {"jwts": ["jwt1...", "jwt2..."], "transactionID": "1234"}
-    var jwts = xhr.response.jwts;
-    var transactionID = xhr.response.transactionID;
-
-    // JSON Web トークンを決済プロバイダに渡します。
-    var request = navigator.mozPay(jwts);
-
-    // 決済ウィンドウのために成功・失敗ハンドラを用意します。
-    request.onsuccess = function () {
-      console.log('ユーザの決済フローが正常に完了しました');
-      // 決済フローは完了しましたが、決済が成立したことを確認するため、
-      // サーバへポーリングを行って検証された決済結果を待ちます。
-      waitForPaymentResult(transactionID);
-    };
-    request.onerror = function () {
-      console.log('申し訳ありませんが、決済フローにエラーが発生しました: ', this.error.name);
-    };
-  })
-
-  // 情報を送信して決済リクエストを開始し、
-  // 署名済み JSON Web トークンを受け取ります。
-  // この例では、productID はユーザが購入したい商品の ID です。
-  xhr.send(productID);
-}
-
-function waitForPaymentResult(transactionID) {
-  var xhr = new XMLHttpRequest();
-  xhr.responseType = 'json';
-
-  // transactionID のためにポストバック・チャージバックを受信したことを確認する準備をします。
-  xhr.open('GET', '/payment_result/' + transactionID);
-
-  xhr.addEventListener('load', function () {
-    // 以下のような結果を取得します。
-    // {"result": "postback received"} or {"result": "still waiting"}
-    if (xhr.response.result == 'postback received') {
-      // ポストバック通知を受信し、そこに含まれる JWT 署名を検証しました。
-      console.log('成功! 商品は購入されました');
-    } else {
-      // ポストバック・チャージバックがまだサーバへ送信されていません。3 秒後に再試行します。
-      window.setTimeout(function() { waitForPaymentResult(transactionID); }, 3000);
-    }
-  });
-
-  // リクエストを送信し transactionID のステータスを確認します。
-  xhr.send();
-}
-

仕様

-

どの仕様書にも含まれていません。ただしこの話題は W3C の Web Payment Community Group において盛んに議論されています。

-

関連記事

- diff --git a/files/ja/web/api/navigator/mozsettings/index.html b/files/ja/web/api/navigator/mozsettings/index.html deleted file mode 100644 index fb06aa962c..0000000000 --- a/files/ja/web/api/navigator/mozsettings/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: window.navigator.mozSettings -slug: Web/API/Navigator/mozSettings -tags: - - B2G - - Firefox OS - - Non Standard - - WebAPI -translation_of: Archive/B2G_OS/API/Navigator/mozSettings ---- -
{{non-standard_header}}{{B2GOnlyHeader2("certified")}}
- - -

概要

-

デバイス設定へのアクセス及びデバイス設定の変更のための {{domxref("SettingsManager")}} オブジェクトを返します。

- - - -

構文

-
settings = window.navigator.mozSettings;
-
- - -

仕様

-

この API はまだ標準仕様に含まれるものではありませんが、現在、 W3C の System Applications Working Group で議論されています。

- - -

関連情報

- diff --git a/files/ja/web/api/navigator/mozsms/index.html b/files/ja/web/api/navigator/mozsms/index.html deleted file mode 100644 index defb9326b5..0000000000 --- a/files/ja/web/api/navigator/mozsms/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: window.navigator.mozSms -slug: Web/API/Navigator/mozSms -tags: - - DOM - - Gecko DOM Reference - - Mobile - - WebSMS -translation_of: Archive/B2G_OS/API/Navigator/mozSms ---- -
- {{ApiRef}}{{non-standard_header}}
-

概要

-

SMS メッセージの送受信に用いることが出来る {{domxref("SmsManager")}} オブジェクトを返します。

-

構文

-
var sms = window.navigator.mozSms;
-
-

ブラウザ実装状況

-

主にモバイルブラウザでのサポートが期待されます。

- - - - - - - - - - - - - - - - - - - -
機能AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本サポート{{CompatNo}}{{CompatGeckoMobile("12.0")}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-

設定 / 可用性

- -

仕様書

-

標準仕様には含まれていません。ただし、WebSMS design document に基づく提案が予定されています。

-

関連情報

- diff --git a/files/ja/web/api/navigator/mozsocial/index.html b/files/ja/web/api/navigator/mozsocial/index.html deleted file mode 100644 index b5e28e701f..0000000000 --- a/files/ja/web/api/navigator/mozsocial/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: navigator.mozSocial -slug: Web/API/Navigator/mozSocial -tags: - - DOM - - Gecko DOM Reference - - Social -translation_of: Archive/mozSocial ---- -
- {{ApiRef}}{{non-standard_header}}{{fx_minversion_header("17.0")}}
-

navigator.mozSocial プロパティによって返される MozSocial オブジェクトは、ソーシャルメディアプロバイダーパネル内で利用することができます。ソーシャルメディアプロバイダーパネルが必要とする機能を提供します。

-
-

注記: Mozilla は最終的に標準化のためにこの API の提出を予定していますが、まだ実行には至っていません。

-
-

属性

-
-
- {{domxref("MozSocial.isVisible")}}
-
- 真偽値を返す。コンテンツが表示されている場合は true を、表示されていない場合は false を返す。
-
-

メソッド

-
-
- {{domxref("MozSocial.closePanel()")}}
-
- 現在開いているフライアウトパネルを閉じます。
-
- {{domxref("MozSocial.getAttention()")}}
-
- ユーザの注意を引くために設計されたいくつかのアクションを実行します。実際の動作はプラットフォームによって異なる場合があり、ヴィジュアル効果、音声通知、画面の点滅、または他のいくつかの技術が用いられる場合があります。
-
- {{domxref("MozSocial.getWorker()")}}
-
- サービスワーカーへの参照を返します。コンテンツが一度この参照を持つと、サービスとの通信のために、worker.port.postMessage() メソッドを呼び出すことが可能となります。
-
- {{domxref("MozSocial.openChatWindow()")}}
-
- ブラウザウィンドウの下部に固定されたチャットウィンドウを開きます。その機能は概ね個人チャットとなると考えられますが、提供者によって異なる場合があります。
-
- {{domxref("MozSocial.openPanel()")}}
-
- 指定された垂直オフセットで、サイドバーに付属するフライアウトパネルを開きます。これは例えば、サイドバー通知に対応する実際の対話の表示に用いられます。
-
-

関連情報

- diff --git a/files/ja/web/api/settings_api/index.html b/files/ja/web/api/settings_api/index.html deleted file mode 100644 index 1f41812c59..0000000000 --- a/files/ja/web/api/settings_api/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: Settings API -slug: Web/API/Settings_API -tags: - - API - - Firefox OS - - Non-standard - - Reference - - Settings API -translation_of: Archive/B2G_OS/API/Settings_API ---- -

{{DefaultAPISidebar("Settings API")}}{{ non-standard_header() }}

- -

{{ B2GOnlyHeader2('certified') }}

- -

Settings API はデバイス設定へのアクセス、監視、変更を行うための手段です。デバイス設定にはシステムを危険に晒す可能性のある、慎重に取り扱うべき情報が含まれるため、認定アプリのみこのAPIを利用することができます。

- -

デバイス設定の利用

- -

デバイス設定は {{domxref("SettingsManager")}} インターフェースのインスタンスである {{domxref("navigator.mozSettings")}} オブジェクトを経由して操作することができます。

- -

デバイス設定へのアクセス

- -

デバイス設定にアクセスするには、まず {{domxref("SettingsManager.createLock()","createLock()")}} メソッドを呼び出して "lock" を作成する必要があります。これは複数のアプリがデバイス設定を同時に呼び出して設定の変更を行う可能性があるため、他のアプリに干渉しないようにする必要があるからです。"lock" 作成することで、特定の期間内にひとつのアプリのみがデバイス設定にアクセスできることを保証します。

- -

"lock" を作成したら、アプリは {{domxref("SettingsLock.get()","get()")}} 関数を利用して様々な設定情報を取得することができます。この関数はリクエストの成功または失敗を示す {{domxref("DOMRequest")}} オブジェクトを返します。リクエストが完了すると、(結果の成功または失敗にかかわらず)"lock" は例外なく自動的に解放されて他のアプリにデバイス設定へのアクセスを譲ります。必要に応じて "lock" の {{domxref("SettingsLock.closed","closed")}} プロパティを参照し "lock" が解放されたかどうか確認することもできます。

- -

以下のコードは "lock" を作成してシステムの wifi.enabled 設定を取得しています。取得結果は {{domxref("console.log()")}} によりコンソールに出力されます。

- -
var lock    = navigator.mozSettings.createLock();
-var setting = lock.get('wifi.enabled');
-
-setting.onsuccess = function () {
-  console.log('wifi.enabled: ' + setting.result);
-}
-
-setting.onerror = function () {
-  console.warn('An error occured: ' + setting.error);
-}
-
- -

デバイス設定の変更

- -

設定値の変更手順は、{{domxref("SettingsLock.set()","set()")}} 関数を呼び出す以外は設定値の取得と全く同じです。この関数は設定変更の成功または失敗を示す {{domxref("DOMRequest")}} オブジェクトを返します。

- -

{{domxref("SettingsLock.set()","set()")}} は引数としてオブジェクトを渡す必要があります。オブジェクトは設定名称をキーとし、変更後の値を対とするキーペアの集合です。設定可能な値については Firefox OS settings list を参照して下さい(ただし設定できる項目がデバイス毎に異なる場合があることに注意して下さい)。

- -

以下のコードは "lock" を作成してシステムの wifi.enabled 設定を変更し、その結果をコンソールに出力します。

- -
var lock = navigator.mozSettings.createLock();
-var result = lock.set({
-  'wifi.enabled': true
-});
-
-result.onsuccess = function () {
-  console.log("the settings has been changed");
-}
-
-result.onerror = function () {
-  console.log("An error occure, the settings remain unchanged");
-}
- -

デバイス設定の変更を監視する

- -

設定の取得や変更だけでなく、アプリはデバイス設定への変更を監視することもできます。システムは設定が変更される毎に {{event("settingchange")}} イベントを発火します。. これは {{domxref("MozSettingsEvent")}} イベントの一つで、通常のイベントに加えて以下の追加プロパティを保持します。

- - - -

{{event("settingchange")}} イベントを監視するには、設定の変更毎に呼び出される {{domxref("SettingsManager.onsettingchange")}} にコールバック関数を渡します。また、{{domxref("SettingsManager.addObserver()")}} 関数を利用すると、特定の設定に限定して変更を監視する事もできます。

- -
function handleWifi(event) {
-  if (event.settingValue === true) {
-    console.log("Hey! I can download that crazy heavy 4GB file")
-  } else {
-    console.log("Oh! I should stop downloading that crazy 4GB file")
-  }
-}
-
-navigator.mozSettings.addObserver('wifi.enabled', handleWifi);
-
- -

仕様

- -

草案。これは正式な仕様ではありませんが、W3Cにおいて System Applications Working Group の一部として協議される予定です。

- -

参考

- - diff --git a/files/ja/web/api/simple_push_api/index.html b/files/ja/web/api/simple_push_api/index.html deleted file mode 100644 index b67dc801e2..0000000000 --- a/files/ja/web/api/simple_push_api/index.html +++ /dev/null @@ -1,189 +0,0 @@ ---- -title: Simple Push -slug: Web/API/Simple_Push_API -tags: - - API - - B2G - - Firefox OS - - Non-standard - - Simple Push API - - WebAPI -translation_of: Archive/B2G_OS/API/Simple_Push_API ---- -

{{ non-standard_header() }}

- -

Simple Push API、別名プッシュ通知 API はウェイクアップして通知を受け取る能力をアプリにもたらします。Simple Push は同期メカニズムとしても、あるいはサードパーティのサーバーから最新データを取得する方法としても利用できます。

- -

「プッシュ」とはリモートサーバーから送られてくるイベントに過ぎません。これは以下のようにして動作します。アプリは Simple Push API を使ってエンドポイントと呼ばれる特殊なユニーク URL をリクエストします。このリクエストは、Mozilla がこの目的のために管理する既存のサーバー(これは「プッシュサーバー」と呼ばれます)へ送られます。プッシュサーバーから返されるエンドポイントをアプリが受け取ると、アプリは自身のサーバー(あなたのアプリサーバーです)へエンドポイントを送信します。アプリサーバーはこのエンドポイントを保存します。その後、アプリをウェイクアップしたいと思った時にバージョン番号付きでエンドポイントを呼び出し、プッシュサーバーはアプリにそのバージョン番号通知を連絡します。アプリは通知を受け取った時に、それを無視することも含め何らかのこと行うことができます。

- -

Simple Push APIは {{domxref("window.navigator")}} を拡張して {{domxref("PushManager")}} オブジェクトを保持する push プロパティを持たせ、またプッシュの状態を監視するために受け取れる新しいイベントをいくつか追加します。

- -

基本を説明する例

- -

Simple Push の使い方はいくつかあります。この例では基本的な使い方を取り上げます。例は以下の一般的な手順からなります。各手順の完全な情報についてはその後のセクションをご覧ください。

- -
    -
  1. アプリのマニフェストファイルに push の設定を追加する
  2. -
  3. PushManager.register を呼んでエンドポイントをリクエストする
  4. -
  5. エンドポイントをサーバーに送信する
  6. -
  7. アプリにプッシュ通知用のメッセージハンドラーを追加する
  8. -
  9. エンドポイントを使ってサーバーから通知を送信する
  10. -
- -

1. アプリのマニフェストファイルに push の設定を追加する

- -

Sinple Push を使えるようにするため、マニフェストファイルで二か所変更が必要です。

- -
    -
  1. messages フィールド - pushpush-register メッセージを追加。
    - これはアプリの(pushpush-register の)各イベントを受け取るページを示します。この例ではどちらも同じ「/index.html」ページへ進みますが、異なるページを使っても構いません。より詳細な各イベントの情報は後述します。
  2. -
  3. permissions フィールド - アプリがプッシュ通知受け取りを要求することを追加。
    - なぜ push 権限が必要なのか、エンドユーザーが理解できるように明確な説明を提供するのはいい考えです。
  4. -
- -
"messages": [
-   { "push": "/index.html"},
-   { "push-register": "/index.html"}
-],
-"permissions": {
-  "push": {
-    "description": "サッカーの試合中にゴールが決まるたび更新を受け取るのに必須",
-  }
-}
- -

2. PushManager.register() を呼んでエンドポイントをリクエストする

- -

アプリは {{domxref("PushManager.register")}} を呼び出してエンドポイントをリクエストする必要があります。いつ呼び出すかはあなたが決めなければなりません。ユーザーがログインした時やサッカーの試合を観戦することに決めた時など何らかの時点でエンドポイントを呼び出せます。以下のコードがそのための一例です。

- -
if (navigator.push) {
-  // エンドポイントをリクエストします。PushManager.register() を使います。
-  var req = navigator.push.register();
-
-  req.onsuccess = function(e) {
-    var endpoint = req.result;
-      console.log("新しいエンドポイント:" + endpoint );
-      // ここであなたのサーバーにエンドポイントを送信するため、何らかの呼び出しを使用します。
-      // 例えばこうです。
-      /*
-      var post = XMLHTTPRequest();
-      post.open("POST", "https://your.server.here/registerEndpoint");
-      post.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-      post.send("endpoint=" + encodeURIComponents( endpoint ) );
-      */
-      // 明らかに .onload と .onerror ハンドラー、及びユーザー ID の情報や
-      // その他エンドポイントとユーザーを関連付ける必要のある何らかの情報を追加したくなるでしょう。
-    }
-
-   req.onerror = function(e) {
-     console.error("新しいエンドポイント取得に関するエラー:" + JSON.stringify(e));
-   }
-} else {
-  // DOM 上で push が使用できないためそれ以外のことをします。
-}
- -

3. エンドポイントをサーバーに送信する

- -

エンドポイントを取得したらそれをアプリケーションのサーバーに送る必要があります。方法は一つではありません。例えばメール送信や POST、PUT、果ては GET を使った送信など好きな方法で送ることができます。エンドポイントは、アプリケーションから送られるクッキーやユーザー名、その他エンドポイントとユーザーの組を特定する時に使う何らかのユーザーデータとともに保存することを推奨します。

- -

とは言え、サーバーに送信するのであれば以下の優れたプラクティスに従うことを推奨します。

- -
    -
  1. XMLHttpRequest で送信する。
  2. -
  3. 常に HTTPS を使う。さもなくば何者かがエンドポイントを傍受してアプリに通知を送り始めるかも知れない。
  4. -
  5. クッキーなど、ユーザー(やインストールしたアプリケーション)をもとにエンドポイントを照合できる物を使用する。
  6. -
  7. エンドポイントを安全に保つこと! エンドポイントがあれば、顧客のバッテリーの浪費やサーバーとの不要な接続など迷惑なことを引き起こせます。いつでもクライアントに新しいエンドポイントを取得して古い物を捨てさせることができますが、あなたのサーバーがその変更を検知できるようにしなければならないことを覚えておいてください。
  8. -
- -

4. アプリに push 通知用のメッセージハンドラーを追加する

- -

これまでの手順でエンドポイントを設定したらようやく、アプリがメッセージハンドラーを使って pushpush-register のメッセージの待ち受けを開始できます。

- -

push メッセージハンドラーを追加する

- -

push メッセージハンドラーindex.html ファイル内や main.js のスクリプト内で登録することもできますが、そのスクリプトだけを持った特別な push-message.html ファイル内で登録することもできます。これは push メッセージを受け取った時にアプリが閉じている場合に便利でしょう。サイズの小さい部分的な HTML/JavaScript コードだけををロードして、アプリ全体を開く必要があるのかバックグラウンドで何かを行う必要があるのか決められるからです。push メッセージハンドラーをどこに置くことに決めたにせよ、マニフェストファイルが正しい場所を示すようにしてください(前述の最初の手順参照)。そうしないとアプリが更新を受け取れません。push メッセージハンドラーの例は以下の通りです。

- -
if (window.navigator.mozSetMessageHandler) {
-  window.navigator.mozSetMessageHandler('push', function(e) {
-    console.log('エンドポイントは ' + e.pushEndpoint);
-    console.log('新しいバージョンは ' +  e.version);
-    //複数の pushEndpoint がある場合、ここで処理できることを
-    //憶えておいてください
-    if (e.pushEndpoint === emailEndpoint) {
-      emailHandler(e.version);
-    } else if (e.pushEndpoint === imEndpoint) {
-      imHandler(e.version);
-    }
-  });
-} else {
-  // メッセージハンドラーなし
-}
- -

push-register メッセージハンドラーを追加する

- -
-

注:忘れずにこのハンドラーを追加して動作することを確認してください。アプリがこのメッセージを受け取った時にエンドポイントを再登録しないと、これ以上プッシュ通知を受け取れなくなります

-
- -

デバイスの (UAID または User Agent Identifierと呼ばれる)内部的な iDが変わった時は、全アプリに push-register メッセージが送信されます。これは、プッシュサーバーが変わった、サーバーがダウンして復旧が必要、その他の事情が原因となり得ます。こうしたうちの一つが発生すると、過去のエンドポイントは不適合となるため、全エンドポイントを再登録しなければならないことを意味します。そのため、アプリは push-register メッセージハンドラーを実装する必要があります。以下のサンプルコードを参照してください。

- -
if (window.navigator.mozSetMessageHandler) {
-  window.navigator.mozSetMessageHandler('push-register', function(e) {
-    console.log('push-register を受信、再度エンドポイントを登録する必要あり!');
-
-    var req = navigator.push.register();
-    req.onsuccess = function(e) {
-      var endpoint = req.result;
-      console.log("新しいエンドポイント:" + endpoint );
-      localStorage.endpoint = endpoint;
-    }
-
-    req.onerror = function(e) {
-      console.error("新しいエンドポイント取得に関するエラー:" + JSON.stringify(e));
-    }
-  });
-} else {
-  // メッセージハンドラーなし
-}
- -

5. エンドポイントを使ってサーバーから通知を送信する

- -

一旦あなたのサーバーにエンドポイントを保持すれば、ボディを version=<version> にした HTTP PUT リクエストをエンドポイントに送るだけで通知を送れます。例えばエンドポイントが

- -
https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef
- -

という URL で、バージョンが 5

- -
version=5
- -

だとしましょう。curl を使う場合、通知はこのようにして確認します。

- -
curl -X PUT -d "version=5" https://updates.push.services.mozilla.com/update/abcdef01234567890abcdefabcdef01234567890abcdef
- -

プッシュサーバーが正しく動いていれば、ステータスが 200OK)でボディが {} となっているレスポンスを受け取ります。また、メッセージは受け入れられたけれど代わりのシステムを使って処理できるということを示すステータス 202 を受け取るかも知れません。そうでなければエラーを説明する JSON つきの妥当な HTTP エラーレスポンスが返ります。

- -
-

お忘れなく:Simple Push がメッセージを受け取ったというだけでそのメッセージがアプリにうまく届いたということが保証されるわけではありません。デバイスがオフラインであることから様々なネットワーク障害まで、多くの要素が通知の配信の妨げとなり得ます。わたしたちも最善を尽くしていますが、ときおり宇宙は思い通りにならないものです。

-
- -

version の値は増加する整数になるはずだということを覚えておいてください。もし新しいバージョンがサーバーやデバイスに保存しているものよりも低い場合は、アプリケーションは新しい通知を受け取りません。バージョンは、アプリが本当に確認しておくべきなのに「見逃された」イベントがないかを表すのに便利かも知れません。また、実際のバージョンの値がそれほど重要でない場合には現在の UTC(1970 年 1 月 1 日の真夜中からの経過秒数。GMT)を使うだけでもいいでしょう。

- -

エンドポイントを登録解除する

- -

エンドポイントを使い終えてこれ以上通知を受けとりたくなくなった場合は、{{domxref("PushManager.unregister")}} を使って古いエンドポイントを登録解除するようお願いします。これによりデバイスがプッシュサーバーに送信する多量のデータを一掃でき、また使用しない通知をアプリに送信しないことでバッテリー使用量を抑えることにもなります。

- -

仕様

- -

{{page("/ja/docs/Web/API/PushManager","Specifications")}}

- -

ブラウザー互換性

- -

{{page("/ja/docs/Web/API/PushManager","Browser_compatibility")}}

- -

関連項目

- - diff --git a/files/ja/web/api/web_activities/index.html b/files/ja/web/api/web_activities/index.html deleted file mode 100644 index 1339d0dd63..0000000000 --- a/files/ja/web/api/web_activities/index.html +++ /dev/null @@ -1,586 +0,0 @@ ---- -title: Web アクティビティ -slug: Web/API/Web_Activities -tags: - - API - - B2G - - Firefox OS - - Guide - - Web Activities - - Web アクティビティ - - WebAPI - - 非標準 -translation_of: Archive/B2G_OS/API/Web_Activities ---- -

{{ non-standard_header() }}

-
-

この API は Firefox for Android 上で動いているインストール済みコードで使用可能であり、Firefox for Android 32+ の Firefox for Android Web アプリでの使用を想定しています。

-
-
-

Web アクテビティはアプリケーションが他の(普通はユーザーが選択した)アプリケーションへ動作を委譲する方法を定義します。

-
-

Web アクテビティは現在 Firefox OS 上でのみ有効です。仕様の全体は  WikiMo で見ることができます

-

アクティビティ

-

アクティビティとは、画像の選択やメールの送信などユーザーが行いたいと思うことです。アプリ作成者はあるアクティビティを処理するものとして、あるいはあるアクティビティを委譲するものとしてアプリを定義することができます。

-

アプリをアクティビティハンドラーとして登録する

-

アプリ作成者は、一つ以上のアクティビティを処理するアプリをビルドすることができます。これは、ほかのアプリから呼び出して、アクティビティで定義したある特定の動作を行わせられるということです。例えばフォトマネージャーをビルドしたいとしましょう。ほかのアプリケーションからそれを使って写真を選択することができます。このアプリは、アクティビティハンドラーとしてほかのアプリのワークフロー上の一部となるのです。

-

アクティビティの登録

-

現在のところ、アプリをアクティビティハンドラーとして登録する方法は一つだけです。それはアプリマニフェスト内で宣言することです。

-
-

注:どんなアプリでも自分自身をアクティビティハンドラーとして登録したり独自のアクティビティを作成できます。どちらの場合もアプリマニフェストで同じように行います。ただ、新しいアクティビティを作る時には URL をアクティビティの接頭辞にしてアクティビティ名の衝突を避けるのがベストプラクティスとされています(例:example.org/myActivity または org.example.myActivity)。

-
-

アプリマニフェスト(または宣言による登録)

-

アプリがあるアクティビティを処理するよう期待されるということを表明するには、以下の例のようにアプリマニフェストを使う必要があります。

-
{
-  // その他のアプリマニフェスト関連事項
-
-  // アクティビティの登録
-  "activities": {
-
-    // 処理するアクティビティ名(ここでは"pick")
-    "pick": {
-      "href": "./pick.html",
-      "disposition": "inline",
-      "filters": {
-        "type": ["image/*","image/jpeg","image/png"]
-      },
-      "returnValue": true
-    }
-  }
-}
-
-

動的な登録

-

アプリが {{domxref("window.navigator","navigator")}} オブジェクトを使って動的に登録できるようにする予定があります。ですが、この API はまだ使用できません。この API に関連した動きを追いかけるには {{bug("775181")}} を参照してください。

-

アクティビティハンドラーの記述

-
-
- href
-
- これは、ほかのアプリや Web ページがこのアプリでサポートしているアクティビティを起動し、アクティビティを実行するのにこのアプリが選ばれた場合に開かれるページを指定します。ページは disposition プロパティに指定した方法で開かれます。 -
- 注: このページの URL は同一生成元ポリシーの制約を受けます。
-
-
-
-
- disposition {{optional_inline()}}
-
-
-
- アクティビティが起動された時に、href で指定したページがどのように表示されるかを指定します。指定する場合、値は以下のどちらかでなければなりません(省略時のデフォルトは window)。 -
    -
  • window - アクティビティを処理するページは新規「ウィンドウ」で開きます(モバイルデバイスでは、この表示はアクティビティをリクエストした元のアプリを置き換えるでしょう)。このページはサポートするアクティビティごとに {{domxref("Navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}} を呼び、それから受け取ったメッセージに合わせてアクティビティを実行する必要があります。
  • -
  • inline - アクティビティを処理するページはオーバーレイで開きます(モバイルデバイスでは、このページはアクティビティをリクエストした元のアプリ上のポップアップで描画されるでしょう)。その後の振る舞いは disposition が window の場合と完全に同じです。
  • -
-
-
-
-
- returnValue {{optional_inline()}}
-
- アクティビティが値を返すか否かを宣言します。アプリケーションが値を返す物ではない場合、 UA はアプリケーションが選択されてすぐに - - success - イベントを送信することができます。値を返す時には、アクティビティハンドラーは、アクティビティが成功した場合には {{domxref("MozActivityRequestHandler.postResult()")}} を、失敗した場合には {{domxref("MozActivityRequestHandler.postError()")}} を呼ぶ必要があります(ここで {{domxref("MozActivityRequestHandler")}} はアクティビティハンドラーが {{domxref("Navigator.mozSetMessageHandler()","mozSetMessageHandler")}} 内で指定する関数に渡す第一引数の型)。 success イベントと error イベントはそれぞれ {{domxref("MozActivityRequestHandler.postResult()","postResult")}}、{{domxref("MozActivityRequestHandler.postError()","postError")}} がアクティビティハンドラーに呼ばれた後に発火します。
-
-
-
- filters {{optional_inline()}}
-
- 各プロパティでフィルターを指定する形式の辞書。このフィルターは、アプリがあるアクティビティを処理するのに適切かどうか決定する際に適用されます。フィルター名は自由形式のテキストで、{{domxref("MozActivityOptions")}} の {{domxref("MozActivityOptions.data","data")}} プロパティ内の名前を反映させるべきです。フィルターの値は基本的な値(文字列または数値)、基本的な値の配列、あるいはフィルター定義オブジェクトのいずれかです。フィルターの条件が全て満たされた場合にのみ、アクティビティが処理可能だと見做されます。
-
-

フィルターの適用方法は以下のように各フィルターの値によります。

- -

アクティビティの処理

-

アプリケーションをアクティビティハンドラーとして宣言した場合には、他のアプリからのアクティビティリクエストを受け取った時に何らかのアクションを実行して実効性を持たせる必要があります。

-

アクティビティを処理するには必要なアクションを全て実行する関数を登録しなければなりません。そのためには {{domxref("Navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}} でメッセージハンドラーを設定し(アクティビティ名ではなく)'activity' を明示的に割り当てる必要があります。アクティビティハンドラー関数の引数として {{domxref("MozActivityRequestHandler")}} オブジェクトが渡されます。

-
navigator.mozSetMessageHandler('activity', function(activityRequest) {
-  // アクティビティ処理のための何かをする
-});
-

アクティビティハンドラー関数がアクションを実行する際に、必要であればアクティビティについての情報を読み出して返答を送り返すためにアクティビティリクエストをつかうことになります。

-

アクティビティを呼び出すアプリは幾らかのデータ(後述)を提供する必要があります。このデータはリクエストの {{domxref("MozActivityRequestHandler.source","source")}} プロパティ経由で伝わり、{{domxref("MozActivityOptions")}} オブジェクトになっています。 このオブジェクトはアクティビティ呼び出しの {{domxref("MozActivityOptions.name","name")}} と関連する {{domxref("MozActivityOptions.data","data")}} を提供します。

-
navigator.mozSetMessageHandler('activity', function(activityRequest) {
-  var option = activityRequest.source;
-
-  if (option.name === "pick") {
-    // アクティビティ処理のための何かをする
-  }
-});
-

アクティビティを処理するためのアクションを全て実行すれば、リクエストの {{domxref("MozActivityRequestHandler.postResult()","postResult()")}} メソッドを呼んでアクティビティを委譲してきたアプリに結果を送り返すことができます。

-

問題が起きた場合にはリクエストの {{domxref("MozActivityRequestHandler.postError()","postError()")}} メソッドを呼んでアクティビティに関するエラーメッセージを送り返すことができます。

-
navigator.mozSetMessageHandler('activity', function(activityRequest) {
-  var option = activityRequest.source;
-
-  if (option.name === "pick") {
-    // アクティビティ処理のための何かをする
-    ...
-
-    // 結果を送り返す
-    if (picture) {
-      activityRequest.postResult(picture);
-    } else {
-      activityRequest.postError("Unable to provide a picture");
-    }
-  }
-});
-
-

注:{{domxref("MozActivityRequestHandler.postError()","postError()")}} も {{domxref("MozActivityRequestHandler.postResult()","postResult()")}} も呼ばれなかった場合 -- 例えばユーザーが(デスクトップ版であればタブを閉じたり、モバイルデバイスであればホームスクリーンに戻ったりして)アプリケーションから離脱した場合 -- にはどこかの時点で UA がエラーを送ることが期待されます。

-
-

アクテビティの開始

-

Web アクティビティの他方では、我らがアプリにアクティビティを委譲したいアプリがあります。この委譲を実行するには {{domxref("MozActivity")}} オブジェクトをインスタンス化することによってアクティビティを呼び出す必要があります。このオブジェクトには、アクティビティハンドラーからのレスポンスを待つことのできる {{domxref("DOMRequest")}} オブジェクトである、ということ以上のことはありません。アクティビティはオブジェクトが作成されるなり開始し、UI は可能な限り速やかにユーザーに表示されます。

-
var activity = new MozActivity({
-  // "pick" アクティビティを要求
-  name: "pick",
-
-  // アクティビティのフィルターに必要なデータを提供
-  data: {
-    type: "image/jpeg"
-  }
-});
-
-activity.onsuccess = function() {
-  var picture = this.result;
-  console.log("A picture has been retrieved");
-};
-
-activity.onerror = function() {
-  console.log(this.error);
-};
-
-

追加情報:コンタクト情報の取得

-

Firefox OS 1.3 以下では、コンタクト情報の取得は以下のように処理します。

-
switch (this.activityDataType) {
-  case 'webcontacts/tel':
-    type = 'contact';
-    dataSet = theContact.tel;
-    noDataStr = _('no_contact_phones');
-    break;
-  case 'webcontacts/contact':
-    type = 'number';
-    dataSet = theContact.tel;
-    noDataStr = _('no_contact_phones');
-    break;
-  case 'webcontacts/email':
-    type = 'email';
-    dataSet = theContact.email;
-    noDataStr = _('no_contact_email');
-    break;
-}
-

その後、ある人の名前と電話番号が欲しい場合には次のようにそれを使用できます。

-
var pick = new MozActivity({
-  name: "pick",
-  data: {
-    type: "webcontacts/contact"
-  }
-});
-
-pick.onsuccess = function () {
-  console.log("got contact");
-  var contact = this.result;
-  if( contact ){
-    console.log( "Name " + contact.name + " number "+ contact.number );
-  }
-};
-

Firefox OS 2.0+ では、次のように、webcontacts/contact を使う際にコンタクト情報全体を取得できるようにするか、というフィールドを追加しました。

-
var pick = new MozActivity({
-  name: "pick",
-  data: {
-    type: "webcontacts/contact",
-    fullContact: "true"
-  }
-});
-

これは Contact オブジェクトを返します。下のように直接そのプロパティを使うことができます。

-
pick.onsuccess = function (Contact) {
-  console.log( "Name " + Contact.name + " number "+ Contact.number );
-};
-

Firefox OS のアクティビティ

-

Firefox OS のネイティブインターフェイスである Gaia は基本的なアクティビティを定義している組み込みアプリケーションを多数提供しています。そのアクティビティは以下の通りです。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
アクティビティ名アプリケーション期待するデータ(フィルター)
browseGallery -
-type: "photos"
-
 
configureSettings -
-target: "device"
-
 
costcontrol/balanceCostcontrolなし 
costcontrol/data_usageCostcontrolなし 
costcontrol/telephonyCostcontrolなし 
dialCommunication -
-type: "webtelephony/number",
-number: {
-  regexp: "^[\\d\\s+#*().-]{0,50}$"
-}
-
アプリが電話呼び出しを渡したい時に使用。
newCommunication -
-type: "webcontacts/contact"
-
アプリが新しいコンタクトエントリーを作成したい時に使用。
Email -
-type: "mail"
-
-

アプリが新規メールを送信したい時に使用。メールアプリは "url" または "URI" プロパティとして渡された mailto URI 文字列をパースすることができます。添付ファイルは "blob" の配列と "filenames" の配列を、n 番目のファイル名は n 番目の blob に対応、というように対応させながら追加することで渡せます。

-
SMS -
-type: "websms/sms",
-number: {
-  regexp: "^[\\w\\s+#*().-]{0,50}$"
-}
-
アプリが SMS を送信したい時に使用。
nfc-ndef-discoveredn/aなしアプリが他デバイス上のアプリと data/tag を交換したい時に使用。
openCommunication -
-type: "webcontacts/contact"
-
 
Gallery -
-type: [
-  "image/jpeg",
-  "image/png",
-  "image/gif",
-  "image/bmp"
-]
-
 
Music -
-type: [
-  "audio/mpeg",
-  "audio/ogg",
-  "audio/mp4"
-]
-
 
Video -
-type: [
-  "video/webm",
-  "video/mp4",
-  "video/3gpp",
-  "video/youtube"
-]
-

{{domxref("Blob")}} オブジェクトとなっている blob プロパティも必要です。

-
アプリが動画を表示したい時に使用(view アクティビティでも同様のことが可能)。
pickCamera, Gallery, Wallpaper -
-type: ["image/*", "image/jpeg"]
-
アプリが画像を取得したい時に使用。
Communication -
-type: [
-  "webcontacts/contact",
-  "webcontacts/email"
-]
-

Firefox OS 2.0 以降では、下のように fullContact: "true" というフィールドを指定して、プロパティに直接アクセスできる完全なオブジェクトを返すことができます。

-
-type: [
-  "webcontacts/contact",
-  fullContact: "true"
-]
-
アプリがコンタクト情報またはメールを読み込みたい時に使用。
recordCamera -
-type: ["photos", "videos"]
-
アプリが何らかの動画を撮りたい時に使用。
save-bookmarkHomescreen -
-type: "url",
-url: {
-  required:true,
-  regexp:/^https?:/
-}
-
 
shareBluetooth -
-number: 1
-
-
 
Email, Wallpaper -
-type: "image/*"
-
アプリが画像をシェアしたい時に使用。
viewBrowser -
-type: "url"
-url: {
-  required: true,
-  regexp: /^https?:.{1,16384}$/
-}
-
アプリが URL を開きたい時に使用。
Email -
-type: "url",
-url: {
-  required:true,
-  regexp: "^mailto:"
-}
-
 
PDFs -
-type: "application/pdf"
-
アプリが PDF ドキュメントの内容を表示したい時に使用。
Video -
-type: [
-  "video/webm",
-  "video/mp4",
-  "video/3gpp",
-  "video/youtube"
-]
-

文字列である url プロパティも必要です。

-
アプリが動画を表示したい時に使用(open アクティビティでも同様のことが可能)。
updateCommunication -
-type: "webcontacts/contact"
-
アプリがコンタクト情報を更新したい時に使用。
-

Firefox for Android のアクティビティ

-

Firefox for Android 32+ では、WebappRT を使っている Web アプリが Web アクティビティ経由で Android のネイティブのインテントを送ることができます。セキュリティ上の理由から、明示的に対応付けされているアクティビティ/インテントのみがサポートされています。該当するアクティビティは以下の通りです。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MozActivityAndroid のインテント
アクティビティ名期待されるデータアクション名ExtrasMIMEURI
dial -
-type: "webtelephony/number",
-number: "+11234567890"
-
DIAL  tel:+11234567890
open -
-type: "image/jpeg",
-uri: "http://mozilla.org/image.jpg"
-
VIEW image/jpeghttp://mozilla.org/image.jpg
pick -
-type: "image/jpeg"
-
GET_CONTENT image/jpeg 
send -
-type: "text/plain",
-text: "my message"
-
SENDTEXT: "my message"text/plain 
-
-type: "text/html",
-html_text: "<strong>my</strong> message"
-
SENDHTML_TEXT: "<strong>my</strong> message"text/html 
view -
-type: "url",
-url: "http://mozilla.org/"
-
VIEW  http://mozilla.org/
-
-type: "url",
-uri: "mailto:user@mozilla.org"
-
VIEW  mailto:user@mozilla.org
-

仕様

-

Web アクティビティはどの仕様にも含まれていません。ですが、提案中の Web Intents 仕様と共通する部分があります。実際、Mozilla は Web アクティビティWeb Intents への 対案 として提案しています。このことについての詳細は Web Intents タスクフォースの ML 上の議論をご覧ください。

-

関連項目

- diff --git a/files/ja/web/api/webfm_api/index.html b/files/ja/web/api/webfm_api/index.html deleted file mode 100644 index ac3a639fd7..0000000000 --- a/files/ja/web/api/webfm_api/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: WebFM API -slug: Web/API/WebFM_API -tags: - - B2G - - Firefox OS - - Non Standard - - WebAPI - - WebFM -translation_of: Archive/B2G_OS/API/WebFM_API ---- -

{{ non-standard_header() }}

-

{{ B2GOnlyHeader2('installed') }}

-

概要

-

WebFM API は、端末の FM ラジオへのアクセスを提供します。これは、ラジオの ON/OFF とラジオ局の切り替え、周波数のチューニングができます。この API は、{{domxref("FMRadio")}} オブジェクトの {{domxref("window.navigator.mozFMRadio","navigator.mozFMRadio")}} プロパティを通じて利用できます。

-

ラジオの ON/OFF を切り替える

-

基本的に、ラジオは {{domxref("FMRadio.enable()")}} メソッドで ON に切り替え、{{domxref("FMRadio.disable()")}} メソッドで OFF に切り替えます。

-

ラジオを ON にする前に、アンテナが使用可能か確認することが賢明です (アンテナ無しでは端末に搭載されたラジオが信号を受信できません)。この情報は、{{domxref("FMRadio.antennaAvailable")}} プロパティ経由で利用可能です。モバイル端末上では、ヘッドフォンケーブルがアンテナとして使用されます。このケーブルは抜き差し可能なため、アンテナの利用可能状態が変化するたびに WebFM API が {{event("antennaavailablechange")}} イベントを発行します。

-

ラジオを ON にするには、ラジオの周波数を指定する必要があります。この周波数 (MHz 単位) は、{{domxref("FMRadio.enable()")}} に渡される数値です。

-
// The frequency of the radio station
-// to listen express in MHz
-var frequency = 99.1;
-var radio = navigator.mozFMRadio;
-
-if (radio.antennaAvailable) {
-  radio.enable(frequency);
-} else {
-  alert("ヘッドフォンを接続する必要があります");
-}
-
-radio.addEventListener('antennaavailablechange', function () {
-  if (radio.antennaAvailable) {
-    radio.enable(frequency);
-  } else {
-    radio.disable();
-  }
-})
-
-
-

補足: 音声は端末で利用可能な 通常 のオーディオチャンネルに出力されます。

-
-

周波数の切り替え

-

周波数の切り替えは、手動または自動でできます。いかなる場合も、端末のラジオに受信される現在のラジオ周波数は、常に {{domxref("FMRadio.frequency")}} プロパティで利用可能です。このプロパティは、MHz 単位の周波数を表す数値です。

-

周波数の手動設定

-

{{domxref("FMRadio.setFrequency()")}} メソッドは、受信する新しい周波数を設定するために使用されます。しかし、設定できる値には制限があります。このメソッドは、メソッド呼び出しの成功またはエラーを扱う {{domxref("DOMRequest")}} オブジェクトを返します。周波数は、次の要件を満たさなければなりません:

- -
var change = radio.setFrequency(frequency);
-
-change.onerror = function () {
-  var min = radio.frequencyLowerBound;
-  var max = radio.frequencyUpperBound;
-  console.warn('周波数は次の範囲内でなければなりません: [' + min + ',' + max + ']');
-}
-
-change.onsuccess = function () {
-  console.log('周波数に次の値を設定しました: ' + radio.frequency);
-}
-
-

周波数の自動探索

-

WebFM API は、ラジオチャンネルを自動的にシークする便利な手段を提供しています。結論から先に言うと、{{domxref("FMRadio.seekUp()")}} (現在よりも高い周波数のラジオチャンネルを見つけるために使用) および {{domxref("FMRadio.seekDown()")}} メソッドを使用します。前者は現在より高い周波数のラジオチャンネルを見つけるため、後者は低い周波数のラジオチャンネルを見つけるために使用します。これらのメソッドは、各メソッド呼び出しの成功またはエラーを扱う {{domxref("DOMRequest")}} オブジェクトを返します。

-

両方のメソッドは、{{domxref("FMRadio.frequencyLowerBound","frequencyLowerBound")}} または {{domxref("FMRadio.frequencyUpperBound","frequencyUpperBound")}} の値に達すると、折り返して周波数が探索されます。新しいラジオチャンネルが見つけた場合、現在の周波数を変更し、{{event("frequencychange")}} イベントを発行します。

-

同時に 2 回探索することはできません (つまり、現在より高い周波数と低い周波数を同時に探索することはできません)。これを試そうとするとエラーが返されます。しかし、必要であれば、{{domxref("FMRadio.cancelSeek()")}} メソッドを呼び出して探索を中止することもできます。このメソッドも {{domxref("DOMRequest")}} オブジェクトを返します。

-
var radio   = navigator.mozFMRadio;
-var seeking = false;
-var UP      = document.querySelector("button.up");
-var DOWN    = document.querySelector("button.down");
-
-// When the frequency change, the seek
-// functions automatically stop to seek.
-radio.onfrequencychange = function () {
-  seeking = false;
-}
-
-function seek(direction) {
-  var cancel, search;
-
-  // If the radio is already seeking
-  // we will cancel the current search.
-  if (seeking) {
-    var cancel = radio.cancelSeek();
-    cancel.onsuccess = function () {
-      seeking = false;
-
-      // Once the radio no longer seek,
-      // we can try to seek as expected
-      seek(direction);
-    }
-
-  // Let's seek up
-  } else if (direction === 'up') {
-    // Just to be sure that the radio is turned on
-    if (!radio.enabled) {
-      radio.enable(radio.frequencyLowerBound);
-    }
-    search = radio.seekUp();
-
-  // Let's seek up
-  } else if (direction === 'down' {
-    // Just to be sure that the radio is turned on
-    if (!radio.enabled) {
-      radio.enable(radio.frequencyUpperBound);
-    }
-    search = radio.seekDown();
-  }
-
-  if (search) {
-    search.onsuccess = function () {
-      // Ok, we are seeking now.
-      seeking = true;
-    };
-    search.onerror = function () {
-      // Something goes wrong... ok, let's try again.
-      seek(direction);
-    }
-  }
-}
-
-UP.addEventListener('click', function () {
-  seek('up');
-});
-
-DOWN.addEventListener('click', function () {
-  seek('down');
-});
-
-

仕様書

-

仕様はありません。

-

参照

- diff --git a/files/ja/web/api/webvr_api/webvr_environment_setup/index.html b/files/ja/web/api/webvr_api/webvr_environment_setup/index.html deleted file mode 100644 index 394dab831d..0000000000 --- a/files/ja/web/api/webvr_api/webvr_environment_setup/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: WebVR環境の設定 -slug: Web/API/WebVR_API/WebVR_environment_setup -translation_of: Archive/WebVR/WebVR_environment_setup ---- -

{{draft("このWebVR APIドキュメントは現在v1.0の仕様への対応作業の途中です.従って,ここにある情報のいくつかは最新ではありません.この作業について質問がある場合は ~~chrisdavidmills へ連絡をとってください.")}}

- -

この記事では,WebVRのテスト環境を設定するのに必要な作業を示します — 必要なハードウェアとソフトウェアを含めて — ,そしていくつかのトラブルシューティングのTIPSも共有します.

- -

ハードウェア Hardware

- -

まずはじめに WebVR に必要なハードウェアを見ていきましょう.

- -

ヘッドマウントディスプレイ/位置トラッカ

- -

現在,VR HMD ハードウェアにはいくつかの選択肢がありますが,ベスト/最も信頼のあるものは Oculus Rift です.Oculus Rift はロバストなヘッドマウントディスプレイと,三脚やモニタにつけて使う位置トラッキングカメラが付属しています.Oculus Rift DK2 は $350で販売されていますが(訳注:2015/10末時点でSold out となり購入できません),市場に多くのヘッドセットが出てくれば価格が下がることが予想され,その技術も進歩するでしょう.

- -

- -

VRハードウェア装置に十分な投資ができない人のために,より安価な代替策があります.VR HMDは基本的には,両目の正面にゴーゴルを備えた単なる高解像度スクリーンです.ディスプレイ自体は,立体視を実現するために,それぞれの眼用にクロップと歪みを加えたシーンをわずかにオフセットして横に並べた表示を行っています.これがVR錯覚を作るための本質的な要素です.

- -

- -

同様の体験を擬似的に作成するのに,Android用の Firefox Nightly のようなサポートされているブラウザを使えます.このFirefox for Android Nightly を通じて,VRアプリの実行にトライしてみてください.スマートフォンを頭部にくっつけるための装置が必要かもしれません.これが Google Cardboard の背景となる考え方です.この方式の主な課題は,位置追跡センサがないことと,スマホのプロセッサはデスクトップPCほど強力ではないことで,その体験はそれほどリアルではありません(頭を回しても仮想空間で同じ効果は得られませんし,グラグラするだけかも).しかし手頃なテストの代替品として十分動作します.

- -

VRシーンをレンダリングするためのコンピュータ

- -

バーチャルリアリティハードウェアは,許容可能なユーザ体験を届けるためには,高精度で低遅延データを扱う必要があります — 60fpsで表示を更新する必要があり,そうしなければジャダーやぎこちない体験になってしまいます.FPSを維持するには大量のデータを処理しなければなりません.従って,VRアプリケーションを動作させるコンピュータは非常に強力なものが必要となります.理想的には,ディスクリートGPUを備えたハイスペックのラップトップかデスクトップを使うべきです.最新の MacBook Pro 15"/17"あるいはMac Pro,あるいはWindowsのゲーミングPCのようなコンピュータが完璧でしょう.もし遅いコンピュータしかないなら,ひどい表示になってしまいます.

- -

ソフトウェア Software

- -

WebVR アプリを実行するために,次に示すソフトウェアセットアップが必要となります.

- -

Oculus Rift SDK

- -

Oculus Riftを使用するには,Oculus Rift SDK のダウンロードとインストール が必要です.SDKには任意のVRアプリを実行するときにも必要となる Oculus Rift ランタイムに加え, トラブルシューティングに便利な OculusWorldDemo アプリが含まれています.

- -

Firefox Nightly と WebVR Enabler Add-on (or equivalent)

- -

ブラウザを設定するために,次のステップを実行します:

- -
    -
  1. Firefox Nightly と Developer Edition の両方がWebVRをサポートしています.未インストールであればどちらかをインストール,あるいは最新版に更新してください.
  2. -
  3. 次に, WebVR Enabler Add-on (訳注: このリンク先のバージョンは古いです)をインストールします — これは WebVRを有効にして,マルチプロセスブラウジングを無効化します(E10S),新しいFirefoxのブラウジング機能は現在WebVRと互換性がありません.
  4. -
  5. 最後に,ブラウザを再起動します.
  6. -
- -
-

注記: 手動でWebVRを有効にするには, about:config を開いて,dom.vr* prefsを有効にします.でも,WebVR Enabler Add-on は一発で全部を簡単にやってくれますよ.

-
- -
-

注記: モバイルユーザの場合は,Firefox for Android は現在 Nightly builds でWebVRをサポートしています.現在の実装は粗いものですが,時間をかけて刷新されていくでしょう.フィードバックも大歓迎!

-
- -
-

注記: Chrome Experimental ビルドもWebVRを利用可能になっています.詳しくは Bringing VR to Chrome by Brandon Jones をチェックしてください.

-
- -

表示設定

- -

最適なパフォーマンスのためには,後述の説明のようにディスプレイを設定することが非常に重要です.そうしないと,余計なジャダーや遅延が発生します.こういった状況を改善し WebVR を真にプラグ&プレイにすることに取り組んでいる最中ですが,現時点ではベストな結果を得るには手動での設定が必要になります.

- -

Windows

- -

初めに,コントロールパネルで Display > Screen Resolution を開き,次の設定をします:

- - - -

- -

次に,Advanced Settings > Monitor > Monitor Settings を開いて,Screen refresh rate を 60Hz に設定します.

- -

- -

Mac

- -

まず System Preferences > Displays > Display を開いて,次の設定をします:

- - - -

- -

次に System Preferences > Displays > Arrangement を開いて, Arrangement を Mirrored にセットします.

- -

- -

トラブルシューティング Troubleshooting

- -

このセクションではトラブルシューティングTIPをいくつか紹介します.

- -
-
HMD や位置トラッキングカメラがまったく動作しません.
-
Oculus Rift SDKに含まれている OculusWorldDemo (異なるVRハードなら同様のデモ)でシステムが動作するかテストしてみてください.ハードウェア装置がまったく動作していない場合は,付属のマニュアルに説明されている通りに正確に設定されていることを確認してください.古典的なミスとして,トラッキングカメラのレンズキャップが付いたままだったり,USBケーブルの挿し忘れがあります.
-
HMD や位置トラッキングカメラがまだ動かないです
-
一般的な状況として,トラッキングカメラが停止していると,シーンは見られるけれど,頭の回転に追従しません.TIP: カメラが動作していると青い光がつきます.もし OculusWorldDemo が動作しているのにWebVRアプリがまだ動作しないときは,ブラウザの再起動を試してください — Nightly は非常に実験的な状態で,時々動かないことがあります.
-
{{anch("Display configuration")}}の説明にしたがって正しく実施したのに,まだグラフィックスがjuddery/jerky です.
-
使っているGPUが遅すぎるか,専用の(ディスクリートな)GPUを備えていないか,Oculus Rift を起動した時にグラフィックスカードが切り替わっていない(これは個別の事例のはずですが,すべてのコンピュータでは保証できません).いずれにせよ,Macの gfxCardStatus のようなアプリケーションを使って,何が起こっているかをテストすることができます.これを使うと,インテグレーテッドGPUかディスクリートGPUの切り替えられているかを確認でき,さらに特定の一方だけを使うよう強制することもできます."You are using a system that gfxCardStatus does not support. Please ensure that you are using a MacBook Pro with dual GPUs." というメッセージが表示されたら,たぶんGPUを持っていないので,高速なプロセッサを入手するか,jerkinessを我慢する必要があります.Windowsの場合は,現在同じ機能を持つアプリはありませんし,手動で変更しなければなりません.
-
VRデバイスと一緒に使うと既存のセカンドディスプレイが妙な動作をします.
-
2ndモニタ(あるいはラップトップで外部モニタ)を使っている場合,VRデバイスを使うときは外したほうが良いです.ときどき奇妙な効果が発生します.
-
Linuxはどうなってます?
-
WebVR はLinuxで現在動作しますか?(続く)
-
-- cgit v1.2.3-54-g00ecf