SflashKiller
This is a simple tool to kill the Flash Player process for Safari with a click of the mouse. Free yourself from Flash-induced slowness!
SflashKiller's braindead simple UI.
The Dilemma...
You may have noticed how after several hours of usage Safari all of a sudden becomes slow as a sick dog. Your best option would be to restart it, but that would involve closing all of your 27 tabs you were currently browsing. It turns out that most of the time the cause of slowness is Flash. (Despite the fact that Safari runs Flash in a separate process!)
... And the Solution!
To get around these problems without killing your whole Safari session, run SflashKiller. It will find the Flash player process run by Safari and mercilessly shut it down. The memory used by Flash will be released immediately, and the Flash Player will be restarted whenever it needs to be. No consequences for you. (Except the benefit of the freed memory that your computer can now finally use for something else.)
Requirements
This little app only works on Mac OS X with Safari 5 and up. It will probably work with Safari 4 also, but that was not tested.
Installation
Place the app wherever you want on your hard drive. For best usage, drag the app into the dock. That way whenever Safari becomes unresponsive because of Flash, all you have to do is reach the dock and click the SflashKiller icon. Done!
Download
Source Code
try
set shellres to do shell script "ps -ax -o comm | grep -i WebKitPluginHost"
set msgshort to "Are you sure you want to kill the Flash plugin process for Safari?"
set btnpressedinfo to display dialog msgshort buttons {"Cancel", "Kill It"} default button 2
set btnpressed to button returned of btnpressedinfo
set cmd to "kill -9 "
& (do shell script "ps -ax -o pid,comm | grep -i WebKitPluginHost | awk '{print $1}'")
if btnpressed is "Kill It" then do shell script cmd
on error err number n
if n is equal to 1 then
display dialog "No Flash process running for Safari"
else if n is not equal to -128 then --hitting Cancel generates a -128 error
display dialog err
end if
end try