HTML5 Notification not working in Mobile Chrome
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using the HTML5 notification API to notify the user in Chrome or Firefox. On desktop browsers, it works. However in Chrome 42 for Android, the permission is requested but the notification itself is not displayed. The request code, works on all devices: if ('Notification' in window) { Notification.requestPermission(); } The sending code, works on desktop browser but not on mobile: if ('Notification' in window) { new Notification('Notify you'); } 回答1: Try the following: navigator.serviceWorker.register('sw.js'); Notification