简体   繁体   English

从Chrome扩展程序获取浏览器“安装” ID

[英]Get browser 'installation' ID from Chrome extension

I'm developing a Chrome extension that sends data to a web API. 我正在开发将数据发送到Web API的Chrome扩展程序。 I need to include some parameter into a HTTP request that would uniquely identify "a browser installation" on the client's computer. 我需要在HTTP请求中包含一些参数,以唯一地标识客户端计算机上的“浏览器安装”。 I need this ID to limit the number of requests the API accepts from a single user. 我需要此ID来限制API从单个用户接受的请求数。

I have read the answers to this question which are close to what I need, but not quite: 我已经阅读了这个问题的答案, 这些答案与我所需要的答案很接近,但并不完全相同:

  • I can't use chrome.storage because I want the ID to remain the same if a user removes the extension an then re-installs it 我无法使用chrome.storage因为如果用户删除扩展名然后重新安装,我希望ID保持不变
  • I can't use chrome.identity because it requires the user to sign in, and the extension has to allow anonymous chrome users 我无法使用chrome.identity因为它要求用户登录,并且扩展名必须允许匿名chrome用户
  • I can't use chrome.system because system information is not unique, and different computers can end up having the same ID 我无法使用chrome.system因为系统信息不是唯一的,并且不同的计算机最终可能具有相同的ID

Whenever possible you should encourage a user to sign in. But for tracking anonymous users I like this past question: Detecting a “unique” anonymous user 只要有可能,您都应该鼓励用户登录。但是对于跟踪匿名用户,我喜欢过去的问题: 检测“唯一”匿名用户

There is no guaranteed way to track anonymous users. 没有保证可以跟踪匿名用户的方法。 Systems are designed that way. 系统就是这样设计的。 Instead you can leave as many bread crumbs as possible. 相反,您可以留下尽可能多的面包屑。 Someone even created an api for an extremely persistent cookie that stores itself in lots of places. 甚至有人为永久存储的cookie创建了一个api,将其存储在很多地方。 Evercookie The api is a couple years out of date, and it can be considered rude. Evercookie该api已经过时了几年,可以认为是不礼貌的。 But the concept is valid. 但是这个概念是有效的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM