-
Notifications
You must be signed in to change notification settings - Fork 0
/
upup.min.js
7 lines (7 loc) · 865 Bytes
/
upup.min.js
1
2
3
4
5
6
7
//! UpUp
//! version : 0.1.1
//! author : Tal Ater @TalAter
//! license : MIT
//! https://github.com/TalAter/UpUp
(function(a){"use strict";var b=this,c=navigator.serviceWorker;if(!c)return b.UpUp=null,a;var d={script:"upup.sw.min.js"},e=!1,f="font-weight: bold; color: #00f;";b.UpUp={start:function(a){this.addSettings(a),c.register(d.script,{scope:"./"}).then(function(a){e&&console.log("ServiceWorker registration successful with scope: %c"+a.scope,f);var b=a.installing||c.controller;b.postMessage({action:"set-settings",settings:d})})["catch"](function(a){e&&console.log("ServiceWorker registration failed: %c"+a,f)})},addSettings:function(a){a=a||{},"string"==typeof a&&(a={content:a}),["content","content-url","assets"].forEach(function(b){d[b]=a[b]||null})},debug:function(a){e=arguments.length>0?!!a:!0}}}).call(this);
//# sourceMappingURL=upup.min.js.map