0
votes

I have read tons of SO and no luck. How do I send cookies in API requests from chrome extension? I want to make a post request to my API through chrome extension. But, the API is protected. Luckily, I can get the cookie for the API if I am already logged into my app with chrome.cookie. But, how do you attach that cookie to the API request?

I can get the cookie of the website with chrome.cookie, but how do I attach that cookie to the API request?

The cookie is sent automatically, usually, if you add the site to host_permissions in manifest.json. Don't forget to reload the extension after editing. If the problem isn't solved, please show MCVE in the question i.e. the code, where it runs, how the file is loaded/declared. - wOxxOm
Wow, @wOxxOm. Thank you so much!!! I have been banging my head over this. - Prabin