Requires the Growl SDK for compilation, which can be obtained here.
This is an NPAPI based browser plugin that exposes 4 functions (register, isInstalled, isRunning, and notify) to JS.
Embed the plugin and then get the embed element, once that is done you can call the JS functions at will.
<embed type="application/x-jsgrowl" id="growl" hidden="true" />
var growl = document.getElementById('growl');
Registration is a mandatory step before you can call anything further.
The application name is what will show up in the growl preference pane under os x for customizing the alerts.
Register can be called with an optional url to an application icon. growl.register("my app", "http://myapp.com/myicon.png");
growl.isInstalled() - returns true if growl is installed.
growl.isRunning() - returns true if growl is running.
growl.notify("title", "message") - sends to growl with no icon.
growl.notify("title", "message" "image url") - sends to growl and attempts to download url with a 3 second timeout displaying the image as the growl icon
(The MIT License)
Copyright (c) 2011 Nicholas Letourneau ( http://nicholasletorneau.com )
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.