0
我目前正在嘗試爲我的應用程序設置後臺服務,以便在打開電話時打開應用程序。如果我沒有弄錯,如果webapp的清單中包含「background_page」,那麼後臺服務應該會自動運行,而不會打開應用程序。目前後臺服務未運行。Firefox OS:後臺服務,清單選項「background_page」不起作用
清單
{
"version": "1.0",
"name": "Hello World",
"description": "Hello World",
"orientation":"portrait-primary",
"icons": {
"16": "/icons/icon_16.png",
"32": "/icons/icon_32.png",
"48": "/icons/icon_48.png",
"128": "/icons/icon_128.png"
},
"permissions":{
"background":{},
"backgroundservice":{},
"desktop-notification":{},
"webapps-manage":{}
},
"launch_path": "/index.html",
"background_page":"/background.html",
"developer": {
"name": "Charlie Hudson"
},
"default_locale": "en"
}
背景
<!DOCTYPE html>
<html>
<script>
navigator.mozApps.mgtm.getSelf().launch();
</script>
</html>