diff --git a/src/coincident.worker.ts b/src/coincident.worker.ts index 9b25e97..245ceb5 100644 --- a/src/coincident.worker.ts +++ b/src/coincident.worker.ts @@ -72,9 +72,9 @@ export class XeusCoincidentKernel extends XeusRemoteKernel { const worker = new XeusCoincidentKernel(); -const sendWorkerMessage = workerAPI.processWorkerMessage.bind(workerAPI); -worker.registerCallback(sendWorkerMessage); - workerAPI.initialize = worker.initialize.bind(worker); +workerAPI.mount = worker.mount.bind(worker); +workerAPI.ready = worker.ready.bind(worker); workerAPI.cd = worker.cd.bind(worker); workerAPI.isDir = worker.isDir.bind(worker); +workerAPI.processMessage = worker.processMessage.bind(worker); diff --git a/src/web_worker_kernel.ts b/src/web_worker_kernel.ts index 480cd37..befb0d5 100644 --- a/src/web_worker_kernel.ts +++ b/src/web_worker_kernel.ts @@ -70,9 +70,9 @@ export class WebWorkerKernel implements IKernel { ): IXeusWorkerKernel | Remote { let remote: IXeusWorkerKernel | Remote; if (crossOriginIsolated) { + this._worker.onmessage = this._processCoincidentWorkerMessage.bind(this); + remote = coincident(this._worker) as IXeusWorkerKernel; - remote.processWorkerMessage = - this._processCoincidentWorkerMessage.bind(this); // The coincident worker uses its own filesystem API: (remote.processDriveRequest as any) = async ( data: TDriveRequest