diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js index c1ae6612d5..8ad933cadc 100644 --- a/chrome/content/zotero/xpcom/http.js +++ b/chrome/content/zotero/xpcom/http.js @@ -43,6 +43,11 @@ Zotero.HTTP = new function() { var channel = xmlhttp.channel; channel.QueryInterface(Components.interfaces.nsIHttpChannelInternal); channel.forceAllowThirdPartyCookie = true; + + // Set charset + if (responseCharset) { + channel.contentCharset = responseCharset; + } // Don't cache GET requests xmlhttp.channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE; @@ -104,6 +109,11 @@ Zotero.HTTP = new function() { channel.QueryInterface(Components.interfaces.nsIHttpChannelInternal); channel.forceAllowThirdPartyCookie = true; + // Set charset + if (responseCharset) { + channel.contentCharset = responseCharset; + } + if (headers) { if (typeof headers == 'string') { var msg = "doPost() now takes a headers object rather than a requestContentType -- update your code"; diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 0700cf9d89..2206a970e3 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -402,9 +402,16 @@ Zotero.Translate.SandboxManager = function(sandboxLocation) { this.parseFromString = function(str, contentType) _DOMParser.parseFromString(str, contentType); } } - } + }; this.sandbox.DOMParser.__exposedProps__ = {"prototype":"r"}; this.sandbox.DOMParser.prototype = {}; + this.sandbox.XMLSerializer = function() { + var s = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"] + .createInstance(Components.interfaces.nsIDOMSerializer); + this.serializeToString = function(doc) { + return s.serializeToString(Zotero.Translate.DOMWrapper.unwrapIfWrapped(doc)); + }; + }; } Zotero.Translate.SandboxManager.prototype = {