Initialize the Browser Notification
For more comfortable to use we need to take user permission to display web notification.
document.addEventListener('DOMContentLoaded', function () {
if (Notification.permission !== "granted")
{
Notification.requestPermission();
}
});
if(window.Notification && Notification.permission !== "denied") {
Notification.requestPermission(function(status) { // status is "granted", if accepted by user
var n = new Notification('Title', {
body: 'I am the body text!',
icon: '/path/to/icon.png' // optional
});
});
}
Please share and Subscribe to get latest updates and tutorials form Being Idea
In this tutorial, I have write code to add custom meta query in main query…
This website uses cookies.