Javascript 我们可以从客户端获取哪些信息?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8180296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What information can we access from the client?
提问by George Reith
I'm trying to compile a list of information that is accessible via javascript such as:
我正在尝试编译可通过 javascript 访问的信息列表,例如:
- Geo-location
- IP address
- Browser software
- Exit location
- Entrance location
- 地理位置
- IP地址
- 浏览器软件
- 出口位置
- 入口位置
I understand that a user can alter any of this information and that it's reliability is purely trust related, but I am still interested in what other information can be mined from the client.
我知道用户可以更改任何这些信息,并且它的可靠性完全与信任有关,但我仍然对可以从客户端挖掘哪些其他信息感兴趣。
采纳答案by Marek Sebera
Don't forget about
不要忘记
- Screen Size
- Allowed Cookies
- Allowed Java
- Mobile or Desktop
- Language
- 屏幕尺寸
- 允许的 Cookie
- 允许的 Java
- 移动或桌面
- 语
And here is useful link with data-mining demo:
这是与数据挖掘演示的有用链接:
http://javascriptsource.com/user-details/browser-properties.html
http://javascriptsource.com/user-details/browser-properties.html
回答by Niel Ryan
Here is most of the information:
以下是大部分信息:
var info={
timeOpened:new Date(),
timezone:(new Date()).getTimezoneOffset()/60,
pageon(){return window.location.pathname},
referrer(){return document.referrer},
previousSites(){return history.length},
browserName(){return navigator.appName},
browserEngine(){return navigator.product},
browserVersion1a(){return navigator.appVersion},
browserVersion1b(){return navigator.userAgent},
browserLanguage(){return navigator.language},
browserOnline(){return navigator.onLine},
browserPlatform(){return navigator.platform},
javaEnabled(){return navigator.javaEnabled()},
dataCookiesEnabled(){return navigator.cookieEnabled},
dataCookies1(){return document.cookie},
dataCookies2(){return decodeURIComponent(document.cookie.split(";"))},
dataStorage(){return localStorage},
sizeScreenW(){return screen.width},
sizeScreenH(){return screen.height},
sizeDocW(){return document.width},
sizeDocH(){return document.height},
sizeInW(){return innerWidth},
sizeInH(){return innerHeight},
sizeAvailW(){return screen.availWidth},
sizeAvailH(){return screen.availHeight},
scrColorDepth(){return screen.colorDepth},
scrPixelDepth(){return screen.pixelDepth},
latitude(){return position.coords.latitude},
longitude(){return position.coords.longitude},
accuracy(){return position.coords.accuracy},
altitude(){return position.coords.altitude},
altitudeAccuracy(){return position.coords.altitudeAccuracy},
heading(){return position.coords.heading},
speed(){return position.coords.speed},
timestamp(){return position.timestamp},
};
回答by call-me
visitor.js is a javascript library that provides information about the client.
visitor.js 是一个 javascript 库,提供有关客户端的信息。
Including:
包含:
- Continent, Country and city
- Date of last visit
- Referring website or search engine (including search term)
- Time spent on the website
- Browser and operating system
- IP Address
- Language
- Browser
- OS
- Screen size
- 大陆、国家和城市
- 上次访问日期
- 推荐网站或搜索引擎(包括搜索词)
- 在网站上花费的时间
- 浏览器和操作系统
- IP地址
- 语
- 浏览器
- 操作系统
- 屏幕尺寸
And more.
和更多。
Visitorjs might be very handy, it's not free however.
Visitorjs 可能非常方便,但它不是免费的。