Save to chrome.storage on Setting Page and Read from Content script -


i read in https://developer.chrome.com/extensions/storage possible content script read directly storage api.

i have setting page allow user save credentials, , want access credentials content script. reason when "get" content-script empty values...

also - how can debug , see storage data chrome developer tools?

chrome.storage.sync.get({'username':undefined,'password':undefined}, function(items) {     console.log(items.username)     username = items.username;     password = items.password;     console.log(typeof(username)) }); 

i found if don't use dictionary in .get api works. reason(probably bug) when using dictionary interface content-script doesn't find data.

from setting page .get dictionary worked.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -