Using decision trees for real-time localization of eye pupils
https://tehnokv.com/posts/puploc-with-trees/
It's actually quite fascinating. I'm too paranoid to enable webcam for any random site, so will be trying it out locally.
For face detection and determining the locations of the eyes, the demo uses picojs, described in another post:
pico.js: a face-detection library in 200 lines of JavaScript