service-worker

GCM Chrome: Empty Data Response

筅森魡賤 提交于 2019-12-14 04:26:00
问题 i am currently integrating gcm in my web application, the subscription and the registration_id saving working, i get on the client also the response, when i trigger a message from Postman. So now i need to transfer the title and the message. i am triggering the gcm api with this parameter: http://i.imgur.com/MkrIAzF.png and thats the received from the client: http://i.imgur.com/gSZtEiY.png The Field "data" is everytime empty, 回答1: Despite using GCM as its push service, Chrome doesn't support

Error with Service Worker registration

自作多情 提交于 2019-12-14 03:53:58
问题 I'm trying to register a service worker but I have the following error: Failed to register a ServiceWorker: The URL Protocol of the current origin ('null') is not supported I'm under localhost with node js and I have my index.html and service-worker.js in the same folder index.html <!doctype html> <html> <head> <title>TryService</title> </head> <body> PROVA SITO CON SERVICE WORKER <script> if('serviceWorker' in navigator){ // Register service worker navigator.serviceWorker.register('service

Best practice for instant claim of a page by Service Worker

帅比萌擦擦* 提交于 2019-12-14 01:45:24
问题 I currently have a service worker set up to claim the page immediately, due to the nature of the application and user experience. As this application is converting over from AppCache, which had a dynamic Manifest file created for each user, I found that the best method was to Parse this Manifest file to a JSON array and send it to the Service Worker in order to cache it. The problem being I need to wait until the Service Worker is active before it can receive this array. I currently have set

Why browser loads service worker when going offline and cause “An unknown error occurred when fetching the script.”?

偶尔善良 提交于 2019-12-13 17:21:16
问题 I register the service worker with this code: // If the browser supports serviceWorker, and we haven't registered any - we'll register our: sw.js .. if ('serviceWorker' in navigator && !navigator.serviceWorker.controller) { navigator.serviceWorker.register('/sw.js').then(function(registrationObj) { console.log('Registration object: ', registrationObj); }).catch(function(error) { // serviceWorker registration failed .. console.log('Registration failed with ' + error); }); } else { console.log(

Failed to execute 'postMessage' on 'ServiceWorker': function could not be cloned

断了今生、忘了曾经 提交于 2019-12-13 14:28:08
问题 I am trying to post a message to a service worker instance. I get the following error: Failed to execute 'postMessage' on 'ServiceWorker': function (){ obj.removeListener(ev, fn); } could not be cloned. My code is as follows: var socket = io(); function onYouTubeIframeAPIReady() { //Tell the service worker who I am navigator.serviceWorker.ready.then(serviceWorkerRegistration => { navigator.serviceWorker.controller.postMessage({ name: 'socketInit', value: socket }); }); } Any idea why this

Angular 5 Service worker not working / Doesn't cache background-image

百般思念 提交于 2019-12-13 13:33:34
问题 I'm having trouble getting my angular5 service worker to work. I have two main problems: The service worker doesn't cache assets images that are used as background-images After simulating a network disconnect the service worker initially pulls files from the cache (except the the aforementioned non cached files), but after a second refresh it runs into an error. Below is a more detailed report of my problem. You can follow along by cloning a repo I made to highlight this problem located here.

Service workers on cordova app

六眼飞鱼酱① 提交于 2019-12-13 11:45:06
问题 Can i use service workers inside hybrids apps(ionic 1/cordova) running on android devices? I'm getting some errors when trying to install a service worker on ionic app running on android device, because android uses file protocol to serve files and service-workers require files to be served by HTTPS protocol or http(only for localhost): Error during service worker registration: DOMException: Failed to register a ServiceWorker: The URL protocol of the current origin ('file://') is not

Changes made in js file or views file or css file doesn't gets reflected for the user

拜拜、爱过 提交于 2019-12-13 07:59:49
问题 I have developed a single page web application with multiple views on it. For rendering these views ng-if has been used. Each view has a separate controller. Many click functionality has been handled using Jquery. For backend, java has been used. The whole application has been developed in spring MVC and deployed on WebLogic . The problem is whenever I make any changes to the views or the js file it won't get reflected after deploying the new WAR file without clearing cache and doing a hard

Is it possible to combine a dom-repeat on a platinum service worker?

亡梦爱人 提交于 2019-12-13 04:44:45
问题 I want to provide a user the ability to cache up to 2,600+ items, by groupings (categories of book, individual books, or possibly even just chapters of a certain book if they don't want the whole book). It is not possible, as far as I can tell, to precache all of these items because there are 2,600+ of them, and will be more in the future - the service worker will timeout with under a couple hundred. And since service workers either get all or none on install (if I understand correctly), do I

PWA offline mode not loading from cache on mobile browsers

巧了我就是萌 提交于 2019-12-13 04:27:20
问题 I wrote a simple PWA (current version) based on this tutorial by Vaadin. It works fine, tested in Chrome, also in offline mode. By using it on a mobile device, issues occur: After saving the PWA, starting it once, it runs fine. then after closing, turning on flight mode and restarting the PWA, I get a system message, saying I have no internet connection -> no problem, I can ignore that after ignoring, the app does not load the static assets as I expected it, but shows a blank page, saying the