简体   繁体   中英

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. 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?

You can run a background script which will hold your session state. Communicate between popup (browser action html) and background script can be done use messages api, or share the same localstorage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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