October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Check Whether JavaScript Is Enabled in Puppeteer

Use Puppeteer's page.isJavaScriptEnabled() to check whether JavaScript is enabled. Learn how to change the setting and when it takes effect.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Call page.isJavaScriptEnabled() on a Puppeteer Page. It returns true when JavaScript is enabled and false when it is disabled.

Check the JavaScript setting on a page

Once you have a Puppeteer Page, read its setting directly:

const enabled = page.isJavaScriptEnabled();
console.log(enabled); // true or false

The method returns a boolean; it does not need await. See the official Page.isJavaScriptEnabled() reference.

Complete example: inspect and disable JavaScript

This example checks the initial setting, disables JavaScript, navigates to a page, and checks the setting again:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();

console.log(page.isJavaScriptEnabled());

await page.setJavaScriptEnabled(false);
await page.goto('https://example.com');
console.log(page.isJavaScriptEnabled());

await browser.close();

The value read by isJavaScriptEnabled() reports the page’s setting. The API does not promise that a particular site will work correctly with JavaScript on or off.

Change the setting at the right time

Use await page.setJavaScriptEnabled(true) to enable JavaScript or await page.setJavaScriptEnabled(false) to disable it. The setter returns a promise, so await it when changing the setting.

Set the option before navigating if it should apply to the page load. Puppeteer’s setter documentation says the change takes full effect on the next navigation and does not affect scripts that have already run. If the page has already loaded, changing the setting will not rewind its execution; navigate again for the new setting to take effect. See the setter reference.

Why page.evaluate() is not the setting check

page.evaluate() executes code in the page context. It can check whether a particular expression runs, but it is not the documented method for reading Puppeteer’s JavaScript-enabled setting. For that setting, use page.isJavaScriptEnabled(). Read about JavaScript execution in Puppeteer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting

  • The method says JavaScript is enabled, but the site looks broken: the method reports the setting, not whether the site’s scripts completed successfully. Check the page’s loading behavior separately.
  • Scripts ran before JavaScript was disabled: changing the setting does not undo prior execution. Navigate again after setting it.
  • You used evaluate() to check the setting: switch to page.isJavaScriptEnabled(); evaluate() runs a page-context expression rather than querying this Puppeteer setting.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to obtain a website screenshot rather than inspect Puppeteer’s JavaScript setting, ScreenshotNeo provides a screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; its setting is not a replacement for Puppeteer’s page-state API.

For example, using cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for setup and options. Before capture, it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses indicate the page verdict and billing status in headers. An MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients.

The free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.