15 lines
		
	
	
		
			365 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			365 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { deleteCaches } from "./cache-utils";
 | |
| 
 | |
| declare let self: ServiceWorkerGlobalScope;
 | |
| 
 | |
| export default async function handleActivate(event: ExtendableEvent) {
 | |
| 	console.debug("Service worker activated");
 | |
| 	// @ts-ignore
 | |
| 	if (self.registration.navigationPreload) {
 | |
| 		// @ts-ignore
 | |
| 		await self.registration.navigationPreload.enable();
 | |
| 	}
 | |
| 
 | |
| 	await deleteCaches();
 | |
| }
 | 
