<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: [1.20.1]</li>
<li>Operating System: [Linux]</li>
<li>Node.js version: [16.14.0]</li>
<li>Browser: [Electron]</li>
<li>Extra: [Electron app]</li>
</ul>
<p dir="auto"><strong>Code Snippet</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const electronApp = await electron.launch({ executablePath: ’xxx.AppImage‘ });
const winCount=electronApp.windows().length;
const window = await electronApp.firstWindow();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">electronApp</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">electron</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-c1">executablePath</span>: <span class="pl-s1">’xxx</span><span class="pl-kos">.</span><span class="pl-c1">AppImage‘</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">winCount</span><span class="pl-c1">=</span><span class="pl-s1">electronApp</span><span class="pl-kos">.</span><span class="pl-en">windows</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">window</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">electronApp</span><span class="pl-kos">.</span><span class="pl-en">firstWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Describe the bug</strong><br>
Can't get the electron app when using AppImage, but launch electron main js file is ok</p>
<p dir="auto"><strong>Using main.js is ok</strong></p>
<p dir="auto">The below code can start electron app normally and the window can return back normal.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const electronApp = await electron.launch({ args: ['main.js'] });
const window = await electronApp.firstWindow();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">electronApp</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">electron</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-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">'main.js'</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">window</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">electronApp</span><span class="pl-kos">.</span><span class="pl-en">firstWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>1. using main.js</strong><br>
const electronApp = await electron.launch({ args: ['main.js'] });<br>
const window = await electronApp.firstWindow();<br>
The above code can start electron app normally and the window can return back normal.</p>
<p dir="auto"><strong>2. using AppImage</strong><br>
const electronApp = await electron.launch({ executablePath: ’xxx.AppImage‘ });<br>
const winCount=electronApp.windows().length;<br>
const window = await electronApp.firstWindow();<br>
The above code can start electron app normally, but can't get the window, and i the winCount variable is 0.</p>
<p dir="auto">So I'm a little confused why can't get the window with AppImage？</p>