Capability Reporting with Service Worker

Avatar of Chris Coyier
Chris Coyier on

We’ve heard 1,000 times: User Agent sniffing is bad news. We largely do it on the server because we want to know stuff about the client before we even send anything to the client. A worthy goal!

We’ve talked about this before. Perhaps you serve a little different JavaScript for a different approach to navigation. Or you set a cookie with client side data and use that to serve different image formats depending on support. Maybe you even refresh the page to ensure you have that data. There are even libraries for all this.

Service Workers, a brand new thing on the web, are uniquely qualified to help with this problem as they sit between the client and server and can manipulate requests to pass additional data.

Direct Link →