fixed service worker
This commit is contained in:
@@ -240,6 +240,27 @@ class PatchingController extends mfBaseController {
|
||||
$this->redirect("Patching","Index", $qs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function swAction() {
|
||||
$javascript = "self.addEventListener('install', event => {
|
||||
console.log('Patching PWA Service Worker: Installing...');
|
||||
});
|
||||
|
||||
self.addEventListener('activate', event => {
|
||||
console.log('Patching PWA Service Worker: Activating...');
|
||||
});
|
||||
|
||||
console.log('Patching PWA Service Worker: Script loaded.');";
|
||||
|
||||
header("Content-Type: application/javascript");
|
||||
header("Service-Worker-Allowed: /");
|
||||
header("Cache-Control: no-cache");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
|
||||
echo $javascript;
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user