From 0a60570aaf54138b88a115eaa30bd1b6f8422097 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 19 Jul 2018 19:02:09 +0200 Subject: Add offline support --- pointless/viewer/init.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pointless') diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index 9454a23..9ba881c 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js @@ -20,9 +20,16 @@ function isController() { return window.opener == null || window.opener.location.href != window.location.href; } +function initCache() { + if (!navigator.serviceWorker) return; + navigator.serviceWorker.register("appcache.js"); +} + function init() { + initCache(); + var viewer = new Viewer(); - + if ("file" in params) viewer.load(params["file"]); } -- cgit v1.2.3