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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/watir-screenshot-stitch.rb +7 -1
- data/lib/watir-screenshot-stitch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5df5fcff5f022bf2f1e21ed08759c6a3f5ebfd3104f390cc13dbb7cd8a2e0a20
|
4
|
+
data.tar.gz: f64025091f88b93993161792cfcb43a20690e459570df9164dc75c0a61db75a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10cf306c440573582cf391b9d260f4404c78d65a2a9745cf17692c64c16d8012d9f497a271c71aa190f4c2cdabf5bfe4107a31a3751890c5631a4c2fc12a1ad6
|
7
|
+
data.tar.gz: 9c65ecf960d4fc94117fc7668e4b9ce36659a97e520e3ab3e04ba72dff87a8aaa106933b8c304756149f45bfa8e9fc6e4e01804b1f1d8a660a0b5a6fa033f0cf
|
data/Gemfile.lock
CHANGED
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.
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|