From cd8f1a4e6c8234caaad62fac325c667a0b03eaf3 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 3 Dec 2019 20:44:13 +0000 Subject: [PATCH] Bug 1598516 - Make Quitter extension retry sending the quit message in case the background script wasn't ready yet. r=mixedpuppy Differential Revision: https://phabricator.services.mozilla.com/D55604 --HG-- extra : moz-landing-system : lando --- tools/quitter/contentscript.js | 8 ++++++-- tools/quitter/quitter@mozilla.org.xpi | Bin 6266 -> 1996 bytes 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/quitter/contentscript.js b/tools/quitter/contentscript.js index fdcbcdd60f1e..71a8afb69a86 100644 --- a/tools/quitter/contentscript.js +++ b/tools/quitter/contentscript.js @@ -7,8 +7,12 @@ /* eslint-env webextensions */ const Quitter = { - quit() { - browser.runtime.sendMessage("quit"); + 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(this.quit, 100); + }); }, }; diff --git a/tools/quitter/quitter@mozilla.org.xpi b/tools/quitter/quitter@mozilla.org.xpi index 4da43cc820c6788db8e879ff5bed63ee3772d94b..34c4e424709598a1e8370a0a0a8140c70224e593 100644 GIT binary patch delta 1611 zcmexmaE8A=z?+#xgn@~HgMooT(PoZDNX1_uD}#}Nffq<8B_?O57v-1crRZf9+xngM zJ8U4Z=eM?-<<`KBg6^xnHMO){@tXSJ(8WTt-oQt?-*!D*_|H0zdybp2wYBlGW8UwD z=UKYDS3H>Z;Y6X!#h|=?A#6PHMO@~z~p$F?)ov}?z%4cMEmfA!BI=K8?&z`8=S_-VI2 z=W_jHKn*FemUh=_U?{mUF)#=KLn=8xuOv0Eq&T@Kv!DbRSgwJNdAEUq^;(p9eu}f| zT{+<;)0r59R5H4rTvB#jtE*;oU3Gfk<@!VQ@4NgiU!HXO=FFQ5?>;Exk>rn=q+au| zvEb}WhPO{I*-sSbaCU17uuA!`F7Dlr@)>IFzc2Y8G{5n{tfFhC)gFl&qv+<@vN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