Easily get current agent with javascript