Don't wrap HTML documents with Zotero.Translate.SandboxManager.Fx5DOMWrapper when performing XPath operations. If we encounter a problem with XML documents at some point, I'll try to figure out how to replace this with a proxy.

Fixes #1851: Voyager translator fails on Newberry catalog in Fx5, Zotero trunk
This commit is contained in:
Simon Kornblith 2011-07-04 16:50:56 +00:00
parent 1774962de9
commit 763d46a565

View file

@ -680,8 +680,10 @@ Zotero.Utilities = {
var results = [];
for(var i in elements) {
var element = elements[i];
// Firefox 5 hack
if(element.__wrappedDOMObject) element = element.__wrappedDOMObject;
// Firefox 5 hack, so we will preserve Fx5DOMWrappers
var useFx5DOMWrapper = !!element.__wrappedDOMObject;
if(useFx5DOMWrapper) element = element.__wrappedDOMObject;
if(element.ownerDocument) {
var rootDoc = element.ownerDocument;
@ -705,7 +707,7 @@ Zotero.Utilities = {
var newEl;
while(newEl = xpathObject.iterateNext()) {
// Firefox 5 hack
results.push(Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(newEl) : newEl);
results.push(useFx5DOMWrapper ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(newEl) : newEl);
}
}