From 95003c88e4f5d05e2f7aea9c166f3f3f7ab752aa Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 24 Oct 2010 06:52:54 +0000 Subject: [PATCH] fix translation in Fx 4 trunk builds --- chrome/content/zotero/xpcom/translate.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 8de1041eb..a960a59be 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -1016,7 +1016,20 @@ Zotero.Translate.prototype._generateSandbox = function() { translation.setHandler(arg1, function(obj, item) { try { - arg2(obj, item); + if(Zotero.isFx4) { + // item is wrapped in an XPCCrossOriginWrapper that we can't get rid of + // except by making a deep copy. seems to be due to + // https://bugzilla.mozilla.org/show_bug.cgi?id=580128 + // hear that? that's the sound of me banging my head against the wall. + // if there is no better way to do this soon, i am going to need a + // brain transplant... + var unwrappedItem = JSON.parse(JSON.stringify(item)); + unwrappedItem.complete = item.complete; + } else { + var unwrappedItem = item; + } + + arg2(obj, unwrappedItem); } catch(e) { me.error(false, e); }