wraith 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wraith/javascript/_phantom__common.js +12 -4
- data/lib/wraith/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c409214f8f7834c0b3b2c6fa5f010686f092d9a4
|
4
|
+
data.tar.gz: a3542e23dbcbf0c3f8da7bb6c07cd92828912418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 479c53baad28975382e6080c8c0828bc7d63c89971c7d88a45903a2ae114940dc9b64b67e59852e226556d760bb073da40cb5d5e4e4f571d44183b9235bc8b10
|
7
|
+
data.tar.gz: 67c76a4f7a7638d08df5ff730aea5349cb10a5181f29df869cdacf439e9906dd317dde59e5376efe782920e1385a7ffcb360a96a8c2d90777ed954dedd138ba2
|
@@ -33,7 +33,6 @@ module.exports = function (config) {
|
|
33
33
|
currentDimensions = dimensions;
|
34
34
|
}
|
35
35
|
|
36
|
-
page.viewportSize = { width: currentDimensions.viewportWidth, height: currentDimensions.viewportHeight};
|
37
36
|
page.settings = { loadImages: true, javascriptEnabled: javascriptEnabled };
|
38
37
|
|
39
38
|
// If you want to use additional phantomjs commands, place them here
|
@@ -58,18 +57,27 @@ module.exports = function (config) {
|
|
58
57
|
});
|
59
58
|
|
60
59
|
function runSetupJavaScriptThenCaptureImage() {
|
60
|
+
resize();
|
61
61
|
if (globalBeforeCaptureJS) {
|
62
62
|
require(globalBeforeCaptureJS)(page);
|
63
63
|
}
|
64
64
|
if (pathBeforeCaptureJS) {
|
65
65
|
require(pathBeforeCaptureJS)(page);
|
66
66
|
}
|
67
|
-
|
67
|
+
resizeAndCaptureImage();
|
68
68
|
}
|
69
69
|
|
70
|
-
function
|
70
|
+
function resize() {
|
71
|
+
page.viewportSize = { width: currentDimensions.viewportWidth, height: currentDimensions.viewportHeight};
|
72
|
+
}
|
71
73
|
|
74
|
+
function resizeAndCaptureImage() {
|
72
75
|
console.log('Snapping ' + url + ' at: ' + currentDimensions.viewportWidth + 'x' + currentDimensions.viewportHeight);
|
76
|
+
resize();
|
77
|
+
setTimeout(captureImage, 1000); // give page time to re-render properly
|
78
|
+
}
|
79
|
+
|
80
|
+
function captureImage() {
|
73
81
|
page.clipRect = {
|
74
82
|
top: 0,
|
75
83
|
left: 0,
|
@@ -82,7 +90,7 @@ module.exports = function (config) {
|
|
82
90
|
if (helper.takingMultipleScreenshots(dimensions) && dimensionsProcessed < dimensions.length) {
|
83
91
|
currentDimensions = dimensions[dimensionsProcessed];
|
84
92
|
image_name = helper.replaceImageNameWithDimensions(image_name, currentDimensions);
|
85
|
-
setTimeout(
|
93
|
+
setTimeout(resizeAndCaptureImage, 1000);
|
86
94
|
}
|
87
95
|
else {
|
88
96
|
// prevent CI from failing from 'Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL' errors
|
data/lib/wraith/version.rb
CHANGED