Automatically Manipulate the File Chooser dialog in a Chrome Extension with the Chrome Devtool Protocol

27 Views Asked by At

I want to automatically (without human intervention) manipulate a Chrome extension using the Chrome Devtool Protocol.

This extension outputs data in JSON format, and I need to select the desired output directory and give permission.
I was able to launch the Chrome extension using the Selenium library, which automatically manipulates web browsers, but I cannot select the directory.

File upload

Apparently, it uses the File System Access API instead of the common <input type="file"> way, and a method in the above link did not work. So, I thought I would use the "Chrome DevTool Protocol", which allows me to manipulate Chrome in more detail, but is it possible to intervene in the directory selection screen and pass the desired directory?

I found that there is an event called Page.setInterceptFileChooserDialog, so it seems possible, but I have no idea how I do it actually.

Is it able to do?

0

There are 0 best solutions below