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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Disable PhantomJS page JavaScript by setting phantomjs.page.settings.javascriptEnabled to False before constructing the driver and before the first navigation. Screenshot capture is separate: PhantomJS exposes a screenshot command, and its documentation does not define a page setting that universally blocks that command. Treat takesScreenshot as version-dependent capability negotiation, not as a guaranteed prohibition.

What you can and cannot disable

PhantomJS has two different controls that are often conflated:

Requirement Documented control What it actually does
Stop scripts from executing in the page phantomjs.page.settings.javascriptEnabled Maps to PhantomJS WebPage’s javascriptEnabled setting. Its default is true; set it to false before the initial page open.
Prevent screenshots No documented global PhantomJS WebPage switch The WebDriver capability takesScreenshot describes screenshot support, while the PhantomJS driver implements a screenshot command. Setting the capability to false is not a universal command block.

GhostDriver documents the capability prefix phantomjs.page.settings.<setting>; PhantomJS documents the underlying page settings and their defaults at the WebPage settings reference. The distinction matters because disabling JavaScript does not disable WebDriver’s screenshot endpoint, and advertising screenshot support as false does not necessarily stop a driver implementation from accepting a screenshot request.

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

Version and maintenance warning

The Python constructor pattern below is a legacy PhantomJS/Selenium integration. PhantomJS itself is archived and read-only in its repository, so current Selenium releases may reject or no longer test this driver. The examples are useful when you must maintain an existing PhantomJS deployment; for new automation, select a maintained browser and an explicit policy for screenshots.

#1 Best Overall
CloudValley Webcam Cover for Logitech C920x / C920 / C922x / C922 / C930e
  • Privacy Protection and Lens Care: Avoid private information from hacking while preventing dust-fall and scratching of the camera lens
  • Multiple Compatibility: Suitable for Logitech webcam C920x, C920, C922, C930e, C922x Pro Stream HD Camera
  • Artful Design: Modeled and designed exclusively to fit the above devices from Logitech and make it more stylish
  • Easy Flip Mechanism: Can be turned 180 angle and easily take the cover off when flipping more than 180
  • Simple Installation: Attaches securely to your Logitech webcam without leaving residue, allowing for quick and hassle-free setup

Always record the exact versions of Python, Selenium, PhantomJS and GhostDriver. A capability-negotiation failure was reported with Selenium 3.8.1, GhostDriver 1.2.0 and PhantomJS 2.1.1 in this 2018 support question. That report is evidence about that combination, not a specification for every fork or version.

Disable JavaScript before the first page open

Set the PhantomJS page setting in the desired capabilities object, then pass that object when creating the driver:

from selenium import webdriver

caps = webdriver.DesiredCapabilities.PHANTOMJS.copy()
caps["phantomjs.page.settings.javascriptEnabled"] = False
driver = webdriver.PhantomJS(desired_capabilities=caps)

try:
    driver.get("https://example.com")
    print(driver.title)
finally:
    driver.quit()

The important ordering is capability assignment, driver creation, then navigation. PhantomJS applies WebPage settings during the initial page.open call. Changing a settings object after that first load does not retroactively alter the page or reliably affect later navigation, as described in the PhantomJS settings documentation. Configure the driver once with the desired value instead of trying to mutate it after get().

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Why the capability key has that name

GhostDriver maps PhantomJS WebPage settings through phantomjs.page.settings.SETTING. Replacing SETTING with javascriptEnabled yields the key used above. The value must be the Boolean False, not the string "false"; a string can be interpreted as a different capability value during negotiation.

Rank #2
CloudValley Laptop Camera Cover Slide, Metal 0.023 Inch Ultra-Thin, 2 Packs
  • Privacy Protection: CloudValley webcam cover is designed for those who prioritize privacy, security, and peace of mind when using laptops, tablets, and computers
  • Fashion Design: The space aluminum alloy webcam cover features a subtle design which compliments the beautiful aesthetic of top devices
  • Ultra-Thin Design: Measures only 0.023 (0.6 mm) inch thin, ensuring it does not interfere with closing your laptop or device while providing reliable camera coverage
  • Broad Compatibility: Works flawlessly with most laptops (MacBook, HP, Dell, Asus, Acer, Lenovo), All-in-One PCs and leading tablets including iPad, Surface Pro, Galaxy Tab, Fire HD, and Google Pixel Tablet
  • Simple to Use: Only need to align to the webcam, attach and press it firmly for 15 seconds. Does not interfere with web use or indicator light

What JavaScript-disabled pages look like

Only script execution is targeted. HTML, CSS, images and other resources can still load unless you configure separate network or resource controls. A site that builds its entire interface with JavaScript may therefore show an empty shell, a loading placeholder or incomplete content. That is an expected consequence, not proof that the capability failed.

Handle screenshot prevention separately

takesScreenshot is a WebDriver capability, not a PhantomJS WebPage setting. The PhantomJS driver source includes a screenshot command, as shown in the PhantomJSDriver implementation. The official materials do not document a PhantomJS page setting that globally disables every screenshot request.

Do not promise a universal takesScreenshot=False switch

You may encounter examples that add takesScreenshot: False to capabilities. That can influence capability negotiation in a particular driver, but it is not a documented guarantee that save_screenshot(), the WebDriver screenshot command or a remote client cannot be called. In one historical setup, screenshot and JavaScript capabilities were treated as mandatory, producing a negotiation error. Verify the exact installed versions rather than assuming the flag enforces a security boundary.

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

Use an enforcement layer when screenshots must never be taken

If the requirement is contractual or security-related, enforce it outside the page setting:

Rank #3
Sale
Yilador Webcam Cover 3 Pack, 0.03 inch Ultra Thin Laptop Camera Cover Slide
  • Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
  • 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
  • ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
  • ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
  • ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
  • Do not expose screenshot methods or permissions to the application code that owns the driver.
  • Wrap the driver in a small interface that allows navigation and assertions but omits get_screenshot_as_file, get_screenshot_as_png and related calls.
  • Review remote WebDriver access and reject the screenshot command at the service or proxy layer if you control that endpoint.
  • Test the deployed binary and driver pair by issuing the command in a controlled environment; record whether it is rejected, ignored or succeeds.

This is stronger than advertising a capability because it tests and controls the command path that actually produces an image.

A combined legacy example

The following keeps JavaScript disabled and attempts no screenshot operation. It is intentionally explicit about cleanup:

from selenium import webdriver

caps = webdriver.DesiredCapabilities.PHANTOMJS.copy()
caps["phantomjs.page.settings.javascriptEnabled"] = False
# Do not rely on this as a universal screenshot prohibition:
# caps["takesScreenshot"] = False

driver = webdriver.PhantomJS(desired_capabilities=caps)
try:
    driver.get("https://example.com")
    print({
        "title": driver.title,
        "url": driver.current_url,
    })
finally:
    driver.quit()

Leaving the takesScreenshot line commented makes the policy clear: JavaScript is disabled through a documented PhantomJS page setting, while screenshot prevention requires an independently verified control or an external enforcement layer.

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

Checks to run in your own environment

  1. Pin and record versions. Capture the output of python --version, your Selenium package version, the PhantomJS binary version and the GhostDriver version.
  2. Start with a page that has visible non-script HTML. This distinguishes a disabled script from a page that is blank because all content is rendered dynamically.
  3. Configure before navigation. Create the driver with the capability already present; do not set it after calling get().
  4. Test the negative requirement. If screenshots must be impossible, attempt the screenshot command in a controlled test and verify the result is rejected by the layer you intend to trust.
  5. Retest after upgrades. Capability negotiation can change when Selenium, GhostDriver or PhantomJS changes, and PhantomJS no longer receives upstream maintenance.

Troubleshooting

Symptom Likely cause Fix
TypeError or an unknown PhantomJS constructor Your Selenium release no longer includes or supports the legacy PhantomJS integration. Use the versions required by the existing project, or migrate to a maintained browser. Do not silently substitute a different driver and assume identical capabilities.
JavaScript still appears to run The setting key was misspelled, passed as a string, or added after the first navigation. Copy the exact phantomjs.page.settings.javascriptEnabled key, pass Boolean False, create a fresh driver and navigate only after construction.
The page is blank or incomplete The site depends on JavaScript to create its content. Inspect the server-delivered HTML and decide whether a non-script rendering path exists. Disabling JavaScript cannot produce DOM that the server never sent.
Session creation fails with a capability error The installed Selenium/GhostDriver/PhantomJS combination disagrees about mandatory capabilities. Reproduce with the exact versions documented in the error, remove unsupported experimental flags, and compare behavior with the historical version-specific report at the Stack Overflow question.
A screenshot call still succeeds takesScreenshot=False was treated as metadata, or the driver ignores it. Do not treat the capability as a prohibition. Remove screenshot access from application code and enforce or test rejection at the remote-driver or service boundary.
Changing settings during a session has no effect WebPage settings were consumed during the initial page.open. Quit the session, create a new driver with the desired capabilities and then perform the first navigation.

Or skip the browser setup

If your actual goal is to obtain clean website images rather than maintain a PhantomJS policy, ScreenshotNeo provides a website screenshot API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and each response identifies the result with X-Page-Verdict and X-Billed headers.

One GET request is enough:

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

See the ScreenshotNeo API documentation for authentication, output formats and options.

Rank #4
JCWINY Webcam Cover, 2 Pack Desktop Computer External Webcam Lens Covers Shutter Cap Hood, Streaming Web Camera Privacy Cover Clip Compatible with Logitech HD Pro Web Cam C270/C615/C920/C930e/C922X
  • 【Premium Webcam Cover】This webcam privacy cover is an accessory of computer webcam. No worry about interfering with web camera lens use or indicator light; No damage to your device in any way as well. A helpful privacy protector and dust separator
  • 【Privacy Protector】Slide the web camera cover over your webcam lens when not in use, and prevents web hackers from Spying on you. It is perfect to provide privacy security and peace of mind to individuals, groups, organizations, companies and governments. It also protects your camera lens from dust, and keeps it in high-definition resolution all the ways
  • 【Durable Material】The web cam cover is made of high-strength plastic, which ensures that your privacy is protected for a long and lasting period of time. The back of the web camera privacy cover slide also has a strong 3M adhesive layer. It helps the privacy protector stick firmly to your device. The most convenient, super thin design, and extra mini size, make it perfectly combine with your devices
  • 【Wide Compatibility】This webcam cover is compatible with most popular webcams with flat area surrounding lens or with protruding lens, such as Logitech HD Pro Webcam C920 C920x C930e and C922, Logitech C615 and C270 (NOT fit Logitech C910, B910, C310). It can be also used as a cover for the peep hole on door
  • 【For Logitech Webcam Cover】 The streamcam cover kit comes with 2 pack. Please clean the lens surface before applying. Make sure the mounting surface is cleaned completely so that it sticks properly and firmly

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
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}`);

ScreenshotNeo supports PNG, JPEG, WebP and PDF output, full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets, arbitrary viewports, retina scale, paper and page-range PDF controls, custom CSS and JavaScript, clicks before capture, selector or network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify a migration.

An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients, so an AI agent can request captures without your maintaining a browser driver. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Other plans are Growth ($15 for 15,000), Pro ($39 for 60,000), Scale ($99 for 250,000) and Business ($249 for 1,000,000); yearly billing gives two months free, and every feature is included on every plan.

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

Create a free ScreenshotNeo account to try 1,000 screenshots a month without entering a card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

FAQ

Does disabling JavaScript disable JavaScript that already ran?

No. The capability must be active before the initial page open. Start a new driver when you need a different setting.

Best Value
Laptop Camera Cover Slide, 6 Pack Ultra-Thin 0.022in Webcam Cover Blocker
  • 【Protect Privacy Security】Focusing on network security, now we can easily and effectively protect personal and family privacy security , Just gently slide the slide and close the camera, you can stop the intrusion of hackers.
  • 【 Ultra Thin Design】The new ultra-thin design, with a thickness of only 0.022 inches, is made of flexible ABS material and is not fragile. Will not affect the closing of the laptops and scratch the laptops.
  • 【Easy to install】 Strong adhesive makes the cover not fall, keep the screen clean and free of stains during installation, tear off the adhesive tape on the back, align it with our camera, and press hard for 10 seconds to work.
  • 【Compatible with 】Compatible with camera for Laptop, tablet, computers, Echo Show and Apple Devices,as: MacBook Pro,Macbook Air,iMac ,Mac mini,iPad,MacBook Air, iPhone 6/7/8 Plus etc front camera .
  • [What you get] 6 pack black webcam covers.

Is the screenshot capability a security boundary?

No. It describes WebDriver support and can be handled differently by different legacy combinations. Enforce the restriction where screenshot commands are exposed, then test that deployed path.

Where is the setting documented?

PhantomJS lists javascriptEnabled and its default in the WebPage settings reference; GhostDriver explains the phantomjs.page.settings.<setting> capability mapping in its README.

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

Frequently Asked Questions

Does disabling JavaScript disable JavaScript that already ran?

No. The capability must be active before the initial page open. Start a new driver when you need a different setting.

Is the screenshot capability a security boundary?

No. It describes WebDriver support and can be handled differently by different legacy combinations. Enforce the restriction where screenshot commands are exposed, then test that deployed path.

Where is the setting documented?

PhantomJS lists javascriptEnabled and its default in the WebPage settings reference; GhostDriver explains the phantomjs.page.settings.<setting> capability mapping in its README.

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.