在OS X 10.10.1 (Yosemite)上的Safari8.0 (10600.1.25.1)中,我访问了一些网站,如google.com,apple.com,facebook.com,然后当我点击" Safari“隐私”偏好设置...“->”隐私“->”详细信息...“
然后我完全退出Safari (实际上是退出,而不仅仅是关闭窗口),并使用以下命令删除以下内容。
rm -r ~/Library/Caches/com.apple.Safari/ rm -r ~/Library/Cookies rm -r ~/Library/Safari
当我重启Safari时,cookie仍然在那里,我仍然登录到一个在登录后存储了cookie的网站。
我需要删除哪些文件,或者我必须做些什么才能让Safari真正删除cookies?
我需要能够移动/重命名文件/目录,然后在稍后将它们移回。Cocoa Cookies可以删除cookies (http://ditchnet.org/cocoacookies/),并且当我使用fswatch时,没有有趣的文件发生变化。
发布于 2015-05-11 06:49:30
我认为苹果脚本是走在这里的道路,看看the linked blog entry here。下面我复制了google脚本示例。
1 set deCookie to {"nytimes.com", "go.com", "cnn.com"}
2
3 tell application "System Events"
4 tell process "Safari"
5 keystroke "," using command down
6 delay 1
7 tell window 1
8 click button "Privacy" of tool bar 1
9 delay 3
10 repeat with d in deCookie
11 click button "Details…" of group 1 of group 1
12 try
13 keystroke d
14 delay 1
15 select row 1 of table 1 of scroll area 1 of sheet 1
16 click button "Remove" of sheet 1
17 end try
18 click button "Done" of sheet 1
19 end repeat
20 end tell
21 keystroke "w" using command down
22 end tell
23 end tell发布于 2016-05-21 06:48:51
我知道有点晚,但我编写了RemoveCookie,这是一个删除Safari cookie的命令行实用程序。非常简单,它使用NSHTTPCookieStorage API,任何想要管理Safari cookie的人都会发现它很有用。
https://stackoverflow.com/questions/27254828
复制相似问题