1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-14 08:15:03 +12:00

Firefox: this fixes ocasional bad cookie handling

This commit is contained in:
gorhill 2015-05-07 19:31:27 -04:00
parent 05089dc370
commit 1e1ec2e92c

View file

@ -1930,11 +1930,14 @@ vAPI.cookies.observe = function(subject, topic, reason) {
if ( topic !== 'cookie-changed' ) {
return;
}
var handler = reason === 'deleted' ? this.onRemoved : this.onChanged;
if ( typeof handler !== 'function' ) {
// https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieService
if ( reason === 'deleted' || subject instanceof Ci.nsICookie2 === false ) {
return;
}
handler(new this.CookieEntry(subject.QueryInterface(Ci.nsICookie)));
if ( typeof this.onChanged !== 'function' ) {
return;
}
this.onChanged(new this.CookieEntry(subject));
};
/******************************************************************************/