<?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: Jaume Milián</title>
    <description>The latest articles on DEV Community by Jaume Milián (@jaume_milin_ca2bc06c7e7c).</description>
    <link>https://dev.to/jaume_milin_ca2bc06c7e7c</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%2F4271967%2Fcc1cb08c-cbbd-405b-b865-53c7d222156a.jpg</url>
      <title>DEV Community: Jaume Milián</title>
      <link>https://dev.to/jaume_milin_ca2bc06c7e7c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaume_milin_ca2bc06c7e7c"/>
    <language>en</language>
    <item>
      <title>3 Sneaky Chrome Manifest V3 Bugs I Hit Building a 100% Local-First Step Recorder</title>
      <dc:creator>Jaume Milián</dc:creator>
      <pubDate>Sun, 29 Nov 2026 08:42:20 +0000</pubDate>
      <link>https://dev.to/jaume_milin_ca2bc06c7e7c/3-sneaky-chrome-manifest-v3-bugs-i-hit-building-a-100-local-first-step-recorder-44kg</link>
      <guid>https://dev.to/jaume_milin_ca2bc06c7e7c/3-sneaky-chrome-manifest-v3-bugs-i-hit-building-a-100-local-first-step-recorder-44kg</guid>
      <description>&lt;p&gt;Every week I had to write bug reproduction steps, internal admin SOPs, or onboarding guides. Cloud tools like Scribe and Tango are great, until you run into two walls:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Privacy &amp;amp; localhost:&lt;/strong&gt; You can't upload screenshots of staging environments, VPN-only admin panels, or client dashboards to third-party servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-seat subscriptions:&lt;/strong&gt; Paying $23–$29/user/month (with basic blur/redaction locked behind Enterprise) just to turn browser clicks into Markdown/PDF felt crazy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://step2md.pages.dev" rel="noopener noreferrer"&gt;Step2MD&lt;/a&gt;&lt;/strong&gt; — a 100% local-first Manifest V3 Chrome extension (vanilla JS, zero backend, zero login) that records your clicks, lets you edit/blur any screenshot afterward in a fullscreen HD Studio, and exports clean Markdown ZIPs or printable PDFs.&lt;/p&gt;

&lt;p&gt;Along the way, building a purely client-side MV3 extension hit &lt;strong&gt;3 genuinely nasty browser edge cases&lt;/strong&gt; that might save you hours if you ever build a Chrome extension or screenshot tool.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/f6NIP5ByWRg" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Inline Base64 Images Break in GitHub Issues &amp;amp; Notion (So I Wrote a Zero-Dependency ZIP Bundler)
&lt;/h2&gt;

&lt;p&gt;My v1 exported a single &lt;code&gt;.md&lt;/code&gt; file with screenshots embedded as inline &lt;code&gt;data:image/jpeg;base64,...&lt;/code&gt; data URIs. It looked fine in VS Code preview — and completely broke the moment I pasted it into GitHub Issues or Notion (both strip &lt;code&gt;data:&lt;/code&gt; image URIs for security, plus a 10-step Markdown file becomes an unreadable 3 MB wall of text).&lt;/p&gt;

&lt;p&gt;Since Step2MD has &lt;strong&gt;zero backend&lt;/strong&gt; (no CDN to upload images to), the cleanest offline solution was exporting a real &lt;code&gt;.zip&lt;/code&gt; archive containing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;step2md-guide.zip
├── README.md          # clean ![Step 1](./images/step-1.jpg) links
└── images/
    ├── step-1.jpg
    ├── step-2.jpg
    └── step-3.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because JPEGs are already compressed, you don't even need Deflate — a standard &lt;strong&gt;ZIP STORE (compression method &lt;code&gt;0&lt;/code&gt;)&lt;/strong&gt; builder with a CRC-32 table takes ~120 lines of dependency-free vanilla JS (&lt;code&gt;DataView&lt;/code&gt; + &lt;code&gt;Uint8Array&lt;/code&gt;), runs in milliseconds inside the browser, and drops straight into GitHub repos, Obsidian vaults, or VS Code.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Manifest V3 CSP Silently Blocks &lt;code&gt;window.print()&lt;/code&gt; Inside &lt;code&gt;blob:&lt;/code&gt; Tabs
&lt;/h2&gt;

&lt;p&gt;For non-technical clients who just want a clean PDF, v1 generated a self-contained HTML string with &lt;code&gt;&amp;lt;button onclick="window.print()"&amp;gt;&lt;/code&gt; and opened it from the popup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;blob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Blob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;html&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="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'text/html;charset=utf-8'&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="n"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tabs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blob&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;p&gt;Three silent bugs blew up in production:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;MV3 CSP killed the Print button:&lt;/strong&gt; A &lt;code&gt;blob:&lt;/code&gt; URL created by an extension gets the origin &lt;code&gt;blob:chrome-extension://&amp;lt;id&amp;gt;/...&lt;/code&gt;, which inherits MV3's strict &lt;code&gt;script-src 'self'&lt;/code&gt; policy. Clicking the button threw &lt;code&gt;Executing inline event handler violates Content Security Policy&lt;/code&gt; and did nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revoked blobs on popup close:&lt;/strong&gt; The moment &lt;code&gt;chrome.tabs.create()&lt;/code&gt; opens a new tab, Chrome closes &lt;code&gt;popup.html&lt;/code&gt; — destroying the popup's document and revoking its &lt;code&gt;blob:&lt;/code&gt; URLs! Pressing &lt;code&gt;F5&lt;/code&gt; immediately hit &lt;code&gt;ERR_FILE_NOT_FOUND&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Invisible step numbers in PDF:&lt;/strong&gt; Without &lt;code&gt;print-color-adjust: exact&lt;/code&gt;, Chrome strips CSS background colors by default when printing — turning white numbers inside indigo circles invisible!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The fix:&lt;/strong&gt; Replace the &lt;code&gt;blob:&lt;/code&gt; tab with a real dedicated extension page (&lt;code&gt;preview.html&lt;/code&gt; + external &lt;code&gt;preview.js&lt;/code&gt;) that reads steps directly from &lt;code&gt;chrome.storage.local&lt;/code&gt;, wires &lt;code&gt;addEventListener('click', () =&amp;gt; window.print())&lt;/code&gt; cleanly under MV3 CSP, waits for all images to decode (&lt;code&gt;decoding="sync"&lt;/code&gt; instead of &lt;code&gt;loading="lazy"&lt;/code&gt;), and enforces &lt;code&gt;print-color-adjust: exact&lt;/code&gt; + &lt;code&gt;@page&lt;/code&gt; sizing so 2 steps fit cleanly per page.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Fast SPA Routers Unmount the Clicked Button &lt;em&gt;Before&lt;/em&gt; &lt;code&gt;captureVisibleTab()&lt;/code&gt; Runs
&lt;/h2&gt;

&lt;p&gt;This one was caught by a real user testing Step2MD on a Next.js/React admin app. Every time he clicked a list item (like &lt;em&gt;"Events"&lt;/em&gt; or an event row), the exported screenshot showed a &lt;strong&gt;black loading spinner&lt;/strong&gt; with the numbered highlight box drawn over empty space!&lt;/p&gt;

&lt;p&gt;Here's why that race condition happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;click&lt;/code&gt; fires on &lt;strong&gt;&lt;code&gt;mouseup&lt;/code&gt;&lt;/strong&gt;, at which point React/Vue/Next routers synchronously unmount the list and render a loading skeleton on the very same frame.&lt;/li&gt;
&lt;li&gt;Sending a message from &lt;code&gt;content.js&lt;/code&gt; to the MV3 service worker + awaiting &lt;code&gt;chrome.storage.local.get()&lt;/code&gt; adds 30–80 ms before &lt;code&gt;chrome.tabs.captureVisibleTab()&lt;/code&gt; finally executes — way too late.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The fix (2 parts):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Synchronous &lt;code&gt;pointerdown&lt;/code&gt; pre-capture:&lt;/strong&gt; In capture phase on &lt;code&gt;pointerdown&lt;/code&gt; (0 ms delay, &lt;em&gt;before&lt;/em&gt; &lt;code&gt;mouseup&lt;/code&gt; triggers navigation), &lt;code&gt;content.js&lt;/code&gt; snapshots the element's bounding rect + label and fires a &lt;code&gt;PRE_CAPTURE&lt;/code&gt; message. The service worker calls &lt;code&gt;captureVisibleTab()&lt;/code&gt; &lt;strong&gt;synchronously before any &lt;code&gt;storage.get&lt;/code&gt; awaits&lt;/strong&gt; and caches the in-flight Promise per &lt;code&gt;tabId&lt;/code&gt; (2.5 s TTL). When &lt;code&gt;click&lt;/code&gt; confirms the interaction, &lt;code&gt;CAPTURE_STEP&lt;/code&gt; awaits that exact pre-navigation screenshot — and if the user drags away without clicking, the cached capture is silently discarded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic "Final result" screenshot on Stop:&lt;/strong&gt; When clicking &lt;strong&gt;Stop&lt;/strong&gt;, we hide the floating toolbar (70 ms repaint) and capture one last clean frame so the guide always shows the final screen after the last click.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It &amp;amp; Roast It
&lt;/h2&gt;

&lt;p&gt;If you document internal apps, localhost staging, or QA bug repros and want something 100% local:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chrome Web Store:&lt;/strong&gt; &lt;a href="https://chromewebstore.google.com/detail/step2md-%E2%80%94-step-by-step-gu/micjcphpclapkkodjlpbhkcmncldkgkk" rel="noopener noreferrer"&gt;Step2MD — Step-by-Step Guide Recorder&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Website &amp;amp; Pricing:&lt;/strong&gt; &lt;a href="https://step2md.pages.dev" rel="noopener noreferrer"&gt;step2md.pages.dev&lt;/a&gt; (Free up to 10 steps per guide with the Fullscreen HD Studio, local blur, ZIP &amp;amp; PDF exports included; optional 19€ one-time Pro for unlimited steps).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Curious what other Manifest V3 gotchas folks here have hit with &lt;code&gt;captureVisibleTab&lt;/code&gt; or &lt;code&gt;OffscreenCanvas&lt;/code&gt; — and if you're a dev/QA, would auto-attaching &lt;code&gt;console.error&lt;/code&gt; + failed 4xx/5xx network logs per step be useful in a future version?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>chrome</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
