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] Google stated in 2009 that using a headless browser could help their search engine index content from websites that use AJAX.[3]
Use Cases for Headless Browsers
Headless browsers are used for:[4][5]
- Test automation in modern web applications.
- Taking screen shots of web pages.
- Running automated tests for JavaScript libraries.
- Scraping web sites for data.
- Automating interaction of web pages.
Malicious Use Cases
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.[17][18]
Simulated Headless Browsers
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.[19][20][21]
- Zombie.js. A simulated browser environment for Node.js.[22]
- ENVJS. A simulated browser environment written in JavaScript for the Rhino engine.[23]
Scriptable Browsers
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.[24]
See also
- Headless system
- Web scraping
- Web testing
- Selenium WebDriver
References
- ↑ http://blog.arhg.net/2009/10/what-is-headless-browser.html
- ↑ http://phantomjs.org/quick-start.html
- ↑ http://googlewebmastercentral.blogspot.com.au/2009/10/proposal-for-making-ajax-crawlable.html
- ↑ http://phantomjs.org/
- ↑ http://triflejs.org/
- ↑ http://www.business2community.com/tech-gadgets/headless-browser-botnet-used-150-hour-ddos-attack-0688767
- ↑ http://www.ecommercetimes.com/story/80194.html
- ↑ http://www.itproportal.com/2014/04/01/headless-browsers-legitimate-software-enables-attack/
- ↑ https://www.owasp.org/index.php/Credential_stuffing
- ↑ http://phantomjs.org
- ↑ http://phantomjs.org/faq.html
- ↑ https://groups.google.com/forum/#!topic/phantomjs/S7sV3JAalag
- ↑ https://github.com/ariya/phantomjs/commits/1.0.0
- ↑ https://github.com/ariya/phantomjs
- ↑ http://htmlunit.sourceforge.net/
- ↑ http://vaadin.com/download/release/7.3/7.3.4/docs/api/com/google/gwt/junit/Platform.html
- ↑ http://triflejs.org/
- ↑ https://github.com/sdesalas/trifleJS/wiki
- ↑ https://github.com/assaf/zombie/tree/v3.0.15#faq
- ↑ http://www.envjs.com/doc/guides
- ↑ http://www.javascriptmvc.com/docs/funcunit.envjs.html
- ↑ http://zombie.labnotes.org/
- ↑ http://www.envjs.com/
- ↑ http://slimerjs.org/