No plugin can do this

If you want to periodically delete all Safari cookies on your Mac, you can use the following steps to create a script and automate this task with a scheduled job:

Step 1: Create a Script to Delete Cookies

  1. Open Terminal.
  2. Create a new script file, e.g., delete_safari_cookies.sh:
   vi delete_safari_cookies.sh
  1. Add the following script to delete Safari cookies:
   #!/bin/bash
   rm -rf ~/Library/Cookies/*
  1. Save the file and exit the editor (Ctrl + X, then Y, then Enter).

Step 2: Make the Script Executable

  1. In Terminal, make the script executable:
   chmod +x delete_safari_cookies.sh

Step 3: Schedule the Script with launchd

  1. Create a new plist file for the launchd job:
   nano ~/Library/LaunchAgents/com.user.delete_safari_cookies.plist
  1. Add the following XML configuration:
   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
   <plist version="1.0">
   <dict>
       <key>Label</key>
       <string>com.user.delete_safari_cookies</string>
       <key>ProgramArguments</key>
       <array>
           <string>/bin/bash</string>
           <string>/path/to/your/script/delete_safari_cookies.sh</string>
       </array>
       <key>StartInterval</key>
       <integer>604800</integer> <!-- 604800 seconds = 1 week -->
   </dict>
   </plist>

Replace /path/to/your/script/delete_safari_cookies.sh with the actual path to your script file.

  1. Save the file and exit the editor.

Step 4: Load the launchd Job

  1. Load the new launchd job:
   launchctl load ~/Library/LaunchAgents/com.user.delete_safari_cookies.plist

This setup will delete all Safari cookies once a week. You can adjust the StartInterval value in the plist file to change the frequency. For example, 86400 for daily or 3600 for hourly deletion.

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.