-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (47 loc) · 1.71 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
var swRegistration = null;
console.log('About to try to install a Service Worker');
navigator.serviceWorker.register('sw.js', {scope: "./"})
.then(function (serviceWorker) {
swRegistration = serviceWorker;
console.log('Successfully installed ServiceWorker');
serviceWorker.addEventListener('statechange', function(event) {
console.log("Worker state is now "+event.target.state);
});
serviceWorker.addEventListener('fetch', (event) => {
console.log("fetch resource", event)
})
console.log("active: ",swRegistration.active);
}, function (why) {
console.log('Failed to install:' + why);
});
</script>
<div style="max-width: 700px; margin: 0 auto 0 auto;">
<h1>Twitter iFrame embed test</h1>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Looking for CMS recommendations:<br><br>- Good TypeScript
support<br>- Queryable from Edge runtime<br><br>Any suggestions?</p>— Sam Selikoff (@samselikoff) <a
href="https://twitter.com/samselikoff/status/1595137918448054272?ref_src=twsrc%5Etfw">November 22, 2022</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
<script>
addEventListener('message', (e) => {
console.log(e.data["twttr.embed"]);
if (e.data["twttr.embed"]?.id === "twitter-widget-0") {
console.log("clients:", self.clients)
self.clients?.matchAll().then(function (clients) {
console.log("clients: ", clients);
clients.forEach(function (client) {
console.log("concrete client:", client);
});
});
}
});
</script>
</body>
</html>