This looks to me like some bog standard browser detection code. I personally think it’s not great to have this kind of thing, but purely for technical reasons. There’s no clear indication what they are doing with the result of this function. Maybe the YT link has more damning evidence, but I certainly don’t see it in this code.