@mefistofelix/cdp.js 0.1.1 → 0.1.2
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 +3 -1
- package/cdp.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -199,7 +199,7 @@ local configuration.
|
|
|
199
199
|
| `user_data_dir` | absolute path string, `<base_path>/<name>` | Chromium user-data directory containing profiles such as `Default`. The generated default is absolute; explicit overrides should be absolute too. |
|
|
200
200
|
| `executable_path` | string, automatic discovery | Executable to spawn; takes precedence over `CDP_BROWSER`. |
|
|
201
201
|
| `headless` | boolean, `false` | When true, add `headless: 'new'` and default `window-size: '1440,900'`. |
|
|
202
|
-
| `windowsHide` | boolean,
|
|
202
|
+
| `windowsHide` | boolean, effective headless mode | Hide the spawned process's console on Windows. Defaults to true when the final arguments include `--headless`, false otherwise; an explicit value wins. Does not hide the parent terminal. |
|
|
203
203
|
| `extensions` | boolean, `false` | When true, omit the two extension-disabling switches; does not install extensions. |
|
|
204
204
|
| `images` | boolean, `true` | When false, request `blink-settings: 'imagesEnabled=false'`; controls loading, not image processing. |
|
|
205
205
|
| `translations` | boolean, `false` | Set translation preferences and, unless true, disable translation feature IDs. |
|
|
@@ -460,6 +460,8 @@ writes with a running browser, which may overwrite the file itself.
|
|
|
460
460
|
| --- | --- |
|
|
461
461
|
| `headless: true` plus `args.headless: false` | Omit `--headless`; the generated window-size argument remains unless also overridden. |
|
|
462
462
|
| `headless: false` plus `args.headless: 'new'` | Send `--headless=new`; no automatic headless window-size default was generated. |
|
|
463
|
+
| `windowsHide` omitted plus a raw `args.headless` override | Follow the effective `--headless` switch after the override. |
|
|
464
|
+
| Explicit `windowsHide: true` or `false` | Pass that value to Node's `spawn`, regardless of headless mode. |
|
|
463
465
|
| `extensions: true` plus `args['disable-extensions']: true` | The raw extension-disabling switch still wins. |
|
|
464
466
|
| `extensions: false` plus only `args['disable-extensions']: false` | Remove that flag, but retain `disable-component-extensions-with-background-pages`. Use `extensions: true` to omit both generated flags. |
|
|
465
467
|
| `images: false` plus an overridden `blink-settings` | Replace the whole string; image disabling is not appended to the caller's value. |
|
package/cdp.js
CHANGED
|
@@ -209,7 +209,7 @@ export class browser {
|
|
|
209
209
|
...options.preferences,
|
|
210
210
|
})
|
|
211
211
|
const proc = child_process.spawn(options.executable_path || browser.find_executable_path(), [...util.args_to_strings(args), 'about:blank'], {
|
|
212
|
-
windowsHide: options.windowsHide ??
|
|
212
|
+
windowsHide: options.windowsHide ?? (args.headless != null && args.headless !== false),
|
|
213
213
|
stdio: ['ignore', 'ignore', 'pipe'],
|
|
214
214
|
})
|
|
215
215
|
let diagnostic = ''
|