2

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?

4

1 回答 1

4

由于您使用的是附加 SDK,因此您最好使用simple-storage。您还可以使用包中makeUuid()的函数xpcom来生成有保证的唯一标识符。像这样的东西:

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);

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

于 2011-10-10T19:00:59.733 回答