Live
Black Hat USAAI BusinessBlack Hat AsiaAI BusinessTown hall in Bay Ridge spotlights AI concerns in NYC public schools - BKReaderGoogle News: AI SafetyOpenAI announces new ‘human powered’ ChatGPT-6 - huckmag.comGoogle News: ChatGPTGoogle Fixes AI Coding Agents' Outdated Code Problem - The Tech BuzzGoogle News: DeepMindThese car gadgets are worth every pennyZDNet AIGoogle Faces Demands to Prohibit AI Videos for Kids on YouTubeBloomberg TechnologyContributor: Investigate the AI campaigns flooding public agencies with fake comments - Los Angeles TimesGoogle News: AIWhy Enterprise AI Stalls Before It Scales - AI BusinessGoogle News: Generative AIThese pocket-sized tech gadgets are packed with purpose (and they're inexpensive)ZDNet AIHershey applies AI across its supply chain operations - AI NewsGoogle News: AIThe AI Video Apps Gaining Ground After OpenAI Declared Sora DeadBloomberg TechnologyThe AI Video Apps Gaining Ground After OpenAI Declared Sora Dead - Bloomberg.comGoogle News: OpenAIHershey applies AI across its supply chain operationsAI NewsBlack Hat USAAI BusinessBlack Hat AsiaAI BusinessTown hall in Bay Ridge spotlights AI concerns in NYC public schools - BKReaderGoogle News: AI SafetyOpenAI announces new ‘human powered’ ChatGPT-6 - huckmag.comGoogle News: ChatGPTGoogle Fixes AI Coding Agents' Outdated Code Problem - The Tech BuzzGoogle News: DeepMindThese car gadgets are worth every pennyZDNet AIGoogle Faces Demands to Prohibit AI Videos for Kids on YouTubeBloomberg TechnologyContributor: Investigate the AI campaigns flooding public agencies with fake comments - Los Angeles TimesGoogle News: AIWhy Enterprise AI Stalls Before It Scales - AI BusinessGoogle News: Generative AIThese pocket-sized tech gadgets are packed with purpose (and they're inexpensive)ZDNet AIHershey applies AI across its supply chain operations - AI NewsGoogle News: AIThe AI Video Apps Gaining Ground After OpenAI Declared Sora DeadBloomberg TechnologyThe AI Video Apps Gaining Ground After OpenAI Declared Sora Dead - Bloomberg.comGoogle News: OpenAIHershey applies AI across its supply chain operationsAI News

Building a Chrome Extension with Zero Unnecessary Permissions

DEV Communityby pmestre-ForgeMarch 31, 20265 min read0 views
Source Quiz

<p>Every time I install a Chrome extension, I check the permissions. Most tab managers ask for:</p> <ul> <li>"Read and change all your data on all websites"</li> <li>"Read your browsing history"</li> <li>"Manage your downloads"</li> </ul> <p>For a tab manager. To save URLs.</p> <p>When I built Tab Stash, I wanted to prove you could build a genuinely useful extension with minimal permissions. Here's how.</p> <h2> The Permission Problem </h2> <p>Chrome's permission model is coarse-grained. The <code>tabs</code> permission, for example, gives you access to tab URLs and titles — but it also signals to users that you can "read your browsing activity." That's technically true, but it scares people.</p> <p>Many developers just request everything upfront because it's easier. That's the wrong trade

Every time I install a Chrome extension, I check the permissions. Most tab managers ask for:

  • "Read and change all your data on all websites"

  • "Read your browsing history"

  • "Manage your downloads"

For a tab manager. To save URLs.

When I built Tab Stash, I wanted to prove you could build a genuinely useful extension with minimal permissions. Here's how.

The Permission Problem

Chrome's permission model is coarse-grained. The tabs permission, for example, gives you access to tab URLs and titles — but it also signals to users that you can "read your browsing activity." That's technically true, but it scares people.

Many developers just request everything upfront because it's easier. That's the wrong trade-off.

What Tab Stash Actually Needs

Tab Stash saves your open tabs as Markdown. Here's the minimum set of permissions for that:

{  "permissions": ["activeTab"],  "optional_permissions": ["tabs"] }

Enter fullscreen mode

Exit fullscreen mode

That's it. activeTab gives us access to the current tab when the user clicks our icon. The tabs permission is optional — we only request it when the user wants to save ALL open tabs, and Chrome shows a prompt first.

The Architecture

The extension is straightforward:

popup.html (UI)  ├── popup.js (tab capture + display)  ├── storage.js (chrome.storage.local wrapper)  ├── export.js (Markdown formatting)  └── settings.js (format preferences)

Enter fullscreen mode

Exit fullscreen mode

No background scripts running 24/7. No content scripts injected into pages. The extension only activates when you click it.

Saving Tabs

The core function is embarrassingly simple:

async function captureCurrentTabs() {  const tabs = await chrome.tabs.query({   currentWindow: true   });

return tabs.map(tab => ({ title: tab.title, url: tab.url, favIconUrl: tab.favIconUrl, savedAt: Date.now() })); }`

Enter fullscreen mode

Exit fullscreen mode

Exporting as Markdown

The export module handles multiple formats:

function toMarkdownLinks(tabs) {  return tabs  .map(t => 
- ${t.title} [blocked]
)  .join('\n'); }

function toWikiLinks(tabs) { return tabs .map(t => - [[${t.title}]]) .join('\n'); }

function toNumberedList(tabs) { return tabs .map((t, i) => ${i + 1}. [${t.title}](${t.url})) .join('\n'); }`

Enter fullscreen mode

Exit fullscreen mode

Local Storage Only

Everything persists in chrome.storage.local:

async function saveSession(name, tabs) {  const session = {  name,  tabs,  createdAt: Date.now(),  id: crypto.randomUUID()  };

const { sessions = [] } = await chrome.storage.local.get('sessions'); sessions.unshift(session); await chrome.storage.local.set({ sessions });

return session; }`

Enter fullscreen mode

Exit fullscreen mode

No server, no database, no sync service. The user's data never leaves their machine.

File Export

For the auto-export feature, we use the downloads permission (requested only when the user enables file export):

async function exportAsFile(session, format) {  const content = formatSession(session, format);  const blob = new Blob([content], { type: 'text/markdown' });  const url = URL.createObjectURL(blob);

await chrome.downloads.download({ url, filename: tab-stash/${session.name}.md, saveAs: false });

URL.revokeObjectURL(url); }`

Enter fullscreen mode

Exit fullscreen mode

Results

Tab Stash weighs in at ~15KB total. It loads instantly, uses zero memory when not active, and requests only the permissions it needs when it needs them.

The permission-minimal approach actually forced better architecture decisions. When you can't spy on everything, you have to think carefully about what data you actually need.

Tab Stash on Chrome Web Store | Source on GitHub

What's your approach to Chrome extension permissions? I'm curious if others think about this as much as I do.

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by AI News Hub · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

More about

modelservicefeature

Knowledge Map

Knowledge Map
TopicsEntitiesSource
Building a …modelservicefeaturegithubDEV Communi…

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 157 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Products