Releases: rubycdp/ferrum
Releases Β· rubycdp/ferrum
0.17.1
0.17
Added
Ferrum::Network::Exchange#blob?determines if the exchange is blob [#516]Ferrum::Network::Request#headersare enhanced and supplemented withNetwork.requestWillBeSentExtraInfo[#506]Ferrum::Page#offto unsubscribe from CDP events [#455]Ferrum::Mouse#scroll_byto be able to scroll by, as alternative toscroll_to[#514]Ferrum::Network::Exchange#unknowndetermines if the exchange is in an unknown state, meaning that browser might not return info about it [#426]Ferrum::Network::Exchange#loader_idreturns loader id [#426]Ferrum::Browser#debugopens headless session in the browser devtools frontend [#519]Ferrum::Frame#parentreturns the parent frame if this frame is nested [#523]Ferrum::Frame#frame_elementreturns the element in which the window is embedded [#524]Ferrum::Page#start_screencaststarts sending frames to record screencast [#494]Ferrum::Page#stop_screencaststops sending frames [#494]Ferrum::Browser#new(incognito: false)whether to create an incognito profile for the browser startup window,trueby default.
Changed
Ferrum::Network::Exchange#finished?takes into account that exchange might be in an unknown state after loader changed(nextgo_tocall) and considers
such as finished [#426]headless: "new"mode is removed as it's now default in modern Chrome, just useheadless: trueinstead [#518]
Fixed
- Correctly set mouse events buttons property [#509]
- Prevent 'Hash#[]=': can't add a new key into hash during iteration [#513]
Ferrum::Network::Exchange#finished?andFerrum::Network#wait_for_idletake into account that request can be a blob [#496]- Safe call body method (DOM) when page is empty and no html [#522]
0.16
Added
Ferrum::Network#wait_for_idle!raises an error if timeout reached.Ferrum::Browser#closecloses browser gracefully issuing a CDP command, doesn't clean up ruby resources.Ferrum::Node#removeremoves node from DOM tree.Ferrum::Node#exists?check whether the node in ruby world still exists in the DOM tree.Ferrum::Cookies#storestores all cookies of current page in a file.Ferrum::Cookies#loadLoads all cookies from the file and sets them for current page.Ferrum::Page#screenshotsupports webp image format.Ferrum::Page#activateactivates the target for the given page.
Changed
Ferrum::Network#wait_for_idlenow returns true or false. Doesn't raise an error [BREAKING CHANGE].
Fixed
:ws_urloption is now used without modifications WYSIWYG.Network.requestWillBeSentcallback didn't handle params in a type-safe wayPage.frameStoppedLoadingcallback shouldn't wait for document_node_id responseJSON::NestingErroris raised when browser returns very deeply nested JSON and crashes the thread [#498]
0.15
Added
Ferrum::Page#disable_javascriptdisables the JavaScript from the HTML source [#407]Ferrum::Page#set_viewportemulates the viewport [#406]Ferrum::Downloads[#416]#filesinformation about downloaded files#waitwait for file download to be completed#set_behaviorwhere and whether to store file
Browser::Client#commandaccepts :async parameter [#433]Ferrum::Browserintroduce:flattenmode with one connection and sessions [#434]- Support for ping requests [#417]
Ferrum::Browserintroduce:ws_urloption to set external websocket for a browser [#435]
Changed
Ferrum::Page#screeshotaccepts :area option [#410]- Resizing page on creation is gone and moved to Cuprite [#427]
- Min Ruby version is 2.7
- Refactored internal API of
Ferrum::Browser,Ferrum::Page,Ferrum::Context,Ferrum::Contexts,Ferrum::Target
instead of passing browser and making cyclic dependency on the browser instance, we pass now a thin client [#431] - Bump
websocket-driverto~> 0.7[#432] - Got rid of
Concurrent::AsyncinFerrum::Browser::Subscriber[#432] Ferrum::Page#set_window_boundsis renamed toFerrum::Page#window_bounds=Ferrum::Pageget right client from the Target and passes it down everywhere [#433]Ferrum::Network::InterceptedRequestacceptsFerrum::Browser::Clientinstead ofFerrum::Page[#433]Ferrum::Browser::Client->Ferrum::Client[#433]
Fixed
0.14
Added
Ferrum::Page#device_pixel_ratioreturns the ratio of the resolution in physical pixels to the
resolution in CSS pixels for the current display device.Ferrum::Network#cache(disable: true | false)whether or not to use cache for every requestFerrum::Network::Exchange#redirect?determines if the exchange is a redirectFerrum::Network::Exchange#xhr?determines if the exchange is XHRFerrum::Network::Request#xhr?determines if the request is XHRFerrum::Network::Response#loaded?returns true if the response is fully loadedFerrum::Network::Response#redirect?returns true if the response is a redirectFerrum::Node#in_viewport?checks if the element in viewport (optional argumentscopeasFerrum::Node)Ferrum::Node#scroll_into_view- scrolls to element if needed (when it's not in the viewport)Ferrum::Cookies#each- is now Enumerable and supportseachmethodFerrum::Cookies::Cookie#priority#sameparty?#source_scheme#source_port#to_s#to_h
Ferrum::Network::Request#to_hFerrum::Network::Response#to_h
Fixed
Ferrum::Network::Exchange#finished?returnstrueonly fully loaded responsesFerrum::Page#resizeset deviceScaleFactor as0by default [#330]Ferrum::Network#interceptsilently discards unknown resource_types [#313]- Truncated Chrome WS URL results in Ferrum::DeadBrowserError [#327]
- Websocket connection remains indefinitely in :connecting state and causes TimeoutError [#329]
Exchange#navigation_request?Handle nil request [#339]- Raise
Ferrum::StatusErrorfor any top frame navigation error [#341] Ferrum::Network::Response#loaded?for redirect response [#338]
0.13
Added
Ferrum::Browser::VersionInfoFerrum::Browser#versionrequests the browser's version information.#create_page(proxy: { host: "x.x.x.x", port: "8800", user: "user", password: "pa$$" })
proxy option, supports creating a page in a new context that uses proxy settings.
Ferrum::Page#timeout = npage supports its own timeoutFerrum::Frame#execution_idreturns execution context id and doesn't raise errorFerrum::Frame#execution_id!returns execution context id and raises error when times out on borrowing
Changed
Fixed
Ferrum::Keyboard#up, #downaccept only one key.
Ferrum::Page#gotofixed undefined method url for nil:NilClass when page times out and there are pending requests.Runtime.consoleAPICalleddidn't show log messagesFerrum::Page#subscribe_frame_detachedadded to clean up old framesFerrum::Proxywas hanging at the exit due to issue in WebrickFerrum::NoExecutionContextErroris raised sometimes when we block onFerrum::Page#frame_by
Removed
Ferrum::Browser#proxy_serverFerrum::Browser.new(proxy: { server: true }):server option.
0.12
Added
- Alias
Ferrum::Frame#content=toFerrum::Frame#set_content - Alias
Ferrum::Node#properytoFerrum::Node#[] - Implement
Ferrum::Network#blacklist=andFerrum::Network#whitelist= - Alias
Ferrum::Network#blocklist=toFerrum::Network#blacklist= - Alias
Ferrum::Network#allowlist=toFerrum::Network#whitelist= - Alias
Ferrum::Page#gotoFerrum::Page#go_to Ferrum::Browser#create_pageaccepts nownew_context: truewhich can create a page in incognito context, and yields
a block with this page, after which the page is closed.Ferrum::Browsersupports new option:proxyhttps://github.com/rubycdp/ferrum#proxyFerrum::Network::Response#paramsattr_reader addedFerrum::Node#selectedchecks selected options. Returns an array ofFerrum::Nodethat's selected.#selectselects options by passed attribute, default::value.#computed_stylereturns hash of computed styles
Ferrum::JavaScriptError#stack_traceattr_reader- Windows support
- Show warning and accept dialog if no handler given
Ferrum::Cookies#setability to set cookie usingFerrum::Cookies::CookieobjectFerrum::Network#emulate_network_conditionsactivates emulation of network conditionsFerrum::Network#offline_modeputs browser into offline modeFerrum::Page#tracing- instance ofFerrum::Page::Tracingfor trace capabilities.Ferrum::Page::Tracing#record(&block)start/stop tracing for steps provided in passed block
Changed
- Use
Concurrent::MVarasexecution_idinFerrum::Frame - Min Ruby version is 2.6 and 3.0 is supported
Ferrum::Page#bypass_cspaccepts hash as argumentenabled: trueby defaultFerrum::Context#has_target?->Ferrum::Context#target?- We now start looking for Chrome first instead of Chromium, the order for checking binaries has changed
- Multiple methods are moved into
Utils:Ferrum.with_attempts->Ferrum::Utils::Attempt.with_retryFerrum.started->Ferrum::Utils::ElapsedTime.startFerrum.elapsed_time->Ferrum::Utils::ElapsedTime.elapsed_timeFerrum.monotonic_time->Ferrum::Utils::ElapsedTime.monotonic_timeFerrum.timeout?->Ferrum::Utils::ElapsedTime.timeout?Ferrum.windows?->Ferrum::Utils::Platform.windows?Ferrum.mac?->Ferrum::Utils::Platform.mac?Ferrum.mri?->Ferrum::Utils::Platform.mri?
Fixed
Ferrum::Node#selected,Ferrum::Node#selectto work in frame scope