The chrome.identity module doesn't appear to exist when I to call its getAuthToken method from a content script in my extension.
I've checked and triple-checked my manifest to ensure it has the correct key, permissions etc. I've created a Google Console project and set its app id to that of the extension and referenced the appropriate scopes and clientids. Yet whenever I try to invoke the getAuthToken method, I get a TypeError stating that it cannot read the property getAuthToken.
While troubleshooting I did some code inspection using the Dev Tools console and found that, while the
chrome namespace exists, the
identity module is not defined on it (hence my inability to call
getAuthToken).
I'm pretty much at my wits end. Can anyone help?
Samples of my manifest and a screenshot of my console below:
{
"manifest_version": 2,
"name": "xxxxx",
"version": "0.1.9",
"description": "xxxxx",
"icons":{
"16": "icon16x16.png",
"32": "icon32x32.png",
"48": "icon48x48.png",
"64": "icon64x64.png",
"128": "icon128x128.png",
"256": "icon256x256.png"
},
"permissions": [
"identity",
"cookies",
"webRequest",
],
"content_scripts": [
{
"js": [
"init.js"
]
}
],
"oauth2":{
"client_id": "xxxxx",
"scopes":[
]
},
"key": "xxxxx"
}
