commit | 81b992e76d7268d78f51ee955c1d952c5d23de0f | [log] [tgz] |
---|---|---|
author | Andrey Lushnikov <[email protected]> | Thu Jun 27 23:27:21 2019 |
committer | Commit Bot <[email protected]> | Thu Jun 27 23:27:21 2019 |
tree | b4d01177d18e517579135548fafb16f8a9546df9 | |
parent | cf8cd61a737b70ef4e5140e51585aa6f0c13e625 [diff] |
DevTools: intercept file chooser requests One of the big issues of web automation is handling file uploads. Many uploads are created "on the fly" without touching page's DOM: const e = document.createElement('input'); e.type = 'file'; e.click(); As a result, the |DOM.setFileInputFiles| method is not applicable since clients can't get a reference to |e|. This patch suggests an alternative approach to intercept file chooser dialogs. With file chooser interception, protocol clients: - enable file chooser interception with |page.setInterceptFileChooserDialog| command - subscribe to the |page.fileChooserOpened| event - handle file choosers with |page.handleFileChooser| command The implementation resides in the //content layer to handle both //chrome and //headless embedders. NOTE: With file chooser interception enabled, the native "file chooser" UI is not shown since the control belongs to DevTools. For the record: this is a re-upload of https://crrev.com/c/1661775 Change-Id: Ibbc8826845c94818a6cb03c8b59ae95237478286 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679638 Commit-Queue: Andrey Lushnikov <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Cr-Commit-Position: refs/heads/master@{#673121}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .