Short checklist to get started
- Language: JavaScript (simple) or TypeScript (recommended)
- Create project folder and
manifest.json(use Manifest V3) - Add a content script to alter/remove DOM elements
- Keep
host_permissionsminimal (only the sites you need) - Load unpacked/temporary extension in your browser to test
- Optionally add a build step (esbuild/webpack/rollup) for TypeScript
Basics of creating an extension (very short)
- Manifest: declare name, version, permissions, content scripts, and background/service worker.
- Content scripts: small JS files injected into pages to find and change DOM elements.
- Background/service worker: run persistent logic and coordinate message passing.
- Messaging: use
chrome.runtime.sendMessage/browser.runtime.sendMessageto communicate between content scripts and background. - UI (optional): add a popup/options page for toggles or settings.
- Test: load the extension unpacked in Chrome/Edge or as a temporary add-on in Firefox.
- Security: avoid
eval, sanitize any inputs, and request only necessary host permissions.