2011-05-26 17:07:35 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
2018-04-04 03:19:26 +03:00
|
|
|
"use strict";
|
2017-05-01 13:38:39 +03:00
|
|
|
|
2018-04-04 03:19:26 +03:00
|
|
|
/* eslint-env webextensions */
|
2011-05-26 17:07:35 +04:00
|
|
|
|
2018-04-04 03:19:26 +03:00
|
|
|
const Quitter = {
|
2019-12-04 02:55:34 +03:00
|
|
|
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);
|
|
|
|
});
|
2018-04-04 03:19:26 +03:00
|
|
|
},
|
2011-05-26 17:07:35 +04:00
|
|
|
};
|
|
|
|
|
2018-04-04 03:19:26 +03:00
|
|
|
window.wrappedJSObject.Quitter = cloneInto(Quitter, window, {
|
|
|
|
cloneFunctions: true,
|
|
|
|
});
|