Short answer: Chrome’s --headless --screenshot command can capture a public page, but the documented CLI does not provide a --cookie, cookie-file, or arbitrary OAuth-token flag. For an authenticated page, start a programmable Chrome session with Puppeteer or the Chrome DevTools Protocol (CDP), set cookies or request headers before navigation, wait for the application’s real ready state, and then capture the image. Whether a token works depends on the target site’s authentication contract.
What the Chrome Headless CLI can do
Current Chrome Headless uses the regular Chrome browser implementation. The newer implementation shipped with Chrome 112; the separate old Headless shell documentation is deprecated. The executable name varies by operating system and installation, so first confirm that the command you use starts the Chrome version you intend.
Capture a public page
google-chrome --headless --screenshot --window-size=1280,900 'https://example.com/'
The CLI writes screenshot.png in the current working directory unless your wrapper or script chooses another path. --window-size=WIDTH,HEIGHT controls the viewport. A smaller documented example is --window-size=412,892, useful for a phone-sized layout.
Control waiting time
google-chrome --headless
--screenshot
--window-size=1280,900
--timeout=5000
'https://example.com/'
--timeout=5000 sets a maximum wait of 5,000 milliseconds before capture, even if loading has not completely finished. --virtual-time-budget=42000 advances page timers as if 42 seconds had passed:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
- AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
- ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
- AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
- STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
google-chrome --headless
--screenshot
--window-size=1280,900
--virtual-time-budget=42000
'https://example.com/'
These flags are timing controls, not readiness detection and not authentication. A single-page application may continue rendering after the timeout or virtual-time budget. If a particular heading, dashboard, or data element must exist in the image, use a scripted wait for that condition.
Platform command names
- Linux: typically
google-chrome --headless(or the executable supplied by your package). - macOS:
open -a "Google Chrome" --args --headless. - Windows:
start chrome --headless.
Check the executable with your operating system’s normal version command or application information. Flags can be version-sensitive.
Why cookies and OAuth tokens are different
Cookies represent a browser session
A session cookie may identify a logged-in browser, but it is valid only within the scope issued by the site. Domain or URL, path, expiration, Secure, HttpOnly, SameSite, and partitioning rules all matter. A cookie copied from another environment can be expired, restricted to a different host, or rejected because the site expects additional state such as a CSRF value.
An OAuth access token is not automatically a website login
A bearer token can authenticate an HTTP request when the application accepts an Authorization: Bearer … header with the correct audience and scopes. That does not prove that a top-level page navigation accepts the header, nor that every later cross-origin request made by the page will receive it. Many sites require their normal OAuth redirect and callback flow, then issue session cookies. Verify the site’s own contract rather than assuming an API token can open its web UI.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteUse Puppeteer when you must set cookies
Puppeteer gives you a browser context in which cookies can be installed before the page is opened. Put secret values in environment variables or a secret manager; never commit them to source control or print them in CI logs.
Rank #2
- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
- 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
- Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
- Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
- Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
const context = browser.defaultBrowserContext();
await context.setCookie({
name: process.env.SESSION_COOKIE_NAME,
value: process.env.SESSION_COOKIE_VALUE,
url: 'https://example.com/',
secure: true,
httpOnly: true,
});
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 900 });
await page.goto('https://example.com/account', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
Replace the URL, cookie name, and value with credentials from an authorized session. If the site issued a domain cookie rather than a URL-scoped cookie, use the matching documented cookie fields and scope. An incorrectly scoped cookie usually produces the site’s login page, not an error from Puppeteer.
Wait for the application, not just the network
networkidle2 waits for a period with few active connections, but it is not a universal “application ready” signal. Analytics, polling, service workers, and streaming requests can keep a page busy, while client-side rendering can still be incomplete after network quiet. Prefer a meaningful selector or application condition when one exists:
await page.goto('https://example.com/account', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-testid="account-loaded"]', { timeout: 30000 });
await page.screenshot({ path: 'screenshot.png', fullPage: true });
Use a selector that the application adds only after the authenticated content is usable. Do not use a selector that exists in the unauthenticated shell.
Use an OAuth bearer header with Puppeteer
For a page that explicitly accepts a bearer header, set extra headers before navigation:
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 900 });
await page.setExtraHTTPHeaders({
Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
});
await page.goto('https://example.com/account', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-testid="account-loaded"]', { timeout: 30000 });
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
Puppeteer sends extra headers with every request initiated by that page. That broad behavior is useful for an API-backed page but can expose the token to requests you did not intend to authorize, especially on redirects or third-party origins. Restrict the target and use the site’s supported flow when possible. Do not include a live token in a screenshot, command transcript, repository, or shared log.
Rank #3
- Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
- Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
- AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
- All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
- Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.
Control Chrome directly with CDP
The Chrome DevTools Protocol exposes the same two relevant capabilities without requiring Puppeteer: the Network domain provides Network.setCookie and Network.setCookies for cookie setup, and Network.setExtraHTTPHeaders for additional request headers. A CDP client must connect to a Chrome instance with remote debugging enabled, create or select a page target, enable the Network domain, set credentials, navigate, wait for a page-specific condition, and call the Page screenshot command.
For diagnosis, Chrome’s Headless debugging guidance uses a remote-debugging port and DevTools attachment. Protect that endpoint and bind it only where trusted tooling can reach it; an exposed debugging port can provide control over the browser and its credentials.
Which method should you choose?
| Need | Recommended approach | Trade-off |
|---|---|---|
| Public page, fixed viewport | Chrome CLI with --headless --screenshot --window-size |
Minimal setup; no documented direct cookie or bearer-header injection. |
| Cookies before navigation | Puppeteer browser context or CDP Network cookie methods | Precise control, but cookie scope and expiry must be correct. |
| Bearer header on page requests | Puppeteer setExtraHTTPHeaders or CDP Network.setExtraHTTPHeaders |
The header mechanism is documented; acceptance remains site-specific. |
| Investigate an invisible browser | Headless mode plus protected remote debugging/CDP | More inspection and control, with additional security responsibility. |
There are no supported benchmark figures here, so select by authentication control and workflow complexity rather than an unsupported speed or reliability claim.
Security and operational practices
- Use a dedicated test account with the minimum permissions required.
- Pass secrets through environment variables or a secret manager, and redact them from logs.
- Use HTTPS and ensure cookie
Secureand domain settings match the real site. - Do not save authenticated screenshots in a shared artifact store without access controls; images can contain personal or financial data.
- Close the browser in a
finallypath so a failed capture does not leave a credentialed process running. - Keep Chrome and Puppeteer compatible and pin versions in reproducible builds.
Troubleshooting Chrome Headless authentication
The command says Chrome is not found
The executable is not on PATH, or your platform uses another name. Install a supported Chrome build, locate its executable, and invoke that absolute path. Confirm the version before debugging page behavior.
The output file is missing
The CLI normally writes screenshot.png to the process’s current directory. Check that directory and its permissions. In Puppeteer, use an explicit writable path such as /tmp/screenshot.png or a path created by your job.
Rank #4
- Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
- 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
- Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
- All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
- AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
The image shows a login page
Inspect cookie host, path, expiration, Secure and SameSite requirements. Confirm that the cookie was set before navigation and that the URL matches its scope. If the site requires an OAuth redirect, a bearer token alone will not create the required session.
Free tools Windows power users keep installed
One-click scans. No signup required.
The bearer token returns 401 or 403
Check token expiry, audience, scopes, issuer, and the exact endpoint’s authentication rules. Confirm that the page—not only an API endpoint—accepts the header. A browser API can attach a header but cannot make an incompatible token valid.
The page is incomplete
Increase a simple CLI timeout, use virtual time only when it matches the page’s timer behavior, or switch to Puppeteer/CDP and wait for a specific authenticated element. Capture after fonts, images, and client-side data have reached the state your selector represents.
Redirects lose authentication
Cookies may not apply to the redirected host, while extra headers can have unintended cross-origin effects. Trace the redirect chain, configure credentials for the approved origins, and prefer the application’s normal login flow where it requires one.
Debugging exposes secrets
Do not bind remote debugging to a public interface. Restrict the port with local firewall rules or a private network, and terminate the browser after the job.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- Designed for mobility with a slim 0.71-inch profile and lightweight 3.24 lb chassis, making it easy to carry between home, office
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. It accepts cookies, custom headers, and an Authorization header, so you can pass the authentication material your authorized target requires without maintaining Chrome setup in your own job. Its clean-shot process accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled.
Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing result. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
Example using the API documented at https://screenshotneo.com/docs/:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan. Create a free ScreenshotNeo account.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallFAQ
Can I pass cookies directly to google-chrome --headless?
The cited Chrome CLI reference documents screenshot and timing flags, not a cookie or cookie-file flag. Use Puppeteer or CDP to set cookies before navigation.
Will an OAuth access token always open a logged-in web page?
No. The site must accept that token, audience, scope, and header on the page request and its dependent resources. Some applications require an interactive redirect and session cookies.
Does --virtual-time-budget wait for API data?
It advances browser time; it does not prove that asynchronous application work has completed. A page-specific readiness condition is safer for scripted captures.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




