简体   繁体   English

Chrome 扩展 - 我的扩展如何维护用户的 session

[英]Chrome Extension - How does my extension maintain the session of the user

my popup has multiple divs on 1 HTML file that are displayed depending on the situation.我的弹出窗口在 1 个 HTML 文件上有多个 div,根据情况显示。 Lets say my user creates a playlist for music and wants to annotate something, but leaves the popup for a minute, once the user clicks back on the extension icon, it goes back to the initial menu.假设我的用户为音乐创建了一个播放列表并想要注释某些内容,但离开弹出窗口一分钟,一旦用户点击扩展图标,它就会返回初始菜单。 What is the strategy behind keeping the session of the user even if they close the popup?即使关闭弹出窗口,保留用户的 session 背后的策略是什么?

You can run a background script which will hold your session state.你可以运行一个后台脚本来保存你的 session state。 Communicate between popup (browser action html) and background script can be done use messages api, or share the same localstorage.弹出窗口(浏览器操作 html)和后台脚本之间的通信可以使用消息 api 来完成,或者共享相同的本地存储。

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

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