I have a weird issue that wasted too much time. I have content script that tries to read some data from the storage.sync API but it fails.
I've added the storage permission and I was able to work with the storage.sync API in the options.js file.
Can you spot what went wrong?
document.addEventListener('DOMContentLoaded', function () { chrome.storage.sync.get([ 'var1', 'var2', ], function(items) { alert("got it"); }); } This is the error message:
CONTENT_SCRIPT context for xxxxx) Lazy require of extension.binding did not set the binding field
(CONTENT_SCRIPT context for xxxxx) extensions::lastError:82: Uncaught TypeError: Cannot convert undefined or null to object{TypeError: Cannot convert undefined or null to object at Object.clear (extensions::lastError:82:23) at handleResponse (extensions::sendRequest:84:15) at restore at HTMLDocument.}