This commit is contained in:
syuilo 2017-12-08 14:59:43 +09:00
parent a9a581adcb
commit 1d2d46e799
3 changed files with 12 additions and 0 deletions

View File

@ -95,6 +95,10 @@
// Clear cache (serive worker) // Clear cache (serive worker)
try { try {
navigator.serviceWorker.controller.postMessage('clear'); navigator.serviceWorker.controller.postMessage('clear');
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => registration.unregister());
});
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }

View File

@ -11,6 +11,10 @@ export default async function(mios: MiOS) {
// Clear cache (serive worker) // Clear cache (serive worker)
try { try {
navigator.serviceWorker.controller.postMessage('clear'); navigator.serviceWorker.controller.postMessage('clear');
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => registration.unregister());
});
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }

View File

@ -5,6 +5,10 @@ if (yn) {
// Clear cache (serive worker) // Clear cache (serive worker)
try { try {
navigator.serviceWorker.controller.postMessage('clear'); navigator.serviceWorker.controller.postMessage('clear');
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => registration.unregister());
});
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }