]>
git.immae.eu Git - github/bastienwirtz/homer.git/blob - app.js
12 that
.getConfig().then(function (config
) {
14 }).catch(function () {
18 document
.addEventListener('visibilitychange', function () {
19 if (document
.visibilityState
== "visible") {
25 checkOffline: function () {
27 return fetch(window
.location
.href
+ "?alive", {
32 }).catch(function () {
36 getConfig: function (event
) {
37 return fetch('config.yml').then(function (response
) {
38 if (response
.status
!= 200) {
41 return response
.text().then(function (body
) {
42 return jsyaml
.load(body
);
49 if ('serviceWorker' in navigator
) {
50 window
.addEventListener('load', function () {
51 navigator
.serviceWorker
.register('/worker.js');