Earlier quoted context omitted.
Safari hasn’t joined the standards yet. You can do one code base for FF and Chrome, but Safari is a totally different beast.
Moreover, Apple is deprecating legacy Safari Extensions now and pushing developers to transition to Safari App Extensions – which are offered through traditional Mac apps via the Mac App Store. More here - https://9to5mac.com/2018/06/09/safari-12-extensions-more/ It's another headache for us. So far we did not find any good step-by-step article on how to do it.
Check out https://github.com/avast/topee - It's work in progress (but already complete enough for our use case).