Why is chrome.cookies undefined in a content script? Why is chrome.cookies undefined in a content script? google-chrome google-chrome

Why is chrome.cookies undefined in a content script?


Quoting the docs about content scripts:

[Content scripts cannot] Use chrome.* APIs (except for parts of chrome.extension)

So, to use chrome.cookies API, you need to do so from a background page, communicating with the content script if needed.


In case someone skipped this, be sure to add "cookies" to permissions.