Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Please don't feel obligated to address issues not of interest.
What I addressed is of interest to your question, whether you like to believe it or not.
You also don't really explain where & how duckduckgo.com "knows" that you are using Brave.
I had a look - there's a button that says "Add DuckDuckGo to Firefox" (for me). Is that what you mean?
Looking at the scripts the page loads, there's also this one: https://duckduckgo.com/d3039.js
Unlike all others, it contains the strings "brave", "download" and "badge-link", which is the CSS class of the button.
Unsurprisingly, when I disable javascript that button is gone.
So, that's your answer.
Bad communication right from the start in this thread, you really need to learn to ask questions better. Please click on & read the first link in my signature, and afterwards also this: http://catb.org/~esr/faqs/smart-questions.html
To understand how websites can get information not sent via HTTP headers, press F12 and examine the output of "console.dir(navigator)" then read the documentation of those properties.
This could provide more insight, but both normal and HTML searches report the same smart potato DuckDuckGo user agent other reporting sites miss or neglect to feedback.
netcat/ncat aren't in my Ubuntu-based system. I installed netcat_1.10-41 from the Ubuntu Universe repository and there's still no recognition of the commands.
Again the goal is just to understand how DuckDuckGo knows I am using Brave despite my string, and perhaps to learn if other sources have access to the same info.
I can change my web browsers user agent with scripts on or off and I get the same results with duckduckgo. I set a weird user agent on purpose so you can see it. But the same user agent both times.
Having javascript on, letting the page scripts run did not allow duck to better probe my machine to get some "secret data". Not unless your browser is made to tell info. I suspect the Brave devs want to advertise their browser. That is common on web browsers. Also a lot of Browsers have javascript as part of their code base. If you turn scrips off, you kill part of the browser. Like webengine for example. No scripts, no web inspector.
That is why I showed you how to read the header that your browser is sending.
And for netcat. Look and see what Ubuntu is calling that executable. netcat, nc, ncat, etc.
I can tell you exactly what loads when you search duckduckgo for "what is my user agent", letting all scripts run, all images load.
This:
Code:
GET
ResourceTypeMainFrame, (Top level page)
https://duckduckgo.com/html/
______________________________________________________________________
GET
ResourceTypeMainFrame, (Top level page)
https://html.duckduckgo.com/html/
______________________________________________________________________
GET
ResourceTypeStylesheet, (CSS stylesheet)
https://duckduckgo.com/h2035.css
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://duckduckgo.com/assets/logo_homepage.normal.v108.svg
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://duckduckgo.com/assets/loupe_gray.png
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://duckduckgo.com/assets/loupe_white.png
______________________________________________________________________
GET
ResourceTypeFavicon, (Favicon)
https://duckduckgo.com/favicon.ico
______________________________________________________________________
POST
ResourceTypeMainFrame, (Top level page)
https://html.duckduckgo.com/html/
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/www.whatsmyua.info.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/whatsmyuseragent.org.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/whatmyuseragent.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/whatuseragent.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/webbrowsertools.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/www.whatismyuseragent.net.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/user-agents.net.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/en.wikipedia.org.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/useragent.openadmintools.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/useragentstring.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/www.deviceinfo.me.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/gs.statcounter.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/developer.mozilla.org.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/yandex.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/www.useragents.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/deviceatlas.com.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://external-content.duckduckgo.com/ip3/sitedozor.ru.ico
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://duckduckgo.com/t/sl_h
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://duckduckgo.com/assets/logo_header.v108.svg
______________________________________________________________________
GET
ResourceTypeImage, (Image - jpg/gif/png/etc)
https://duckduckgo.com/assets/chevron.png
______________________________________________________________________
The OP could make a little tester for that to better understand it.
Brave looks like a big bunch of code to try and troubleshoot. So are a lot of other browsers.
Since Brave is gtk3 already. A tester for DuckDuckgo user agent reporting using webkit2gtk in gtk3 can be made easy enough. Any halfway recent version of webkit2gtk, gtk3, glib will do.
ducktest.c
Code:
//webkit2gtk user agent tester for duckduckgo
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
//DuckDuckGo user agent page, may change.
const gchar* DuckPage = "https://duckduckgo.com/?q=what+is+my+user+agent&t=h_&ia=answer";
//User agent to test here.
const gchar* agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 "
"like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) "
"Version/10.0 Mobile/14A403 Safari/602.1";
static void destroyWindow(GtkWidget* widget, GtkWidget* window) {
gtk_main_quit();
}
static gboolean closeWebView(WebKitWebView* webView, GtkWidget* window) {
gtk_widget_destroy(window);
return TRUE;
}
int main(int argc, char* argv[])
{
gtk_init(&argc, &argv);
g_set_application_name("DuckTest"); //Browser name
GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
//Window size for test
gtk_window_set_default_size(GTK_WINDOW(main_window), 1000, 800);
WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
//Zoom level for the window
webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(webView), 1.5);
//Browser settings. Set scripts TRUE or FALSE here for test. Add more if you want.
WebKitSettings *settings = webkit_settings_new();
g_object_set(G_OBJECT (settings), "enable-javascript", FALSE, NULL);
g_object_set(G_OBJECT (settings), "auto-load-images", FALSE, NULL);
g_object_set(G_OBJECT (settings), "minimum-font-size", 18, NULL);
g_object_set(G_OBJECT (settings), "enable-developer-extras", TRUE, NULL);
g_object_set(G_OBJECT (settings), "print-backgrounds", FALSE, NULL);
g_object_set(G_OBJECT (settings), "user-agent", agent, NULL);
//Set it from above.
webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webView), settings);
gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));
//Connect to signals
g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindow), NULL);
g_signal_connect(webView, "close", G_CALLBACK(closeWebView), main_window);
//Load the page
webkit_web_view_load_uri(webView, DuckPage);
gtk_widget_grab_focus(GTK_WIDGET(webView));
gtk_widget_show_all(main_window);
//Here we go
gtk_main();
return 0;
}
//gcc ducktest.c -o ducktest $(pkg-config --cflags --libs gtk+-3.0 glib-2.0 webkit2gtk-4.0)
Chrome and Firefox have Developer Tools, which show you the exact headers that your browser is sending for each request. I assume Brave does too. Those should help.
Now, for the record, I have no idea how you got that DuckDuckGo screenshot. It looks nothing like what I see when I type "what is my user agent" into their search box.
Now, for the record, I have no idea how you got that DuckDuckGo screenshot. It looks nothing like what I see when I type "what is my user agent" into their search box.
Yes, I can see why that would be.
I get different looking pages with different user agents. With scripts/images on or off. Also if I am using Ducks full page or html only page. The iPhone agent pages are lighter and load fewer scripts. Which would be a reason to alter the user agent that the browser reports to start with. If one doesn't care, then leave it alone.
This is heavier, with more content. You'll get different looking pages depending on user agent. https://www.duckduckgo.com/
In fact, let me see...I get a little different looking pages with each, iPhone 10, iPhone 12, Win10 Firefox, Win10 Edge, Linux Firefox. But Duckduckgo only gives me the user agent that I used, nothing else. (Answer to the OP)
Ones that I used.
Code:
Mozilla/5.0 (iPhone; CPU iPhone OS 15_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/78.0.257670029 Mobile/19A348 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0
Mozilla/5.0 (X11; Arch; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.69
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.