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 :
notifications.notify({
title: "notification title",
text: " notification text ",
data: List[i] ,
onClick: function (data) {
tabs.open(data);
}
});
There is no way to control the animation. @canuckistani is half-right: Both the SDK notifications
and the HTML5 notifications use the same underlying service, the nsIAlertsService
. This service does not allow you to control the duration.
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 setTimeout
will be used, or a 4s CSS animation.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With