Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsNot with a documented, dedicated WebSocket switch. Puppeteer’s HTTP request interception API is not documented as a reliable way to block WebSocket handshakes. For Chrome, an experimental connection option called blocklist can block matching URL patterns while Puppeteer remains attached to CDP targets, but Puppeteer warns that it is not a complete network sandbox. If you need a dependable access boundary, enforce it outside Puppeteer, such as at the operating-system or container level.
What “disable WebSockets” can mean
Before choosing a control, distinguish between stopping one page from opening a particular connection and preventing the browser process from reaching a network destination at all. Those are different goals. A page-level control may affect what a page does while Puppeteer is attached; a network boundary is intended to constrain traffic regardless of page behavior.
There is no dedicated disableWebSockets option in the Puppeteer API documentation covered here. The documented controls have narrower scopes: request interception handles requests exposed through Puppeteer’s page API, and Chrome’s experimental blocklist can fail matching network requests while Puppeteer is attached to CDP targets. Neither should be treated as a universal WebSocket kill switch.
Which Puppeteer controls apply?
| Control | Documented behavior | What it does not establish |
|---|---|---|
page.setRequestInterception(true) and request resolution |
Allows a handler to abort, continue, or respond to intercepted requests. Each intercepted request must be resolved or it stalls. | The reviewed API documentation does not promise that a normal page request handler sees or blocks WebSocket handshakes. |
ConnectOptions.blocklist |
An experimental Chrome option for failing network requests matching URL patterns while Puppeteer is attached to CDP targets. | It is Chrome-only, attachment-dependent, and explicitly not a complete network sandbox. |
page.emulateNetworkConditions() |
Emulates network conditions such as offline status, latency, and throughput. | The API says it does not affect WebSockets or WebRTC PeerConnections. |
Page.setOfflineMode() |
Is mentioned in the API as a way to take the page offline. | The reviewed reference does not specify its WebSocket behavior, so do not assume it blocks WebSockets in a particular way. |
How to use request interception without mistaking it for a WebSocket blocker
Request interception remains useful when your goal is to filter ordinary requests that Puppeteer exposes to the page handler. The following example aborts matching HTTP(S) requests based on their URL. It does not prove that WebSocket handshakes will be intercepted: do not rely on it for that purpose unless you have verified behavior with your exact Puppeteer version, browser, and protocol.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Install Puppeteer in a Node.js project with npm install puppeteer, then save this as block-http.mjs and run it with node block-http.mjs. Replace the example page and host with your own. The handler deliberately resolves every intercepted request: matching requests are aborted; the rest continue.
import puppeteer from 'puppeteer';
const pageUrl = 'https://example.com/';
const blockedHost = 'api.example.net';
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', request => {
let shouldBlock = false;
try {
const url = new URL(request.url());
shouldBlock = url.hostname === blockedHost;
} catch {
// If a request URL cannot be parsed, let Puppeteer handle it normally.
}
if (request.isInterceptResolutionHandled()) return;
if (shouldBlock) {
void request.abort().catch(() => {});
} else {
void request.continue().catch(() => {});
}
});
await page.goto(pageUrl, { waitUntil: 'domcontentloaded', timeout: 30000 });
console.log('Loaded:', page.url());
} finally {
await browser.close();
}
The handler is intentionally scoped to a host and to requests that reach this API. A page can also make requests that are not represented as ordinary page requests, which is why successful execution of this code is not evidence that a WebSocket was blocked. If the objective is to stop access to a host rather than filter a subset of page traffic, use a network policy outside this handler.
Do not leave intercepted requests unresolved
Once request interception is enabled, Puppeteer documents that requests stall until you resolve them with abort(), continue(), or respond(). Check all branches in the handler—including error or early-return paths—so a request is not left waiting. If other listeners may resolve the same request, guard resolution as shown in the code and handle rejected promises rather than creating unhandled rejections.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
For Chrome, consider the experimental blocklist
Puppeteer’s ConnectOptions reference documents an experimental blocklist for Chrome. Its stated behavior is to fail requests matching URL patterns while Puppeteer is attached to CDP targets. That makes it the closest documented Puppeteer-side control for blocking access to selected destinations, but it is not a promise of comprehensive WebSocket isolation.
- Use it only when its scope fits: the documented support is Chrome-only, and the effect depends on Puppeteer remaining attached to CDP targets.
- Confirm the pattern and behavior: the option is experimental. Validate the exact pattern, Puppeteer release, Chrome version, and connection setup in your environment before depending on it.
- Do not use it as a security boundary: Puppeteer explicitly warns that the blocklist is not a complete network sandbox. For an enforceable boundary, apply network restrictions at the container or operating-system level.
If Puppeteer connects to a browser that is already running, its browser management guide shows connecting through the browser’s WebSocket endpoint. In that arrangement, keep the attachment condition in mind: the documented blocklist effect applies while Puppeteer is attached to CDP targets. A remote browser’s own host or network controls are separate from Puppeteer’s page-level request handler.
Why network emulation is not the answer
Do not use page.emulateNetworkConditions() as a WebSocket switch. Puppeteer’s API reference for version 25.10.0 states: “This does not affect WebSockets and WebRTC PeerConnections” and points to Chromium issue 563644. Network throttling may change conditions for supported traffic, but the documented exception means it cannot stand in for blocking WebSocket connections.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Offline mode is a separate setting, not a documented substitute with a WebSocket guarantee. Puppeteer’s Page.setOfflineMode() reference mentions taking the page offline, but the reviewed documentation does not spell out what it does to WebSockets. If offline mode matters to your test, check it in the exact browser and Puppeteer versions you deploy; do not infer WebSocket semantics from the setting’s name.
Choose a control based on the boundary you need
To filter ordinary page requests
Use request interception, resolve every request, and treat the handler as a filter for traffic exposed through that API. It is useful for controlling conventional requests, but the API documentation does not establish WebSocket-handshake coverage.
Recommended Free Tools
To block selected destinations in a Chrome automation session
Evaluate the experimental connection-level blocklist. Keep the Chrome-only, CDP-attachment, experimental, and incomplete-sandbox qualifications in your design and tests. Do not assume matching behavior across all browser types or connection arrangements.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
To enforce a security or network policy
Put the rule outside Puppeteer, for example in a container or operating-system-level network sandbox. Puppeteer’s own documentation recommends this kind of isolation when a complete access boundary is needed. Define the allowed destinations, apply the policy where the browser process runs, and verify the policy using the network controls available in that environment.
Verification and troubleshooting
A script completing without an exception does not show that a WebSocket was prevented. Verify the outcome with the browser and network observability available in your setup, and test the actual destination and connection path the page uses.
- The page still connects after enabling interception: request interception is not documented as covering WebSocket handshakes. Do not treat the ordinary request handler as proof of a block; use the Chrome blocklist only within its stated scope or enforce the rule externally.
- A request hangs after interception is enabled: at least one intercepted request may not have been resolved. Ensure every handler path calls
abort(),continue(), orrespond(), and account for other listeners that may resolve it first. - The blocklist has no apparent effect: check that the browser is Chrome, Puppeteer is still attached to CDP targets, and the URL pattern matches the destination. Because the option is experimental, validate it against the exact versions and setup rather than generalizing from one run.
- Throttling changes page loading but the socket persists: that is consistent with the documented behavior of
emulateNetworkConditions(); it does not affect WebSockets. - Offline mode behaves differently between runs: the reviewed API reference does not define its WebSocket-specific behavior. Treat that behavior as something to test, not as a documented guarantee.
- You need a complete restriction: move the enforcement to the browser host’s network boundary. Puppeteer’s Chrome blocklist is explicitly not a complete network sandbox.
Performance, reliability, and cost considerations
Request interception adds a handler to the page’s request flow, and unresolved intercepted requests stall. Keep the handler simple, avoid unnecessary asynchronous work, and resolve requests promptly. The documentation here does not establish a performance benchmark, so measure the impact in your own workload instead of assuming a particular slowdown.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
The experimental blocklist may be operationally convenient for matching URL patterns, but its limited support and attachment-dependent scope make it less suitable as the only enforcement layer in a security-sensitive system. A host-level policy is the more appropriate place for a rule that must remain effective independently of page code or Puppeteer request handling.
Or skip the browser setup
If your actual goal is to capture a clean website screenshot rather than to test WebSocket blocking, ScreenshotNeo can return an image or PDF from one GET request. It does not disable WebSockets, and it is not a replacement for the Puppeteer network controls above.
For example, this cURL call captures a PNG of Stripe; replace the target URL with the page you want. See the ScreenshotNeo API documentation for options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie and consent banners are accepted like a visitor, and more than 60 known consent platforms, newsletter popups, and chat widgets are removed before capture; each step can be turned off.
- Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers say which page verdict applied and whether the request was billed.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents and MCP clients. - The Free plan includes 1,000 screenshots a month with no card. Paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Does Puppeteer have a disableWebSockets option?
No dedicated option by that name is documented in the Puppeteer API references covered here.
Does the Chrome blocklist apply when Puppeteer is not attached to the browser?
Its documented effect depends on Puppeteer being attached to CDP targets; it should not be assumed to enforce a rule outside that scope.
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.




