Safari Pop-up whitelist?

MatG
Contributor III

Hi,

Is it possible to set certain websites to always allow pop-ups via a script we can push out via Jamf?

2 REPLIES 2

PatrickD
Contributor II

Hey @MatG, did you ever find a solution to this? We are looking to block pop-ups in Safari except for those that we specify.

We are trying to do this through a Config Profile.

MatG
Contributor III

@PatrickD Hello, not really. I spoke with Apple Professional Service and they told me its not possible but there is script we tried out but it only had about a 60-70% success rate. swap Just out where it says YOURURL and  ANOTHERURL

#!/bin/sh

loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'`
echo $loggedInUser
sudo -u $loggedInUser echo 'insert into preference_values (domain,preference,preference_value) values ("YOURURL","PerSitePreferencesPopUpWindow",2)'|sqlite3 /Users/$loggedInUser/Library/Safari/PerSitePreferences.db
sudo -u $loggedInUser echo 'insert into preference_values (domain,preference,preference_value) values ("ANOTHERURL","PerSitePreferencesPopUpWindow",2)'|sqlite3 /Users/$loggedInUser/Library/Safari/PerSitePreferences.db