Determining if browser or app is used to connect from server

#1

Is there a way to tell what kind of client is used to connect to server be it browser or a mobile app?

#2

Maybe this.connection will have more relevant information regarding the current connection in this case? We use this.connection to detect specific domains, perhaps on Mobile it shows more info.