mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 22:28:59 +02:00
40 lines
811 B
HTML
40 lines
811 B
HTML
<html>
|
|
<head>
|
|
<script>
|
|
"use strict";
|
|
|
|
function showNotification1() {
|
|
var options = {
|
|
dir: undefined,
|
|
lang: undefined,
|
|
body: "Test body",
|
|
tag: "Test tag",
|
|
icon: undefined,
|
|
};
|
|
var n = new Notification("Test title", options);
|
|
n.addEventListener("click", function(event) {
|
|
event.preventDefault();
|
|
dump("Should focus new window.");
|
|
newWindow.focus();
|
|
});
|
|
return n;
|
|
}
|
|
|
|
function showNotification2() {
|
|
var options = {
|
|
dir: undefined,
|
|
lang: undefined,
|
|
body: "Test body",
|
|
tag: "Test tag",
|
|
icon: undefined,
|
|
};
|
|
return new Notification("Test title", options);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form id="notificationForm" onsubmit="showNotification();">
|
|
<input type="submit" value="Show notification" id="submit"/>
|
|
</form>
|
|
</body>
|
|
</html>
|