mirror of
https://github.com/andwati/kget-capture.git
synced 2026-10-18 03:02:56 +00:00
17 lines
555 B
JavaScript
17 lines
555 B
JavaScript
const checkbox = document.getElementById("auto-capture-toggle");
|
|
const statusLine = document.getElementById("status-line");
|
|
|
|
function renderStatus(enabled) {
|
|
statusLine.textContent = `Auto-capture: ${enabled ? "ON" : "OFF"}`;
|
|
}
|
|
|
|
chrome.storage.local.get({ autoCaptureEnabled: true }).then(({ autoCaptureEnabled }) => {
|
|
checkbox.checked = autoCaptureEnabled;
|
|
renderStatus(autoCaptureEnabled);
|
|
});
|
|
|
|
checkbox.addEventListener("change", () => {
|
|
chrome.storage.local.set({ autoCaptureEnabled: checkbox.checked });
|
|
renderStatus(checkbox.checked);
|
|
});
|