mikser-io 7.10.0 → 7.10.1
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.
- package/package.json +1 -1
- package/src/plugins/post/pdf.js +27 -1
package/package.json
CHANGED
package/src/plugins/post/pdf.js
CHANGED
|
@@ -22,12 +22,38 @@ export async function setup({ config, logger }) {
|
|
|
22
22
|
// user-supplied launch.args so callers can add flags without losing
|
|
23
23
|
// these. To run WITH the sandbox, override launch.args explicitly.
|
|
24
24
|
const defaultArgs = ['--no-sandbox', '--disable-setuid-sandbox']
|
|
25
|
+
|
|
26
|
+
// Resolve which chrome to use, in precedence order:
|
|
27
|
+
// 1. config.launch.executablePath — explicit, wins
|
|
28
|
+
// 2. config.executable — friendly top-level alias
|
|
29
|
+
// 3. PUPPETEER_EXECUTABLE_PATH — puppeteer's standard env var
|
|
30
|
+
// (useful for prod servers where
|
|
31
|
+
// the path differs from dev)
|
|
32
|
+
// 4. undefined → puppeteer's bundled download (the brittle path
|
|
33
|
+
// that fails when ~/.cache/puppeteer is half-populated)
|
|
34
|
+
//
|
|
35
|
+
// For headless production servers, pointing at a system chromium
|
|
36
|
+
// installed via apt (executable: '/usr/bin/chromium') skips
|
|
37
|
+
// puppeteer's postinstall download entirely. Set
|
|
38
|
+
// PUPPETEER_SKIP_DOWNLOAD=true at npm install time to keep it from
|
|
39
|
+
// even trying.
|
|
40
|
+
const executablePath =
|
|
41
|
+
config?.launch?.executablePath
|
|
42
|
+
?? config?.executable
|
|
43
|
+
?? process.env.PUPPETEER_EXECUTABLE_PATH
|
|
44
|
+
?? undefined
|
|
45
|
+
|
|
25
46
|
browser = await puppeteer.launch({
|
|
26
47
|
headless: true,
|
|
27
48
|
...config?.launch,
|
|
49
|
+
...(executablePath ? { executablePath } : {}),
|
|
28
50
|
args: [...new Set([...defaultArgs, ...(config?.launch?.args ?? [])])],
|
|
29
51
|
})
|
|
30
|
-
|
|
52
|
+
if (executablePath) {
|
|
53
|
+
logger.debug('Puppeteer browser launched (executable: %s)', executablePath)
|
|
54
|
+
} else {
|
|
55
|
+
logger.debug('Puppeteer browser launched (bundled chrome)')
|
|
56
|
+
}
|
|
31
57
|
}
|
|
32
58
|
|
|
33
59
|
export async function postprocess({ entity, options, config, logger }) {
|