Webventures

To boldy go where countless others have gone before.

Abortable promise chains

TL;DR: An idea for a small library that makes it easier to abort Promise chains. But... why? I've found myself wanting to be able to easily abort a Promise chain many times. And by that I don't mean just the initial promise itself (which is possible), I...

Stripping html - dos, don'ts and more

TL;DR: Use template (not div) and textContent (not innerText). Every so often I run into a situation where I need to strip HTML from a string. For example. this blog's post list includes a short excerpt of the actual post, but I didn't want any of the cont...

In-App Browsers are tracking you(r users)

TL;DR: Users are being spied on, websites are broken and hijacked. Most people probably don't know this, but when you click a link in Facebook, Instagram, TikTok and many other apps, you're viewing the site (and all subsequent pages you visit from there)...

Need cheap paint? Use getComputedStyle().opacity

TL;DR: If you need a double rAF() for a transition to work, getComputedStyle().opacity may be a cheap, synchronous alternative. I thought I'd share a neat little trick I learned a few years back, just a nice and short blog post like I did a while ago. ...

The Biggest Thing from WWDC 2022

TL;DR: No one is talking about Apple announcing it's finally going to bring Web Push to Safari. Safari is getting Web Push! On iOS! If you ask me, the biggest thing to come out of WWDC 2022 was the announcement of Web Push for Safari. MacOS is going to ...

Returning a promise in new Promise() vs .then()

TL;DR: Returning a promise in new Promise() never resolves, but returning a promise in .then() does. Consider the example below: The constructor of Promise expects a function that only resolves when its resolve() callback is called. Having it both (callba...