为什么刷新页面后Shared Worker会死掉?它必须重新启动。如何解决这个问题?
刷新前
刷新后(在example.com上按F5)
父Worker
var port = new SharedWorker('/app/worker-5n1261e73b.js').port;
port.onmessage = function(e){
console.log(e.data);
};
port.start();
worker-5n1261e73b.js
onconnect = function(e){
var port = e.ports[0];
port.onmessage = function(e){
console.log(e.data);
};
port.start();
port.postMessage('Connected');
};