From e06babd67cf5a6ed150cf9d635a546df02f0e515 Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Mon, 19 Feb 2024 12:17:44 +0100 Subject: [PATCH] Add badge --- worker.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker.ts b/worker.ts index cda3652..5cd590b 100644 --- a/worker.ts +++ b/worker.ts @@ -4,6 +4,7 @@ async function applyProxy() { const { active, host, port, bypass } = await chrome.storage.local.get(["active", "host", "port", "bypass"]) as Storage; if (!active) { chrome.proxy.settings.clear({ scope: "regular" }, function () { }); + await chrome.action.setBadgeText({ text: "" }); return; } const config = { @@ -18,6 +19,7 @@ async function applyProxy() { } }; chrome.proxy.settings.set({ value: config, scope: "regular" }, function () { }); + await chrome.action.setBadgeText({ text: "✓" }); } chrome.storage.onChanged.addListener(() => { void applyProxy(); }); void applyProxy();