So it partially works, but has some issues that would need to be addressed in Xcode.
Discussion
It's fully broken when in Lockdown Mode, but that's sorta expected with a Safari extension.
Attached is the macOS app that you can use in Safari to test it. You'll need to enable the option in Developer settings to allow unsigned extensions. I can also export the Xcode project and send that through if you like. I'm probably not the right person to try and fix the broken bits or use my own Apple dev account for it.