diff --git a/services/sync/tps/extensions/tps/resource/quit.js b/services/sync/tps/extensions/tps/resource/quit.js index d4c2ae9e86c0..f2825d4fe6f3 100644 --- a/services/sync/tps/extensions/tps/resource/quit.js +++ b/services/sync/tps/extensions/tps/resource/quit.js @@ -31,23 +31,8 @@ function goQuitApplication() { return false; } - const kAppStartup = "@mozilla.org/toolkit/app-startup;1"; - const kAppShell = "@mozilla.org/appshell/appShellService;1"; - var appService; - var forceQuit; - - if (kAppStartup in Cc) { - appService = Services.startup; - forceQuit = Ci.nsIAppStartup.eForceQuit; - } else if (kAppShell in Cc) { - appService = Services.appShell; - forceQuit = Ci.nsIAppShellService.eForceQuit; - } else { - throw new Error("goQuitApplication: no AppStartup/appShell"); - } - try { - appService.quit(forceQuit); + Services.startup.quit(Ci.nsIAppStartup.eForceQuit); } catch (ex) { throw new Error(`goQuitApplication: ${ex.message}`); }