-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.html
38 lines (31 loc) · 944 Bytes
/
window.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src self 'unsafe-inline' file:">
<title>Window</title>
</head>
<body>
<h1>Window</h1>
<button onclick="onClickNewWindow()">New Window</button>
<button onclick="onClickIncrement()">Increment</button>
<span>Counter=<span id="counter">?</span></span>
<script src="poc.js"></script>
<script>
pocSendLog('starting window');
pocSend('getCounter');
const onClickNewWindow = () => {
pocSendLog('sending poc/new-window');
pocSend('newWindow');
}
const onClickIncrement = () => {
pocSendLog('sending poc/increment');
pocSend('increment');
}
pocAddListener('updateCounter', payload => {
pocSendLog(`received poc/update-counter with ${payload.counter}`);
document.getElementById('counter').innerText = payload.counter;
});
</script>
</body>
</html>