File: button-overlay-oopif.html

package info (click to toggle)
node-playwright 1.38.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,728 kB
  • sloc: javascript: 114,018; sh: 899; java: 372; xml: 247; cs: 118; python: 29; makefile: 12
file content (39 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (2)
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
<style>
* {
  padding: 0;
  margin: 0;
}

iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
}

button {
  position: absolute;
  top: 150px;
  left: 150px;
  width: 200px;
  height: 200px;
}
</style>
<script>
window.addEventListener('DOMContentLoaded', () => {
  const iframe = document.createElement('iframe');
  const url = new URL(location.href);
  url.hostname = url.hostname === 'localhost' ? '127.0.0.1' : 'localhost';
  url.pathname = '/grid.html';
  iframe.src = url.toString();
  document.body.append(iframe);

  const button = document.createElement('button');
  button.textContent = 'CLICK ME';
  button.addEventListener('click', () => {
    window.BUTTON_CLICKED = true;
  }, false);
  document.body.append(button);
}, false);
</script>