Fixes #1745, Observe private browsing mode

Don't report translator failure if in private browsing mode

Thanks to ajlyon for the patch
This commit is contained in:
Dan Stillman 2010-11-05 23:00:48 +00:00
parent f724949d83
commit dd53cb5da9

View file

@ -979,6 +979,13 @@ Zotero.Translate.Web.prototype.complete = function(returnValue, error) {
// Report translaton failure if we failed
if(this._currentState == "translate" && errorString && this.translator[0].inRepository && Zotero.Prefs.get("reportTranslationFailure")) {
// Don't report failure if in private browsing mode
var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
.getService(Components.interfaces.nsIPrivateBrowsingService);
if (pbs.privateBrowsingEnabled) {
return;
}
var postBody = "id=" + encodeURIComponent(this.translator[0].translatorID) +
"&lastUpdated=" + encodeURIComponent(this.translator[0].lastUpdated) +
"&diagnostic=" + encodeURIComponent(Zotero.getSystemInfo()) +