-
-
Save ochameau/2510872 to your computer and use it in GitHub Desktop.
example notifcationbox addon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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