每个插件用户的唯一标识符

发布于 2024-12-09 02:45:41 字数 327 浏览 0 评论 0原文

到目前为止,我只是在尝试使用 Addon SDK 并制作自己使用的工具。

我想到了一个想法,可能会尝试做一些类似的扩展,将个人资料主题添加到您的 Facebook 个人资料中,并让使用该扩展的其他人在访问您的 Facebook 个人资料时看到您的主题。

我只是在想我可以做什么,我想知道的是 - 我知道插件将有一个唯一的 ID,但是有什么固有的东西可以用来识别每个唯一的插件用户吗?即通过主题信息将它们与存储的数据联系起来?

如果有人有这方面的经验 - 你是如何处理的?

也许我可以将cookie设置为持续一年之类的插件,然后每次打开浏览器时不断重置它,并希望得到最好的结果?

So far I have been just playing around with the Addon SDK and making tools for my own use.

I had in mind the idea to possibly try to do something like one of those extensions that adds a profile theme to your Facebook profile, as well as letting others with the extension see your theme when they visit your Facebook profile.

I'm just kind of thinking out what I may do, and what I was wondering is - I know the addon will have a unique ID, but is there anything inherent I can use to identify each unique Addon user? I.e. to tie them to the stored data with their theme information?

If anyone has experience with this - how did you approach it?

Maybe I could set a cookie as the Addon that lasts a year or something, and then keep resetting it each time the browser is opened, and hope for the best?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬シ愛 2024-12-16 02:45:41

由于您使用的是附加 SDK,因此最好使用 简单存储。您还可以使用 xpcom 包中的 makeUuid() 函数来生成有保证的唯一标识符。像这样的事情:

var ss = require("simple-storage");
if (!("UserID" in ss))
{
  // We were just installed, generate user ID
  var xpcom = require("xpcom");
  ss.UserID = xpcom.makeUuid()
}
console.log("User ID: " + ss.UserID);

请确保您有一份隐私政策,其中解释了您生成的用户标识符及其用途。

Since you are using Add-on SDK you are probably best off by using simple-storage. You can also use makeUuid() function in the xpcom package to generate a guaranteed unique identifier. Something like this:

var ss = require("simple-storage");
if (!("UserID" in ss))
{
  // We were just installed, generate user ID
  var xpcom = require("xpcom");
  ss.UserID = xpcom.makeUuid()
}
console.log("User ID: " + ss.UserID);

Please make sure that you have a privacy policy where you explain that you generate a user identifier and what you use it for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文