void.cat/examples/embed/embeded.html
Kieran 991d8a841d Small changes
- Simplify autoloader
- Update embded example with new autoloader and also update readme
- Basic void_uitl_form downloads
2018-12-07 00:27:47 +08:00

29 lines
1.2 KiB
HTML

<html>
<head>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/void_auto_loader.js').then(function (registration) {
console.log(`ServiceWorker registration successful with scope: ${registration.scope}`);
}, function (err) {
console.error(`ServiceWorker registration failed: ${err}`);
});
}
</script>
</head>
<body>
<!--
Path must be to the current host, the service worker will pick this up and redirect the request to the correct server
Keep in mind that the entire file is loaded and decrypted into memory, so it can look like nothing is happening while the file is loading.
Currently its not advised to use this example for anything other than images that can be downloaded fast
Check other examples for videos, this may be added at a later stage
If you already have multiple service workers or this one doesnt work, try to load the service worker under a fake folder name and prefix all the urls with that
for example:
<img src="/void_proxy/Jet0iBptr3AyVu1tUiPTAn5y3VY" />
-->
<img src="/RiUKijQm3I4VotqaeRl81XqnISo:cf7581696fff2349391218f99ffaca50:7b19587e9a5faa2a0439044c8852f0e5" />
</body>
</html>