This commit is contained in:
2025-07-02 21:56:37 +09:00
commit 29adf2c274
736 changed files with 89300 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
const clients = [];
self.onconnect = function(e) {
console.log(1)
const port = e.ports[0];
clients.push(port)
port.onmessage = function(e) {
const message = e.data;
clients.forEach(client => client.postMessage(message))
}
port.isMaster = function() {
clients.forEach(client => client.postMessage({tabId: port.tabId}))
}
port.setMaster = function(tabId) {
port.tabId = tabId;
}
}