Remove focus listeners on unload
Try get focused node in old browsers
Remove spaces from textarea
Additionally check for contentEditable property
Better handle old browsers without contentEditable support