commit c36a2b32b16787020ab6bf45b211dcfaab043cc0
parent 17e9c466d04ef0f88018c24b9e88b88355ea0c31
Author: Simon Kornblith <simon@simonster.com>
Date: Fri, 17 Feb 2012 14:48:26 -0500
Merge branch '3.0'
Diffstat:
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git 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
@@ -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 = {