I'm developing a Google Chrome extension, and have been working on one for a while. So it's been installed for a while, and I updated the manifest file to include the "storage" permission and reloaded the extension. However, when I try it in the console, chrome.storage
is undefined
. I restarted Chrome and still nothing.
My manifest file looks like this:
{
... snip ...
"permissions": [
"tabs",
"http://*/*",
"https://*/*",
"chrome://favicon/",
"storage"
]
}
I could reinstall the application, but I'm hesitant, since: Will it be the same for the existing users of the extension? It says in the documentation that the permission won't show any warnings or temporarily block the extension for adding more permissions.
My question is mainly, how will the existing users of my extension be affected? Will they get a warning and have the extension disabled until they actively enable it? Or is it just a local develpment issue?
chrome.storage.local.get('myKey', function(data) {console.log(JSON.stringify(data))}) and in that case ‘undefined’ is returned too. slosd
Use the chrome.storage API to store, retrieve, and track changes to user data. This API has been optimized to meet the specific storage needs of extensions. It provides the same storage capabilities as the localStorage API with the following key differences:
Use the chrome.storage API to store, retrieve, and track changes to user data. This API has been optimized to meet the specific storage needs of extensions. It provides the same storage capabilities as the localStorage API with the following key differences: User data can be automatically synced with Chrome sync (using storage.sync ).
The storage area isn't encrypted. The storage.managed storage is read-only. chrome.storage is not a big truck. It's a series of tubes.
Your manifest looks fine. Did you reload your extension after making the change?
I pasted your manifest permissions into a new extension and called:
console.log(chrome.storage);
And recieved the following:
Note "local" and "sync", the two types of storage available to the extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With