Alex Rivera | Logout

How to send real growl messages with javascript?

Asked 2009-09-18T16:15:50.520
19

Is it possible to post growl notifications to a user's computer, from a web application, using javascript? This will be only on an intranet application so security is not a major concern. Additionally it will be limited to only Mac users with Safari or Firefox.

Thanks.

Edit
Report

2 Answers

7

Growl has a network interface, and HTML 5 has Web Sockets, so in theory it might be possible entirely in JavaScript (when Web Sockets are implemented). More realistically, if your webserver is connected to the same network as your clients (i.e. can see and connect to their individual IP addresses), you could do an AJAX style callback to a script on the server that will make the network request.

answered 2009-09-18T16:23:45.803
3

Fluid, a site-specific browser generator for Mac, exposes a JavaScript Growl notification API [1]:

window.fluid.showGrowlNotification({
    title: "title", 
    description: "description", 
    priority: 1, 
    sticky: false,
    identifier: "foo",
    onclick: callbackFunc,
    icon: imgEl // or URL string
})

Relevant source is on the Fluid Developer page.

You can search for real-world examples at userscripts.org.

One downside with this approach is, of course, you have to force your users to use a Fluid browser when accessing the intranet application.

Setting up a bridge like Adam suggests has the advantage of requiring minimum effort from the users.

answered 2011-04-19T22:15:48.710

Your Answer