
I built 18 Chrome extensions, kept rewriting the same code, so I open-sourced the toolkit
Every Chrome extension I've built starts the same way. I need to store some user preferences. I need the popup to talk to the background script. I need to check if the user granted a permission before I call an API that'll throw if they didn't. And every time, I'd write the same wrapper around chrome.storage, the same message-passing boilerplate, the same permission checks. Slightly different each time. Slightly broken in new ways each time. After 18 extensions and roughly the tenth time copy-pasting a storage helper between repos, I finally extracted it all into three packages and a documentation site. Sharing it here because I wish this existed when I started. The packages All three are TypeScript, ship ESM + CJS, and have actual tests (not "tests"). @theluckystrike/webext-storage Typed storage with schema validation. You define your shape once, and every get and set call is type-safe from that point forward. ``import { defineSchema, createStorage } from '@theluckystrike/webext-stora
Continue reading on Dev.to Webdev
Opens in a new tab




