Add (partial) Safari compatibility

[ci skip]