add support for unescapeHTML in Chrome/Safari
This commit is contained in:
parent
6169643b16
commit
59f9c1639d
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue