Latency would be horrible, but you could do it. There were a few WMs/DEs that did things like that in the past.
https://github.com/Manjaro-WebDad/jde
https://sparkylinux.org/jade-desktop/
Historically, Hiweed (now Deepin) was HTML5/JS but it’s now QT based.