How are firefox notifications implemented?

风流意气都作罢 提交于 2019-12-10 23:21:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!