Carl L.
Carl L.

Reputation: 1

Chrome Extension Help - Send data to file to display notification

So I am creating a Chrome Extension, and I've reached a point where I want to create a desktop notification that links to a forum thread. I'm using jQuery to retrieve data from a server, which contains the ID of the thread. Since the only way to do HTML in desktop notifications is to put it in a separate file, I need some way to pass the data onto the external notification file.

I've looked into message passing (http://code.google.com/chrome/extensions/messaging.html), but the data doesn't stay while the notification file is called.

Are there any ideas?

Thanks very much in advance! It is greatly appreciated.

Carl L.

Upvotes: 0

Views: 345

Answers (1)

serg
serg

Reputation: 111265

From a notification you can call your background page directly:

chrome.extension.getBackgroundPage().getCurrentThreadId();

You can also use URL parameters (which you would need to parse on notification's side):

webkitNotifications.createHTMLNotification("notification.html?threadid=100");

Upvotes: 1

Related Questions