(I say this, having done a vibe-port of the code to a browser extension, so the underlying concept works.)