Repository: puppeteer
Issue: FileChooser.accept doesn't work on file dialogs not associated with an input element
Labels: bug,upstream,confirmed,P2

Here is my code 

[nodeJs]
```
const puppeteer = require('puppeteer');

class App {

    private static ROOT_PATH:string = "D:/WWW/test_puppeteer_file_access/"
    private static CLIENT_PATH:string = "http://127.0.0.1/edsa-LocalHost_D/test_puppeteer_file_access/src/index.html";
    private page:any;

    constructor(){
        this.init();
    }

    async init(){
        let browserConfig = {
            executablePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
            headless:false,
            devtools:true,
            args:["--enable-blink-features=WebCodecs",
                  "--enable-experimental-web-platform-features",
                  "--file-handling-api",
                  "--enable-features=MediaFoundationAsyncH264Encoding"
                ]
        }
        
        let pageViewport = {
            width:800,
            height:450,
            deviceScaleFactor:1
        }

        const browser = await puppeteer.launch(browserConfig); 
        
        this.page = await browser.newPage();
        this.page.setViewport(pageViewport)
        await this.page.goto(App.CLIENT_PATH);


        let futureFileChooser = await this.page.waitForFileChooser();
        await this.page.click('#fileSelectionBtn') 
        let fileChooser = await futureFileChooser;

        console.log("fileChooser = ",fileChooser)
        await fileChooser.accept(['/myfile.mp4']); 
    }
}
new App();
```
[/nodeJs]

[WebPage]
```
<html>
    <body>
        <script>
            let btn = document.createElement("div");
            btn.id = "fileSelectionBtn"
            btn.style.width = btn.style.height = "100px";
            btn.style.backgroundColor = "#cccccc";
            document.body.appendChild(btn);

            async function saveFile() {
                const options = {
                    types: [{
                    description: 'video file',
                    accept: {'video/mp4': ['.mp4']},
                    }],
                };
                const newHandle = await window.showSaveFilePicker(options);
                console.log("fileHandle => ",newHandle);
            }
            btn.onclick = ()=>{ saveFile(); } 
        </script>
    </body>
</html>
```
[/WebPage]

I tryed different file paths : 

```
 await fileChooser.accept(['/myfile.mp4'])
 await fileChooser.accept(['./myfile.mp4'])
 await fileChooser.accept(['D:/WWW/test_puppeteer_file_access/myfile.mp4'])
 await fileChooser.accept(['D:\\WWW\\test_puppeteer_file_access\\myfile.mp4'])
 await fileChooser.accept(['http://127.0.0.1/edsa-LocalHost_D/test_puppeteer_file_access/myfile.mp4']);
 await fileChooser.accept(['http:\\\\127.0.0.1\\edsa-LocalHost_D\\test_puppeteer_file_access\\myfile.mp4']);
```

I also tryed another way to proceed (the one given here : https://pptr.dev/#?product=Puppeteer&version=v9.1.1&show=api-class-filechooser ) 

```
const [fileChooser] = await Promise.all([
      page.waitForFileChooser(),
      page.click('#btn'), // some button that triggers file selection
    ]);
  await fileChooser.accept(['/tmp/myfile.pdf']);
```


(the way I proceed in my code is described here : https://pub.dev/documentation/puppeteer/latest/puppeteer/FileChooser-class.html )


But it doesn't work in any case.... 
The fileChooser appears but never close, so no file is selected... 

Actually, the problem come from "waitForFileChooser" ; the promise never resolve

Please help, I want to open a file that doesn't exist yet (to save it) in a folder contained in my puppeteer project.
I do not know what to do...  


I'm using Windows 10 and Puppeteer v9.1.1