Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Rohkem teavet

do nothing when "browser-lastwindow-close-requested" is triggered

  • 1 vastus
  • 1 on selline probleem
  • 7 views
  • Viimati vastas User16

more options

I am using services.jsm to addobserver "em-action-requested", "quit-application-granted", "quit-application-requested" : let { classes: Cc, interfaces: Ci, manager: Cm } = Components;

 const {Services} = Components.utils.import('resource://gre/modules/Services.jsm');

function ConfigJS() { Services.obs.addObserver(this, "em-action-requested", false); Services.obs.addObserver(this, "quit-application-granted", false); Services.obs.addObserverr(this, "quit-application-requested", false); Services.obs.addObserver(this, "browser-lastwindow-close-requested", false); }


I want that when one of these actions is triggered, nothing happens (no execution of the code related to these actions). ConfigJS.prototype = {

   observe: function (aSubject, topic, data) {

//do nothing }

does anyone have any idea how we can do this? Thank you

I am using services.jsm to addobserver "em-action-requested", "quit-application-granted", "quit-application-requested" : let { classes: Cc, interfaces: Ci, manager: Cm } = Components; const {Services} = Components.utils.import('resource://gre/modules/Services.jsm'); function ConfigJS() { Services.obs.addObserver(this, "em-action-requested", false); Services.obs.addObserver(this, "quit-application-granted", false); Services.obs.addObserverr(this, "quit-application-requested", false); Services.obs.addObserver(this, "browser-lastwindow-close-requested", false); } I want that when one of these actions is triggered, nothing happens (no execution of the code related to these actions). ConfigJS.prototype = { observe: function (aSubject, topic, data) { //do nothing } does anyone have any idea how we can do this? Thank you

All Replies (1)

more options

with an older version of Firefox, i am using nsIObserverService. and I was able to do that with this code : subject.QueryInterface(Components.interfaces.nsISupportsPRBool); subject.data = true;

So, is there an alternative to nsISupportsPRBool when i use services.jsm ?