<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Thomas Schneider&#39;s Blog</title>
        <link>https://snider-dev.github.io/</link>
        <description>Recent content on Thomas Schneider&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Tue, 09 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://snider-dev.github.io/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Claude Code &#43; Playwright MCP: Using Your Real Chrome Profile</title>
            <link>https://snider-dev.github.io/posts/playwright-mcp-real-chrome/</link>
            <pubDate>Tue, 09 Jun 2026 00:00:00 +0000</pubDate>
            <guid>https://snider-dev.github.io/posts/playwright-mcp-real-chrome/</guid>
            <description>&lt;p&gt;If you use Claude Code for day-to-day development, you&amp;rsquo;ve run into this. You ask it to pull up a doc, check a Reddit thread, or look at a GitHub issue, and it comes back with a 403. Or it fetches some stripped-down cached version that&amp;rsquo;s missing the thing you actually needed.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;WebFetch&lt;/code&gt; doesn&amp;rsquo;t use a real browser. No cookies, no session, no JS rendering. A lot of the sites developers actually need hit it with a 403 or a login redirect.&lt;/p&gt;&#xA;&lt;p&gt;ChatGPT and Gemini have web search built in. Claude Code doesn&amp;rsquo;t, at least not out of the box. But you can get pretty close by connecting Claude Code to your real Chrome via Playwright MCP. Here&amp;rsquo;s how.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-this-keeps-happening&#34;&gt;Why this keeps happening&#xA;&lt;/h2&gt;&lt;p&gt;When Claude Code fetches a URL it&amp;rsquo;s sending a plain HTTP request. No browser fingerprint, no cookies, no rendered DOM. Sites see it as a bot and either block it (403), redirect to login, or throw a Cloudflare challenge.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s most annoying when you&amp;rsquo;re:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Integrating a new library and the actual docs are behind a JS render&lt;/li&gt;&#xA;&lt;li&gt;The answer to your bug is on a Reddit thread that needs login to view properly&lt;/li&gt;&#xA;&lt;li&gt;You want Claude Code to use Gemini&amp;rsquo;s deep research or web search instead of fetching raw URLs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The obvious fix looks like &lt;code&gt;playwright-cli open --profile&lt;/code&gt;. It doesn&amp;rsquo;t work, and it fails without telling you why.&lt;/p&gt;&#xA;&lt;h2 id=&#34;whats-wrong-with-profile&#34;&gt;What&amp;rsquo;s wrong with &amp;ndash;profile&#xA;&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;playwright-cli open --browser&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;chrome --profile&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/Users/you/Library/Application Support/Google/Chrome/Default&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Looks fine. The path is right. But Playwright doesn&amp;rsquo;t launch your Chrome app, it launches its own bundled Chromium binary and points it at that directory. Chromium and Chrome don&amp;rsquo;t share a cookie store, so you get a fresh unauthenticated session no matter what path you pass.&lt;/p&gt;&#xA;&lt;p&gt;I tried this three different ways before I understood what was happening. The path was right the whole time. The binary was the problem.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-actual-fix&#34;&gt;The actual fix&#xA;&lt;/h2&gt;&lt;p&gt;The Playwright MCP Bridge extension connects Playwright to your already-running Chrome over CDP. Same browser you use every day, same cookies, same sessions. Everything you&amp;rsquo;re logged into just works.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 1: Install the extension&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Search &amp;ldquo;Playwright Extension&amp;rdquo; in the Chrome Web Store. The ID is &lt;code&gt;mmlmfjhmonkocbjadbfplnigmagldckm&lt;/code&gt; if you want to go directly.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 2: Use &amp;ndash;extension instead of &amp;ndash;profile&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Chrome needs to already be running. Then:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;playwright-cli open --browser&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;chrome --extension --headed https://example.com&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it. Playwright connects to your running browser and your login state is there.&lt;/p&gt;&#xA;&lt;h2 id=&#34;approving-the-connection&#34;&gt;Approving the connection&#xA;&lt;/h2&gt;&lt;p&gt;The first time you run this, and every time Chrome restarts, you&amp;rsquo;ll see a dialog:&lt;/p&gt;&#xA;&#xA;    &lt;blockquote&gt;&#xA;        &lt;p&gt;&amp;ldquo;playwright-cli is trying to connect to the Playwright Extension&amp;rdquo;&lt;/p&gt;&#xA;&#xA;    &lt;/blockquote&gt;&#xA;&lt;p&gt;Click &lt;strong&gt;Allow &amp;amp; select&lt;/strong&gt; on the tab you want to automate. That&amp;rsquo;s the whole setup. The re-approval on restart is intentional — the extension has full access to your browser including everything you&amp;rsquo;re signed into, so it asks each session.&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-this-for-web-research-in-claude-code&#34;&gt;Using this for web research in Claude Code&#xA;&lt;/h2&gt;&lt;p&gt;Once it&amp;rsquo;s set up you can point Claude Code at ChatGPT, Gemini or Perplexity and have it do research there with your real session, rather than firing WebFetch at raw URLs and getting blocked.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re using the &lt;code&gt;playwright-cli&lt;/code&gt; skill in Claude Code, add this section to the top of your &lt;code&gt;~/.claude/skills/playwright-cli/SKILL.md&lt;/code&gt; so Claude always knows to ask before opening a browser:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;## Profile mode (use my real Chrome)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;font-weight:bold&#34;&gt;**Before opening a browser, if the user hasn&amp;#39;t specified, always ask:**&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&#34;font-style:italic&#34;&gt;&amp;#34;Should I use your Chrome profile (so you&amp;#39;re logged in), or open a fresh browser?&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;If the user wants their profile:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;-&lt;/span&gt; Chrome must already be running — if not, tell the user to open it first&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;-&lt;/span&gt; Always use &lt;span style=&#34;color:#e6db74&#34;&gt;`--browser=chrome --extension`&lt;/span&gt; (never &lt;span style=&#34;color:#e6db74&#34;&gt;`--profile`&lt;/span&gt;, it doesn&amp;#39;t work)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;-&lt;/span&gt; Always use &lt;span style=&#34;color:#e6db74&#34;&gt;`--headed`&lt;/span&gt; so the browser is visible&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;-&lt;/span&gt; If the connection dialog appears in Chrome, tell the user to click Allow &amp;amp; select&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;```bash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;playwright-cli open --browser=chrome --extension --headed https://example.com&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If connection times out, remind the user that Chrome needs to be open and the Playwright Extension must be installed (Chrome Web Store ID: &lt;code&gt;mmlmfjhmonkocbjadbfplnigmagldckm&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</description>
        </item></channel>
</rss>
