grover 1.1.4 → 1.1.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/js/processor.cjs +34 -23
- data/lib/grover/options_builder.rb +1 -1
- data/lib/grover/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9685b557f5d1cdc200fe5806aadc59106ccb9d6572e4d57c1660964286b3f4c7
|
4
|
+
data.tar.gz: b0584418598e6ca66b097b8e9ffc87ad5bbd6ae64becf74966ceef4b4d894730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfad1954989183edd8f9cd238085c6031ec9cfca25b61dbe6e83fd33bd733c4d60b97b64da59d9b6301b538aa26979e8e9813b40765fa34fd03a17f47f46897c
|
7
|
+
data.tar.gz: e06271f0ede0792519f7a6d1156b04e5d5465921b8b75d36438fffdf62a491c54029c73f070de6241cb4cb1654e548024115634fe27c80fa1ee1b056375d20c9
|
data/lib/grover/js/processor.cjs
CHANGED
@@ -16,35 +16,46 @@ const path = require('path');
|
|
16
16
|
|
17
17
|
const _processPage = (async (convertAction, urlOrHtml, options) => {
|
18
18
|
let browser, errors = [], tmpDir;
|
19
|
-
try {
|
20
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'grover-'));
|
21
|
-
|
22
|
-
const launchParams = {
|
23
|
-
args: process.env.GROVER_NO_SANDBOX === 'true' ? ['--no-sandbox', '--disable-setuid-sandbox'] : [],
|
24
|
-
userDataDir: tmpDir
|
25
|
-
};
|
26
19
|
|
20
|
+
try {
|
27
21
|
// Configure puppeteer debugging options
|
28
22
|
const debug = options.debug; delete options.debug;
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
// Configure additional launch arguments
|
35
|
-
const args = options.launchArgs; delete options.launchArgs;
|
36
|
-
if (Array.isArray(args)) {
|
37
|
-
launchParams.args = launchParams.args.concat(args);
|
38
|
-
}
|
23
|
+
const browserWsEndpoint = options.browserWsEndpoint; delete options.browserWsEndpoint;
|
24
|
+
if (typeof browserWsEndpoint === "string") {
|
25
|
+
const connectParams = {
|
26
|
+
browserWSEndpoint: browserWsEndpoint,
|
27
|
+
};
|
39
28
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
browser = await puppeteer.connect(connectParams);
|
30
|
+
} else {
|
31
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'grover-'));
|
32
|
+
|
33
|
+
const launchParams = {
|
34
|
+
args: process.env.GROVER_NO_SANDBOX === 'true' ? ['--no-sandbox', '--disable-setuid-sandbox'] : [],
|
35
|
+
userDataDir: tmpDir
|
36
|
+
};
|
37
|
+
|
38
|
+
if (typeof debug === 'object' && !!debug) {
|
39
|
+
if (debug.headless !== undefined) { launchParams.headless = debug.headless; }
|
40
|
+
if (debug.devtools !== undefined) { launchParams.devtools = debug.devtools; }
|
41
|
+
}
|
42
|
+
|
43
|
+
// Configure additional launch arguments
|
44
|
+
const args = options.launchArgs; delete options.launchArgs;
|
45
|
+
if (Array.isArray(args)) {
|
46
|
+
launchParams.args = launchParams.args.concat(args);
|
47
|
+
}
|
48
|
+
|
49
|
+
// Set executable path if given
|
50
|
+
const executablePath = options.executablePath; delete options.executablePath;
|
51
|
+
if (executablePath) {
|
52
|
+
launchParams.executablePath = executablePath;
|
53
|
+
}
|
54
|
+
|
55
|
+
// Launch the browser and create a page
|
56
|
+
browser = await puppeteer.launch(launchParams);
|
44
57
|
}
|
45
58
|
|
46
|
-
// Launch the browser and create a page
|
47
|
-
browser = await puppeteer.launch(launchParams);
|
48
59
|
const page = await browser.newPage();
|
49
60
|
|
50
61
|
// Basic auth
|
@@ -8,7 +8,7 @@ class Grover
|
|
8
8
|
# Build options from Grover.configuration, meta_options, and passed-in options
|
9
9
|
#
|
10
10
|
class OptionsBuilder < Hash
|
11
|
-
def initialize(options, url)
|
11
|
+
def initialize(options, url)
|
12
12
|
@url = url
|
13
13
|
combined = grover_configuration
|
14
14
|
Utils.deep_merge! combined, Utils.deep_stringify_keys(options)
|
data/lib/grover/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bromwich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02
|
11
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: combine_pdf
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0'
|
217
217
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
218
|
+
rubygems_version: 3.2.3
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: A Ruby gem to transform HTML into PDF, PNG or JPEG by wrapping the NodeJS
|