<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.24.*</li>
<li>Operating System: Windows</li>
<li>Node.js version: 16.10 +</li>
<li>Browser: Chrome</li>
</ul>
<p dir="auto"><strong>Code Snippet</strong><br>
electronApp = await electron.launch({ args: [path.join(__dirname, ' ****')], bypassCSP: true });<br>
app1stWindow= await electronApp.firstWindow();</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
**Describe the bug**
 
 **Electron 12 has been EOL, so i migrate the electron app to electron 18 , but seems the playwright get the firstWindow timeout, 
my question is does latest playwright supported the electron 18 now???**


"><pre class="notranslate"><code class="notranslate">
**Describe the bug**
 
 **Electron 12 has been EOL, so i migrate the electron app to electron 18 , but seems the playwright get the firstWindow timeout, 
my question is does latest playwright supported the electron 18 now???**



</code></pre></div>
<p dir="auto">Hi, we've noticed that <code class="notranslate">context.route()</code> can alter the rendering for some websites, e.g. <a href="https://www.wm.com/ca/en/support/faqs/how-do-i-handle-medical-waste-or-sharps-disposal" rel="nofollow">https://www.wm.com/ca/en/support/faqs/how-do-i-handle-medical-waste-or-sharps-disposal</a></p>
<p dir="auto">Would you know what can cause that, and how to debug it?</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.32.3 (Node v18.15)</li>
<li>Operating System: Debian 11</li>
<li>Browser: Chromium, Firefox</li>
<li>Other info: A bit more reliable with Firefox</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>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { chromium } = require('playwright');

(async () =&gt; {
  const browser = await chromium.launch();

  let success;
  let attempt = 1;
  do {
    console.log(`attempt ${attempt}...`);
    const context = await browser.newContext();

    // This will make the rendering fail after a few attempts some point
    // When commented out, all 100 attempts succeed.
    await context.route('**/*', async route =&gt; {
      await route.continue();
    });

    const page = await context.newPage();
    await page.goto(
      'https://www.wm.com/ca/en/support/faqs/how-do-i-handle-medical-waste-or-sharps-disposal',
      { waitUntil: 'networkidle' }
    );
    const element = page.locator('h1');
    success = (await element.count()) &gt; 0;
    if (!success) {
      console.log('FAILED!');
      await page.screenshot({ path: 'rendering_fail.png' });
      break;
    }

    await page.close();
    await context.close();
    ++attempt;
  } while (attempt &lt;= 100);

  await browser.close();
})();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> chromium <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">chromium</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">let</span> <span class="pl-s1">success</span><span class="pl-kos">;</span>
  <span class="pl-k">let</span> <span class="pl-s1">attempt</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
  <span class="pl-k">do</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`attempt <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">attempt</span><span class="pl-kos">}</span></span>...`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-c">// This will make the rendering fail after a few attempts some point</span>
    <span class="pl-c">// When commented out, all 100 attempts succeed.</span>
    <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">route</span><span class="pl-kos">(</span><span class="pl-s">'**/*'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-s1">route</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
      <span class="pl-k">await</span> <span class="pl-s1">route</span><span class="pl-kos">.</span><span class="pl-en">continue</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span>
      <span class="pl-s">'https://www.wm.com/ca/en/support/faqs/how-do-i-handle-medical-waste-or-sharps-disposal'</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span> <span class="pl-c1">waitUntil</span>: <span class="pl-s">'networkidle'</span> <span class="pl-kos">}</span>
    <span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">element</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">locator</span><span class="pl-kos">(</span><span class="pl-s">'h1'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">success</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">element</span><span class="pl-kos">.</span><span class="pl-en">count</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">success</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'FAILED!'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">screenshot</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-s">'rendering_fail.png'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-k">break</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-c1">++</span><span class="pl-s1">attempt</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-s1">attempt</span> <span class="pl-c1">&lt;=</span> <span class="pl-c1">100</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li><code class="notranslate">node repro_script.js</code></li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<ul dir="auto">
<li>Rendering never fails (100 successful attempts).</li>
</ul>
<p dir="auto"><strong>Actual</strong></p>
<ul dir="auto">
<li>After a few rendering attempts, you will see a <code class="notranslate">FAILED!</code> log and a <code class="notranslate">rendering_fail.png</code> image is generated, showing that the content of the page wasn't correctly loaded.</li>
</ul>
<p dir="auto">Note: it never fails if the <code class="notranslate">await context.route('**/*'</code> hook is commented out.</p>