Add badge
All checks were successful
Build / build (push) Successful in 42s

This commit is contained in:
Mathieu Strypsteen 2024-02-19 12:17:44 +01:00
parent 9d0b16b443
commit e06babd67c

View file

@ -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();