Skip to content

Instantly share code, notes, and snippets.

@ochameau
Forked from gregglind/notification.js
Created April 27, 2012 17:07
Show Gist options
  • Save ochameau/2510872 to your computer and use it in GitHub Desktop.
Save ochameau/2510872 to your computer and use it in GitHub Desktop.
example notifcationbox addon
"use strict";
const observer = require("observer-service");
const tabs = require("tabs");
const widgets = require("widget");
const { WindowTracker, isBrowser } = require('api-utils/window-utils');
var widget = widgets.Widget({
id: "mozilla-link",
label: "Mozilla website",
contentURL: "http://www.mozilla.org/favicon.ico",
onClick: function() {
var window = require("api-utils/window-utils").activeBrowserWindow;
var nb = window.gBrowser.getNotificationBox();
var buttons = [{
label: 'Button',
accessKey: 'B',
popup: 'blockedPopupOptions',
callback: null
}];
nb.appendNotification(subject,'got-notice',
'chrome://browser/skin/Info.png',
nb.PRIORY_INFO_LOW, {});
}
});
console.log("The add-on is running.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment