HTML5 with canvas API is meant to fill the gap. And it's really powerful. There are some 2D game engines using that tech and awesome games like tetr.io using it.
Whenever I hear "this thing is powerful" my brain replaces it with "this thing has a really steep learning curve". The reason flash was so popular is that it was easy to learn the basics.
Flash, by its nature was a security risk. HTML5 can do a lot, as well as various game engines, e.g. Godot. Unfortunately, they also lack the simplicity of flash.