Join us and the lead editor of IRL, Mozilla's multi-award-winning podcast, for a behind-the-scenes look at the pod and to contribute your ideas for the next season, themed: "AI and ME." Mark your calendar and join our Community Call on Wednesday, Aug 7, 17:00–17:45 UTC. See you there!

Prohledat stránky podpory

Vyhněte se podvodům. Za účelem poskytnutí podpory vás nikdy nežádáme, abyste zavolali nebo poslali SMS na nějaké telefonní číslo nebo abyste sdělili své osobní údaje. Jakékoliv podezřelé chování nám prosím nahlaste pomocí odkazu „Nahlásit zneužití“.

Zjistit více

Detect browser close event

  • 1 odpověď
  • 1 má tento problém
  • 1 zobrazení
  • Poslední odpověď od FredMcD

more options

We are working with Firefox Portable ESR 78.6.0 on windows 10 OS We need to detect the close event to override it, or disable it when the user try to close the browser from the taskbar.

With an older version of Firefox Portable ESR (52.2.0), we used the following code to detect browser closure:

var observerService = Components.classes ["@ mozilla.org/observer-service;1"OUND.getService(Components.interfaces.nsIObserverService); observerService.addObserver (this, "quit-application-granted", false); observerService.addObserver (this, "quit-application-requested", false); observerService.addObserver (this, "browser-lastwindow-close-requested", false);


This code is no longer compatible with the version 78.6.0.

When the user close the browser from the taskbar we need to check:

if (user can close) close browser else do not close the browser

So, is there a way or an add-on to install to disable the closing of the browser from the taskbar? Or if possible how can we override the browser's code to prevent the user's click on "close window" ?

We are working with Firefox Portable ESR 78.6.0 on windows 10 OS We need to detect the close event to override it, or disable it when the user try to close the browser from the taskbar. With an older version of Firefox Portable ESR (52.2.0), we used the following code to detect browser closure: var observerService = Components.classes ["@ mozilla.org/observer-service;1"OUND.getService(Components.interfaces.nsIObserverService); observerService.addObserver (this, "quit-application-granted", false); observerService.addObserver (this, "quit-application-requested", false); observerService.addObserver (this, "browser-lastwindow-close-requested", false); This code is no longer compatible with the version 78.6.0. When the user close the browser from the taskbar we need to check: if (user can close) close browser else do not close the browser So, is there a way or an add-on to install to disable the closing of the browser from the taskbar? Or if possible how can we override the browser's code to prevent the user's click on "close window" ?
Přiložené obrázky

Všechny odpovědi (1)

more options

Firefox Portable is a 3rd-party build. Support is available here: http://portableapps.com/forums/support/firefox_portable