<h3 dir="auto">Playwright version</h3>
<p dir="auto">1.12.3</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">MacOS</p>
<h3 dir="auto">What browsers are you seeing the problem on?</h3>
<p dir="auto">Firefox</p>
<h3 dir="auto">Other information</h3>
<p dir="auto">Node: v14.17.0<br>
Mac OS: 11.4<br>
Firefox: 89</p>
<h3 dir="auto">What happened? / Describe the bug</h3>
<p dir="auto">When i try to download file in Firefox, i get a 'openFile / saveToDisk' dialog box. Same code works fine in Chrome and Webkit without prompting to open / save the file.</p>
<p dir="auto">I followed the documentation mentioned <a href="https://playwright.dev/docs/downloads" rel="nofollow">here</a> to download file.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/22808594/126113203-eaac3380-ef4d-442a-9117-4492a1f2b6ac.png"><img width="377" alt="firefox-download" src="https://user-images.githubusercontent.com/22808594/126113203-eaac3380-ef4d-442a-9117-4492a1f2b6ac.png" style="max-width: 100%;"></a></p>
<p dir="auto">I can share the actual code privately if it helps you to troubleshoot the issue</p>
<h3 dir="auto">Code snippet to reproduce your bug</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="playwright.config.js
====================
use: {
                browserName: 'firefox',
                launchOptions: {
                    downloadsPath: path.join(__dirname, 'downloads'),
                },
                acceptDownloads: true,
            }

example.spec.js
===============
let elmFrame = page.frames().find(frame =&gt; frame.name() === 'submainframe');

        const [download] = await Promise.all([
            page.waitForEvent('download'), // wait for download to start
            elmFrame.click('css=tr &gt; td &gt;&gt; text=PlaywrightTest &gt;&gt; xpath=parent::td/parent::tr &gt;&gt; td &gt;&gt; css=img[alt=&quot;Download&quot;]'),
        ]);

        let downloadPath;
        downloadPath = await download.path();
        console.log(downloadPath);"><pre class="notranslate">playwright.config.js
====================
use: {
                browserName: <span class="pl-s"><span class="pl-pds">'</span>firefox<span class="pl-pds">'</span></span>,
                launchOptions: {
                    downloadsPath: path.join(__dirname, <span class="pl-s"><span class="pl-pds">'</span>downloads<span class="pl-pds">'</span></span>),
                },
                acceptDownloads: true,
            }

example.spec.js
===============
<span class="pl-c1">let</span> elmFrame = <span class="pl-en">page.frames</span>().find(frame =<span class="pl-k">&gt;</span> <span class="pl-en">frame.name</span>() === <span class="pl-s"><span class="pl-pds">'</span>submainframe<span class="pl-pds">'</span></span>);

        const [download] = await Promise.all([
            page.waitForEvent(<span class="pl-s"><span class="pl-pds">'</span>download<span class="pl-pds">'</span></span>), // <span class="pl-c1">wait</span> <span class="pl-k">for</span> download to start
            elmFrame.click(<span class="pl-s"><span class="pl-pds">'</span>css=tr &gt; td &gt;&gt; text=PlaywrightTest &gt;&gt; xpath=parent::td/parent::tr &gt;&gt; td &gt;&gt; css=img[alt="Download"]<span class="pl-pds">'</span></span>),
        ])<span class="pl-k">;</span>

        <span class="pl-c1">let</span> downloadPath<span class="pl-k">;</span>
        downloadPath = await <span class="pl-en">download.path</span>();
        console.log(downloadPath)<span class="pl-k">;</span></pre></div>
<h3 dir="auto">Relevant log output</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="n/a"><pre class="notranslate">n/a</pre></div>
<h3 dir="auto">Playwright version</h3>
<p dir="auto">1.13.0</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">MacOS</p>
<h3 dir="auto">What browsers are you seeing the problem on?</h3>
<p dir="auto">Firefox</p>
<h3 dir="auto">Other information</h3>
<p dir="auto">Node.js v14.15.3</p>
<h3 dir="auto">What happened? / Describe the bug</h3>
<p dir="auto">Hello!<br>
I’m having trouble with the file uploading. The following snippet works OK in Chromium, but fails in the Firefox.<br>
Filechooser window appears in FF (Juggler) by clicking on browseForFilesLink if page.waitForEvent('filechooser') is removed.<br>
Filechooser window does not appear if page.waitForEvent('filechooser') exists.<br>
Unfortunately, I cannot share a website link since it's private.</p>
<h3 dir="auto">Code snippet to reproduce your bug</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const frame: Frame = await this.getFrame();
const [fileChooser] = await Promise.all([
    page.waitForEvent('filechooser'),
    frame.click(this.browseForFilesLink),
 ]);
await fileChooser.setFiles(path);"><pre class="notranslate">const frame: Frame = await <span class="pl-en">this.getFrame</span>();
const [fileChooser] = await Promise.all([
    page.waitForEvent(<span class="pl-s"><span class="pl-pds">'</span>filechooser<span class="pl-pds">'</span></span>),
    frame.click(this.browseForFilesLink),
 ])<span class="pl-k">;</span>
await fileChooser.setFiles(path)<span class="pl-k">;</span></pre></div>
<h3 dir="auto">Relevant log output</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="● FIREFOX_ItemImport_ › Item_is_imported_successfully_and_found_via_search

    page.waitForEvent: Timeout while waiting for event &quot;filechooser&quot;
    =========================== logs ===========================
    waiting for event &quot;filechooser&quot;
    ============================================================

      220 |     async uploadFile(path: string): Promise&lt;void&gt; {
      221 |         const [fileChooser] = await Promise.all([
    &gt; 222 |             page.waitForEvent('filechooser'),
          |                  ^
      223 |             this.waitAndClick(this.browseForFilesLink),
      224 |         ]);
      225 |         await fileChooser.setFiles(path);

      at GeneralPopup.&lt;anonymous&gt; (src/pages/generalPopup.ts:222:18)
      at step (src/pages/generalPopup.ts:48:23)
      at Object.next (src/pages/generalPopup.ts:29:53)
      at src/pages/generalPopup.ts:23:71
      at Object.&lt;anonymous&gt;.__awaiter (src/pages/generalPopup.ts:19:12)
      at GeneralPopup.Object.&lt;anonymous&gt;.GeneralPopup.uploadFile (src/pages/generalPopup.ts:489:16)
      at src/Tests/ItemSourcing/ItemImport.test.ts:42:28
      at step (src/Tests/ItemSourcing/ItemImport.test.ts:33:23)
      at Object.next (src/Tests/ItemSourcing/ItemImport.test.ts:14:53)
      at fulfilled (src/Tests/ItemSourcing/ItemImport.test.ts:5:58)"><pre class="notranslate">● FIREFOX_ItemImport_ › Item_is_imported_successfully_and_found_via_search

    page.waitForEvent: Timeout <span class="pl-k">while</span> waiting <span class="pl-k">for</span> event <span class="pl-s"><span class="pl-pds">"</span>filechooser<span class="pl-pds">"</span></span>
    =========================== logs ===========================
    waiting <span class="pl-k">for</span> event <span class="pl-s"><span class="pl-pds">"</span>filechooser<span class="pl-pds">"</span></span>
    ============================================================

      220 <span class="pl-k">|</span>     async uploadFile(path: string): Promise<span class="pl-k">&lt;</span>void<span class="pl-k">&gt;</span> {
      221 <span class="pl-k">|</span>         const [fileChooser] = await Promise.all([
    <span class="pl-k">&gt;</span> 222 <span class="pl-k">|</span>             page.waitForEvent(<span class="pl-s"><span class="pl-pds">'</span>filechooser<span class="pl-pds">'</span></span>),
          <span class="pl-k">|</span>                  ^
      223 <span class="pl-k">|</span>             this.waitAndClick(this.browseForFilesLink),
      224 <span class="pl-k">|</span>         ])<span class="pl-k">;</span>
      225 <span class="pl-k">|</span>         await fileChooser.setFiles(path)<span class="pl-k">;</span>

      at GeneralPopup.<span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span> (src/pages/generalPopup.ts:222:18)
      at step (src/pages/generalPopup.ts:48:23)
      at Object.next (src/pages/generalPopup.ts:29:53)
      at src/pages/generalPopup.ts:23:71
      at Object.<span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span>.__awaiter (src/pages/generalPopup.ts:19:12)
      at GeneralPopup.Object.<span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span>.GeneralPopup.uploadFile (src/pages/generalPopup.ts:489:16)
      at src/Tests/ItemSourcing/ItemImport.test.ts:42:28
      at step (src/Tests/ItemSourcing/ItemImport.test.ts:33:23)
      at Object.next (src/Tests/ItemSourcing/ItemImport.test.ts:14:53)
      at fulfilled (src/Tests/ItemSourcing/ItemImport.test.ts:5:58)</pre></div>