angular-notifications icon indicating copy to clipboard operation
angular-notifications copied to clipboard

Enable HTML5 notifications straightaway

Open pablocaselas opened this issue 11 years ago • 2 comments

Hi,

I want to ask the user for html5 notifications as he launches the site. I tried a dirty hack clicking on a button with jQuery but it doesn't work. It only works if it's the user the one who clicks the button.

I know this doesn't have to do with your library but why is that, and how can we bypass this issue?

Thanks

pablocaselas avatar Dec 20 '13 11:12 pablocaselas

I acheived this by calling the $notification.enableHtml5Mode(); in a timeout. But it seems to work only in chrome. Other browsers won't show anything :S

asystat avatar Jan 30 '14 15:01 asystat

Browsers have security around enabling client side notifications. The only way the security won't flag the request is if its triggered based on a browser side click. Once enabled once for a site, it can be used (and checked with Notifications.permissions) without a click.

halkeye avatar Aug 20 '14 17:08 halkeye