()
| 229 | } |
| 230 | |
| 231 | onOpen() { |
| 232 | this.socketSend(JSON.stringify({type: "init", url: location.pathname, hash: location.hash.substring(1)})) |
| 233 | for(let queued of this.socketQueue) { |
| 234 | this.socketSend(queued); |
| 235 | } |
| 236 | // ping the server so that the connection isn't overzealously |
| 237 | // closed |
| 238 | setInterval(() => { |
| 239 | this.socketSend(JSON.stringify({type: "ping"})); |
| 240 | }, 30000); |
| 241 | } |
| 242 | |
| 243 | onClose() { |
| 244 | if(!this.localControl) { |