Skip to main content
Question

Clear Browser cache/history/cookies with SwiftDialog UI

  • February 21, 2025
  • 4 replies
  • 11 views

Forum|alt.badge.img+9

This one grew out of necessity at my old job.  The higher level VPs didn't want to go into each browser settings and clear their cache/cookies/history when asked to do so, so I tried to create a "one stop shop" to work on all installed browsers with a single click.  The goal was to keep their bookmarks, extensions & tabs intact...and it works "for the most part".  If anyone knows critical directories / files that should be kept during a cleanup, by all means, let me know and I can get it put into the code.  Hopefully you find this app useful.

Code is here: https://github.com/ScottEKendall/JAMF-Pro-Scripts/blob/main/ClearBrowserCache.sh

4 replies

dletkeman
Forum|alt.badge.img+14
  • Jamf Heroes
  • 145 replies
  • February 21, 2025

Nice idea!  Looks like the link is broken though:

Keep these coming!  You're doing good work here.

Link should be:
https://github.com/ScottEKendall/JAMF-Pro-Scripts/blob/main/ClearBrowserCache/ClearBrowserCache.sh


Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • 60 replies
  • February 21, 2025

yea...I am busy moving everything into files with appropriate READMEs and pictures..for some reason, I cannot change my original post to change the links I posted..

 

This is probably the best link to use: https://github.com/ScottEKendall/JAMF-Pro-Scripts

 


SMR1
Forum|alt.badge.img+13
  • Valued Contributor
  • 219 replies
  • May 29, 2025

@ScottEKendall Hey Scott, I'm in the process of trying this script out. I'm not very good at scripting. I changed the portion that uses the .png file, but when I run the script via self service i get the error message. Am I missing something. What I changed was below. I just changed the top one to /Users/Shared and the bottom one to /Desktop/our.png. Thanks in advance.

SUPPORT_DIR="/Library/Application Support/GiantEagle"
SD_BANNER_IMAGE="${SUPPORT_DIR}/SupportFiles/GE_SD_BannerImage.png"

 

Script result: Ensuring that swiftDialog version is installed... tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:16: Ensuring that swiftDialog version is installed... Swift Dialog is currently running: 2.5.6.4805 tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:16: Swift Dialog is currently running: 2.5.6.4805 Clearing Google Chrome cache tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:25: Clearing Google Chrome cache Backup file: bmpbcphgifhfkfjioddeenggdpffbgek tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:25: Backup file: bmpbcphgifhfkfjioddeenggdpffbgek Backup file: egaejpfbkjamgheoingidhokbfnidlpi tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:25: Backup file: egaejpfbkjamgheoingidhokbfnidlpi Backup file: mdkgfdijbhbcbajcdlebbodoppgnmhab tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:25: Backup file: mdkgfdijbhbcbajcdlebbodoppgnmhab Backup file: miinajhilmmkpdoaimnoncdiliaejpdk tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:25: Backup file: miinajhilmmkpdoaimnoncdiliaejpdk Backup file: nmmhkkegccagdldgiimedpiccmgmieda tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:26: Backup file: nmmhkkegccagdldgiimedpiccmgmieda Restoring Google Chrome files tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:26: Restoring Google Chrome files Restoring Extensions tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:26: Restoring Extensions Restoring Favicons tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:26: Restoring Favicons Restoring Preferences tee: /Users/Shared//logs/CleanBrowserCache.log: No such file or directory 2025-05-29 11:41:26: Restoring Preferences

  


Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • 60 replies
  • May 29, 2025

yep...this line 

/Users/Shared//logs/

shows that your LOG_DIR variable (line #38) is not correct...Also check line #35...that is the "root" of the support directory 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings