349

alt textCaption

Web dev: What browser is visiting the page?

User agent string:

A screenshot of a browser. The URL bar reads firefox://settings, a button on the URL bar is labelled Netscape, a popup from the button reads: "You're viewing a secure Opera page", and the web page title reads "Chrome settings".

you are viewing a single comment's thread
view the rest of the comments
[-] elrik@lemmy.world 7 points 4 hours ago

User agents are useful for checking if the request was made by a (legitimate self-identifying) bot, such as Googlebot.

It could also be used in some specific scenarios where you control the client and want to easily identify your client traffic in request logs.

Or maybe you offer a download on your site and you want to reorder your list to highlight the most likely correct binary for the platform in the user agent.

There are plenty of reasonable uses for user agent that have nothing to do with feature detection.

this post was submitted on 20 Sep 2024
349 points (98.9% liked)

Programmer Humor

19198 readers
1292 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS