mirror of
https://github.com/andwati/kget-capture.git
synced 2026-10-18 03:02:56 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user