mirror of
https://github.com/zotero/zotero.git
synced 2026-09-21 00:22:44 +00:00
Support synchronous getTranslatorObject() in Firefox connecotr
This commit is contained in:
parent
7756620490
commit
9ce0e47117
1 changed files with 7 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue