Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

chrome storage local update

var storage = chrome.storage.local;

storage.get("key1", function (items){        
    if(items.key1 != undefined) { // Or items["key1"] != undefined
       storage.remove("key1", function (){
           console.log("Key1 has been removed");
       });
    }
    else {
        storage.set({"key1":"value1"}, function (){
            console.log("Key1 has been set");
        });
    }
});
 
PREVIOUS NEXT
Tagged: #chrome #storage #local #update
ADD COMMENT
Topic
Name
8+8 =