mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-26 20:51:22 +01:00
service-worker
This commit is contained in:
parent
663186c708
commit
0a8fbff321
3 changed files with 21 additions and 3 deletions
|
@ -51,4 +51,17 @@
|
|||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('{{ site.baseurl }}/service-worker.js', {scope: '{{ site.baseurl }}/'})
|
||||
.then(function(r) {
|
||||
console.log('registered service worker');
|
||||
})
|
||||
.catch(function(whut) {
|
||||
console.error('uh oh... ');
|
||||
console.error(whut);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
|
|
@ -8,13 +8,16 @@ layout: null
|
|||
{
|
||||
"src": "{{ site.baseurl }}/img/favicons/favicon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image/png"
|
||||
"type": "image/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "{{ site.baseurl }}/img/favicons/apple-touch-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png"
|
||||
"type": "image/png",
|
||||
"density": "3.0"
|
||||
}
|
||||
],
|
||||
"display": "standalone"
|
||||
"display": "standalone",
|
||||
"start_url": "{{ site.baseurl }}/index.html"
|
||||
}
|
2
service-worker.js
Normal file
2
service-worker.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Empty service worker for App Install banners to work.
|
||||
// Can be implemented to have offline and sync support.
|
Loading…
Reference in a new issue