0

Let's say, I'm a logged-in user in google. Now I'd like to send one ajax request there WITHOUT sending any cookies. (But naturally, I want to keep those cookies for the future). How is that possible?

i'm interested in solution for ajaxing INSIDE chrome extension

important edit: I'm talking about intercepting requests sent FROM the extension itself! There the beforeHeadersSend don't work...

Novellizator
  • 13,633
  • 9
  • 43
  • 65
  • this may help - http://stackoverflow.com/questions/11091277/send-xhr-request-from-chrome-extension-with-cookies – Jaromanda X Aug 03 '15 at 14:07
  • this helps me reset the cookie but not to delete it temporarily for one request :( Or should I: save cookies, delete them, send request, set the up again ? – Novellizator Aug 03 '15 at 14:11
  • if you read the first comment to the question (by Rob W), that would direct you to http://stackoverflow.com/questions/10334909/associate-a-custom-user-agent-to-a-specific-google-chrome-page-tab/10339902#10339902 - which shows how to change the User-Agent request header - the same principal applies to changing the Cookie header for the request – Jaromanda X Aug 03 '15 at 14:15
  • Well I tried that but it does not seem to be able to intercept requests sent FROM the extension. It can only intercept requests sent from external source. Am I mistaken? – Novellizator Aug 03 '15 at 15:54
  • Perhaps it's even easier. Try using the `setRequestHeader` method on the `xmlHttpRequest` object – Jaromanda X Aug 04 '15 at 01:50
  • Does not work. I'm doing a super-ugly hack: deleting cookies, do request, restore cookies. – Novellizator Aug 04 '15 at 07:12

0 Answers0