Just thought you might know - Apple added a new feature in the latest MacOS update that does the same thing. It's called Video Viewer and you can turn it on when a video is playing by clicking the icon that looks like the rectangle with two lines under it.
Yours is seamless and you don't have to turn it on every time, though.
Hey man, yeah I actually saw that! Before this I used another safari extension for it but I thought I could automate it - born was AutoPiP!