Deploying Safari Extensions

bentoms
Release Candidate Programs Tester

Hi all,

Anyone had any experiences deploying Safari extensions? Can you share your experience & workflow?

Cheers!

1 ACCEPTED SOLUTION

bentoms
Release Candidate Programs Tester
3 REPLIES 3

mm2270
Legendary Contributor III

Haven't done it, but it looks possible based on what I can see. It looks like at least 2 things happen when installing a Safari extension.

1- The .safariextz file gets added to /Users/username/Safari/Extensions/

2- The Extensions.plist file in the same location gets updated with a new dict in the array to indicate the extension is installed. It should be possible to use PlistBuddy to add the relevant info into the array. Deploying the updated array itself would probably overwrite other user installed extensions so that wouldn't be recommended.

For example, installing ClickToFlash.safariextz puts this into the plist-

<dict>
    <key>Added Non-Default Toolbar Items</key>
    <array/>
    <key>Archive File Name</key>
    <string>ClickToFlash.safariextz</string>
    <key>Bundle Directory Name</key>
    <string>ClickToFlash.safariextension</string>
    <key>Enabled</key>
    <true/>
    <key>Hidden Bars</key>
    <array/>
    <key>Removed Default Toolbar Items</key>
    <array/>
</dict>

In my very quick tests, just dropping the .safariextz file doesn't do it, even after quitting/restarting Safari. It won't show up as installed until that plist is updated with the appropriate info.

I suspect there is 3rd piece going on that tells Safari to read the new Plist file in without having to relaunch it. Maybe a launchagent of some kind. There's probably some info out there on exactly what goes on behind the scenes that a little Google searching will turn up.

All in all though, it looks possible to do. I may give it a go myself just as an experiment.

mm2270
Legendary Contributor III

On second thought, it may not be possible due to security considerations in Safari. Its possible Apple designed Safari extension installation to not be allowed without user confirmation. Otherwise a piece of malware could install itself into Safari in this same way.

bentoms
Release Candidate Programs Tester