Consider removing "Mozilla/5.0" from the User-Agent string?

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1125
Joined: 2020-11-03, 06:47
Location: Philippines

Consider removing "Mozilla/5.0" from the User-Agent string?

Post by jobbautista9 » 2025-10-29, 14:20

Or at least as an option besides "Native" in the User Agent Mode setting in Preferences, like an "Experimental Native" or "Cleaner Native"...

I've been thinking about this because I found out that the reason why Danbooru always throws a Cloudflare CAPTCHA at me when I force the browser to only use HTTP/1.1 is that they don't like HTTP1 clients using Mozilla/5.0 in their user-agent string. This made me wonder how useful this legacy slice still is, especially when bad scrapers and crawlers pretend to be browsers by including the Mozilla string... It seems websites trying to target Firefox and Chrome via user-agent string only care about the number besides the Firefox/ and Chrome/ anyway. :coffee:

Something like PaleMoon/33.9.1 would be cleanest, but I'm fine with something like PaleMoon/33.9.1 Goanna/20251016 (rv: 6.8) or PaleMoon/33.9.1 Goanna/20251016 (Windows NT 10.0; Win64; x64; rv:6.8)
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2505
Joined: 2018-05-05, 13:29

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by vannilla » 2025-10-29, 19:34

Because I've seen it used in practice, in actual code I've read included in relatively popular projects, I can say the Mozilla/5.0 part is either directly checked or is used to extract the important part by order, for example the user agent checker might use a regex to match Mozilla/5.0 (group1) (group 2) (group 3) and then the rest of the code will do id1 = regex group 1; id2 = regex group 3; and use it.
This is not only used by sites to detect features but also by loggers and analytics to show pretty graphs.

Removing that part will likely make the browser trip on a number of pointless pitfalls.

User avatar
Moonchild
Project founder
Project founder
Posts: 38728
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by Moonchild » 2025-10-29, 20:09

The Mozilla/* token, while pretty much just historical, does generally indicate the application is a browser or browser-class user agent. That is the reason e.g. Chrome has carried it from the start, while not actually being a Mozilla product.

If removed, you will likely be treated like a crawler or bot, with all of the drawbacks that come with being classified as such. It's just not wise and would be a pretty pointless footgun to incorporate.
"There is no point in arguing with an idiot, because then you're both idiots." - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
frostknight
Keeps coming back
Keeps coming back
Posts: 845
Joined: 2022-08-10, 02:25

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by frostknight » 2025-10-29, 20:55

Why is it even called 5.0 still? ITS WAY... past that now.

Its at least 140+ even on ESR. lol
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5747
Joined: 2015-12-09, 15:45

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by moonbat » 2025-10-29, 22:29

frostknight wrote:
2025-10-29, 20:55
Why is it even called 5.0 still? ITS WAY... past that now.

Its at least 140+ even on ESR. lol
That was the last sensible version before they jumped on the Chrome bandwagon of meaningless major version updates.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

User avatar
RealityRipple
Keeps coming back
Keeps coming back
Posts: 919
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by RealityRipple » 2025-10-30, 01:03

All covered in the wiki article on User-Agent headers.

User avatar
frostknight
Keeps coming back
Keeps coming back
Posts: 845
Joined: 2022-08-10, 02:25

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by frostknight » 2025-10-30, 04:37

moonbat wrote:
2025-10-29, 22:29
That was the last sensible version before they jumped on the Chrome bandwagon of meaningless major version updates.
Very strange...
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5747
Joined: 2015-12-09, 15:45

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by moonbat » 2025-10-30, 06:21

It's just a side effect of their deciding to completely ape Chrome to the detriment of everything that made Firefox unique instead of fixing the problems that it had then (memory leaks and slowness, again due to misbehaving extensions which again goes to the absolute moth eaten state of their documentation). The existence of Pale Moon rebuts the idea that you have to have multi-process for 'security' (and it does squat other than increasing the attack surface, as Moonchild has highlighted before); and is probably why it gets so much hate from Mozilla fanboys.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

User avatar
laki2
Hobby Astronomer
Hobby Astronomer
Posts: 19
Joined: 2025-04-13, 20:13

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by laki2 » 2025-10-30, 13:53

moonbat wrote:
2025-10-29, 22:29
frostknight wrote:
2025-10-29, 20:55
Why is it even called 5.0 still? ITS WAY... past that now.

Its at least 140+ even on ESR. lol
That was the last sensible version before they jumped on the Chrome bandwagon of meaningless major version updates.
Firefox version 210339 coming soon??? :lol:

User avatar
UCyborg
Astronaut
Astronaut
Posts: 660
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by UCyborg » 2025-10-30, 18:45

What happened to the idea of deprecating user agent header altogether?

User avatar
Moonchild
Project founder
Project founder
Posts: 38728
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Consider removing "Mozilla/5.0" from the User-Agent string?

Post by Moonchild » 2025-10-30, 21:17

UCyborg wrote:
2025-10-30, 18:45
What happened to the idea of deprecating user agent header altogether?
Google wanted to replace it with "Client Hints", however it became painfully apparent what Google was trying to do, which is introducing a Web API that would directly and pretty much transparently give them the tools to track everyone by exfiltration of user agent data to third parties via JS.

From the Client Hints Wikipedia page (with my emphasis):
Since the adoption of Client Hints by major browsers like Google Chrome and Microsoft Edge, privacy researchers have raised concerns over their real-world use for tracking.[15] A 2023 study by researchers from KU Leuven and Radboud University found that out of the top 100,000 websites, 60% of JavaScript files loaded by web pages accessed the Client Hints JavaScript APIs, with most being tracking and advertising scripts, many of which came from Google. Over 90% of these script files exfiltrated the obtained data to tracking domains.[16] A subsequent study in May 2024 by researchers from the Hochschule Bonn-Rhein-Sieg University of Applied Sciences noted that while overall adoption of Client Hints amongst websites on the internet was low, a significant number of third-party domains known for tracking accessed HTTP Client Hints data.[17]
No user-respecting browser should expose this API as it's clearly only being adopted by trackers and ad companies with the biggest culprit being the company that proposed the API to begin with.
"There is no point in arguing with an idiot, because then you're both idiots." - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite