Reputation: 7550
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.
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.
Just for the curious. Here is a page with missing images on this auction site
Thanks for any input, John.
Upvotes: 2
Views: 2618
Reputation: 349192
You can use the webRequest
API 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.cookie
API, and bind a onChanged
event. Then, you can intercept cookie modifications, and revert the changes using chrome.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:
Upvotes: 4
Reputation: 5685
Presumably this AJAX interaction is being run from a content script? Could you run it from the background page instead and pass the data to the content script? I belive the background page operates in a different context and shouldn't send the normal cookies.
Upvotes: 0