问题
I would like to implement a notification mechanism in a firefox extension equal to firefox's "save password" option or popup blocking warning with the yellow bar sliding in above the main window.
Does anybody now how this can be achieved in XUL?
Thanks for any help.
回答1:
You'll want to use the notifcationbox element for this.
回答2:
Thanks to the hint of sdwilsh, a wrote the following code to achive my goal:
var notificationBox = gBrowser.getNotificationBox(); notificationBox.appendNotification("This is my message", "popup-blocked", "chrome://browser/skin/Info.png", notificationBox.PRIORITY_WARNING_MEDIUM);
来源:https://stackoverflow.com/questions/1737628/how-are-firefox-notifications-implemented