News for hackers. Stuff that matters.
Re:DuckDuckGo for Mac beta now open to the public by AdriaanvRossum on Tuesday October 18, 2022 @01:20PM (#33250841)
Too bad they don't show in the User Agent:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)

Would love to show the amount of visitors in Simple Analytics dashboards. [1]

Does anybody know a way to detect the DuckDuckGo browser?

[1] https://www.simpleanalyics.com

Re:DuckDuckGo for Mac beta now open to the public by AdriaanvRossum on Tuesday October 18, 2022 @01:24PM (#33250896)
They seem to set something on `window.navigator._duckduckgoloader_`

If you run `JSON.stringify(window.navigator)`, it only shows the _duckduckgoloader_ variable. Anybody knows why JSON.stringify behaves like that?

Re:DuckDuckGo for Mac beta now open to the public by wifu on Tuesday October 18, 2022 @02:59PM (#33252229)
JSON.stringify is outputting the "own, enumerable" properties. The default properties of window.navigator aren't enumerable and/or come through the prototype chain.

The rules for JSON.stringify are actually pretty complicated: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re:DuckDuckGo for Mac beta now open to the public by AdriaanvRossum on Wednesday October 19, 2022 @04:55AM (#33259382)
Thanks for sharing!
Re:DuckDuckGo for Mac beta now open to the public by doitLP on Tuesday October 18, 2022 @02:03PM (#33251485)
Brave does something similar. It just looks like a generic version of chrome
Re:DuckDuckGo for Mac beta now open to the public by WallyFunk on Tuesday October 18, 2022 @02:10PM (#33251587)
It didn't always have a generic Chrome UA, if you go here[0] it had 'Brave' somewhere in the string, which you could fix by turning on fingerprinting prevention. Glad they fixed that. I don't want people to know I use Brave, although I'm sure there's ways to detect Brave with JS.

[0] https://duckduckgo.com/?q=what+is+my+useragent&ia=answer

Re:DuckDuckGo for Mac beta now open to the public by AdriaanvRossum on Wednesday October 19, 2022 @04:57AM (#33259399)
You can do `await navigator.brave.isBrave()` to detect Brave.

[1] https://github.com/brave/brave-browser/issues/24478

Re:DuckDuckGo for Mac beta now open to the public by WallyFunk on Tuesday October 18, 2022 @02:07PM (#33251548)
> Does anybody know a way to detect the DuckDuckGo browser?

Only in the DDG iOS app the useragent adds a DuckDuckGo string appended to a generic Safari string. You can test here:

https://duckduckgo.com/?q=what+is+my+useragent&ia=answer