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 8
8
- ` Ferrum::Node#exists? ` check whether the node in ruby world still exists in the DOM tree.
9
9
- ` Ferrum::Cookies#store ` stores all cookies of current page in a file.
10
10
- ` 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.
12
13
13
14
### Changed
14
15
Original file line number Diff line number Diff line change @@ -336,6 +336,19 @@ def bypass_csp(enabled: true)
336
336
enabled
337
337
end
338
338
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
+
339
352
def command ( method , wait : 0 , slowmoable : false , **params )
340
353
iteration = @event . reset if wait . positive?
341
354
sleep ( @options . slowmo ) if slowmoable && @options . slowmo . positive?
You can’t perform that action at this time.
0 commit comments