diff --git a/README.md b/README.md index 6086f0c..f4ab50a 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ sudo apt-get install xvfb const { connect } = require('puppeteer-real-browser'); const start = async () => { - const { page, browser } = await connect({}) + const { page, browser } = await connect() } ``` @@ -64,7 +64,7 @@ const start = async () => { import { connect } from 'puppeteer-real-browser' -const { page, browser } = await connect({}) +const { page, browser } = await connect() ``` diff --git a/lib/cjs/index.js b/lib/cjs/index.js index 673df35..05a203c 100644 --- a/lib/cjs/index.js +++ b/lib/cjs/index.js @@ -4,7 +4,7 @@ const Xvfb = require('xvfb'); process.env.REBROWSER_PATCHES_RUNTIME_FIX_MODE = "alwaysIsolated" // process.env.REBROWSER_PATCHES_DEBUG = 1 -async function connect({ args = [], headless = false, customConfig = {}, proxy = {}, turnstile = false, connectOption = {}, disableXvfb = false, plugins = [], ignoreAllFlags = false }) { +async function connect({ args = [], headless = false, customConfig = {}, proxy = {}, turnstile = false, connectOption = {}, disableXvfb = false, plugins = [], ignoreAllFlags = false } = {}) { const { launch, Launcher } = await import('chrome-launcher'); let xvfbsession = null diff --git a/lib/esm/index.mjs b/lib/esm/index.mjs index 7742271..8060adc 100644 --- a/lib/esm/index.mjs +++ b/lib/esm/index.mjs @@ -5,7 +5,7 @@ import Xvfb from 'xvfb'; process.env.REBROWSER_PATCHES_RUNTIME_FIX_MODE = "alwaysIsolated" // process.env.REBROWSER_PATCHES_DEBUG=1 -export async function connect({ args = [], headless = false, customConfig = {}, proxy = {}, turnstile = false, connectOption = {}, disableXvfb = false, plugins = [], ignoreAllFlags = false }) { +export async function connect({ args = [], headless = false, customConfig = {}, proxy = {}, turnstile = false, connectOption = {}, disableXvfb = false, plugins = [], ignoreAllFlags = false } = {}) { let xvfbsession = null if (headless == 'auto') headless = false