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 caches.open(RUNTIME).then(cache => { return fetch(event.request).then(response => { // Put … Continue reading Error handling for failed network requests with service workers

Secure messaging in the browser

By observing news and public discussions I feel that there is a growing awareness of data privacy and an increasing demand for secure person-to-person communication. In order to address my communication needs, I plugged together a few Javascript libraries and started the Webencryption [1] project on Github. What is Webencryption? Webencryption is a rather crude … Continue reading Secure messaging in the browser

Advanced web security topics

(Updated 22 May 2020) This post discusses web security issues that I come across - so far thankfully mostly by reading about them. It is a work in progress which I'll keep updating. The post title includes "advanced" because the topics discussed here involve clever, non-trivial hacks, are novel at the time of their publication … Continue reading Advanced web security topics

Heisenbugs with angular.js and Internet Explorer 9 or: missing console.log

I'm developing a proof of concept web application based on angular.js for corporate users, which - as so often in my career - means that they are using Internet Explorer. Several users complained about sporadic failures which were really hard to pin down, but during debugging sessions boiled down to a simple observation: the errors … Continue reading Heisenbugs with angular.js and Internet Explorer 9 or: missing console.log

AngularJS, Internet Explorer 9 and watch error

While working on an enterprise project (of course...) I run into an error with Angular (1.3.13), Internet Explorer 9 and $watch-ing a scope when programming a directive:   TypeError: Object doesn't support property or method 'watch' I'll never find out what the reason is. The collective wisdom of Angular users claims that including JQuery solves … Continue reading AngularJS, Internet Explorer 9 and watch error