-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
54 lines (45 loc) · 1.2 KB
/
demo.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>URLObserver demo</title>
</head>
<body>
<script type="module">
import '/dist/demo/demo.js';
import '/dist/demo/demo-view.js';
</script>
<!-- <script type="module">
import { URLObserver } from '/dist/url-observer.js';
try {
const observer = new URLObserver();
observer.observe([
/^\/test$/i,
/^\/test\/(?<test>[^\/]+)$/i,
]);
const btn = document.body.querySelector('.simulate-urls');
if (btn) {
const links = Array.from(document.body.querySelectorAll('a'));
btn.addEventListener('click', () => {
try {
links.forEach((n) => {
n.click();
console.log(n);
});
} catch (e) {
console.error(e);
}
});
}
console.info('demo:1');
} catch (e) {
console.error('demo:2', e);
}
</script> -->
<!-- <a href="/test/123">/test/123</a>
<a href="/test/456">/test/456</a>
<button class="simulate-urls">Simulate URLs</button> -->
<demo-view></demo-view>
</body>
</html>