As this official document said, I put safari.extension.settings.test = "test"
in my injected script, and it didn't work with an error:
TypeError: undefined is not an object (evaluating 'safari.extension.settings.test = "test"')
And I noticed that this setting api might have been depreciated? apple forums
So what's the best way now to read/write global settings through the injected script or somewhere else?