File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 88- ` Ferrum::Node#exists? ` check whether the node in ruby world still exists in the DOM tree.
99- ` Ferrum::Cookies#store ` stores all cookies of current page in a file.
1010- ` Ferrum::Cookies#load ` Loads all cookies from the file and sets them for current page.
11- - ` Ferrum::Page#screenshot ` supports webp image format
11+ - ` Ferrum::Page#screenshot ` supports webp image format.
12+ - ` Ferrum::Page#activate ` activates the target for the given page.
1213
1314### Changed
1415
Original file line number Diff line number Diff line change @@ -336,6 +336,19 @@ def bypass_csp(enabled: true)
336336 enabled
337337 end
338338
339+ #
340+ # Activates (focuses) the target for the given page. When you have multiple tabs you work with, and you need to switch a given one.
341+ #
342+ # @return [Boolean]
343+ #
344+ # @example
345+ # page.activate # => true
346+ #
347+ def activate
348+ command ( "Target.activateTarget" , targetId : target_id )
349+ true
350+ end
351+
339352 def command ( method , wait : 0 , slowmoable : false , **params )
340353 iteration = @event . reset if wait . positive?
341354 sleep ( @options . slowmo ) if slowmoable && @options . slowmo . positive?
You can’t perform that action at this time.
0 commit comments