Skip to main content

openBrowser()

Available since v3.0 - Part of the @remotion/renderer package.

Opens a Chrome or Chromium browser instance. By reusing an instance across renderFrames(), renderStill(), renderMedia() and getCompositions() calls, you can save time by not opening and closing browsers for each call.

ts
const openBrowser: (
browser: Browser,
options: {
shouldDumpIo?: boolean;
browserExecutable?: string | null;
chromiumOptions?: ChromiumOptions;
},
) => Promise<puppeteer.Browser>;
ts
const openBrowser: (
browser: Browser,
options: {
shouldDumpIo?: boolean;
browserExecutable?: string | null;
chromiumOptions?: ChromiumOptions;
},
) => Promise<puppeteer.Browser>;

Arguments

browser

Currently the only valid option is "chrome". This field is reserved for future compatibility with other browsers.

options?

optional

An object containing one or more of the following options:

shouldDumpIo?

optional

If set to true, logs and other browser diagnostics are being printed to standard output. This setting is useful for debugging.

browserExecutable?

optional

A string defining the absolute path on disk of the browser executable that should be used. By default Remotion will try to detect it automatically and download one if none is available. If puppeteerInstance is defined, it will take precedence over browserExecutable.

chromiumOptions?

optional

Allows you to set certain Chromium / Google Chrome flags. See: Chromium flags.

note

Chromium flags need to be set at browser launch. If you pass an instance to SSR APIs like renderMedia(), the chromiumOptions option of that API will not apply, but rather the flags that have been passed to openBrowser().

forceDeviceScaleFactor?

Set a scale. If you plan to use scaling, you already need to set it when opening the browser.

onBrowserDownload?v4.0.137

Gets called when no compatible local browser is detected on the system and this API needs to download a browser. Return a callback to observe progress. See here for how to use this option.

See also