API reference
Modules, storage keys and message handlers.
Source · docs/API.md
Core modules
storage.js wraps chrome.storage.local with defaults and migration; logger.js gates debug output behind DEBUG_LOGS; dom-helpers.js guards every DOM write in try/catch; sanitize-html.js escapes anything that ever renders as HTML.
// Read all settings
const settings = await chrome.storage.local.get(null);
// Persist a change
await chrome.storage.local.set({ extensionEnabled: true });
// React to changes anywhere
chrome.storage.onChanged.addListener((changes, area) => {
if (changes.blockedSites) refreshBlocks();
});javascriptBlocking layer
- site-blocker.js — universal blocking on all URLs, subdomain-aware matching
- ad-blocker.js / shorts-blocker.js — YouTube surface cleanup
- keyword-blocker.js / channel-blocker.js — content rules
- smart-lists.js — category presets: Social, Gaming, News, Shopping…
Message validation
Every runtime message payload is validated before handling, handlers never return true asynchronously, and chrome.runtime.lastError is checked everywhere — the patterns SECURITY.md formalized in v1.0.1.