mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-09-07 00:16:58 +08:00
feat: 1. using cache storage store image data; 2. get base64image before chat to api #5013
This commit is contained in:
@@ -2,8 +2,15 @@ if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.register('/serviceWorker.js').then(function (registration) {
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
registration.update().then(res => {
|
||||
console.log('ServiceWorker registration update: ', res);
|
||||
});
|
||||
}, function (err) {
|
||||
console.error('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
navigator.serviceWorker.addEventListener('controllerchange', function() {
|
||||
console.log('ServiceWorker controllerchange ');
|
||||
window.location.reload(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user