Repository navigation
feat!: return Download objects, window_bounds in its writer's shape, add Response cache predicates - #751
Merged
Conversation
…add Response cache predicates downloads.files and await_download return Ferrum::Download objects instead of merged CDP event hashes, with path (Chrome's filePath, the guid with allowAndName), state, completed?, canceled?, suggested_filename, byte counts and to_h for the raw params. window_bounds returns symbol keys with window_state:, the shape window_bounds= takes, instead of CDP's string keys and "windowState". The position RBS is fixed to the [left, top] it returns. Network::Response gets from_disk_cache? and from_service_worker?, so callers stop digging into params.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few methods handed out CDP's raw hashes where a Ruby shape is clearer.
Downloads
downloads.filesandawait_downloadreturnFerrum::Downloadinstead of the mergeddownloadWillBegin/downloadProgresshashes:pathis Chrome's ownfilePath, so it's right forbehavior: :allowAndNametoo, where the file is named after the guid.stateis:in_progress,:completedor:canceled, plusreceived_bytes,total_bytes,url,frame_idandguid.to_hreturns the raw event params.window_boundsIt returns
{left:, top:, width:, height:, window_state:}, the shapewindow_bounds=takes, instead of"left", ...,"windowState". Sopage.window_bounds = page.window_boundsworks.Network::Responsefrom_disk_cache?andfrom_service_worker?, instead ofresponse.params.dig("response", "fromDiskCache").Breaking:
downloads.filesandawait_downloadno longer return hashes.window_boundsreturns symbol keys andwindow_state:.