add popup element and handle server messages

This commit is contained in:
makaveli10
2023-08-08 15:16:55 +05:30
parent b7b4f8a9d2
commit 50e18b5d5f
4 changed files with 105 additions and 5 deletions
+9
View File
@@ -119,6 +119,8 @@ document.addEventListener("DOMContentLoaded", function () {
startButton.disabled = isCapturing;
stopButton.disabled = !isCapturing;
useServerCheckbox.disabled = isCapturing;
useMultilingualCheckbox.disabled = isCapturing;
startButton.classList.toggle("disabled", isCapturing);
stopButton.classList.toggle("disabled", !isCapturing);
}
@@ -165,5 +167,12 @@ document.addEventListener("DOMContentLoaded", function () {
}
}
});
chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
if (request.action === "toggleCaptureButtons") {
toggleCaptureButtons(false);
chrome.storage.local.set({ capturingState: { isCapturing: false } })
}
});
});