Notification: thuộc tính renotify
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Note: This feature is available in Web Workers.
Thuộc tính chỉ đọc renotify của giao diện Notification chỉ định xem người dùng có nên được thông báo lại sau khi một thông báo mới thay thế một thông báo cũ hay không, như được chỉ định trong tùy chọn renotify của constructor Notification().
Giá trị
Một giá trị boolean. false là mặc định; true sẽ khiến thông báo thông báo lại cho người dùng.
Ví dụ
Đoạn mã sau nhằm phát một thông báo sẽ thông báo lại cho người dùng sau khi nó bị thay thế; một object options đơn giản được tạo rồi thông báo được phát bằng constructor Notification().
const options = {
body: "Your code submission has received 3 new review comments.",
renotify: true,
};
const n = new Notification("New review activity", options);
console.log(n.renotify); // true
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| Notifications API> # dom-notification-renotify> |