(翻译)火狐操作系统javascript API

原文地址

 

 

 

开放网络应用(Open Web app)的JavaScript API是提供安装、客户端管理等功能的程序接口。

Feature availability

这些 JavaScript API目前还不可用。当前已经发布的版本在火狐15以后就过时了。

Mozilla已经实现了一个原型: "dashboard",可以到 myapps.mozillalabs.com 进行测试。

Methods of the API

所有和应用相关的方法都通过navigator.mozApps 对象来访问。有两种方法:

Installation API (navigator.mozApps.* )

该 installation API来自 window.navigator.mozApps 对象.

Management API (navigator.mozApps.mgmt.* )

该management API是特权API。它要授权访问信任页,也就是所谓的 "dashboards"。该 API的方法运行dashboards管理和运行应用。另外,也提供了账户同步方法。

Objects

下面的JavaScript对象由应用API使用:

Old API and the new API

若还在实验老的API, 在2012年3月会过期。 新旧对应如下:

navigator.mozApps.install()
This function has a changed signature.
navigator.mozApps.amInstalled() 过时
Replaced by navigator.mozApps.getSelf() .
navigator.mozApps.getInstalledBy() 过时  
Replaced by navigator.mozApps.getInstalled() .
navigator.mozApps.mgmt.list() 过时  
Replaced by navigator.mozApps.mgmt.getAll() .
navigator.mozApps.mgmt.watchUpdates(onupdate) 过时
navigator.mozApps.mgmt.clearWatch(watchId) 过时
Both of these replaced by navigator.mozApps.addEventListener(type, cb) and navigator.mozApps.removeEventListener(type, cb) where type can be either "install" or "uninstall".
navigator.mozApps.mgmt.uninstall(origin, [onsuccess], [onerror]) 过时
Replaced by app.uninstall() where app is an object returned by getAll() or getInstalled() .
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值