added between line 111-123 a browser support check of .focus()