SyncMessage support for asynchronous listeners.
This commit is contained in:
parent
0940fc84b3
commit
958bfba66c
|
@ -82,10 +82,9 @@
|
|||
console.error(e, "Processing message %o from %o", msg, sender);
|
||||
}
|
||||
}
|
||||
return {
|
||||
redirectUrl: `data:application/json,${JSON.stringify(result)}`
|
||||
};
|
||||
return result instanceof Promise ? (async () => ret(await result)) : ret(result);
|
||||
};
|
||||
let ret = r => ({redirectUrl: `data:application/json,${JSON.stringify(r)}`})
|
||||
|
||||
let listeners = new Set();
|
||||
browser.runtime.onSyncMessage = {
|
||||
|
|
Loading…
Reference in New Issue