-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prepare jsHandle.uploadFile for CDP Page.handleFileChooser remov…
…al (#5196) * fix: prepare jsHandle.uploadFile for CDP Page.handleFileChooser removal https://chromium-review.googlesource.com/c/chromium/src/+/1935410 removes Page.handleFileChooser from the CDP. * fix: improve binary file support UTF-8-decoding the input file could fail for binary files, and so we now read the raw file buffer and base64-encode it. To base64-decode it within the page context, we use the Fetch API in combination with a data URL. This requires knowing the proper MIME type for the input file, which we now figure out using the new mime-types dependency.
- Loading branch information
1 parent
8b49dc6
commit 6091a34
Showing
2 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6091a34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mathiasbynens
Since 2.1.0 I'm finding uploadFile with is handle isn't working for my e2e tests :( downgraded to 2.0.0 and all is fine #5420 wondering if this might be why? In linked issue is code snippet from CodeceptJS