I've made a small (bootstrapped) extension to notify me about for some changes on a site. Everything has done, except of displaying notifications.
As I understand HTML5 Notification is not accessible from extensions.
Then I found another way with PopupNotifications.jsm. But the common sample of usage is not working, because "gBrowser is not defined". This variable is used to creating a notification.
I don't want to use any external extensions to work with notifications (I've found at least two). I need a standalone extension.
There is another way - using of the sdk. But I am not ready to use it just for notifications. I want to do my extension as simplest as it possible.
Example I found here: https://developer.mozilla.org/en-US/docs/Using_popup_notifications
OK, now the question: what the best way to add notifications to my extension with minimal changes? Continue with PopupNotifications.jsm? Or try to createInstanse of nsIDOMDesktopNotification (but I don't know suited class name, like '@mozilla.org/...'). What can you suggest me?
You can use the alert service or create it manually from
chrome://global/content/alerts/alert.xul
: