I've created a Tampermonkey script to do just that:
https://gist.github.com/lachlanmcdonald/b2d9663fdb13fc1df820...
It mostly works — except I've noticed that html-midi-player will continue to play the last note if there's any kind of delay set, which is jarring. html-midi-player doesn't seem to expose a JavaScript API to make any of it simple...