polotno-node 3.4.0 → 3.6.0

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/README.md CHANGED
@@ -75,6 +75,11 @@ const instance = await createInstance({
75
75
  // e.g. the Chrome installed in your container. Ignored if you pass `browser`.
76
76
  executablePath: '/usr/bin/google-chrome-stable',
77
77
 
78
+ // headless - which headless mode to launch. By default, where we pick the
79
+ // browser ourselves, that is puppeteer's `chrome-headless-shell`; set `true`
80
+ // for full Chrome. Ignored if you pass `browser`.
81
+ headless: true,
82
+
78
83
  // useFontCache - cache Google Fonts responses (in memory + on disk in the
79
84
  // OS temp folder, shared across processes) and serve them to every page.
80
85
  // Every page starts with an empty HTTP cache, so without it each render
@@ -265,7 +270,7 @@ By default, when exporting video and **only** when using the default local clien
265
270
  - Deduplicate downloads (same URL is downloaded once)
266
271
  - Probe downloaded remote videos with `ffprobe`
267
272
  - Conditionally normalize incompatible downloaded videos into MP4 with H.264 video, `yuv420p`, and AAC audio for better Chromium render compatibility
268
- - Rewrite `src` to `file://...` URLs so Chromium loads media from disk
273
+ - Rewrite `src` to a URL that `polotno-node` answers from the temporary folder
269
274
 
270
275
  For best compatibility, use MP4 with H.264 (`yuv420p`) video and AAC audio.
271
276
 
@@ -279,6 +284,12 @@ const url = await instance.jsonToVideoDataURL(json, {
279
284
 
280
285
  When `skipDownloads` is enabled, `polotno-node` will skip both remote-media downloading and the conditional video preprocessing described above.
281
286
 
287
+ ### Local files
288
+
289
+ A `file:` source anywhere in a design — an image, an SVG, a video, an audio track, a font — is read by `polotno-node` and handed to the renderer, in every export format. `skipDownloads` does not affect this; it controls **remote** media only.
290
+
291
+ Because the bytes come from Node, a browser running somewhere else (`browser: await puppeteer.connect(...)`, browserless) can render a design that names files on this machine.
292
+
282
293
  ### Restricted media hosts
283
294
 
284
295
  Server-side downloads block cloud-metadata addresses (e.g. `169.254.169.254`) by default. Normal URLs, `localhost`, and private hosts still work. To restrict further: