Ticket #1745: translate.js.diff

File translate.js.diff, 1.3 KB (added by ajlyon, 6 years ago)

Patch for PB observance in translator error reporting

  • chrome/content/zotero/xpcom/translation/translate.js

     
    979979         
    980980        // Report translaton failure if we failed 
    981981        if(this._currentState == "translate" && errorString && this.translator[0].inRepository && Zotero.Prefs.get("reportTranslationFailure")) { 
    982                 var postBody = "id=" + encodeURIComponent(this.translator[0].translatorID) + 
     982                var pbs = Components.classes["@mozilla.org/privatebrowsing;1"] 
     983                        .getService(Components.interfaces.nsIPrivateBrowsingService); 
     984                var inPrivateBrowsingMode = pbs.privateBrowsingEnabled; 
     985 
     986                if (!inPrivateBrowsingMode) { 
     987                        var postBody = "id=" + encodeURIComponent(this.translator[0].translatorID) + 
    983988                                           "&lastUpdated=" + encodeURIComponent(this.translator[0].lastUpdated) + 
    984989                                           "&diagnostic=" + encodeURIComponent(Zotero.getSystemInfo()) + 
    985990                                           "&errorData=" + encodeURIComponent(errorData); 
    986                 Zotero.HTTP.doPost("http://www.zotero.org/repo/report", postBody); 
     991                        Zotero.HTTP.doPost("http://www.zotero.org/repo/report", postBody); 
     992                } 
    987993        } 
    988994} 
    989995 
     
    16981704                } 
    16991705                return returnArray; 
    17001706        } 
    1701 }; 
    1702  No newline at end of file 
     1707};