An easy way would be to use alert()
on older browsers, e.g.:
if(!("Notification" in window)){
console.log("Browser not supported");
alert("my message");
}else if(Notification.permission === "granted"){
console.log("Show content for New Message");
};
Otherwise, if you're looking for better UX than that, you could write the message to the page.
It would also be a reasonable decision to only use the feature where it is supported. People using IE are unlikely to expect notifications from their browser!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…