<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ethan Davis</title>
    <description>The latest articles on DEV Community by Ethan Davis (@ethan_davis_dfb170f18eef4).</description>
    <link>https://dev.to/ethan_davis_dfb170f18eef4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1604307%2Fd42f4725-867f-4c10-ba88-54531d38b36f.png</url>
      <title>DEV Community: Ethan Davis</title>
      <link>https://dev.to/ethan_davis_dfb170f18eef4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ethan_davis_dfb170f18eef4"/>
    <language>en</language>
    <item>
      <title>Why Most AI Chrome Extensions Ask for Too Many Permissions — and How I Built a 25 KB activeTab-Only Clipper</title>
      <dc:creator>Ethan Davis</dc:creator>
      <pubDate>Sun, 29 Nov 2026 04:05:22 +0000</pubDate>
      <link>https://dev.to/ethan_davis_dfb170f18eef4/why-most-ai-chrome-extensions-ask-for-too-many-permissions-and-how-i-built-a-25-kb-activetab-only-1cd</link>
      <guid>https://dev.to/ethan_davis_dfb170f18eef4/why-most-ai-chrome-extensions-ask-for-too-many-permissions-and-how-i-built-a-25-kb-activetab-only-1cd</guid>
      <description>&lt;p&gt;When the official Claude browser extension rolled out, one detail jumped out to developers inspecting its store listing: because it acts as an autonomous browser agent that clicks and types across websites, it discloses access to browsing history, page contents across sites, mouse position, and keystroke activity.&lt;/p&gt;

&lt;p&gt;That tradeoff makes complete sense if you genuinely want an autonomous agent navigating your browser for you.&lt;/p&gt;

&lt;p&gt;But when I looked at what I &lt;em&gt;actually&lt;/em&gt; do 90% of the time with Claude, ChatGPT, and Gemini in Chrome, I didn't want an autonomous agent at all. I only needed three boring, everyday things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clip the current webpage (or highlighted passage) to clean Markdown&lt;/strong&gt; without ads, navbars, and cookie banners eating half my context window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Organize important threads across Claude, ChatGPT, and Gemini&lt;/strong&gt; in one searchable place so I'm not locked into one vendor's sidebar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export full conversations to Obsidian-ready &lt;code&gt;.md&lt;/code&gt; or PDF locally&lt;/strong&gt;, without generating public share URLs or pasting chats through random third-party servers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of those three workflows requires &lt;code&gt;&amp;lt;all_urls&amp;gt;&lt;/code&gt;, &lt;code&gt;history&lt;/code&gt;, or a remote backend.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://clipforai.app/" rel="noopener noreferrer"&gt;ClipForAI&lt;/a&gt;&lt;/strong&gt;—an open-source, zero-dependency Chrome MV3 extension (~25 KB zipped) designed around strict minimal permissions. Here are the two engineering choices that made it work cleanly.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Using &lt;code&gt;activeTab&lt;/code&gt; + &lt;code&gt;scripting&lt;/code&gt; Instead of &lt;code&gt;&amp;lt;all_urls&amp;gt;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Most "AI sidebar" and "web clipper" extensions declare &lt;code&gt;&amp;lt;all_urls&amp;gt;&lt;/code&gt; or &lt;code&gt;https://*/*&lt;/code&gt; in &lt;code&gt;content_scripts&lt;/code&gt;. That means their JavaScript loads on every single tab you open—banking dashboards, internal admin panels, private docs—whether you ever click the extension or not.&lt;/p&gt;

&lt;p&gt;In Manifest V3, Chrome already gives us a much safer primitive: &lt;strong&gt;&lt;code&gt;activeTab&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is the entire permissions block of &lt;a href="https://github.com/windwhyhere/clipforai/blob/main/extension/manifest.json" rel="noopener noreferrer"&gt;&lt;code&gt;extension/manifest.json&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"manifest_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"permissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"activeTab"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"scripting"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"storage"&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"content_scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"matches"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"https://claude.ai/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"https://chatgpt.com/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"https://gemini.google.com/*"&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"lib/prompts.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"lib/markdown.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"lib/store.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"content/ai-bridge.js"&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"run_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"document_idle"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How this behaves in practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On normal websites&lt;/strong&gt;: ClipForAI runs &lt;strong&gt;zero code&lt;/strong&gt; until you explicitly click &lt;strong&gt;Clip Active Tab&lt;/strong&gt; in the popup. At that moment, &lt;code&gt;chrome.scripting.executeScript&lt;/code&gt; injects the local Markdown extractor into &lt;em&gt;only&lt;/em&gt; that active tab, extracts the main article (or your highlighted selection), and returns clean Markdown + an estimated token count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On &lt;code&gt;claude.ai&lt;/code&gt;, &lt;code&gt;chatgpt.com&lt;/code&gt;, and &lt;code&gt;gemini.google.com&lt;/code&gt;&lt;/strong&gt;: The scoped content script renders a tiny local dock to save threads into &lt;code&gt;chrome.storage.local&lt;/code&gt; folders, insert clipped Markdown into the composer, and export the active conversation to &lt;code&gt;.md&lt;/code&gt; or print-ready PDF.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network footprint&lt;/strong&gt;: Zero external API calls. Everything runs in-browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to inspect the exact permission comparison between autonomous AI browser agents and on-click &lt;code&gt;activeTab&lt;/code&gt; tools, I documented the full breakdown here: &lt;strong&gt;&lt;a href="https://clipforai.app/claude-chrome-extension-privacy" rel="noopener noreferrer"&gt;Official Claude Chrome Extension Privacy &amp;amp; Permission Audit&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Surviving Frequent AI Web UI DOM Changes (Without Breaking Export)
&lt;/h2&gt;

&lt;p&gt;Anyone who has built a browser extension for ChatGPT, Claude, or Gemini knows the real maintenance headache: &lt;strong&gt;all three web apps change their DOM markup constantly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Earlier this week, testing our local conversation exporter on live ChatGPT immediately exposed a classic failure mode: relying solely on &lt;code&gt;[data-message-author-role]&lt;/code&gt; or &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; wrappers broke on a subset of updated conversation views where inner &lt;code&gt;.markdown&lt;/code&gt; containers were empty placeholders.&lt;/p&gt;

&lt;p&gt;Instead of brittle single-selector scraping, &lt;a href="https://github.com/windwhyhere/clipforai/blob/main/extension/content/ai-bridge.js" rel="noopener noreferrer"&gt;&lt;code&gt;extension/content/ai-bridge.js&lt;/code&gt;&lt;/a&gt; uses a &lt;strong&gt;4-layer resilient extraction cascade&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Semantic role selectors first&lt;/strong&gt; (&lt;code&gt;[data-message-author-role]&lt;/code&gt;, Claude's user/assistant test IDs, Gemini's &lt;code&gt;user-query&lt;/code&gt; / &lt;code&gt;model-response&lt;/code&gt; custom elements).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container deduplication (&lt;code&gt;dedupeRoots&lt;/code&gt;)&lt;/strong&gt; so nested matching elements are never exported twice, while explicitly stripping UI chrome (&lt;code&gt;button&lt;/code&gt;, &lt;code&gt;form&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt;, &lt;code&gt;#clipforai-dock&lt;/code&gt;, &lt;code&gt;.sr-only&lt;/code&gt;):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;extractNodeMarkdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cloneNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;clone&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;"button, [role='button'], form, textarea, [contenteditable='true'], .sr-only, [aria-hidden='true'], #clipforai-dock, #clipforai-toast"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cleanBlankLines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;md&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;domNodeToMarkdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;baseUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Structural turn fallback&lt;/strong&gt;: If primary attributes change overnight, inspect top-level turn containers inside &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;, infer &lt;code&gt;User&lt;/code&gt; vs &lt;code&gt;Assistant&lt;/code&gt; from attributes/class hints, and preserve fenced code blocks, tables, and lists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-empty &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; guard&lt;/strong&gt;: Even in the worst-case redesign, never silently drop a user's transcript or crash.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And when inserting clipped Markdown back into ProseMirror (Claude / ChatGPT) or Quill (Gemini), we fall back cleanly across &lt;code&gt;document.execCommand("insertText")&lt;/code&gt;, &lt;code&gt;InputEvent&lt;/code&gt;, and clipboard copy so a frontend refactor never loses your clipped notes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try the Converter Without Installing Anything
&lt;/h2&gt;

&lt;p&gt;ClipForAI is now live on the &lt;strong&gt;&lt;a href="https://chromewebstore.google.com/detail/egagdpdjhdcgpmkbmchgeaadeildojei" rel="noopener noreferrer"&gt;Chrome Web Store&lt;/a&gt;&lt;/strong&gt; (free, zero account required). If you want to try the exact same client-side HTML-to-Markdown engine without installing anything, I also published it as a standalone, zero-upload browser tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Install on Chrome Web Store&lt;/strong&gt;: &lt;a href="https://chromewebstore.google.com/detail/egagdpdjhdcgpmkbmchgeaadeildojei" rel="noopener noreferrer"&gt;ClipForAI on Chrome Web Store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Online Tool&lt;/strong&gt;: &lt;a href="https://clipforai.app/html-to-markdown" rel="noopener noreferrer"&gt;HTML &amp;amp; Webpage to Markdown Converter (100% In-Browser)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-Source Repo (MIT)&lt;/strong&gt;: &lt;a href="https://github.com/windwhyhere/clipforai" rel="noopener noreferrer"&gt;github.com/windwhyhere/clipforai&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you audit Chrome extensions before installing them—or have hit weird DOM quirks on Claude, ChatGPT, or Gemini—I'd love to hear what edge cases you've run into in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>chrome</category>
      <category>privacy</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
