I'm working on a Safari extension now, but I haven't been able to find a way to access any of the extension's settings from within the start script. I can access them just fine from the end script by getting them from messages to the global.html file. However, when I try that in the start script, I never seem to get a response back from global.html. Does anyone know a solution to this? Or am I just overlooking something?
Asked
Active
Viewed 345 times
1 Answers
1
When you use a start script, you are injecting it and accessing that page's DOM. Rather than making calls against the SafariExtension
class, you'll want to make them against the SafariContentExtension
class. This is a relatively minor difference, but it makes all the difference when you are accessing extension functionality from an injected script rather than a global page.
EDIT: Since answering this question a couple of days ago, I've begun working on adding a custom settings page to my own Safari extension. It appears that you can only access the baseURI
variable of your extension using the SafariContentExtension
class. Apparently Apple won't give that class the same access as the full SafariExtension
one.

Jordan M.
- 310
- 2
- 13