修改firefox扩展中的通知超时 [英] Modifying the timeout of notifications in a firefox extension
问题描述
notifications.notify({
title:notification title,
text:通知文本,
data:List [i],
onClick:function(data){
tabs.open(data);
}
});
没有办法控制动画。 @canuckistani是一半权利:SDK 通知
和HTML5通知使用相同的基础服务, nsIAlertsService
。此服务不允许您控制持续时间。
桌面Firefox不使用系统级服务,除了Metro实施(尚未正式发布且不无论如何支持附加组件IIRC)。相反,他们使用XUL警报服务实施,这只是一些XUL与一些Javascript和一些额外的CSS 。
根据一些pref,通过 尽管不方便,特别是在没有获得chrome的SDK插件中包打开你自己的XUL窗口,你可以复制/粘贴XUL窗口的控制持续时间自己的叉子,甚至可以覆盖Firefox的默认窗口。 I am using the notification function of the firefox SDK to create a firefox extensions. the problem is that after showing the notification it fades away too quickly , is there a way to modify the timeout of the notification ? this is the code i'm using :
There is no way to control the animation. @canuckistani is half-right: Both the SDK Desktop Firefox does not use system-level services, except for the Metro implementation (yet to be officially released and does not support add-ons anyway IIRC). Instead they use the XUL alert service implementation, which is just some XUL with some Javascript and some additional CSS.And some code to open the window. Depending on some pref, either a hardcoded 4000ms timeout via While not convenient, in particular not in an SDK add-on where you do not get a chrome package to open your own XUL windows from, you could copy/paste implement your own fork of the XUL window with controls for the duration, or even override the Firefox default one.
I cannot recall the name right now, but I know there is or was at least one add-on doing exactly that, overriding the built-in implementation and letting the user choose a custom timeout, among other things. 这篇关于修改firefox扩展中的通知超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! setTimeout <硬件编码的4000ms超时> code>将被使用,或者是一个4s的CSS动画。
现在我不记得名字了,但是我知道至少有一个插件正在做这件事,覆盖了内置的实现,并让用户选择一个自定义超时等等。 p> notifications.notify({
title: "notification title",
text: " notification text ",
data: List[i] ,
onClick: function (data) {
tabs.open(data);
}
});
notifications
and the HTML5 notifications use the same underlying service, the nsIAlertsService
. This service does not allow you to control the duration.setTimeout
will be used, or a 4s CSS animation.