service-worker-events

TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script

烂漫一生 提交于 2019-12-07 00:16:45
I'm trying to add a service worker to a website.I'm using Node.js with Express.js,Vue.js and EJS.^ My node server (index.js) looks like : const https = require('https'); const fs = require('fs'); const express = require('express'); const app = express(); const router = express.Router(); const pool = require('./mysqldb.js'); const pathView = __dirname + "/views/"; var bodyParser = require("body-parser"); const listenPort = 8010; // Process application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // Process application/json app.use(bodyParser.json()); app.set('view

Uncaught (in promise) TypeError: Request failed pwa error

南楼画角 提交于 2019-12-05 10:44:15
问题 I am trying to build a Progressive Web App (PWA). The service worker shows registered, PWA audit shows everything good, but the console shows this error: TypeError: Request failed pwa error I am unable to cache the files. I tried all possible answers on Stack Overflow and it's the same //self.addEventListener('fetch', function(event) {}); var dataCacheName = 'myappData-v3n'; var cacheName = 'myapp-3n'; var filesToCache = [ 'images/logo.png', 'js/jquery.min.js', 'js/popper.min.js', 'js

Is it possible to track geolocation with a service worker while PWA is not open

走远了吗. 提交于 2019-12-05 08:21:49
Is it possible to read from local storage and track geolocation in PWAs with a service worker while app is not open on phone (in background) So far my research is pointing to no, and I am finding that the PWA needs to be open for location services. Thank you, The solution is at hand and has been for some years now as this POC clearly testifies. Unfortunately W3C and lobbyists such as Jake Archibald have fought tooth and nail to prevent it from being made available :-( Why? I know not. The "cui bono" argument points to plug-in vendors such as Ionic whose whole raison d'etre appears to be

Uncaught (in promise) TypeError: Request failed pwa error

末鹿安然 提交于 2019-12-03 21:58:56
I am trying to build a Progressive Web App (PWA). The service worker shows registered, PWA audit shows everything good, but the console shows this error: TypeError: Request failed pwa error I am unable to cache the files. I tried all possible answers on Stack Overflow and it's the same //self.addEventListener('fetch', function(event) {}); var dataCacheName = 'myappData-v3n'; var cacheName = 'myapp-3n'; var filesToCache = [ 'images/logo.png', 'js/jquery.min.js', 'js/popper.min.js', 'js/bootstrap.min.js', 'js/main.js', 'css/bootstrap.min.css', 'css/fontawesome-all.min.css', 'css/style.css', 'css

Firefox: Service Worker: SecurityError: DOMException: The Operation is insecure

ⅰ亾dé卋堺 提交于 2019-12-03 13:32:31
In app.js , I am checking the serviceWorker existence in navigator object and if available then registering the SW. if ('serviceWorker' in navigator) { navigator.serviceWorker.register('./service-worker.js', { scope: './' }) .then(function(registration) { console.log("Service Worker Registered!"); }).catch(function(err) { console.log("Service Worker not registered!", err); }); } When trying to register SW, I receive the below error in Firefox. I also made sure the service-worker.js file is under src directory. Checking my about:config in Firefox (version 59.0.2) I had service worker and