0

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?

yuan
  • 1,701
  • 2
  • 13
  • 24

1 Answers1

1

The old Safari Extensions API is deprecated! Please check the Safari App Extensions API instead.

The easiest way would be to store your settings in UserDefaults, like a classic iOS/Mac app.

Greg de J
  • 320
  • 1
  • 2
  • 8