每个插件用户的唯一标识符
到目前为止,我只是在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您使用的是附加 SDK,因此最好使用 简单存储。您还可以使用 xpcom 包中的 makeUuid() 函数来生成有保证的唯一标识符。像这样的事情:
请确保您有一份隐私政策,其中解释了您生成的用户标识符及其用途。
Since you are using Add-on SDK you are probably best off by using simple-storage. You can also use
makeUuid()
function in thexpcom
package to generate a guaranteed unique identifier. Something like this:Please make sure that you have a privacy policy where you explain that you generate a user identifier and what you use it for.