2808 explained code solutions for 75 technologies


chrome-extensionSave object to chrome.storage


chrome.storage.sync.set({obj: 'Hi'}, function() { console.log('saved'); });ctrl + c
chrome.storage

extension storage API

.set

saves object to storage by specified key

obj

key to save our object under

'Hi'

example object to save (simple string in our case)

console.log('saved')

because set is asynchronous, we specify callback to know when object is actually saved