This workaround did not work for content scripts as the relative URL is resolved relative to the website the script is running in.
But this appears to be fixed now in Safari 18.3.1
Topic:
Safari & Web
SubTopic:
General
Tags: