-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe2e-sync.html
More file actions
29 lines (29 loc) · 874 Bytes
/
e2e-sync.html
File metadata and controls
29 lines (29 loc) · 874 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TabStateSync E2E Test</title>
<script type="module">
import { createTabStateSync } from './tabstatesync.bundle.js';
window.tabSync = createTabStateSync('e2e');
// Expose createTabStateSync globally for E2E tests (multiple channels)
window.createTabStateSync = createTabStateSync;
</script>
</head>
<body>
<input id="value" type="text" placeholder="Type to sync" />
<button id="set">Set</button>
<div id="synced"></div>
<script type="module">
const input = document.getElementById('value');
const btn = document.getElementById('set');
const synced = document.getElementById('synced');
btn.onclick = () => {
window.tabSync.set(input.value);
};
window.tabSync.subscribe((v) => {
synced.textContent = v;
});
</script>
</body>
</html>