summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/tabs/file_window_open.html
blob: 831bafe6bdf497618755f6be02a8f08e0d563f26 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <title>window.open test</title>
<style>
div {
  padding: 20px;
}
</style>
</head>
<body>
  <div>
  <input id="instant" type="button" value="instant no features"
         onclick="window.open('about:blank', '_blank');">
  </div>
  <div>
  <input id="instant-popup" type="button" value="instant popup"
         onclick="window.open('about:blank', '_blank', 'popup=true');">
  </div>
  <div>
  <input id="delayed" type="button" value="delayed no features"
         onclick="setTimeout(() => window.open('about:blank', '_blank'), 100);">
  </div>
  <div>
  <input id="delayed-popup" type="button" value="delayed popup"
         onclick="setTimeout(() => window.open('about:blank', '_blank', 'popup=true'), 100);">
  <div>
  <div>
  <a id="link-instant" href=""
         onclick="window.open('about:blank', '_blank'); event.preventDefault()">
    instant no features
  </a>
  </div>
  <div>
  <a id="link-instant-popup" href=""
         onclick="window.open('about:blank', '_blank', 'popup=true'); event.preventDefault()">
    instant popup
  </a>
  </div>
  <div>
  <a id="link-delayed" href=""
         onclick="setTimeout(() => window.open('about:blank', '_blank'), 100); event.preventDefault()">
    delayed no features
  </a>
  </div>
  <div>
  <a id="link-delayed-popup" href=""
         onclick="setTimeout(() => window.open('about:blank', '_blank', 'popup=true'), 100); event.preventDefault()">
    delayed popup
  </a>
  <div>
  <div>
  <input id="focus-check" type="button" value="check focus"
         onclick="document.getElementById('focus-result').value = 'ok';">
  </div>
  <div>
  <input id="focus-result" type="text" value="">

<script type="text/javascript">
document.addEventListener("keydown", event => {
  if (event.key == "x") {
    window.open('about:blank', '_blank');
  }
  if (event.key == "y") {
    window.open('about:blank', '_blank', 'popup=true');
  }
});
</script>
</body>
</html>