Firefox cookie read event?
Using observer and cookie-changedtopic, we can get to know when a cookie
is added, changed, cleared, or deleted. The script below do the same,
var httpRequestObserver_cookies = { observe: function(aSubject, aTopic,
aData) { if ("cookie-changed" == aTopic) { //cookie was added, changed,
cleared, or deleted } },
get observerService()
{
return
Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
},
register: function()
{
this.observerService.addObserver(this, "cookie-changed", false);
},
unregister: function()
{
this.observerService.removeObserver(this, "cookie-changed");
}
};
Without modifying the cookie, I want to serve modified cookie dynamically,
Is there any way to know when a cookie is read and the data passed which
can be modified?
No comments:
Post a Comment