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){
console.log(e)
if(e[0]=="openUrl"){
window.open(e[1])
}
return false;
}
document.title="TheDesk"

View File

@ -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
}

1
app/sw.js Normal file
View File

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

View File

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