Posted on 07-14-2019 10:35 AM
Is it possible to set certain websites to always allow pop-ups via a script we can push out via Jamf?
Posted on 10-10-2021 05:32 PM
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.
Posted on 10-11-2021 02:07 AM
@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]); 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
Posted on 11-10-2021 02:27 PM
Hello! When I attempted this, I swapped out YOURURL and ANOTHERURL with the pop-up URL.
I am getting the following error:
"Error near line 1: UNIQUE constraint failed: preference_values.domain, preference_values.preference"
Any suggestions on how to resolve this? I have no idea how to script or where to even begin.
Thank you! 🙂