commit 9ce0e47117e2fc0bb4a64fa60a4d9e6b21a987e2
parent 7756620490b7b44fe812372e87cd57f26b3142e1
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 16 Aug 2011 16:13:59 +0000
Support synchronous getTranslatorObject() in Firefox connecotr
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -342,13 +342,18 @@ Zotero.Translate.Sandbox = {
haveTranslatorFunction(translation.translator[0]);
return translation._sandboxManager.sandbox;
} else {
- if(Zotero.isConnector && !callback) {
+ if(Zotero.isConnector && !Zotero.isFx && !callback) {
throw new Error("Translator must pass a callback to getTranslatorObject() to "+
"operate in this translation environment.");
}
Zotero.Translators.get(translation.translator[0], haveTranslatorFunction);
- if(!Zotero.isConnector) return sandbox;
+ if(Zotero.isConnector && Zotero.isFx && !callback) {
+ while(!sandbox) {
+ Zotero.mainThread.processNextEvent(true);
+ }
+ }
+ if(sandbox) return sandbox;
}
};