Chrome.storage.local.get issue | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Chrome.storage.local.get issue

I'm working on a chrome extension I'm facing issue when I want to get back my saved data, when I use console.log inside chrome storage api it works but when I assign it to a variable it returns undefined

9th Apr 2022, 12:56 AM
Mohammed RIFAI
Mohammed RIFAI - avatar
2 Answers
+ 2
I've found that chrome.stroage acts async so I've to wait for about 1.5s to get the result, I've achieved that using setTimeout function thank you Ipang
9th Apr 2022, 12:22 PM
Mohammed RIFAI
Mohammed RIFAI - avatar
+ 1
Save a copy of the code in SoloLearn and share its link inside your post Description. It might help improve your chances for answers 👍
9th Apr 2022, 6:48 AM
Ipang