最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How does Google know my Computers's name? - Stack Overflow

programmeradmin2浏览0评论

I was entering my Google account recently and noticed that not only did it say which browser I was currently using - it also knew the exact name of the computer I was using. How is Google able to fetch these informations?

I have been browsing the internet for javascript methods that should give me computer name or similar - but I am sure that Javascript is not able to read these data. If for anything, the site should maybe contain a small java application that executes and fetches the data, but that would usually require for me to accept that java is running in the browser by clicking a modal opening box.

Then I thought maybe they executed some C code in the browser - but how do they do it and access data outside the browsers "sandbox"? A third theory I have is that when I installed the Google Chrome browser, it was able to pass along these details - but it didn't make sense neither when I note that it also knows my iPads exact name though I haven't installed any google applications on my ipad at all. (neither google maps, gmail, chrome or anything).

UPDATE 01/25/2016

I have given this some extra thought and seemed to stumble across something else. I went through possible solutions using node.js or Flash to do the same, but I recalled that Google writes everything in Python, which made me think if it was simple enough using Python. I found this post: How can I use Python to get the system hostname? and thought that this might be a way for Google to it. I don't know if this is still achievable when you are writing a website and if this is a browser-based method as well (mind you I am not Python programmer at any level).

I was entering my Google account recently and noticed that not only did it say which browser I was currently using - it also knew the exact name of the computer I was using. How is Google able to fetch these informations?

I have been browsing the internet for javascript methods that should give me computer name or similar - but I am sure that Javascript is not able to read these data. If for anything, the site should maybe contain a small java application that executes and fetches the data, but that would usually require for me to accept that java is running in the browser by clicking a modal opening box.

Then I thought maybe they executed some C code in the browser - but how do they do it and access data outside the browsers "sandbox"? A third theory I have is that when I installed the Google Chrome browser, it was able to pass along these details - but it didn't make sense neither when I note that it also knows my iPads exact name though I haven't installed any google applications on my ipad at all. (neither google maps, gmail, chrome or anything).

UPDATE 01/25/2016

I have given this some extra thought and seemed to stumble across something else. I went through possible solutions using node.js or Flash to do the same, but I recalled that Google writes everything in Python, which made me think if it was simple enough using Python. I found this post: How can I use Python to get the system hostname? and thought that this might be a way for Google to it. I don't know if this is still achievable when you are writing a website and if this is a browser-based method as well (mind you I am not Python programmer at any level).

Share Improve this question edited May 23, 2017 at 12:02 CommunityBot 11 silver badge asked Jan 10, 2016 at 11:30 Corfitz.Corfitz. 1,8844 gold badges32 silver badges54 bronze badges 19
  • 1 stackoverflow.com/questions/922476/… – Mi-Creativity Commented Jan 10, 2016 at 11:44
  • 1 Java Applets can do this. stackoverflow.com/questions/3964595/… – CoderPi Commented Jan 10, 2016 at 11:46
  • 1 @CodeiSir Java Applets are depending on the Java functionality in the browser. Currently most browsers are removing java as a browser functionality - how do they preserve this functionality then? – Corfitz. Commented Jan 10, 2016 at 11:54
  • 8 I nominate to reopen because I believe this case may be unique from the linked question. Google is not using ActiveX/IE, Java, or reverse DNS to determine my machine name on their "Recently used devices" page. – quietmint Commented Jan 22, 2016 at 23:29
  • 4 What programming language Google uses on their end has no relevance. Any general-purpose language on the remote end has the exact same amount of information available; Python doesn't have some mystical power to access extra information. – JJJ Commented Jan 25, 2016 at 11:55
 |  Show 14 more comments

4 Answers 4

Reset to default 17

I did some testing. I have 2 Google accounts, and what I found was that on my main account (which I use with Chrome), Google knows my computer name. On another account, I am logged in with Edge and Firefox, but neither of them show my computer name. It was not until I logged into the Chrome browser ITSELF (not the Google page) as a Chrome user that my second Google account showed the browser I was using.

I verified this on my laptop: I logged in with my second account into the Google website on a new user, which didn't update the computer name on either device in the security settings. Once I logged into the Google Browser with that account, it showed my computer name. So it looks like because you're logged into Google Chrome, Google knows your computer name.

Note that Google using a sandbox does not make any difference for this. It is trivial to find your computer name, all it takes is hostname in a command prompt.

the problem here is if there was a way to get dekstop name though headers that means the browser has that info and if it has there will definitely be some way of getting the name from javascript but there is not i support the above answer that the google uses some sync bad habits or it may be that it stores the ip address which btw we can get with headers this might be the case as with tokens and this ip address thing ddos attacks will be quite easier to deal with so this ip address storing might be true but still its just a guess

Because when you connect to Google they install cookie in your compputer for they know your information and for say you are alerady come here its Like ID Installor

Cookie its file (ID) when you connect to site, the site use this file for know if you alerady came here or not and they can get all your infos: IP, Computer Name, Access To WIFI I thing and create special and unique ID on your pc that are why they know your computer name

I don't know you still want to know that or not but anyway, Every requests that browser sends to loading every pages on the web has some headers, and this headers has some information about browser, referral url and etc.. The important one in this case is "User-Agent" header which includes information about browser, OS and few more information.

You could access the browsers User-Agent string using Java Script in client side via:

navigator.userAgent

and even in server side programming languages like PHP and ASP and etc.. .

This is and example User-Agent string of Safari browser on Macintosh Device:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A

Also you can get yourself User-Agent string and all of analysed datas here

发布评论

评论列表(0)

  1. 暂无评论