Chrome.identity not available/undefined

前端 未结 2 1239
终归单人心
终归单人心 2021-01-07 18:19

I am writing a chrome extension in which I am trying to use the chrome.identity API. But my Chrome doesn\'t recognize identity.

On the following code in developer to

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-07 18:35

    The reason I was not able to use identity was because I was trying to access it from a content script. I switched to a background script and it works now! Thanks Rob!

    PS! You also need to have "permissions": ["identity"] set in your manifest.json.

提交回复
热议问题