diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild index 1241f1b0f94e..7162d0b106cb 100644 --- a/toolkit/toolkit.mozbuild +++ b/toolkit/toolkit.mozbuild @@ -161,7 +161,6 @@ if CONFIG['MOZ_GECKODRIVER'] and not CONFIG['MOZ_TSAN'] and not CONFIG['FUZZING_ DIRS += ['/testing/geckodriver'] DIRS += [ - '/tools/quitter', '/media/gmp-clearkey/0.1', ] diff --git a/tools/quitter/.eslintrc.js b/tools/quitter/.eslintrc.js deleted file mode 100644 index ca920089606d..000000000000 --- a/tools/quitter/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -module.exports = { - globals: { - cloneInto: true, - }, -}; diff --git a/tools/quitter/Makefile.in b/tools/quitter/Makefile.in deleted file mode 100644 index bc0c0852cf7c..000000000000 --- a/tools/quitter/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -XPI_PKGNAME = quitter@mozilla.org diff --git a/tools/quitter/README.md b/tools/quitter/README.md new file mode 100644 index 000000000000..cd726a65fa61 --- /dev/null +++ b/tools/quitter/README.md @@ -0,0 +1,6 @@ +All code for this is part of the quitter project on github: +https://github.com/mozilla-extensions/quitter + +This is within the mozilla-extensions organization so that we can sign the .xpi. + +To update code, please submit a PR to the github repo. Once that is merged in, a JIRA ticket (ex [ADDONSOPS-194](https://mozilla-hub.atlassian.net/browse/ADDONSOPS-194)) is needed to resign the .xpi. \ No newline at end of file diff --git a/tools/quitter/background.js b/tools/quitter/background.js deleted file mode 100644 index a915d953f993..000000000000 --- a/tools/quitter/background.js +++ /dev/null @@ -1,13 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -/* eslint-env webextensions */ - -browser.runtime.onMessage.addListener(msg => { - if (msg === "quit") { - browser.quitter.quit(); - } -}); diff --git a/tools/quitter/contentscript.js b/tools/quitter/contentscript.js deleted file mode 100644 index b0cfc703137d..000000000000 --- a/tools/quitter/contentscript.js +++ /dev/null @@ -1,21 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -/* eslint-env webextensions */ - -const Quitter = { - async quit() { - // This can be called before the background page has loaded, - // so we need to wait for it. - browser.runtime.sendMessage("quit").catch(() => { - setTimeout(Quitter.quit, 100); - }); - }, -}; - -window.wrappedJSObject.Quitter = cloneInto(Quitter, window, { - cloneFunctions: true, -}); diff --git a/tools/quitter/manifest.json b/tools/quitter/manifest.json deleted file mode 100644 index de7f5a67327a..000000000000 --- a/tools/quitter/manifest.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "manifest_version": 2, - - "applications": { - "gecko": {"id": "quitter@mozilla.org"} - }, - - "name": "Quitter", - "description": "Quit", - "version": "2019.12.03", - "author": "Mozilla", - - "background": { - "scripts": ["background.js"] - }, - - "content_scripts": [{ - "js": ["contentscript.js"], - "run_at": "document_start", - "match_about_blank": true, - "matches": [""] - }], - - "experiment_apis": { - "quitter": { - "schema": "schema.json", - "parent": { - "scopes": ["addon_parent"], - "script": "parent.js", - "paths": [["quitter", "quit"]] - } - } - } -} diff --git a/tools/quitter/moz.build b/tools/quitter/moz.build deleted file mode 100644 index d78249335528..000000000000 --- a/tools/quitter/moz.build +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -XPI_NAME = "quitter" - -USE_EXTENSION_MANIFEST = True - -FINAL_TARGET_FILES += [ - "background.js", - "contentscript.js", - "manifest.json", - "parent.js", - "schema.json", -] diff --git a/tools/quitter/parent.js b/tools/quitter/parent.js deleted file mode 100644 index 45b179aa76ae..000000000000 --- a/tools/quitter/parent.js +++ /dev/null @@ -1,25 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -/* globals ExtensionAPI, Services */ - -this.quitter = class extends ExtensionAPI { - getAPI(context) { - return { - quitter: { - async quit() { - let browserWindow = Services.wm.getMostRecentWindow( - "navigator:browser" - ); - if (browserWindow && browserWindow.gBrowserInit) { - await browserWindow.gBrowserInit.idleTasksFinishedPromise; - } - Services.startup.quit(Ci.nsIAppStartup.eForceQuit); - }, - }, - }; - } -}; diff --git a/tools/quitter/quitter@mozilla.org.xpi b/tools/quitter/quitter@mozilla.org.xpi index abf86b7914d7..5f25ca3dad63 100644 Binary files a/tools/quitter/quitter@mozilla.org.xpi and b/tools/quitter/quitter@mozilla.org.xpi differ diff --git a/tools/quitter/schema.json b/tools/quitter/schema.json deleted file mode 100644 index 4c2e6fc86dad..000000000000 --- a/tools/quitter/schema.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { - "namespace": "quitter", - "functions": [ - { - "name": "quit", - "type": "function", - "async": true, - "parameters": [] - } - ] - } -]