Earlier quoted context omitted.
The service worker does not maintain a persistent connection. Some websites/pwa's allow you to configure that.
but then you're depending on the website/pwa to be a good citizen and allow you to configure that
Service Workers
31–40 of 68 posts
Re: Service Workers
#32Earlier quoted context omitted.
My most delightful experience with a service worker was SVGOMG, https://jakearchibald.github.io/svgomg/ . One time I was without an internet connection, and I thought to myself, “if only it had a service worker so it’d work offline!” and then I opened a tab to it, to remind myself to optimise the SVG I was working with later, and— huh. It loaded. On reflection, I decided that given who Jake Archibald is, it made sens…
I've recently set an offline mail client to sync mail locally for my wife's laptop. Her two gmail accounts downloaded 22GB. Be careful what offline actually means when it comes to mail; eg. that 22GB as service worker cache sounds a bit nasty to me, especially because service workers don't tend to differentiate between desktop and mobile.
Re: Service Workers
#33Earlier quoted context omitted.
Push requests only exists on Chrome and is behind a permission, intercepting resource requests within the domain of a website could cause some annoyances, can’t see the malware effect immediately. Scheduling a download for a stable connection, again, could be an annoyance, but what’s the malware implication?
The malware angle is basically service-worker-powered cache poisoning: if you can get the server to serve your code once, users can get a service worker installed, and intercept resource requests under that path. It’s limited in practical value because you have to be able to serve a full JS file as the service worker, rather than just injecting a snippet of JS as the most common technique is, but it is a genuine atta…
Re: Service Workers
#34I'm very glad about existence of this wonderful extension: https://chrome.google.com/webstore/detail/manage-web-workers...
Re: Service Workers
#35"Imagine being able to respond to push notifications, intercept resource requests, and schedule background syncronization, all without the need for a user to actively have your website open in front of them." ".. by authoring special-purpose JavaScript which you register with the browser." Why does this seem like something useful for malware and generally annoying me.
I would we rather leave http to be a document model, and create something new and better to support"web-based" apps.
Re: Service Workers
#36I like service workers, but I don't like the lack of control I have. For example, I want Messenger to send me notifications if I have the tab open, but I don't want the service worker to maintain a persistent connection and send me notifications with the tab closed. Unfortunately, I am not able to block service workers. My only option is to block notifications entirely, which doesn't even stop the service worker.
The service worker does not maintain a persistent connection. Some websites/pwa's allow you to configure that.
The notifications dropdown should be:
- Always allow
- Allow when open
- Disallow
Re: Service Workers
#37Great write up. I’ve been exploring SWs recently to help with downloading and caching data in the background for faster UI. Question, I’d like to avoid doing large downloads or possibly cap the transfer rate to avoid any potential jank. Is there a best practice or is it possible to monitor the current browser interaction to determine how strategically best to pull data with a SW? Depending on what a user chooses to c…
May I ask the justification to download 1-10MB JSON on the user's system without the user being aware?
It’s also configurable to only operate on faster connections/non mobile IP address etc.
The main reason I was asking is if you currently benchmark service worker updates with indexedDB for async/larger updates, they still cause a small amount of jank, (at least on larger requests) even though they may use a different process etc.
There’s a github repo with a benchmark, this link is older but if you clone the current version and update to the lastest packages, the results are still similar.
https://www.google.com/amp/s/nolanlawson.com/2015/09/29/indexeddb-websql-localstorage-what-blocks-the-dom/amp/Re: Service Workers
#38Re: Service Workers
#39Note to Author: Irregardless is not a word.
Re: Service Workers
#40Earlier quoted context omitted.
You also cache regular web resources like images. It is for the user's benefit since next visit to the site can be faster.
You misunderstand. Service worker traffic is invisible, unlike loading an image and generally speaking can't be governed, unlike visible elements. Loading 1-10MB JSON might drain a significant portion of mobile data. It could take a long time, meaning it may need to re-start it a couple of times, due to, say, a flaky 3G connection. I'm curious on the why - unless this is an announced feature, I don't think this shoul…