在我的Firefox插件警报窗口 [英] alert window in my firefox addon
本文介绍了在我的Firefox插件警报窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pre>
alert('This is an alert');
但是,它不会识别'alert'。什么组件应该包含(要求)?
谢谢!
解决方案
也许这可以帮助你?
由于链接偶尔会死掉,我会为您节省一些滚动操作,并发布可能最有用的代码:
let alertsService =
Cc [@ mozilla.org/alerts-service;1\"].getService(Ci.nsIAlertsService);
let title = this._bundle.getString(xulschoolhello.greeting.title);
let message = this._bundle.getString(xulschoolhello.greeting.label);
alertsService.showAlertNotification(
chrome://xulschoolhello/skin/hello-notification.png,
title,message,true,,this,XULSchool Hello信息);
I'm fresh to firefox addons development, so pls excuse me if it's too dumb. I just couldnt find the answer here in the Stack.
I try to launch an alert window from my addon:
alert('This is an alert');
However, it won't recognize 'alert'. What component should I include (Require)?
Thanks!
解决方案
Perhaps this could help you?
Since links occasionally die I'll save you some scrolling and post the code that might be most useful:
let alertsService =
Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
let title = this._bundle.getString("xulschoolhello.greeting.title");
let message = this._bundle.getString("xulschoolhello.greeting.label");
alertsService.showAlertNotification(
"chrome://xulschoolhello/skin/hello-notification.png",
title, message, true, "", this, "XULSchool Hello Message");
这篇关于在我的Firefox插件警报窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文