• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!doctype html>
2<title>This tab will have its connection observed</title>
3<script>
4'use strict';
5
6let protocol = location.protocol.replace('http', 'ws');
7let url = protocol + '//' + location.host + '/close-observer?role=observed';
8
9window.ws = new WebSocket(url);
10ws.onopen = () => {
11  document.title = 'CONNECTED';
12  ws.onclose = null;
13};
14ws.onclose = () => {
15  document.title = 'CLOSED';
16};
17
18// Leave the connection open.
19</script>
20