Force-enabling Firefox’ reader view

TL;DR: Prepend "about:reader?url=" to any website URL to force reader view in Firefox I'm in love with Firefox' reader view. It not only removes ads, nag-screens, subscription prompts and other clutter from articles but it's typographical choices often are better than the (well-intended) choices of the author. I also value the consistent look and feel … Continue reading Force-enabling Firefox’ reader view

Error handling for failed network requests with service workers

Most service worker code samples show only the happy path where the fetched resource will eventually be available, eg: self.addEventListener('fetch', event => { // Skip cross-origin requests, like those for Google Analytics. if (event.request.url.startsWith(self.location.origin)) { event.respondWith( caches.match(event.request).then(cachedResponse => { if (cachedResponse) { return cachedResponse; } return => { return fetch(event.request).then(response => { // Put … Continue reading Error handling for failed network requests with service workers

Book of dark arts: storing data in the view

Pentagram, source Wikipedia. Towards the end of the year I'll indulge in the dark arts, join the goblins and leave my white architect hat under the Christmas tree where it belongs. I'm helping a friend (a technically minded, non-programmer) write his first mobile app . We wanted to keep everything simple: use technologies which can … Continue reading Book of dark arts: storing data in the view

HTTP compression and incremental rendering

TL;DR: HTTP compression can delay rendering of web resources HTTP permits content to be served with different encodings, some of which can be used to compress [1] the data volume transferred over the network, which has become a frequent suggestion [2] towards optimising websites for performance. It turns out that the deflation phase of the … Continue reading HTTP compression and incremental rendering