A headless browser is a web browser without a graphical user interface (GUI). It runs in the background, controlled programmatically through code or command-line interfaces. Headless browsers can perform all standard browser operations like rendering web pages, executing JavaScript, and handling cookies, but without displaying any visual components.
// SDK will prepare the browser and will start it on your machine then you can control it with puppeteerimport { GologinApi } from 'gologin';const token = process.env.GL_API_TOKEN || 'your dev token here';const gologin = GologinApi({ token,});async function main() { const { browser } = await gologin.launch({ extra_params: ['--headless'], // pass profileId parameter if you want to run particular profile // profileId: 'your profileId here', }); const page = await browser.newPage(); await page.goto('https://iphey.com/', { waitUntil: 'networkidle2' }); const status = await page.$eval('.trustworthy:not(.hide)', (elt) => elt?.innerText?.trim(), ); await new Promise((resolve) => setTimeout(resolve, 10000)); console.log('status', status); return status;}main().catch(console.error) .finally(gologin.exit);