Back to feed
Dev.to
Dev.to
7/19/2026
Building a Chrome extension for AI usage tracking: three Manifest V3 cookie pitfalls and fixes

Building a Chrome extension for AI usage tracking: three Manifest V3 cookie pitfalls and fixes

Original: I built a Chrome extension that reads AI usage limits, and MV3 cookies nearly broke me

Short summary

A build log for AI Karma Tracker, a Chrome extension that aggregates usage limits from six AI tools (Claude, ChatGPT, Codex, Cursor, Grok, Perplexity). Three key MV3 lessons: service worker fetches don't carry SameSite cookies (use content scripts instead), never hardcode hosts (cursor.com vs www.cursor.com breaks first-party requests), and Gumroad's license API enables serverless Pro tier verification.

  • MV3 service worker cross-site fetches omit SameSite cookies — move fetch to content scripts for first-party cookie access
  • Never hardcode hostnames in extensions — derive origin from location.origin to avoid www vs non-www cookie drops
  • Gumroad license verification API enables serverless Pro tier without running your own backend

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more