watir-screenshot-stitch 0.6.2 → 0.6.3

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: 1363896c8f191d48045b435d5063b858451b6a73045774eceb1cb0ef1f195e71
4
- data.tar.gz: 5967eefb8e243dfc05336d6d51986695cc6d9ed393e8606e785a69ab2c3ec7e4
3
+ metadata.gz: 5df5fcff5f022bf2f1e21ed08759c6a3f5ebfd3104f390cc13dbb7cd8a2e0a20
4
+ data.tar.gz: f64025091f88b93993161792cfcb43a20690e459570df9164dc75c0a61db75a7
5
5
  SHA512:
6
- metadata.gz: 367216545643afad3613715763dde039ba47be37a1adb36e59edfc949e25018303b587a9547f3bdc3caa450466c278a041ad6dace9d547c9232ada3dc9825066
7
- data.tar.gz: 27c93a6be14c65b86cb235ed6a20670f1d677a4c5999b6d35dc298b4485702cf235638faeee08264025a4fa31df4cc1075614b1b2eca78bb363bd0c4437fb07a
6
+ metadata.gz: 10cf306c440573582cf391b9d260f4404c78d65a2a9745cf17692c64c16d8012d9f497a271c71aa190f4c2cdabf5bfe4107a31a3751890c5631a4c2fc12a1ad6
7
+ data.tar.gz: 9c65ecf960d4fc94117fc7668e4b9ce36659a97e520e3ab3e04ba72dff87a8aaa106933b8c304756149f45bfa8e9fc6e4e01804b1f1d8a660a0b5a6fa033f0cf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- watir-screenshot-stitch (0.6.1)
4
+ watir-screenshot-stitch (0.6.2)
5
5
  binding_of_caller (~> 0.7)
6
6
  mini_magick (~> 4.0)
7
7
  os (~> 1.0)
data/README.md CHANGED
@@ -57,7 +57,7 @@ require 'watir-screenshot-stitch'
57
57
 
58
58
  b = Watir::Browser.new :firefox
59
59
  b.goto "https://github.com/watir/watir/issues/702"
60
- b.screenshot.base64_stitch(b)
60
+ b.screenshot.base64_canvas(b)
61
61
  ```
62
62
 
63
63
  will return a base64 encoded image blob of the given site.
@@ -110,7 +110,7 @@ module Watir
110
110
  @viewport_height = (@browser.execute_script "return window.innerHeight").to_f.to_i
111
111
  @page_height = (@browser.execute_script "return Math.max( document.documentElement.scrollHeight, document.documentElement.getBoundingClientRect().height )").to_f.to_i
112
112
 
113
- @mac_factor = 2 if OS.mac?
113
+ @mac_factor = 2 if retina?
114
114
  @mac_factor ||= 1
115
115
 
116
116
  limit_page_height
@@ -168,5 +168,11 @@ module Watir
168
168
  c.geometry "+0+#{offset}"
169
169
  end
170
170
  end
171
+
172
+ def retina?
173
+ payload = %{var mq = window.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)"); return (mq && mq.matches || (window.devicePixelRatio > 1));}
174
+
175
+ @browser.execute_script payload
176
+ end
171
177
  end
172
178
  end
@@ -1,4 +1,4 @@
1
1
  module WatirScreenshotStitch
2
2
  NAME = 'watir-screenshot-stitch'
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-screenshot-stitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Nissen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-17 00:00:00.000000000 Z
11
+ date: 2018-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler