Describe the test environment as follows:
Ie:11 version
FIREFOX:34 version
chrome:39 version
Statement : Baidu's online search for most of the information, almost all is wrong! Almost all the same is to detect whether the browser supports "desktop reminders" need to use the following code:
Determine if the browser supports notifications
function supported () {
if (window.webkitnotifications) {
Alert (' Browser support notifications ');
} else {
Alert (' Browser does not support notifications ');
}
}
If you put the core object "window.webkitnotifications" in the above code into IE11, Google, and Firefox, the results are all the same--undefined! The three major browser tests are as follows:
Really hate yourself not to see the official HTML5 document. Then finally found an article, the original HTML5 desktop reminders, in fact, in the major browsers have been supported! The object to be detected is not just the webkitnotifications, but one calledwindow. Notification"the Object!
Test findings:
IE11 does not support desktop reminders, the results are as follows:
Firefox and Chrome support, the results are as follows:
So the related functions and code of desktop reminders should be modified as follows:
------------------
Http://www.html5china.com/HTML5features/Notifications/20110926_2049.html
Http://www.html5china.com/HTML5features/Notifications/20110926_2049.html
http://www.html5china.com/HTML5features/Notifications/
Http://www.th7.cn/web/js/201408/53473.shtml
Desktop reminders about HTML5--notification