MCPcopy Index your code
hub / github.com/devploit/debugHunter / setupCheckbox

Function setupCheckbox

options.js:91–104  ·  view source on GitHub ↗
(inputId, storageKey, defaultValue = true)

Source from the content-addressed store, hash-verified

89// ============================================================================
90
91function setupCheckbox(inputId, storageKey, defaultValue = true) {
92 const input = document.getElementById(inputId);
93 if (!input) return;
94
95 // Load saved value
96 chrome.storage.sync.get(storageKey, (data) => {
97 input.checked = data[storageKey] !== undefined ? data[storageKey] : defaultValue;
98 });
99
100 // Save on change
101 input.addEventListener('change', (e) => {
102 saveOption(storageKey, e.target.checked);
103 });
104}
105
106// ============================================================================
107// SELECT INPUTS

Callers 1

options.jsFile · 0.85

Calls 1

saveOptionFunction · 0.85

Tested by

no test coverage detected