Skip to content Skip to sidebar Skip to footer

Extension: Chrome.storage Set

Hello everyone :) my other post where we solved the GET. Ok, I got the base working once again - i think. Now I really don't know how the SET command of chrome storage works. This

Solution 1:

I actually got it working with this:

chrome.storage.local.set({"ts_id_js": input_id}, function (obj) { chrome.storage.local.get("ts_id_js", function (obj) { console.log("ts_id_js INSIDE func. test (is this your ID?):" + obj.ts_id_js); //this line is for test output in console });

Only issue now is, that it fails to get the input in the chrome extension popup for some reason. Whenever I try to GET the ID I need to first add

chrome.storage.local.get("ts_id_js", function (obj) {

infront of the code, and then close it at the end

});

(if someone else uses this code, DON'T forget to change all parts that are necessary! (ts_id_js, input_id, obj (obj.ts_id_js))

Post a Comment for "Extension: Chrome.storage Set"