Safari Extensions – Allow Safari Extensions to Access Files
macossafarisafari-extensions
I installed a Safari extension. I need to allow this extension to access files on mu system. Chrome has option looking like this:
I want the same for Safari. Where can I do this?
Best Answer
There is no way to enable this. Safari extensions are restricted to accessing the extensions folder and nowhere else.
If you need to access local resources, use safari.extension.baseURI + “relative path and filename”. You cannot access resources on the user’s hard drive outside of the extensions folder.
After starting Safari, you can go to History -> Reopen All Windows from Last Session to have Safari reopen the windows and tabs that were open when you last used it.
It's primarily a matter of parsing the output of defaults read ~/Library/Safari/Extensions/extensions and formatting it in a user-friendly way. The result actually answers both of your questions:
Best Answer
There is no way to enable this. Safari extensions are restricted to accessing the extensions folder and nowhere else.
Source: Injecting Scripts - Safari Extensions Development Guide