ferrum 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f5179f765dbfb25cfbb1512958c5c4e8d2e8b486d48973bd2d2922389f74f8f
4
- data.tar.gz: 47f2b8cc7afc75c06dffe27fae3e3a54558c86579c412d6806e9713e3282c0e8
3
+ metadata.gz: 9c0325708ecf4ff29cd0d11a3527207271a1a9a76c945a321810b7f37325c538
4
+ data.tar.gz: 9d2f4790ef55ddfb55f1588473dc94511fc95fe7c7cc937f0e49af0980457b9e
5
5
  SHA512:
6
- metadata.gz: 9566908dab8979128138801a7b105905e0198e4873b9c668e231078108a31cc6e7586ab4c4405c527908ffb9557d255bc9a02b6e878392946b2eb1d79f8cc0a0
7
- data.tar.gz: 4b4fa5c411f0831a0fbd80ac880621e0459ff8dc976d828c1b88dfbf5f05023a096b2a6696269048416b7bdcef1f34f8d360a841e0798bb936277a96b4da4929
6
+ metadata.gz: 8067b96de131a957317d641afeec6d145f47455b18eb119227dc1de184ed35b8b6a6cbf84aa8e1e6b3c87ff190b2218c68dd43cb1c9187fe7e7acea2cae1ca89
7
+ data.tar.gz: a4fb8e6749da0fa5ccbf1ab05c807f176e30c2650e23b263072281065b5ca9632201a596652989636f7b9f565ac8a23ca391e8d366d755538e7b28504b09209b
@@ -4,6 +4,10 @@ module Ferrum
4
4
  class Target
5
5
  NEW_WINDOW_WAIT = ENV.fetch("FERRUM_NEW_WINDOW_WAIT", 0.3).to_f
6
6
 
7
+ # You can create page yourself and assign it to target, used in cuprite
8
+ # where we enhance page class and build page ourselves.
9
+ attr_writer :page
10
+
7
11
  def initialize(browser, params = nil)
8
12
  @browser = browser
9
13
  @params = params
@@ -19,8 +23,7 @@ module Ferrum
19
23
 
20
24
  def page
21
25
  @page ||= begin
22
- # Dirty hack because new window doesn't have events at all
23
- sleep(NEW_WINDOW_WAIT) if window?
26
+ maybe_sleep_if_new_window
24
27
  Page.new(id, @browser)
25
28
  end
26
29
  end
@@ -52,5 +55,10 @@ module Ferrum
52
55
  def window?
53
56
  !!opener_id
54
57
  end
58
+
59
+ def maybe_sleep_if_new_window
60
+ # Dirty hack because new window doesn't have events at all
61
+ sleep(NEW_WINDOW_WAIT) if window?
62
+ end
55
63
  end
56
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ferrum
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ferrum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Vorotilin