deploy adblock plus

Krytos
New Contributor III

is it possible to deploy adblock plus to Chrome, Firefox and Safari via Casper? if so, how would you go about doing it? I want it to be active for all users who log into the computers.
Just create a package for it and deploy it? or is it a different process?

1 REPLY 1

bpavlov
Honored Contributor

Since that's an extension, I imagine you have to deploy it with whatever method the browser uses for adding extensions. This I think should work with Safari and Firefox.

Firefox:

#!/bin/sh

User="$(who | awk '/console/ {print $1}' | head -n 1)"

#To install Firefox extension
sudo -u "$User" osascript -e 'tell app "Firefox" to activate'

sudo -u "$User" osascript <<EOF
tell application "Firefox"
open "/path/to/Firefox/extension.xpi"
activate
end tell
EOF

Safari:
Note in Safari you essentially have to create a simple HTML page where the page loads the Safari extension. Programmatically, I believe Apple disable other methods for deploying extensions as they want it to be deployed with end user interaction.

#!/bin/sh

User="$(who | awk '/console/ {print $1}' | head -n 1)"

sudo -u "$User" osascript -e 'tell app "Safari" to activate'

sudo -u "$User" osascript <<EOF
tell application "Safari"
open "/path/to/Safari/extension.html"
activate
end tell
EOF

And note that these methods I'm referring to are meant to be used in Self Service. I'm not sure how they will work if run via policies in the background. Also, I'm not sure if this method will work in 10.11. Lots of caveats. But hopefully it's a starting point for you to get something going. Good luck.