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

Function renderWhitelist

options.js:160–188  ·  view source on GitHub ↗
(whitelist)

Source from the content-addressed store, hash-verified

158// ============================================================================
159
160function renderWhitelist(whitelist) {
161 const container = document.getElementById('whitelistItems');
162 if (!container) return;
163
164 container.innerHTML = '';
165
166 if (!whitelist || whitelist.length === 0) {
167 container.innerHTML = '<div style="color: var(--text-muted); font-size: 12px; padding: 12px; text-align: center;">No whitelisted domains</div>';
168 return;
169 }
170
171 whitelist.forEach(domain => {
172 const item = document.createElement('div');
173 item.className = 'whitelist-item';
174 item.innerHTML = `
175 <span>${domain}</span>
176 <button data-domain="${domain}" title="Remove"><i class="fas fa-times"></i></button>
177 `;
178 container.appendChild(item);
179 });
180
181 // Add remove handlers
182 container.querySelectorAll('button').forEach(btn => {
183 btn.addEventListener('click', () => {
184 const domain = btn.dataset.domain;
185 removeFromWhitelist(domain);
186 });
187 });
188}
189
190function removeFromWhitelist(domain) {
191 chrome.storage.sync.get('whitelist', (data) => {

Callers 3

removeFromWhitelistFunction · 0.85
addToWhitelistFunction · 0.85
setupWhitelistFunction · 0.85

Calls 1

removeFromWhitelistFunction · 0.85

Tested by

no test coverage detected