Last active
August 29, 2015 14:27
-
-
Save todokr/dac49963593e2ac50f2f to your computer and use it in GitHub Desktop.
Clear favicon cache of localhost (Google Chrome v.44.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sqlite3' | |
favicon_path = File.join(ENV['HOME'], '/Library/Application Support/Google/Chrome/Default/Favicons') | |
db = SQLite3::Database.new favicon_path | |
begin | |
command = "delete from favicons where url like '%localhost%'" | |
db.execute(command) | |
p "Done: #{command}" | |
rescue SQLite3::BusyException => ex | |
print <<-ERROR_DOC | |
Chrome may be running. Quit and retry. | |
ERROR_DOC | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment