add support for unescapeHTML in Chrome/Safari

This commit is contained in:
Simon Kornblith 2011-06-17 19:35:41 +00:00
parent 6169643b16
commit 59f9c1639d

View file

@ -218,9 +218,15 @@ Zotero.Utilities = {
* @type String
*/
"unescapeHTML":function(/**String*/ str) {
var nsISUHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"]
.getService(Components.interfaces.nsIScriptableUnescapeHTML);
return nsISUHTML.unescape(str);
if(Zotero.isFx) {
var nsISUHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"]
.getService(Components.interfaces.nsIScriptableUnescapeHTML);
return nsISUHTML.unescape(str);
} else {
var node = document.createElement("div");
node.innerHTML = str;
return node.textContent;
}
},
/**