I don’t recommend doing this kind of checking.
An HTTP request needs to contain, in a well summarized form, only the address to get, the way to get (i.e.: GET) and optionally parameters for the page. Any data in addition are courtesy of the browser. So much so that it is trivial to make a client who passes for any browser.
The intention of the anonymous mode is precisely to pass the minimum possible data to the page you want to get. If you decide to get the data that the browser intends to hide, you have already entered a game of cat and mouse. It is exactly for this reason that some solutions proposed in two previous answers (already deleted and only visible to those who have more than 10 thousand points) have already worked one day, but no longer work today.
If you get something that works today, tomorrow it might not work anymore. And when it stops working, it will be without warning, and you will have to run after another gambiarra.
Finally, this afternoon’s solution is to use the file system API, which from time to time has a different behavior in Incognite mode. When this technique starts to be used (it doesn’t take long), the Chromium people will find a way to solve this. Until then, you can risk your luck. You can find documentation on how to use it on MDN, but even there you already start your study with this warning (emphasis mine):
This Feature is non-standard and is not on a standards track. Do not use it on Production sites facing the Web: it will not work for Every user. There may also be large incompatibilities between implementations and the behavior may change in the Future.
In Portuguese:
This functionality is not standard and is not in the path of standards to be implemented. Do not use this on production and web accessible websites: this will not work for all users. There may be major incompatibilities between implementations and behavior may change in the future.
thanks for the reply, the use I was going to give was homemade and for a very simple thing, as I said it was only to show the message, I will try to dig deeper and try to discover something and hope that someone can help me.
– Tmc