<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.27.1</li>
<li>Operating System: Mac</li>
<li>Node.js version: 16.13.1</li>
<li>Browser: Chromium at least, but likely all.</li>
<li>Extra: On M1 Mac Ventura</li>
</ul>


<p dir="auto"><strong>Code Snippet</strong></p>
<p dir="auto"><a href="https://github.com/coryhouse/playwright-demo">Small repo that shows the issue</a></p>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">I have global setup configured in playwright-config.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  globalSetup: &quot;./global-setup&quot;,
  use: {
    // Tell all tests to load signed-in state from 'storageState.json'.
    storageState: &quot;storageState.json&quot;,
  },"><pre class="notranslate"><code class="notranslate">  globalSetup: "./global-setup",
  use: {
    // Tell all tests to load signed-in state from 'storageState.json'.
    storageState: "storageState.json",
  },
</code></pre></div>
<p dir="auto">This global setup fails to apply. The test in <code class="notranslate">login.spec.ts</code> fails to "see" the localStorage info that is persisted in storageState.json. As a workaround, I can add this to the top of login.spec.ts, and it works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test.use({
  storageState: &quot;storageState.json&quot;,
});"><pre class="notranslate"><code class="notranslate">test.use({
  storageState: "storageState.json",
});
</code></pre></div>
<p dir="auto">But that shouldn't be necessary per these docs: <a href="https://playwright.dev/docs/auth#reuse-signed-in-state" rel="nofollow">https://playwright.dev/docs/auth#reuse-signed-in-state</a></p>
<p dir="auto">there are some launchOptions that playwright completely ignores, even in headed mode, like --show-fps-counter<br>
and then even for the ones it honors (like --credits and --version ).<br>
We discovered this problem when we were adding this configuration:<br>
<code class="notranslate">projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'], launchOptions: { args: [ '--disable-blink-features=AutomationControlled', // needed for gsl so google doesn't flag it as not secure ], }, }, },</code><br>
seems like this configuration is only working on headed mode, in headless mode it is not working</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.35.1]</li>
<li>Operating System: [MacOS ventura 13.4.1]</li>
<li>Browser: [Chromium] (didn't test on others)</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto">private repository</p>
<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="projects: [
        {
            name: 'chromium',
            use: {
                ...devices['Desktop Chrome'],
                launchOptions: {
                    args: [
                        '--disable-blink-features=AutomationControlled', // needed for gsl so google doesn't flag it as not secure
                    ],
                },
            },
        },"><pre class="notranslate"><code class="notranslate">projects: [
        {
            name: 'chromium',
            use: {
                ...devices['Desktop Chrome'],
                launchOptions: {
                    args: [
                        '--disable-blink-features=AutomationControlled', // needed for gsl so google doesn't flag it as not secure
                    ],
                },
            },
        },
</code></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>[Run the test headless mode]</li>
<li>[the lauchOption are not taking as part of the tests]</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">the lauchOptions in headed or headless mode should be the same</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">the launchOptions are only working in headed mode and also some flags are not working in both</p>