Use the proxy port to communicate with the share worker thread.
// Create a new SharedWorker and get the proxy workervar myWorkerProxy = new SharedWorker( 'backend/worker.js', 'my-worker-name' );
// Get the proxy worker port for communicationvar workerProxyPort = myWorkerProxy.port;
// Send a "wake up" message to the worker
workerProxyPort.postMessage( 'wake-up' );
Use the proxy port to communicate with the share worker thread.
// Create a new SharedWorker and get the proxy worker var myWorkerProxy = new SharedWorker( 'backend/worker.js', 'my-worker-name' ); // Get the proxy worker port for communication var workerProxyPort = myWorkerProxy.port; // Send a "wake up" message to the worker workerProxyPort.postMessage( 'wake-up' );