How to hide the caret cursor in Selenium

If you are using Selenium to take screenshots of your user Interface, then is wise to hide the cursor. Use the WebDriver to execute the following snippet of JS code and voila!

{ var el = document.activeElement; el && el.blur(); }