message: wait for WebScoket to become open before calling send.
diff: @@ -221,7 +221,13 @@ socket.addEventListener("message", (event) => {
  socket.onclose = () => { document.title = `[Disconnected] ${document.title}` }
  document.addEventListener('pagesinit', (e) => {
  + if (socket.readyState === 1) {
  socket.send(JSON.stringify({type:"loaded", path:file}))
  + } else {
  + socket.addEventListener("open", () => {
  + socket.send(JSON.stringify({type:"loaded", path:file}))
  + }, {once: true})
  + }
  })
  // if we're embedded we cannot open external links here. So we intercept clicks and forward them to the extension
  