Settings API equivalent for Safari App Extensions?

I'm the author of a legacy Safari Extension listed on the Safari Extension Gallery. I've been attempting to convert my extension to a Safari App Extension however I have found it unreasonably difficult to replace the functionality provided by the now depreciated simple Settings API. Let me illustrate:


Say for example I have an extension that adjusts colors for those who are color blind and want a setting to select the type of color blindness


Legacy Safari Extension method

Storing the setting

A1) Create settings.plist and user selects setting from Safari Extension Preferences

or

B1) User clicks toolbar setting icon presented with options and a single line of Javascript code is used to save the value e.g. safari.extension.settings.colorBlindnessType = 'Deuteranomaly'

Reading the setting

1) On every page request access the value with a single line of Javascript code e.g. safari.extension.settings.colorBlindnessType


Safari App Extension method

Storing the setting

1) Create native application settings page and save setting within the App

Reading the setting

1) On every page request injected code must send a message to Safari App Extension

2) Safari App Extension recieves message and reads the setting from within the App

3) Safari App Extension sends message to injected code with response containing the settings

4) Injected code recieves message containing the setting


The Safari App Extension method requires a slow, spaghetti web of complicated code to achieve what I consider to be basic functionaility. To see how ugly this gets just look at the code of this popular Safari App Extension https://github.com/arnoappenzeller/PiPifier


I'm desperately hoping I've overlooked something and would love if anyone could suggest a better alternative. In an ideal world the Safari App Extension and injected code could share access to a persistent dictionary.

Thanking you all in anticipation,


Adam

Can you please file a radar describing this shortcoming of the Safari App Extension's settings API? This is very valuable feedback and should be considered.


If you could also tell us a bit more about what you are trying to do with your extension, that would be very helpful as well. Thanks!

Settings API equivalent for Safari App Extensions?
 
 
Q