I’d like to know if there is a way to make an AJAX request with a different set of cookies that the browser contains.
I’m making a specific extension to extend one specific web-page. That page contains some data that can only be seen as an anonymous user (not logged in). What I’m trying to do, is to fetch that data with AJAX when the user is logged-in.
Is that possible to do with chrome extension? Even the most hackish way would be good for me.
Thanks in advance.
Max: There’s no mechanism for loading pages with separate cookie jars inside the same profile. What you can do is play around with the WebRequest Extension API, which is more or less feature-complete on the dev channel. That will allow you to directly manipulate the headers of the outgoing requests that are made, meaning that you can strip cookies, or add your own.
Specifically, you’ll want to look at the
onBeforeSendHeadersevent. Something like this seems like a good start: