Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
Allow placing main script file in a separate directory (CDN support).tar.gz | 2015-12-30 | 13.9 MB | |
Allow placing main script file in a separate directory (CDN support).zip | 2015-12-30 | 13.9 MB | |
README.md | 2015-12-30 | 879 Bytes | |
Totals: 3 Items | 27.8 MB | 0 |
You can now load the main UpUp script (upup.min.js
) from a completely different directory, or even server, than where you keep the ServiceWorker file (upup.sw.min.js
).
This is a great way to load upup.min.js
from a CDN, and then only for users who use the Service Worker, load upup.sw.min.js
from your domain's root directory.
:bulb: upup.sw.min.js
must remain under the main domain (preferably at the root level), because that defines its scope. Read more here.
:::html
<script src="//cdnjs.cloudflare.com/ajax/libs/UpUp/0.2.0/upup.min.js"></script>
<script>
UpUp.start({
'content-url': 'offline.html',
'assets': ['/img/logo.png', '/css/style.css', 'headlines.json'],
'service-worker-url': '/upup.sw.min.js'
});
</script>