grover 0.5.4 → 0.5.5
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/grover.rb +6 -3
- data/lib/grover/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: f1b134a553f30ceb3fa72cc1699eaa46457dc055
|
|
4
|
+
data.tar.gz: d927e1b38d32982d7578657c67fb4ccfcd664e8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80630d162e38555c0eec975009ade34104fcaa21addb3b2215ff57dc9f46625d5335254827161aa3d0654413e237d7cb775999709a5f1051ecf691f31f2bd912
|
|
7
|
+
data.tar.gz: 32bf0d1016b22a24877404052165226c104c0f90bad13298fb69feeb18cfcb295f93ad80b02328ff137fd0448d1b1fac26d2c659511cc5cf120d877e3b1fcaf7
|
data/lib/grover.rb
CHANGED
|
@@ -32,13 +32,16 @@ class Grover
|
|
|
32
32
|
const page = await browser.newPage();
|
|
33
33
|
|
|
34
34
|
const cache = options.cache; delete options.cache;
|
|
35
|
-
|
|
35
|
+
if (cache != undefined) {
|
|
36
|
+
await page.setCacheEnabled(cache);
|
|
37
|
+
}
|
|
36
38
|
|
|
37
39
|
let request_options = {};
|
|
38
40
|
const timeout = options.timeout; delete options.timeout;
|
|
39
|
-
if (timeout) {
|
|
41
|
+
if (timeout != undefined) {
|
|
40
42
|
request_options.timeout = timeout;
|
|
41
43
|
}
|
|
44
|
+
|
|
42
45
|
if (url.match(/^http/i)) {
|
|
43
46
|
request_options.waitUntil = 'networkidle2';
|
|
44
47
|
await page.goto(url, request_options);
|
|
@@ -48,7 +51,7 @@ class Grover
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
const emulateMedia = options.emulateMedia; delete options.emulateMedia;
|
|
51
|
-
if (emulateMedia) {
|
|
54
|
+
if (emulateMedia != undefined) {
|
|
52
55
|
await page.emulateMedia(emulateMedia);
|
|
53
56
|
}
|
|
54
57
|
|
data/lib/grover/version.rb
CHANGED