Headless browser
A headless browser is a web browser without a graphical user interface.
Headless browsers provide automated control of a web page in an environment similar to popular web browsers, but are executed via a command-line interface or using network communication. They are particularly useful for testing web pages as they are able to render and understand HTML the same way a browser would, including styling elements such as page layout, colour, font selection and execution of JavaScript and AJAX which are usually not available when using other testing methods.[1][2]
Use cases
Headless browsers are used for:[3][4]
- Test automation in modern web applications.
- Taking screenshots of web pages.
- Running automated tests for JavaScript libraries.
- Scraping web sites for data.
- Automating interaction of web pages.
Google stated in 2009 that using a headless browser could help their search engine index content from websites that use AJAX.[5]
Malicious
Headless browsers can also be used to:
- Perform DDOS attacks on web sites.[6]
- Increase advertisement impressions.[7]
- Automate web sites in unintended ways[8] e.g. for Credential stuffing.[9]
List of headless browsers
This is a list of browsers providing a complete or near-complete headless implementation.
- PhantomJS – a headless web browser using WebKit layout engine for rendering web pages and JavaScriptCore for executing scripted tests. PhantomJS was originally developed by Ariya Hidayat in 2010 and has gained a wide following and extensive development ecosystem.[10][11][12][13][14]
- HtmlUnit – a headless browser written in Java. HtmlUnit uses the Rhino engine to provide JavaScript and AJAX support as well as partial rendering capability.[15][16]
- TrifleJS – a headless Internet Explorer scriptable browser using the Trident layout engine for rendering pages and the V8 JavaScript engine for executing scripted tests. TrifleJS uses the same API language as PhantomJS and works by using the .NET WebBrowser object to control whatever version of IE is installed on the machine.[4][17]
- Splash – a headless web browser with an HTTP API, Lua scripting support and a built-in IPython (Jupyter)-based IDE. Splash is written in Python and uses WebKit layout engine. Development started at ScrapingHub in 2013; it is partially funded by DARPA.[18][19]
Simulated
These are browsers that simulate a browser environment. While they are able to support common browser features (HTML parsing, cookies, XHR, some javascript, etc.), they do not render DOM and have limited support for DOM events. They usually perform faster than full browsers, but are unable to correctly interpret many popular websites.[20][21][22]
- Zombie.js – a simulated browser environment for Node.js.[23]
- ENVJS – a simulated browser environment written in JavaScript for the Rhino engine.[24]
Scriptable
These are browsers that may still require a user Interface but have programmatic APIs and are intended to be used in ways similar to traditional headless browsers.
- SlimerJS – a scriptable browser using Mozilla's Gecko layout engine. SlimerJS uses the same API language as PhantomJS.[25]
See also
References
- ↑ "What is a headless browser?". arhg.net.
- ↑ "Quick Start". phantomjs.org.
- ↑ "PhantomJS - PhantomJS". phantomjs.org.
- 1 2 "trifleJS". trifleJS.
- ↑ "Official Google Webmaster Central Blog: A proposal for making AJAX crawlable". Official Google Webmaster Central Blog.
- ↑ "Headless Browser Botnet Used in 150 hour DDoS attack". Business 2 Community.
- ↑ "Headless Web Traffic Threatens Internet Economy". ecommercetimes.com.
- ↑ "Headless browsers: legitimate software that enables attack". ITProPortal.
- ↑ "Credential stuffing". owasp.org.
- ↑ "PhantomJS - PhantomJS". phantomjs.org.
- ↑ "FAQ". phantomjs.org.
- ↑ "Google Groups". google.com.
- ↑ "Commits · ariya/phantomjs · GitHub". GitHub.
- ↑ "ariya/phantomjs". GitHub.
- ↑ Mike Bowler. "HtmlUnit – Welcome to HtmlUnit". sourceforge.net.
- ↑ "Platform (Vaadin 7.3.4 API)". vaadin.com. 6 November 2014.
- ↑ "Home". GitHub.
- ↑ "scrapinghub/splash". GitHub.
- ↑ http://www.darpa.mil/opencatalog/MEMEX.html
- ↑ "assaf/zombie". GitHub.
- ↑ http://www.envjs.com/doc/guides
- ↑ "JavaScriptMVC - EnvJS". javascriptmvc.com.
- ↑ "Zombie". labnotes.org.
- ↑ http://www.envjs.com/
- ↑ Laurent Jouanneau. "SlimerJS". slimerjs.org.