File: window_open.html

package info (click to toggle)
qutebrowser 3.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,432 kB
  • sloc: python: 72,411; javascript: 31,862; sh: 874; xml: 149; makefile: 52
file content (42 lines) | stat: -rw-r--r-- 980 bytes parent folder | download | duplicates (4)
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
<!DOCTYPE html>
<html>

<head>
<script type="text/javascript">
    let my_window;

    function open_modal() {
        my_window = window.open('about:blank', 'window', 'modal');
    }

    function open_normal() {
        my_window = window.open('about:blank', 'my_window');
    }

    function open_invalid() {
        window.open('', 'my_window');
    }

    function close_normal() {
        my_window.close();
        console.log("window closed");
    }

    function close_twice() {
        my_window.close();
        my_window.close();
        console.log("window closed");
    }
</script>
</head>

<body>

<button onclick="open_normal()" id="open-normal">normal</button>
<button onclick="open_modal()" id="open-modal">modal</button>
<button onclick="open_invalid()" id="open-invalid">invalid/no URL</button>
<button onclick="close_normal()" id="close-normal">close</button>
<button onclick="close_twice()" id="close-twice">close twice (issue 906)</button>

</body>
</html>