How can I detect that a user is using the DuckDuckGo browser?
I have a page that links to the appropriate browser extension store. I need to detect the DuckDuckGo browser so I can display a message saying that the extension can't be added.
Currently the user is directed to the store of whatever browser DuckDuckGo is spoofing as, currently Edge on Windows. (Meaning that DuckDuckGo uses the same user agent as Edge.)
Note that Brave also spoofs as another browser, but they added a way to detect it: window.navigator.brave
DuckDuckGo requests send a request header SEC_CH_UA, which includes the text "DuckDuckGo". This may also be called HTTP_SEC_CH_UA.
In Django, I get it like this:
request.META["HTTP_SEC_CH_UA"]