This commit is contained in:
Cutls 2019-09-13 21:54:11 +09:00
parent f250d69af8
commit 74fe12c896
5 changed files with 27 additions and 9 deletions

View File

@ -174,3 +174,13 @@ onmessage = function (e) {
}) })
} }
} }
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);
});
}
});

View File

@ -1,5 +1,7 @@
function postMessage(e){ function postMessage(e){
console.log(e) if(e[0]=="openUrl"){
window.open(e[1])
}
return false; return false;
} }
document.title="TheDesk" document.title="TheDesk"

View File

@ -1,17 +1,21 @@
{ {
"name": "TheDesk", "name": "TheDesk",
"short_name": "TheDesk", "short_name": "TheDesk",
"description": "Mastodonクライアント",
"icons": [ "icons": [
{ {
"src": "./img/desk.png", "src": "./img/desk.png",
"sizes": "512x512", "type": "image/png",
"type": "image/png" "sizes": "512x512"
} }
], ],
"theme_color": "#212121", "start_url": "/",
"background_color": "#212121",
"display": "standalone", "display": "standalone",
"start_url": "./view/ja", "orientation": "portrait-primary",
"scope": "https://thedesk.github.io" "background_color": "#212121",
"theme_color": "#212121",
"description": "TheDesk",
"dir": "ltr",
"lang": "ja-jp",
"related_applications": [],
"prefer_related_applications": false
} }

1
app/sw.js Normal file
View File

@ -0,0 +1 @@
self.addEventListener('fetch', function(){});

View File

@ -70,6 +70,7 @@
</script> </script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> <script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@ @@comment-end@@
<link href="../../../manifest.json" rel="manifest">
</head> </head>
<body id="mainView"> <body id="mainView">