This commit is contained in:
parent
9d0b16b443
commit
e06babd67c
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue