0

I'm trying to save the popup state and I can't figure out how the popup itself would know right before it happens? All the solutions found here are about to notifying background not popup itself.

Thanks

mimic
  • 4,897
  • 7
  • 54
  • 93
  • The browser closes it unconditionally so no. You should autosave the state to storage right after it's changed to prevent data loss. – wOxxOm Dec 10 '17 at 02:27
  • @wOxxOm Sorry I don't understand you. How to do it technically? – mimic Dec 10 '17 at 03:02
  • 1
    You should constantly listen to any changes and save each new data or info to storage like wOxxOm said. What is the exact data than you need to save? – Luka Čelebić Dec 10 '17 at 03:09
  • @PredatorIWD Ah, okay. So the only solution is to store data every time they changed? Hm it could be tricky because I want to restore the whole popup UI and data: which tab is selected, which data is showing right now and which state those data have. – mimic Dec 10 '17 at 03:12
  • You can save each individual data then and fill it up on the next popup load. – Luka Čelebić Dec 10 '17 at 03:13
  • @PredatorIWD Yes I can but I thought there is more natural way to do it - exactly *before* popup closed. And I really don't understand why there is no such event. – mimic Dec 10 '17 at 03:15
  • Check out this question: https://stackoverflow.com/q/15798516/6908282 – Gangula Jun 14 '23 at 06:33

0 Answers0