News for hackers. Stuff that matters.
Re:Twitter preconnects to the wrong domains by dTal on Tuesday October 27, 2020 @10:24AM (#24907700)
TIL about service workers.

So there's a persistent cache of javascript that can't be cleared except one at a time? My cache is full of fly-by-night websites. Surely this is a shocking privacy hole?

Web browsers need to be more transparent about what state they are storing, and more accommodating of attempts to clear it.

Re:Twitter preconnects to the wrong domains by kalleboo on Tuesday October 27, 2020 @10:35AM (#24907823)
> Surely this is a shocking privacy hole?

Also a performance/battery suck. Apple refuses to implement it in Safari, and it's one of the big reasons web developers deride Safari for being "the new IE"

Re:Twitter preconnects to the wrong domains by detaro on Tuesday October 27, 2020 @11:10AM (#24908153)
> Also a performance/battery suck

That's far from obvious. Good cache control and offline usage are great for battery usage.

> Apple refuses to implement it in Safari

Wrong, Safari supports them. What Apple doesn't do well is enabling webapps that you pin to your homescreen ("PWAs") to work (they allow it, but from what I hear it's buggy and has weird restrictions), because they'd rather force you to make a native app.

Re:Twitter preconnects to the wrong domains by account42 on Tuesday November 03, 2020 @05:35AM (#24978292)
You can have good cache control with HTTP headers, no need to run scripts on the client for that.
Re:Twitter preconnects to the wrong domains by GoblinSlayer on Tuesday October 27, 2020 @11:07AM (#24908126)
As I understand the docs, they can be killed any time, e.g. when their site is left, then they aren't different from page scripts. Well, it doesn't look like they solve any problem either.
Re:Twitter preconnects to the wrong domains by detaro on Tuesday October 27, 2020 @11:21AM (#24908255)
The most crucial thing they solve is giving websites access to their cached pages, and they can thus show cached content while also making a request for new data in the background, still provide cached functionality while the device isn't connected to the internet, ...

In the wider concept of "PWA" (Progressive Web Apps), they also are used to enable webapps to act a bit like local apps if the user opts in - a user can add them to the homescreen, and they then are launched just like normal apps (but still sandboxed in the browser). An example that does this quite well is the Web-IRC client "The Lounge" - you can open and use it in the browser, but also pin it as a standalone app, including support for push notifications etc if you allow that.

Re:Twitter preconnects to the wrong domains by dTal on Tuesday October 27, 2020 @06:40PM (#24912873)
Well, except there's nothing stopping a site from handing out a unique service worker with a hard-coded i.d. to every visitor. It's persistent state with behaviour, like a cookie that can do things.
Re:Twitter preconnects to the wrong domains by Isthatablackgsd on Tuesday October 27, 2020 @11:21AM (#24908254)
Me as well, I look up about service workers.

I agree with the transparency, I was not aware about service workers until this post. In the meantime, there are Firefox/Chrome extensions that manages the service workers. Those extension can block service workers from installing without the user consent which that was nice.

Re:Twitter preconnects to the wrong domains by wasmitnetzen on Tuesday October 27, 2020 @12:02PM (#24908735)
The Cookie AutoDelete extension has an option to delete them. I'd highly recommend having that extension anyway!
Re:Twitter preconnects to the wrong domains by gruez on Tuesday October 27, 2020 @11:05AM (#24908103)
>Surely this is a shocking privacy hole?

AFAIK it's fine because they get cleared when you delete cookies/site data, so it's no worse than a site using localstorage, for instance.