Hello,
I want to display Desktop Notification from HTML webresource. If user has opened a web resource, then he moved to another applications, Notification should be displayed by Desktop Notification Javascript functionality.
I have used below code for Desktop Notification, but 'ClientGlobalContext.js.aspx' javascript overwrite the value of 'Notification'. So, below code doesn't working.
function notifyMe() { // Let's check if the browser supports notifications if (!("Notification" in window)) { alert("This browser does not support desktop notification"); } // Let's check whether notification permissions have already been granted else if (Notification.permission === "granted") { // If it's okay let's create a notification var notification = new Notification("Hi there!"); } // Otherwise, we need to ask the user for permission else if (Notification.permission !== "denied") { Notification.requestPermission().then(function (permission) { // If the user accepts, let's create a notification if (permission === "granted") { var notification = new Notification("Hi there!"); } }); } // At last, if the user has denied notifications, and you // want to be respectful there is no need to bother them any more. }
Please suggest me with the solutions.
Thanks in advance!
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156