diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2025-11-24 20:54:57 +0100 |
|---|---|---|
| committer | Philipp Tanlak <philipp.tanlak@gmail.com> | 2025-11-24 20:57:48 +0100 |
| commit | b1e2c8fd5cb5dfa46bc440a12eafaf56cd844b1c (patch) | |
| tree | 49d360fd6cbc6a2754efe93524ac47ff0fbe0f7d /content/docs/configuration/browser-mode.md | |
Docs
Diffstat (limited to 'content/docs/configuration/browser-mode.md')
| -rw-r--r-- | content/docs/configuration/browser-mode.md | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/content/docs/configuration/browser-mode.md b/content/docs/configuration/browser-mode.md new file mode 100644 index 0000000..bbb2c1e --- /dev/null +++ b/content/docs/configuration/browser-mode.md @@ -0,0 +1,40 @@ +--- +title: 'Browser Mode' +weight: 10 +--- + +The Browser Mode controls the interaction with a headless Chromium browser. Enabling the browser mode allows `flyscrape` to download a Chromium browser once and use it to render JavaScript-heavy pages. + +## Browser Mode + +To enable Browser Mode, set the `browser` option to `true` in your configuration. This allows `flyscrape` to use a headless Chromium browser for rendering JavaScript during the scraping process. + +```javascript {filename="Configuration"} +export const config = { + browser: true, +}; +``` + +In the above example, Browser Mode is enabled, allowing `flyscrape` to render pages that rely on JavaScript execution. + +## Headless Option + +The `headless` option, when combined with Browser Mode, controls whether the Chromium browser should run in headless mode or not. Headless mode means the browser operates without a graphical user interface, which can be useful for background processes. + +```javascript {filename="Configuration"} +export const config = { + browser: true, + headless: false, +}; +``` + +In this example, the Chromium browser will run in non-headless mode. If you set `headless` to `true`, the browser will run without a visible GUI. + +```javascript {filename="Configuration"} +export const config = { + browser: true, + headless: true, +}; +``` + +In this example, the Chromium browser will run in headless mode, suitable for scenarios where graphical rendering is unnecessary. |