From 74fe12c896205dfbc418c41d0ce0c5077d2fdf09 Mon Sep 17 00:00:00 2001 From: Cutls Date: Fri, 13 Sep 2019 21:54:11 +0900 Subject: [PATCH] push --- app/js/platform/end.js | 12 +++++++++++- app/js/platform/first.js | 4 +++- app/manifest.json | 18 +++++++++++------- app/sw.js | 1 + app/view/make/acct.sample.html | 1 + 5 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 app/sw.js diff --git a/app/js/platform/end.js b/app/js/platform/end.js index c7a03a4c..8be9e11f 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -173,4 +173,14 @@ onmessage = function (e) { title: e.data[1] }) } -} \ No newline at end of file +} +window.addEventListener('load', function() { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.register("/sw.js") + .then(function(registration) { + console.log("serviceWorker registed."); + }).catch(function(error) { + console.warn("serviceWorker error.", error); + }); + } + }); \ No newline at end of file diff --git a/app/js/platform/first.js b/app/js/platform/first.js index b545d06c..fffb4ec7 100644 --- a/app/js/platform/first.js +++ b/app/js/platform/first.js @@ -1,5 +1,7 @@ function postMessage(e){ - console.log(e) + if(e[0]=="openUrl"){ + window.open(e[1]) + } return false; } document.title="TheDesk" diff --git a/app/manifest.json b/app/manifest.json index 2025c2eb..014bd0bf 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,17 +1,21 @@ { "name": "TheDesk", "short_name": "TheDesk", - "description": "Mastodonクライアント", "icons": [ { "src": "./img/desk.png", - "sizes": "512x512", - "type": "image/png" + "type": "image/png", + "sizes": "512x512" } ], - "theme_color": "#212121", - "background_color": "#212121", + "start_url": "/", "display": "standalone", - "start_url": "./view/ja", - "scope": "https://thedesk.github.io" + "orientation": "portrait-primary", + "background_color": "#212121", + "theme_color": "#212121", + "description": "TheDesk", + "dir": "ltr", + "lang": "ja-jp", + "related_applications": [], + "prefer_related_applications": false } diff --git a/app/sw.js b/app/sw.js new file mode 100644 index 00000000..d1090d4f --- /dev/null +++ b/app/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', function(){}); \ No newline at end of file diff --git a/app/view/make/acct.sample.html b/app/view/make/acct.sample.html index 1e4aa144..9d7b6ee3 100644 --- a/app/view/make/acct.sample.html +++ b/app/view/make/acct.sample.html @@ -70,6 +70,7 @@ @@comment-end@@ +