dylang / grunt-notify

Automatic Notifications when Grunt tasks fail.
https://npmjs.org/package/grunt-notify
MIT License
921 stars 73 forks source link

Add support for browser Chrome notifications #101

Open krustnic opened 9 years ago

krustnic commented 9 years ago

Added new platform - browser Chrome. To use Chrome notifications it is needed to install chrome extension (which creates http server and proxies all requests to Chrome Notifications API).

Since grunt-notify searches for supported platform in certain order Chrome platform may not be used because there may be another supported platform (for example 'notification-center' on Mac OS). So the ability to manually specify which platform you want to use is also added. For this reason new option 'platform' is added. It is an object with two properties: 'name' and 'port' (both are optional), for example:

grunt.initConfig({
  notify: {
    mac: {
      options: {
        title: 'Notify Title',
        message: 'This message is shown by Notification Center or not shown at all!',
        platform : {
          // 'growl-notify', 'hey-snarl', 'notification-center', 'notify-send', 'toaster', 'chrome'
          name : 'notification-center'
        }
      }
    },
    chrome: {
      options: {
        title: 'Notify Title',
        message: 'This message is shown by Chrome or not shown at all!',
        platform : {
          name : 'chrome',
          port : 8989
        }
      }
    }
  }
});