Posts List
moustapha.dev : I built a browser extension this week blog post cover image

I built a browser extension this week

July 11th 25

TL;DR: If you're feeling too lazy to read this post, get yourself Digestmark and summarize it 😉.

I've always wanted to experiment with web extension. This week, I built digestmark.app , a browser extension to help you summarize web content. In this post, I talk about what I learned, the tools I used and what the browser extension business looks like.

The idea

I always find myself copying the entire content of a web page, feed it into an AI, or multiple ones, to get a summary, chat with the content et cetera. If you read a lot, that can be time consuming in the long run. That's when I find the inspiration to build quickly a browser utility to summarize the content of any page I need to read, in one click. But that's not all, Digestmark is also a bookmarking tool, it keeps in sync all the digested bookmarks and I plan to do something pretty cool with that data for the v2 : a background task that digests your new bookmarks and send you by email on a daily basis relevant content summaries. But to keep things simple and ship and MVP quickly, this release has only content summary feature and it's priced at $5 per month for unlimited summaries.

How I built it

A browser extension is pretty simple, it's just like (almost) any basic html, css, js website. I boostraped a vite react app to start.

bun create vite@latest digestmark --template react-ts

I'm also using React router and a little bit of ShadcnUI. To start testing the extension, open Chrome or any Chromium-based browser and navigate to chrome://extensions and toggle on the top of the page the developer mode. You can then click to load an unpacked extension. It's going to prompt for a folder, use vite to build the project.

bun run build

That produces a build folder. Select that folder to load the extension.

Loaded extension

The loaded extension should look like this

Then started the backend work. The logic of retrieving the current page content is pretty trivial, I'm just using the scripting permission (from the extension's manifest file), to inject a script in the current tab. I'm doing some processing after that to clean the noise.

I initially started with Firebase, because of the ecosystem, and the first class integrations. It worked pretty well both for the authentication and for saving the data in firestore but when I needed the Firebase cloud functions, to trigger a summary work when a bookmark is created, Google asked to move to the pay as you go plan. In order to do that, I needed to validate my bank debit card but it was during the weekend and I wasn't able to do so. That's when I decided to move to Supabase. Thankfully, the initial implementation was abstracted enough to make that easy.

When a bookmark is created, I trigger a Supabase edge function to get the summary from an AI third-party provider as markdown content and the summary is saved within the bookmark. And it looks like this.

After I get that working, I focused on adding the payment gateway. I decided to use Polar, it has a really nice developer experience and easy to integrate. They just raised a $10M seed funding and I believe they're going to do something incredible. I has two Supabase functions, one for getting a checkout URL and another for the webhook. When the payment is validated, I update the user subscription details.

And it was pretty much all. Of courses I did ran into some issues but the overall experience was pretty nice.

I added the RLS rules on Supabase for auth and validated subscription.

For the landing page, I used astro, with a nice theme from the astro templates page.

Publishing

To publish an extension on the Chrome Web Store, you need a Google Chrome developer account. You have to pay a one-time fee of 5 dollars. You then submit a zipped file of you build folder and add stuffs like privacy policy, the need for each permission in the manifest file etc.

The Chrome Web Store team needs a way to log into the extension (if you have auth) to see how it works. I didn't plan that in the beginning but it was easy to implement too.

I've requested for a review, the extension will be published after a successful review and it can apparently take weeks, that's one downside of app stores.

What's next

I hope that the reviewed process isn't going to take too long. I can't wait to see it published. I'm already extensively using it on the local version I have and the experience is pretty nice, I have some improvement ideas and I'll keep iterating on this.

Thanks for reading.