-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiframe.html
More file actions
54 lines (52 loc) · 1.21 KB
/
iframe.html
File metadata and controls
54 lines (52 loc) · 1.21 KB
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" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>IFrame Page</title>
</head>
<body>
<div id="app">
<h1>IFrame Page</h1>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
<p>7</p>
<p>8</p>
<p>9</p>
<p>10</p>
<p>11</p>
<p>12</p>
<p>13</p>
<p>14</p>
<p>15</p>
</div>
<script type="module">
import Postmate from "./src/main.js";
const handshake = new Postmate.Model({
hello: () => {
return "I'm iframe page."
}
});
handshake.then(parent => {
console.log('iframe page handshake completed.');
const observer = new ResizeObserver(() => {
parent.emit('resize', document.documentElement.scrollHeight);
});
observer.observe(document.body);
});
let index = 15;
setInterval(() => {
index ++;
const p = document.createElement('p');
p.textContent = index;
document.getElementById('app').appendChild(p);
console.log("insert p", index);
}, 5000);
</script>
</body>
</html>