Nightmare is an Electron-based browser automation library and headless browser controller. It provides the infrastructure to programmatically navigate web pages, interact with DOM elements, and execute JavaScript within a background browser instance.
The project distinguishes itself by integrating a full Chromium instance within an Electron shell, allowing for the management of browser sessions, network proxy settings, and persistent storage partitions. It enables the capture of page states as PNG screenshots, PDF documents, or HTML files.
The tool covers a broad range of capabilities including automated web scraping, visual testing, and synthetic user monitoring. It includes utilities for cookie management, network traffic configuration via custom HTTP headers, and the ability to extend the browser's functionality through custom actions and plugins.