JavaScript plugin for desktop notifications in Chrome

NotifyG is just 1.5 kb minified completely standalone JavaScript plugin for desktop notifications in Google Chrome.

NotifyG - JavaScript plugin for desktop notifications in Chrome

Step by step guide

  1. Import nofityG.min.js into your project.
  2. If you want show notification, first you must ask user to allow it. It’s not easy, because notification request is fired only by click event (triggers not works). So bind notifyG.permission() function as click event on some element on you page (for example, I’m using it on all links on page). Notification request is called only once per visit.
  3. Now you can call notifyG.create('notify image', 'notify title', 'notify content', notify_callback) for create desktop notification whenever you want.
  4. Notification is hide after 5 seconds or when user click on notification. You can change global hide interval setting by call notifyG.timeoutValue(time in ms).
  5. For hide all notifications, just call notifyG.clear().

It’s all, it’s simple! Just try it. If you want not-minified version of plugin, write me a comment, I’ll send you on your e-mail.

NotifyG on Bitbucket

Demo (only in Chrome)
NotifyG playground

2 komentáře u „JavaScript plugin for desktop notifications in Chrome

Napsat komentář

Vaše emailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *

Můžete používat následující HTML značky a atributy: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>