qutebrowser/tests/end2end/data/javascript/window_open.html

43 lines
980 B
HTML
Raw Normal View History

2016-09-02 07:41:48 +02:00
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
2018-03-25 19:56:48 +02:00
let my_window;
2016-09-02 07:41:48 +02:00
function open_modal() {
2018-03-25 19:56:48 +02:00
my_window = window.open('about:blank', 'window', 'modal');
2016-09-02 07:41:48 +02:00
}
function open_normal() {
my_window = window.open('about:blank', 'my_window');
}
function open_invalid() {
window.open('', 'my_window');
}
function close_normal() {
my_window.close();
2018-03-25 19:56:48 +02:00
console.log("window closed");
}
function close_twice() {
my_window.close();
my_window.close();
2018-03-25 19:56:48 +02:00
console.log("window closed");
}
2016-09-02 07:41:48 +02:00
</script>
</head>
<body>
<button onclick="open_normal()" id="open-normal">normal</button>
2016-09-02 07:41:48 +02:00
<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>
2016-09-02 07:41:48 +02:00
</body>
</html>