I have a great working chrome extension now.
It basically loops over a list of HTML of a web auction site, if a user has not paid for to have the image shown in the main list. A default image is shown.
- My plugin use a jQuery Ajax request to load the auction page and find the main image to display as a thumbnail for any missing images. WORKS GREAT.
- The plugin finds the correct image url and update the HTML Dom to the new image and sets a new width.
The issue is, that the auction site tracks all pages views and saves it to a “recently viewed” section of the site “users can see any auctions they have clicked on”
ISSUE
– My plugin uses ajax and the cookies are sent via the jQuery ajax request. I am pretty sure I cannot modify the cookies in this request so the auction site tracks the request and for any listing that has a missing image this listing is now shown in my “recently viewed” even though I have not actually navigated to it.
- Can I remove cookies for ajax request (I dont think I can)
- Can chrome remove the cookie (only for the ajax requests)
- Could I get chrome to make the request (eg curl, with no cookie?)
Just for the curious.
Here is a page with missing images on this auction site
Thanks for any input, John.
You can use the
webRequestAPI to intercept and modify requests (including blanking headers). It cannot be used to modify requests which are created within the context of a Chrome extension though. If you want to use this API for cookie-blanking purposes, you have to load the page in a non-extension context. Either by creating a new tab, or use an off-screen tab (using the experimental offscreenTabs API.Another option is to use the
chrome.cookieAPI, and bind aonChangedevent. Then, you can intercept cookie modifications, and revert the changes usingchrome.cookies.set.The last option is to create a new window+tab in Incognito mode. This method is not reliable, and should not be used: