Switching to javascript browser detection