update sw.js

This commit is contained in:
Nofated095 2023-11-24 22:55:20 +08:00
parent 9b46411fa7
commit de658f1ddd
2 changed files with 12 additions and 2 deletions

View File

@ -45,7 +45,17 @@ module.exports = class extends Component {
var lazyLoadInstance = new LazyLoad({
});
</script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/js/sw.js').then(function (registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function (err) {
console.log('ServiceWorker registration failed: ', err);
});
})
}
</script>
</Fragment>;
}
};

View File

@ -1,6 +1,6 @@
{
"name": "hexo-theme-amane",
"version": "0.0.29",
"version": "0.0.30",
"author": "Nofated095 <nofated095@users.noreply.github.com>",
"license": "MIT",
"description": "A simple, delicate, and modern theme for Hexo",